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,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 ;
}
}