1 | initial version |
Based on @sturmen code I translated to python. I'm not sure about the Mat() instruction, what is the equivalent in python.
blur = cv2.blur(lA1innerContourmask, (3,3))
kernel = np.ones((5,5),np.uint8)
erodeblur = cv2.erode(blur,kernel,(-1,-1), iterations=5)
edges = cv2.Canny(erodeblur,100,200,6)
contoursCanny, hier__ = cv2.findContours(edges,cv2.RETR_TREE,
cv2.CHAIN_APPROX_SIMPLE, offset = (0,0))
cv2.imshow('new image',blur)
cv2.waitKey(0)
cv2.imshow('new image',edges)
cv2.waitKey(0)
cv2.drawContours(lA1innerContourmask,contoursCanny,-1,(0,0,255),2,8,hier__,0)
cv2.imshow('new image',lA1innerContourmask)
cv2.waitKey(0)