I have a contour of object..and a line..
Object is moving..but line is constant..
I want to know the points at which contour intersects the line..
For example:- Take example of Car Race in which their is finish line..
I have a contour of Car and finish line.
I want to know the points on contour which intersects the finish line.
Contour lines join places with the same altitude on a map. Therefore,generally they do not cross each other.
Since OpenCV 3.2, findContours() no longer modifies the source image but returns a modified image as the first of three return parameters. In OpenCV, finding contours is like finding white object from black background. So remember, object to be found should be white and background should be black.
You can use cv::dilate() and cv::erode() then detect the contours again.
Intersect the object contour with the line contour (use numpy.logical_and( object_mask, line_mask )
) and all points where the resulting image is non-zero are the points of intersection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With