需要建议使用 kinect 在 opencv 中找到最近的块
我对opencv完全陌生,最近我被分配了一项任务,寻找kinect检测到的最近斑点的中心,这意味着如果你在kinect面前伸出你的手,那么你的手就会成为与kinect相比最接近的斑点你的身体。
我获得了一个示例代码,也可以在此处在线找到。到目前为止,我只能想到两种方法,一种是使用 cvFindContours() 获取对象的所有轮廓,然后循环遍历每个轮廓并找到最接近的轮廓。问题是我不知道该怎么做,因为我不知道是否有函数可以用来获取每个轮廓的深度信息。
我的第二个想法是循环遍历 heightMat 矩阵,找到最低值(应该是最近的点),然后传播出去找到一个块,然后绘制该块。这样做的问题是需要进行大量计算,导致我的 kinect 视频响应速度非常慢。
有人对这个任务有好的建议吗?谢谢。
I'm totally new to opencv, and I was recently assigned an assignment to find the center of the closest blob detected by kinect, which means that if you reach out your hands in front of kinect, then your hands become the closest blobs compared to your body.
I'm given a sample code, which can also be found online at here. So far I can only think of 2 approaches, one is using cvFindContours() to get all contours of objects, and loop though each of them and find the closest one. The problem is I don't know how to do that, because I don't know if there are functions that I can use to get each contour's depth information.
My second idea is to just loop though the depthMat matrix, and find the lowest value, which is supposed to be the closest point, and propagate out to find a block, and draw the block. The problem with this is that it takes so many calculations that my kinect video response very slowly.
Does anyone have a good suggestion on this task? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试迭代范围选通。 Kinect 的最大有效范围约为 6m,因此对于有限的距离,这可能有效。
假设深度以厘米为单位(如果以计数为单位,则将计数划分为 10、100 或 1000 计数等合适的容器)。
一旦循环中断,您应该得到以下结果:
希望这有帮助!
You could try iterative range gating. The maximum effective range on the Kinect is about 6m, so for limited distances this might work.
Assuming depth is in centimeters (if it's in counts, divide counts up into bins of say 10, 100 or 1000 counts whatever seems appropriate).
Once that loop breaks out, you should have the following:
Hope that's helpful!