Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教如何输出检测物体的三维坐标 #28

Open
chunxuli90 opened this issue Apr 12, 2021 · 7 comments
Open

请教如何输出检测物体的三维坐标 #28

chunxuli90 opened this issue Apr 12, 2021 · 7 comments

Comments

@chunxuli90
Copy link

大家好,求教一问题。我想用一个深度摄像头,不管是哪个CNN model,比如YOLO,如何能输出物体的三维坐标?不知道有没有相关的教程?谢谢

@bubbliiiing
Copy link
Owner

你有深度信息可以有一个z轴信息

@chunxuli90 chunxuli90 reopened this Apr 17, 2021
@chunxuli90
Copy link
Author

@bubbliiiing 请问如何调取z轴信息?谢谢

@bubbliiiing
Copy link
Owner

emm有深度的话可以把框里面做个求和或者平均呗

@chunxuli90
Copy link
Author

额。。。我就是这么做的输出box中点坐标。但是不知道用什么代码command来调用深度摄像机的Z轴信息,比如这行代码(top = max(0, np.floor(top + 0.5).astype('int32'))
left = max(0, np.floor(left + 0.5).astype('int32'))
bottom = min(image.size[1], np.floor(bottom + 0.5).astype('int32'))
right = min(image.size[0], np.floor(right + 0.5).astype('int32')))是输出box的左上右下的XY坐标,但是用什么代码输出相应点Z的坐标?还请帮忙说明一下。。谢谢

@bubbliiiing
Copy link
Owner

你不应该有深度图吗,深度图表示的就是Z轴呀,xy就是图上的坐标,距离就是Z轴?

@chunxuli90
Copy link
Author

你不应该有深度图吗,深度图表示的就是Z轴呀,xy就是图上的坐标,距离就是Z轴?

是的,我是Kinect Azure摄像头,可以输出深度信息。我是想问用什么命令或者哪个function来调用深度值?比如cpp里面是.ad()命令。。。。另外还有个问题请教,我在yolo.py里面加入POS = (CENTRE_X, CENTRE_Y)这个命令并且可以输出二维坐标值,我想在video.py文件中使用textD = 'Position{}mm'.format(POS)和frame = cv2.putText(frame, textD, (0, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)把坐标打印到屏幕,但是不知道如何把POS值从yolo传送到video中,可否帮忙解答一下?十分感谢啊!

@bubbliiiing
Copy link
Owner

你这个摄像头我没用过,我不知道怎么获取深度图,你查一下官方文档就知道了
后面的pos从yolo到video,我没看懂你,你想写字的话,和写种类分数一样写就行了。有字符串就能在detect_image写。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants