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.

normalisation of depth map

i find approximately box around object.

enter image description here

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:

enter image description here

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) 

enter image description here

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:

enter image description here

hope looking :)


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -