Commit 91c35a7d authored by Vitaly Tuzov's avatar Vitaly Tuzov

Updated handling of collinear edges while searching for intersection.

parent fb6db3dc
...@@ -988,14 +988,15 @@ static bool findGammaIntersectionPoints(const std::vector<cv::Point2f> &polygon, ...@@ -988,14 +988,15 @@ static bool findGammaIntersectionPoints(const std::vector<cv::Point2f> &polygon,
double sideCExtraParam = 2 * polygonPointHeight * distFormulaDenom; double sideCExtraParam = 2 * polygonPointHeight * distFormulaDenom;
// Get intersection points if they exist or if lines are identical // Get intersection points if they exist or if lines are identical
if (!areIntersectingLines(side1Params, side2Params, sideCExtraParam, intersectionPoint1, intersectionPoint2)) { if (areIntersectingLines(side1Params, side2Params, sideCExtraParam, intersectionPoint1, intersectionPoint2)) {
return false; return true;
} else if (areIdenticalLines(side1Params, side2Params, sideCExtraParam)) { } else if (areIdenticalLines(side1Params, side2Params, sideCExtraParam)) {
intersectionPoint1 = side1StartVertex; intersectionPoint1 = side1StartVertex;
intersectionPoint2 = side1EndVertex; intersectionPoint2 = side1EndVertex;
return true;
} }
return true; return false;
} }
//! Check if the given lines are identical or not //! Check if the given lines are identical or not
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment