diff --git a/lines.cpp b/lines.cpp index 153de92..7aa6598 100644 --- a/lines.cpp +++ b/lines.cpp @@ -84,12 +84,13 @@ int main(int argc, char *argv[]) // cv::waitKey(0); #endif - std::vector> verticals; - verticals.push_back(find_longest_line(hull, (maxdistances[0]+1)%hull.size(), maxdistances[1])); + std::vector verticals[2]; + // Between the two corners on the same side, the longest line is the vertical border of the book + verticals[0] = 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])); + verticals[1] = find_longest_line(hull, (maxdistances[1]+1)%hull.size(), maxdistances[0]); free(maxdistances); // theta is the angle of the line connecting point 1 and 2; it will be the