We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd4ff36 commit 155f23fCopy full SHA for 155f23f
1 file changed
src/gab/opencv/Contour.java
@@ -51,6 +51,14 @@ public void loadPoints(Point[] pts){
51
}
52
53
54
+ public boolean containsPoint(int x, int y){
55
+ Point p = new Point(x,y);
56
+ MatOfPoint2f m = new MatOfPoint2f(pointMat.toArray());
57
+
58
+ double r = Imgproc.pointPolygonTest(m,p, false);
59
+ return r == 1;
60
+ }
61
62
// The polygonApproximationFactor is used to determine
63
// how strictly to follow a curvy polygon when converting
64
// it into a simpler polygon with getPolygonApproximation().
0 commit comments