日常更新
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
void img_processing() {
|
||||
|
||||
|
||||
//
|
||||
int w1 = IMAGE_W / 2 - BEGINW_R, h1 = BEGINH_L;
|
||||
pts_left_count = sizeof(pts_left) / sizeof(pts_left[0]);
|
||||
for (; w1 > 0; w1--) {
|
||||
@@ -23,6 +23,20 @@ void img_processing() {
|
||||
SearchLineAdaptive_Left(mt9v03x_image_copy[0], SELFADAPT_KERNELSIZE, SELFADAPT_OFFSET, h1, w1, pts_left, &pts_left_count);
|
||||
}
|
||||
else pts_left_count = 0;
|
||||
//算曲率
|
||||
int w1_curvature = IMAGE_W / 2 - BEGINW_R, h1_curvature = BEGINH_L_curvature;
|
||||
pts_left_count_curvature = sizeof(pts_left_curvature) / sizeof(pts_left_curvature[0]);
|
||||
for (; w1_curvature > 0; w1_curvature--) {
|
||||
if (GET_PIX_1C(mt9v03x_image_copy[0], h1_curvature, w1_curvature - 1) < FIX_BINTHRESHOLD)
|
||||
break;
|
||||
}
|
||||
|
||||
if (GET_PIX_1C(mt9v03x_image_copy[0], h1_curvature, w1_curvature) >= FIX_BINTHRESHOLD){
|
||||
SearchLineAdaptive_Left(mt9v03x_image_copy[0], SELFADAPT_KERNELSIZE, SELFADAPT_OFFSET, h1_curvature, w1_curvature, pts_left_curvature, &pts_left_count_curvature);
|
||||
}
|
||||
else pts_left_count_curvature = 0;
|
||||
|
||||
|
||||
|
||||
int w2 = IMAGE_W / 2 + BEGINW_L, h2 = BEGINH_R;
|
||||
pts_right_count = sizeof(pts_right) / sizeof(pts_right[0]);
|
||||
@@ -35,6 +49,18 @@ void img_processing() {
|
||||
SearchLineAdaptive_Right(mt9v03x_image_copy[0], SELFADAPT_KERNELSIZE, SELFADAPT_OFFSET, h2, w2, pts_right, &pts_right_count);
|
||||
}
|
||||
else pts_right_count = 0;
|
||||
//算曲率
|
||||
int w2_curvature = IMAGE_W / 2 + BEGINW_L, h2_curvature = BEGINH_R_curvature;
|
||||
pts_right_count_curvature = sizeof(pts_right_curvature) / sizeof(pts_right_curvature[0]);
|
||||
for (; w2_curvature < IMAGE_W - 1; w2_curvature++) {
|
||||
if (GET_PIX_1C(mt9v03x_image_copy[0], h2_curvature, w2_curvature + 1) < FIX_BINTHRESHOLD)
|
||||
break;
|
||||
}
|
||||
|
||||
if (GET_PIX_1C(mt9v03x_image_copy[0], h2_curvature, w2_curvature) >= FIX_BINTHRESHOLD){
|
||||
SearchLineAdaptive_Right(mt9v03x_image_copy[0], SELFADAPT_KERNELSIZE, SELFADAPT_OFFSET, h2_curvature, w2_curvature, pts_right_curvature, &pts_right_count_curvature);
|
||||
}
|
||||
else pts_right_count_curvature = 0;
|
||||
|
||||
//透视变换
|
||||
for (int i = 0; i < pts_left_count; i++) {
|
||||
@@ -86,6 +112,7 @@ void img_processing() {
|
||||
valid_points_count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pts_resample_right_count = valid_points_count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user