To find out the X, Y and Z co-ordinates from 3D point cloud.
1 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152908/image.png)
Hello I'm using Stereo Vision in MATLAB. In that i have to find out the X, Y and Z co-ordinates of region of interest(in my case white color object) from 3D point cloud. I able to create 3D scene reconstruction but how to proceed further I don't know. Can anyone suggest some code examples or method to find out these co-ordinates. I'm attaching my 3d point cloud and disparity map with this. Thanks in Advance.
0 个评论
采纳的回答
Dima Lisin
2015-12-28
Hi Naseeb,
If you trying to find the 3D coordinates of a particular object in the scene, then you need to be able to detect it either in the image, or in the point cloud. reconstructScene returns an M-by-N-by-3 array, where [M,N] is the size of the rectified image. So the 3D coordinates are in correspondence with image pixels. Thus, if you can find the object in image 1 of your stereo pair, then you can simply look up the [X,Y,Z] coordinates of the pixels belonging to this object in the 3D point array returned by reconstructScene.
How to detect an object in the image is a whole separate question, and the answer depends on the type of object. If the object has a distinctive color, you can try using a segmentation algorithm. Otherwise, you can use local feature matching, or a detection algorithm trained for a specific kind of object, such as vision.CascadeObjectDetector or vision.PeopleDetector.
Alternatively, if your object has a particular 3D shape, such as plane, sphere, or cylinder, you can try detecting it in the point cloud directly. There are functions for fitting primitive shapes to the point cloud: pcfitplane, pcfitshpere, and pcfitcylinder.
3 个评论
Uzair UlHaq
2018-2-28
If you want to extract x,y,z values from points3D then simply use: x=points3D(:,:,1) y=points3D(:,:,2) z=points3D(:,:,3)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!