I wrote two matlab scripts to convert ply file generated by meshlab to pcd. One that I called as naive one, which scan each line in ply and then write them into pcd with appropriate format. The other one that I referred as efficient one due to data block can be read and written only once, it is about 10 times faster than the naive one for large file.
With respect to color conversion, as the color is stored as 8-bit unsigned integer for r, g, b channel in ply, while rgb is packed as 32-bit unsigned integer in pcd. I convert r, g, b from decimal to hex, and then pack them together and convert them back to decimal format.
N.B.: currently it only supports the ply file with x,y,z or x,y,z, r,g,b information.
Download:
you saved my day, great script :)
ReplyDelete