Testing each contour as to how much of it belongs to a polygon.