From 3995002180b45f41aaa6d9fa19f1f45b22285677 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sat, 1 Dec 2012 11:20:21 +0100 Subject: mehr schön MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- detect_road_borders.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/detect_road_borders.cpp b/detect_road_borders.cpp index 14841f3..af35651 100644 --- a/detect_road_borders.cpp +++ b/detect_road_borders.cpp @@ -428,10 +428,10 @@ int find_bestquality_index(const vector& contour, double* angle_derivativ *bestquality_width_out = bestquality_width; } -int find_ideal_line(int xlen, int ylen, vector& contour, int** contour_map, int bestquality_j) +int find_ideal_line(int xlen, int ylen, vector& contour, Point origin_point, int** contour_map, int bestquality_j) // TODO: this code is crappy, slow, and uses brute force. did i mention it's crappy and slow? { - int intersection = find_intersection_index(xlen/2, ylen-ylen/5, + int intersection = find_intersection_index(origin_point.x, origin_point.y, contour[bestquality_j].x, contour[bestquality_j].y, contour_map); int steering_point=-1; @@ -449,7 +449,7 @@ int find_ideal_line(int xlen, int ylen, vector& contour, int** contour_ma // rotate the line to the left till it gets better for (; xx>=0; xx--) { - int intersection2 = find_intersection_index(xlen/2, ylen-ylen/5, xx, contour[bestquality_j].y, contour_map); + int intersection2 = find_intersection_index(origin_point.x, origin_point.y, xx, contour[bestquality_j].y, contour_map); if (intersection2<0) // won't happen anyway break; @@ -468,7 +468,7 @@ int find_ideal_line(int xlen, int ylen, vector& contour, int** contour_ma // rotate the line to the right till it gets better for (; xx& contour, int** contour_ma // else // we directly met the bestquality point, i.e. where we wanted to go to. // do nothing - return find_intersection_index(xlen/2, ylen-ylen/5, xx, contour[bestquality_j].y, contour_map, false); + return find_intersection_index(origin_point.x,origin_point.y, xx, contour[bestquality_j].y, contour_map, false); } } @@ -547,7 +547,7 @@ void draw_it_all(Mat drawing, vector< vector >& contours, const vector