The easiest way for the code is as follows:
cv::Rect BoundingBox; int IntersectionArea = 0; //insert Min-Max X,Y to create the BoundingBox for (every y inside boundingbox) for (every x inside boundingbox) if (PointPolygonTest(x,y,Contour1) && PointPolygonTest(x,y,Contour2)) IntersectionArea++;
source share