To find out the X, Y and Z co-ordinates from 3D point cloud.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Naseeb Gill
el 28 de Dic. de 2015
Comentada: Uzair UlHaq
el 28 de Feb. de 2018
![](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 comentarios
Respuesta aceptada
Dima Lisin
el 28 de Dic. de 2015
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 comentarios
Uzair UlHaq
el 28 de Feb. de 2018
If you want to extract x,y,z values from points3D then simply use: x=points3D(:,:,1) y=points3D(:,:,2) z=points3D(:,:,3)
Más respuestas (0)
Ver también
Categorías
Más información sobre Point Cloud Processing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!