Point Cloud to depth information
Hi, I want to retrieve depth of various objects from the point cloud. I am getting point cloud from a stereo camera. All I know is that the z coordinate in point cloud does not corresponds to depth/ distance from stereo camera to object. Thanks in advance.
Asked by BotLover on 2017-07-12 09:26:06 UTC
Comments
Please post your tf tree.
Asked by Akif on 2017-07-12 09:28:19 UTC
link text this is the tf tree generated after executing rosrun tf view_frames
Asked by BotLover on 2017-07-12 09:44:54 UTC
If you are gathering point cloud in one of _optical frames, z coordinate should point forward from the camera. If not, the driver you use may be written disregarding REP-103.
Asked by Akif on 2017-07-12 09:57:24 UTC
so you mean that z-coordinate would itself give me depth? what would be the units then?
Asked by BotLover on 2017-07-12 10:11:44 UTC
No I don't. To be able to "mean" anything, you need to supply more details (like sensor model, driver you use, topic you listen and message samples etc.). Drivers should follow REP-103 for units but they do not have to.
Asked by Akif on 2017-07-13 01:40:12 UTC
Are you wanting radial distance, like if you had a ruler from the center of your camera to the object -
distance = sqrt(x^2 + y^2 + z^2)
?Asked by lucasw on 2017-07-13 11:26:28 UTC
Yes it is what I need!!!! @lucasw
Asked by BotLover on 2017-07-13 19:44:36 UTC
I don't think there is an existing node to do that for you- is implementing that equation in your own node unclear or is just having the equation a sufficient answer to this question?
Asked by lucasw on 2017-07-15 09:44:17 UTC
To implement it in my code I need to know xyz coordinates of the object of whose depth I want. But how do I get those coordinates??
Asked by BotLover on 2017-07-15 14:47:39 UTC
If you are asking how to do object recognition check out the pcl tutorials, http://pointclouds.org/documentation/tutorials/ , or if you are asking how to iterate through a pointcloud to get xyz values look at http://wiki.ros.org/pcl_ros#Subscribing_to_point_clouds
Asked by lucasw on 2017-07-17 10:27:25 UTC