I am using the opencv python interface (not cv2)
contourmov = cv.FindContours(image1, storage, cv.CV_RETR_CCOMP, cv.CV_CHAIN_APPROX_SIMPLE)
contourmove = cv.FindContours(image2, storage, cv.CV_RETR_CCOMP, cv.CV_CHAIN_APPROX_SIMPLE)
I have the contours from image1 and image2 and I need the intersection between the two contours.
I used
image3 = cv.CloneImage(image1)
cv.Set(image1, cv.Scalar(0,0,0));
image4 = cv.CloneImage(image1)
cv.Set(image2, cv.Scalar(0,0,0));
cv.DrawContours(image3,contourmov,cv.CV_RGB(0,255,0),cv.CV_RGB(0,255,0),1)
cv.DrawContours(image4,contourmove,cv.CV_RGB(0,255,0),cv.CV_RGB(0,255,0),1)
cv.And(image3,image4,image3)
So I assumed image3 will have the intersection of contours of image1 and image2 but i do not see them.
Kindly let me know where am I going wrong.
I figured out the problem. I had to use
This fills the contour area and you will get the intersection. Else there are only lines and you will get line intersections which might be points.