opencv - Detect approximately objects on depth map -
i find approximately object on depth map. process following : 1. normalization of depth 2. threshold closest object 3. gaussian blur 4. canny edge detection 5. contour detection
however, i'm not able find box around object. actually, don't know if it's possible kind of depth map...
i have 3 object on table : box of food , 2 mugs.
i find approximately box around object.
is there way image processing ? appreciated.
thank in advance.
you can using opencv. have @ following solution.
i used depth map provided in question input image. performed binary threshold of gray scale image of depth map
ret,th = cv2.threshold(gray,127,255, 1)
and obtained following:
now in order fill gaps in image, performed morphological close operation
kernel = np.ones((15,15),np.uint8) dilate = cv2.morphologyex(th, cv2.morph_close, kernel, 3)
then found contours using:
contours,hierarchy = cv2.findcontours(dilate,2,1)
and drew them using:
cv2.drawcontours(img, contours, -1, (0,255,0), 3)
finally obtained this:
hope looking :)
Comments
Post a Comment