Is there a function to see if a polygon is contained within another polygon?
I need to test to see if a polygon is contained within another polygon. Right now I'm just iterating through the points in one polygon and calling pointPolygonTest()
on each one. I'm wondering if there is an openCV function to do this in a single call.
There doesn't appear to be such a thing. As long as you're using convex polygons, your method should work.
If they're more complicated, you need to check that there is at least one corner inside, and that the edges of the inner polygon never intersect the outer one.
Thanks. I'm only working with convex polygons so I guess I'm good.