image thumbnail

MATLAB to Point Cloud Library

version 1.5.0.0 (7.42 KB) by Peter Corke
matpcl is pure MATLAB code that allows interfacing with the Point Cloud Library (PCL) tools

10.2K Downloads

Updated 14 Aug 2013

View License

matpcl is pure MATLAB code that allows interfacing with the Point Cloud Library (PCL) tools by reading and writing PCD format files. Being pure MATLAB avoids all kinds of headaches in trying to link PCL code into MEX files which involves various grief such as versions of compilers and support libraries such as boost.

There are only four user-level functions:

savepcd() writes a matrix as an optionally coloured point cloud in an ASCII PCD format file.

loadpcd() reads an optionally colored point cloud from a PCD format file (ASCII or binary) and returns a matrix.

pclviewer() writes a matrix to a temporary file and invokes the pcl_viewer app for visualization. This is much much faster for rotating a large point cloud than using a MATLAB 3D plot.

lscpd() shows the attributes of the PCD files in the current directory

Point clouds are considered to be either:

2-d matrices, with one column per point. The rows are X, Y, Z and for a colored point cloud X, Y, Z, R, G, B. (R,G,B) are in the range 0 to 1.

3-d matrices, with planes X, Y, Z and for a colored point cloud X, Y, Z, R, G, B. (R,G,B) are in the range 0 to 1.

Limitations (for now):

- No support for reading/writing normals

Cite As

Peter Corke (2022). MATLAB to Point Cloud Library (https://www.mathworks.com/matlabcentral/fileexchange/40382-matlab-to-point-cloud-library), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!