I have 2 contours and I want to compare how much the same are they, as the ratio of the area_of_c1/area_of_intersection
and area_of_c2/area_of_intersection
. I have done in a way of creating 2 convex contours and 2 Mat
s of zeros and fill them with fillConvexPoly()
and doing a bitwise_and()
between the two Mat
s for getting the intersection. Then I have counting the non zeros pixels for getting the areas and computed the ratios. Is there another more efficient way of computing the two ratios (like computing the intersection of two contours, or I do not know)?