|
@@ -21,8 +21,6 @@ auto MAGENTA = cv::Scalar(110,10,200);
|
|
|
auto BROWN = cv::Scalar(90,100,60);
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
int main(int argc, char *argv[])
|
|
|
{
|
|
|
char const *fname = "files/masckera.png";
|
|
@@ -66,7 +64,7 @@ int main(int argc, char *argv[])
|
|
|
cv::convexHull(cv::Mat(contour),hull,false);
|
|
|
|
|
|
//these are the "horizontal" lines
|
|
|
- int *maxdistances = max2_distance(hull);
|
|
|
+ unsigned *maxdistances = max2_distance(hull);
|
|
|
cv::Point corn_1, corn_2, corn_3, corn_4;
|
|
|
corn_1 = hull[maxdistances[0]];
|
|
|
corn_2 = hull[(maxdistances[0]+1)%hull.size()];
|
|
@@ -88,7 +86,11 @@ int main(int argc, char *argv[])
|
|
|
|
|
|
std::vector<std::vector<cv::Point>> verticals;
|
|
|
verticals.push_back(find_longest_line(hull, (maxdistances[0]+1)%hull.size(), maxdistances[1]));
|
|
|
+ std::cout << maxdistances[1] << std::endl;
|
|
|
+ std::cout << maxdistances[1]+1 << std::endl;
|
|
|
+ std::cout << (maxdistances[1]+1)%hull.size() << std::endl;
|
|
|
verticals.push_back(find_longest_line(hull, (maxdistances[1]+1)%hull.size(), maxdistances[0]));
|
|
|
+ free(maxdistances);
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
//img = cv::imread(fname,CV_LOAD_IMAGE_COLOR); // uncomment to this to display image with colors
|
|
@@ -111,6 +113,7 @@ int main(int argc, char *argv[])
|
|
|
if( cv::waitKey(0) == 113 )
|
|
|
break;
|
|
|
}
|
|
|
+ img.release();
|
|
|
#endif
|
|
|
|
|
|
// theta is the angle of the line connecting point 1 and 2; it will be the
|