2016-06-29 25 views
0

我想在我的深度图上找到大约物体。 现在我的过程是这样的:1。 正常化深度 2阈值的只得到最接近的对象 3.高斯模糊 4. Canny边缘检测 5.轮廓检测在深度图上检测大约物体

不过,我米无法找到我的对象周围的框。其实,我不知道这种深度图是否可能...

我在桌上有三个物体:一盒食物和两个杯子。

Normalisation of the depth map

我想找到大约在我的对象框。

enter image description here

有没有办法只是通过图像处理办呢? 任何帮助,将不胜感激。

非常感谢您提前。

回答

1

你可以使用OpenCV来做到这一点。看看下面的解决方案。

我用问题中提供的深度图作为我的输入图像。我所执行的深度图

ret,th = cv2.threshold(gray,127,255, 1) 

的灰度图像的二进制阈值,并且获得以下:

enter image description here

现在,为了填补图像中的空白,我执行形态接近操作

kernel = np.ones((15,15),np.uint8) 
dilate = cv2.morphologyEx(th, cv2.MORPH_CLOSE, kernel, 3) 

enter image description here

后来我发现轮廓使用:

contours,hierarchy = cv2.findContours(dilate,2,1) 

,并使用拉他们:

cv2.drawContours(img, contours, -1, (0,255,0), 3) 

最终得到这样的:

enter image description here

希望这是你要找的:)