Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 2088

Skeletonization of the image

$
0
0
Hey, im trying to convert the below image into skeleton using opencv. ![Photo 1](/upfiles/15133133844829775.jpg) By using ---------------------------------------- size = np.size(crop) skel = np.zeros(crop.shape,np.uint8) element = cv2.getStructuringElement(cv2.MORPH_CROSS,(3,3)) done = False while( not done): eroded = cv2.erode(crop,element) temp = cv2.dilate(eroded,element) temp = cv2.subtract(crop,temp) skel = cv2.bitwise_or(skel,temp) crop = eroded.copy() zeros = size - cv2.countNonZero(crop) if zeros==size: done = True ------------------------------------------------------------------ And i got this ![image description](/upfiles/15133136534821451.jpg) There are some noise and the line are not connected properly. any help pls? Thanks!

Viewing all articles
Browse latest Browse all 2088

Trending Articles