fix: glz图像bug修复

This commit is contained in:
2024-03-10 08:35:37 +08:00
parent 28b591d7a7
commit 0ab683ba60
6 changed files with 12 additions and 12 deletions

View File

@@ -3,8 +3,8 @@
#define IMAGE_H (MT9V03X_H)
#define IMAGE_W (MT9V03X_W)
#define BEGINH_L (55)
#define BEGINH_R (55)
#define BEGINH_L (61)
#define BEGINH_R (61)
#define BEGINW_L (-18)
#define BEGINW_R (-12)
#define PT_MAXLEN (75)

View File

@@ -23,6 +23,6 @@ enum state_type_e {
extern enum state_type_e state_type;
#define CROSS_AIM (0.49f)
#define COMMON_AIM (0.31f)
#define COMMON_AIM (0.25f)
#endif /* STATE_H_ */

View File

@@ -3,7 +3,7 @@
float (*mid_track)[2];
int32_t mid_track_count;
float dx;
float pure_angle;
float dx_near;
float (*rpts)[2];
int rpts_num;
@@ -107,10 +107,10 @@ void MidLineTrack()
int aim_idx_near = clip(round(0.09 / RESAMPLEDIST), 0, rptsn_num - 1);
// 计算远锚点偏差值
dx = rptsn[aim_idx][1] - cx;
// float dy = cy - rptsn[aim_idx][0] + 0.2 * PIXPERMETER;
// float dn = sqrt(dx * dx + dy * dy);
// float error = -atan2f(dx, dy) * 180 / PI;
float dx = rptsn[aim_idx][1] - cx;
float dy = cy - rptsn[aim_idx][0] + 0.2 * PIXPERMETER;
float dn = sqrt(dx * dx + dy * dy);
float error = -atan2f(dx, dy) * 180 / PI;
// 计算近锚点偏差值
dx_near = rptsn[aim_idx_near][1] - cx;
@@ -121,6 +121,6 @@ void MidLineTrack()
// //考虑近点
// near_angle = -atanf(PIXPERMETER * 2 * 0.2 * dx_near / dn_near / dn_near) / PI * 180 ;
// //考虑远点
// pure_angle = -atanf(PIXPERMETER * 2 * 0.2 * dx/ dn / dn) / PI * 180 ;
pure_angle = -atanf(PIXPERMETER * 2 * 0.2 * dx/ dn / dn) / PI * 180 ;
}
}

View File

@@ -2,7 +2,7 @@
#define TRACKING
extern float (*mid_track)[2];
extern float dx;
extern float pure_angle;
extern float dx_near;
void tracking(void);

View File

@@ -31,7 +31,7 @@ void jj_param_eeprom_init(void)
PARAM_REG(imgax_Ki, &data4, EFLOAT, 1, "im_I:"); // 注冊
PARAM_REG(imgax_Kd, &data5, EFLOAT, 1, "im_D:");
PARAM_REG(other , &data6, EFLOAT, 1, "add:");
PARAM_REG(delta_x , &dx, EFLOAT, 2, "far:");
PARAM_REG(delta_x , &pure_angle, EFLOAT, 2, "far:");
PARAM_REG(delta_y , &dx_near, EFLOAT, 0, "near:");
jj_param_read(); // 注冊
}

View File

@@ -56,7 +56,7 @@ int main(void)
while (1) {
Page_Run();
by_buzzer_run();
tiny_frame_param[0].f32 = dx;
tiny_frame_param[0].f32 = pure_angle;
tiny_frame_param[1].f32 = dx_near;
system_delay_ms(10);
if (mt9v03x_finish_flag) {