PointCloudLibrary / pcl

Point Cloud Library (PCL)

Home Page:https://pointclouds.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use tiff2pcd?

gyc137 opened this issue · comments

I used pcl_tiff2pcd.exe to convert .tiff to .pcd format, but it didn't work.
Here is my command: pcl_tiff2pcd.exe -v 1 -rgb rgb -depth xyz -out out
Here is the result after running the command:
-Creating RGB Tiff List
-Extension".png"
-Filename"000.png"
-Creating Depth Tiff List
-Extension".tiff"
-Filename"000.tiff"
It successed reading those png and tiff files, but it turned out that there was nothing in the output directory.
Please let me know what is wrong with this, thanks!

@gyc137 Can you upload one tiff file and the corresponding rgb file as a zip, please? Then I can test where it goes wrong.

@gyc137 Can you upload one tiff file and the corresponding rgb file as a zip, please? Then I can test where it goes wrong.

file.zip
Here are a tiff file and the corresponding rgb file of the MVTec 3D Dataset, I can give you more if you need.

@gyc137 I found at least two problems:

  • The tiff2pcd tool expects that both the rgb and the depth file are in tiff format. It does not accept an rgb image in png format. You could fix this problem by converting 000.png to tiff format
  • The depth file (000.tiff) is weird: it contains red, green, and blue channels, but tiff2pcd expects it to have a single channel (representing depth). If you did any modification on 000.tiff, check if you have made any mistake, otherwise check if 000.tiff is really meant to represent a depth image.

If you want examples of tiff images that work with tiff2pcd, see https://github.com/PointCloudLibrary/pcl/tree/master/test/grabber_sequences/tiff

@gyc137 I found at least two problems:

  • The tiff2pcd tool expects that both the rgb and the depth file are in tiff format. It does not accept an rgb image in png format. You could fix this problem by converting 000.png to tiff format
  • The depth file (000.tiff) is weird: it contains red, green, and blue channels, but tiff2pcd expects it to have a single channel (representing depth). If you did any modification on 000.tiff, check if you have made any mistake, otherwise check if 000.tiff is really meant to represent a depth image.

If you want examples of tiff images that work with tiff2pcd, see https://github.com/PointCloudLibrary/pcl/tree/master/test/grabber_sequences/tiff

Thanks! I tried those examples you provided and it worked.
In terms of the MVTech 3D Dataset, I didn't do anything on it, and here is its explanation about its depth tiff file:
-'xyz', which contains 3-channel TIFF images that store the x,y, and z coordinates.
Does that means I should keep the last channel of the tiff file, drop the other and make it a real depth image?

Does that means I should keep the last channel of the tiff file, drop the other and make it a real depth image?

Yes, that should work

I kept the first channel of the tiff file, and I thought it produced the correct output.
Very grateful to you for your reply!