Lines Matching refs:polygon
107 static void advanceBToRightChain(const std::vector<cv::Point2f> &polygon,
134 static void createConvexHull(cv::InputArray points, std::vector<cv::Point2f> &polygon);
141 static bool findGammaIntersectionPoints(const std::vector<cv::Point2f> &polygon, unsigned int nrOfP…
150 static void findMinEnclosingTriangle(const std::vector<cv::Point2f> &polygon,
153 static void findMinimumAreaEnclosingTriangle(const std::vector<cv::Point2f> &polygon,
156 static cv::Point2f findVertexCOnSideB(const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoi…
164 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints,
169 static double height(const cv::Point2f &polygonPoint, const std::vector<cv::Point2f> &polygon,
172 static double height(unsigned int polygonPointIndex, const std::vector<cv::Point2f> &polygon,
178 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints,
182 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints,
186 const std::vector<cv::Point2f> &polygon,
190 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints,
204 cv::Point2f &vertexC, const std::vector<cv::Point2f> &polygon,
211 static bool isNotBTangency(const std::vector<cv::Point2f> &polygon,
221 … const cv::Point2f &vertexC, const std::vector<cv::Point2f> &polygon,
250 static void moveAIfLowAndBIfHigh(const std::vector<cv::Point2f> &polygon,
258 static void returnMinimumAreaEnclosingTriangle(const std::vector<cv::Point2f> &polygon,
261 static void searchForBTangency(const std::vector<cv::Point2f> &polygon,
273 static void updateSideB(const std::vector<cv::Point2f> &polygon,
278 static void updateSidesBA(const std::vector<cv::Point2f> &polygon,
285 static void updateSidesCA(const std::vector<cv::Point2f> &polygon,
323 std::vector<cv::Point2f> resultingTriangle, polygon; in findMinEnclosingTriangle() local
325 createConvexHull(points, polygon); in findMinEnclosingTriangle()
326 findMinEnclosingTriangle(polygon, resultingTriangle, area); in findMinEnclosingTriangle()
335 static void createConvexHull(cv::InputArray points, std::vector<cv::Point2f> &polygon) { in createConvexHull() argument
344 convexHull(pointsVector, polygon, true, true); in createConvexHull()
356 static void findMinEnclosingTriangle(const std::vector<cv::Point2f> &polygon, in findMinEnclosingTriangle() argument
360 if (polygon.size() > 3) { in findMinEnclosingTriangle()
361 findMinimumAreaEnclosingTriangle(polygon, triangle, area); in findMinEnclosingTriangle()
363 returnMinimumAreaEnclosingTriangle(polygon, triangle, area); in findMinEnclosingTriangle()
395 static void findMinimumAreaEnclosingTriangle(const std::vector<cv::Point2f> &polygon, in findMinimumAreaEnclosingTriangle() argument
412 nrOfPoints = static_cast<unsigned int>(polygon.size()); in findMinimumAreaEnclosingTriangle()
421 advanceBToRightChain(polygon, nrOfPoints, b, c); in findMinimumAreaEnclosingTriangle()
422 moveAIfLowAndBIfHigh(polygon, nrOfPoints, a, b, c); in findMinimumAreaEnclosingTriangle()
423 searchForBTangency(polygon, nrOfPoints, a ,b, c); in findMinimumAreaEnclosingTriangle()
425 updateSidesCA(polygon, nrOfPoints, a, c, sideAStartVertex, sideAEndVertex, in findMinimumAreaEnclosingTriangle()
428 if (isNotBTangency(polygon, nrOfPoints, a, b, c)) { in findMinimumAreaEnclosingTriangle()
429 updateSidesBA(polygon, nrOfPoints, a, b, c, validationFlag, sideAStartVertex, in findMinimumAreaEnclosingTriangle()
433 updateSideB(polygon, nrOfPoints, a, b, c, validationFlag, in findMinimumAreaEnclosingTriangle()
437 if (isLocalMinimalTriangle(vertexA, vertexB, vertexC, polygon, nrOfPoints, a, b, in findMinimumAreaEnclosingTriangle()
452 static void returnMinimumAreaEnclosingTriangle(const std::vector<cv::Point2f> &polygon, in returnMinimumAreaEnclosingTriangle() argument
454 unsigned int nrOfPoints = static_cast<unsigned int>(polygon.size()); in returnMinimumAreaEnclosingTriangle()
457 triangle.push_back(polygon[i % nrOfPoints]); in returnMinimumAreaEnclosingTriangle()
472 static void advanceBToRightChain(const std::vector<cv::Point2f> &polygon, in advanceBToRightChain() argument
475 while (greaterOrEqual(height(successor(b, nrOfPoints), polygon, nrOfPoints, c), in advanceBToRightChain()
476 height(b, polygon, nrOfPoints, c))) { in advanceBToRightChain()
491 static void moveAIfLowAndBIfHigh(const std::vector<cv::Point2f> &polygon, in moveAIfLowAndBIfHigh() argument
496 while(height(b, polygon, nrOfPoints, c) > height(a, polygon, nrOfPoints, c)) { in moveAIfLowAndBIfHigh()
497 …if ((gamma(a, gammaOfA, polygon, nrOfPoints, a, c)) && (intersectsBelow(gammaOfA, b, polygon, nrOf… in moveAIfLowAndBIfHigh()
515 static void searchForBTangency(const std::vector<cv::Point2f> &polygon, in searchForBTangency() argument
520 while (((gamma(b, gammaOfB, polygon, nrOfPoints, a, c)) && in searchForBTangency()
521 (intersectsBelow(gammaOfB, b, polygon, nrOfPoints, c))) && in searchForBTangency()
522 (greaterOrEqual(height(b, polygon, nrOfPoints, c), in searchForBTangency()
523 height(predecessor(a, nrOfPoints), polygon, nrOfPoints, c))) in searchForBTangency()
539 static bool isNotBTangency(const std::vector<cv::Point2f> &polygon, in isNotBTangency() argument
544 if (((gamma(b, gammaOfB, polygon, nrOfPoints, a, c)) && in isNotBTangency()
545 (intersectsAbove(gammaOfB, b, polygon, nrOfPoints, c))) || in isNotBTangency()
546 …(height(b, polygon, nrOfPoints, c) < height(predecessor(a, nrOfPoints), polygon, nrOfPoints, c))) { in isNotBTangency()
567 static void updateSidesCA(const std::vector<cv::Point2f> &polygon, in updateSidesCA() argument
571 sideCStartVertex = polygon[predecessor(c, nrOfPoints)]; in updateSidesCA()
572 sideCEndVertex = polygon[c]; in updateSidesCA()
574 sideAStartVertex = polygon[predecessor(a, nrOfPoints)]; in updateSidesCA()
575 sideAEndVertex = polygon[a]; in updateSidesCA()
595 static void updateSidesBA(const std::vector<cv::Point2f> &polygon, in updateSidesBA() argument
602 sideBStartVertex = polygon[predecessor(b, nrOfPoints)]; in updateSidesBA()
603 sideBEndVertex = polygon[b]; in updateSidesBA()
610 (height(sideBMiddlePoint, polygon, nrOfPoints, c) < in updateSidesBA()
611 height(predecessor(a, nrOfPoints), polygon, nrOfPoints, c))) { in updateSidesBA()
612 sideAStartVertex = polygon[predecessor(a, nrOfPoints)]; in updateSidesBA()
613 sideAEndVertex = findVertexCOnSideB(polygon, nrOfPoints, a, c, in updateSidesBA()
636 static void updateSideB(const std::vector<cv::Point2f> &polygon, in updateSideB() argument
640 if (!gamma(b, sideBStartVertex, polygon, nrOfPoints, a, c)) { in updateSideB()
644 sideBEndVertex = polygon[b]; in updateSideB()
669 cv::Point2f &vertexC, const std::vector<cv::Point2f> &polygon, in isLocalMinimalTriangle() argument
684 return isValidMinimalTriangle(vertexA, vertexB, vertexC, polygon, nrOfPoints, a, b, in isLocalMinimalTriangle()
712 … const cv::Point2f &vertexC, const std::vector<cv::Point2f> &polygon, in isValidMinimalTriangle() argument
723 ? (areEqualPoints(midpointSideA, polygon[predecessor(a, nrOfPoints)])) in isValidMinimalTriangle()
727 ? (areEqualPoints(midpointSideB, polygon[b])) in isValidMinimalTriangle()
797 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints, in intersectsBelow() argument
799 double angleOfGammaAndPoint = angleOfLineWrtOxAxis(polygon[polygonPointIndex], gammaPoint); in intersectsBelow()
801 …return (intersects(angleOfGammaAndPoint, polygonPointIndex, polygon, nrOfPoints, c) == INTERSECTS_… in intersectsBelow()
816 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints, in intersectsAbove() argument
818 double angleOfGammaAndPoint = angleOfLineWrtOxAxis(gammaPoint, polygon[polygonPointIndex]); in intersectsAbove()
820 …return (intersects(angleOfGammaAndPoint, polygonPointIndex, polygon, nrOfPoints, c) == INTERSECTS_… in intersectsAbove()
832 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints, in intersects() argument
834 …double anglePointPredecessor = angleOfLineWrtOxAxis(polygon[predecessor(polygonPointIndex, nrOfPoi… in intersects()
835 polygon[polygonPointIndex]); in intersects()
836 …double anglePointSuccessor = angleOfLineWrtOxAxis(polygon[successor(polygonPointIndex, nrOfPoint… in intersects()
837 polygon[polygonPointIndex]); in intersects()
838 double angleFlushEdge = angleOfLineWrtOxAxis(polygon[predecessor(c, nrOfPoints)], in intersects()
839 polygon[c]); in intersects()
845 polygonPointIndex, polygon, nrOfPoints, c); in intersects()
849 polygonPointIndex, polygon, nrOfPoints, c); in intersects()
879 const std::vector<cv::Point2f> &polygon, in intersectsAboveOrBelow() argument
881 … if (height(succPredIndex, polygon, nrOfPoints, c) > height(pointIndex, polygon, nrOfPoints, c)) { in intersectsAboveOrBelow()
909 const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoints, in gamma() argument
914 if (!findGammaIntersectionPoints(polygon, nrOfPoints, c, polygonPointIndex, in gamma()
915 polygon[a], polygon[predecessor(a, nrOfPoints)], in gamma()
916 polygon[c], polygon[predecessor(c, nrOfPoints)], in gamma()
922 if (areOnTheSameSideOfLine(intersectionPoint1, polygon[successor(c, nrOfPoints)], in gamma()
923 polygon[c], polygon[predecessor(c, nrOfPoints)])) { in gamma()
951 static cv::Point2f findVertexCOnSideB(const std::vector<cv::Point2f> &polygon, unsigned int nrOfPoi… in findVertexCOnSideB() argument
960 if (!findGammaIntersectionPoints(polygon, nrOfPoints, c, predecessor(a, nrOfPoints), in findVertexCOnSideB()
968 if (areOnTheSameSideOfLine(intersectionPoint1, polygon[successor(c, nrOfPoints)], in findVertexCOnSideB()
969 polygon[c], polygon[predecessor(c, nrOfPoints)])) { in findVertexCOnSideB()
989 static bool findGammaIntersectionPoints(const std::vector<cv::Point2f> &polygon, unsigned int nrOfP… in findGammaIntersectionPoints() argument
998 double polygonPointHeight = height(polygonPointIndex, polygon, nrOfPoints, c); in findGammaIntersectionPoints()
1091 static double height(const cv::Point2f &polygonPoint, const std::vector<cv::Point2f> &polygon, in height() argument
1093 cv::Point2f pointC = polygon[c]; in height()
1094 cv::Point2f pointCPredecessor = polygon[predecessor(c, nrOfPoints)]; in height()
1108 static double height(unsigned int polygonPointIndex, const std::vector<cv::Point2f> &polygon, in height() argument
1110 cv::Point2f pointC = polygon[c]; in height()
1111 cv::Point2f pointCPredecessor = polygon[predecessor(c, nrOfPoints)]; in height()
1113 cv::Point2f polygonPoint = polygon[polygonPointIndex]; in height()