Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert color and depth image to a pcd file #680

Merged
merged 1 commit into from
May 22, 2014

Conversation

xiangxw
Copy link
Contributor

@xiangxw xiangxw commented May 19, 2014

I use rgbd dataset from http://rgbd-dataset.cs.washington.edu/dataset/rgbd-scenes/ to test this.
Color image:
desk_1_10

Depth image:
desk_1_10_depth

Gray image:
desk_1_10_gray

Test case 1: color + depth -> pcd(color)

pcl_png2pcd desk_1_10.png desk_1_10_depth.png out.pcd --intensity_type FLOAT

pcd viewer_003

Test case 2: color + depth -> pcd(force gray)

pcl_png2pcd desk_1_10.png desk_1_10_depth.png out.pcd --intensity_type FLOAT -mode FORCE_GRAYSCALE

pcd viewer_004

Test case 3: gray + depth -> pcd(gray)
pcl_png2pcd desk_1_10_gray.png desk_1_10_depth.png out.pcd --intensity_type FLOAT

pcd viewer_006

Test case 4: gray + depth -> pcd(force color)

pcl_png2pcd desk_1_10_gray.png desk_1_10_depth.png out.pcd --intensity_type FLOAT -mode FORCE_COLOR

pcd viewer_005

@jspricke
Copy link
Member

Hi, this looks like a really nice addition. Can you adopt it to the PCL style guide? https://github.com/PointCloudLibrary/pcl/blob/master/CONTRIBUTING.md#pull-requests

@xiangxw xiangxw changed the title png2pcd: convert color and depth image to a pcd file convert color and depth image to a pcd file May 21, 2014
@xiangxw
Copy link
Contributor Author

xiangxw commented May 21, 2014

@jspricke I have modified the commit message to adopt the PCL style guide. Please check it. Or somewhere else not adopted to the guide? Thanks.

pixel[0] = image_data->GetScalarComponentAsDouble(x, y, 0, 0);
for (int x = 0; x < dimensions[0]; x++)
{
pixel[0] = color_image_data->GetScalarComponentAsDouble(x, y, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a space before the bracket here. (And in the next line).

@taketwo
Copy link
Member

taketwo commented May 21, 2014

I added a few inline comments about missing spaces. Actually there are more of them missing in similar lines, but I stopped in order not to flood, hope you got the point.

Also I noticed there are always outer loops over the third dimension: for (int z = 0; z < dimensions[2]; z++). I do not think these are necessary, anyways z is never used inside them.

@xiangxw
Copy link
Contributor Author

xiangxw commented May 21, 2014

Thanks @taketwo
I fixed the spaces and removed the unnecessary code about the third dimension.
Is it ok to keep two commit message, or just one?

@taketwo
Copy link
Member

taketwo commented May 21, 2014

We'll need to squash this in one commit, please see our wiki page in case you are not sure how to do this.

@xiangxw
Copy link
Contributor Author

xiangxw commented May 21, 2014

Hi, @taketwo commits squashed.

Use pcl_png2pcd to convert color and depth image to a pcd file.
Example:
  pcl_png2pcd color.png depth.png out.pcd --intensity_type FLOAT
Tested with RGB-D dataset from
http://rgbd-dataset.cs.washington.edu/dataset/rgbd-scenes
jspricke added a commit that referenced this pull request May 22, 2014
convert color and depth image to a pcd file
@jspricke jspricke merged commit 2d5bec6 into PointCloudLibrary:master May 22, 2014
@xiangxw xiangxw deleted the powerful_png2pcd branch June 12, 2014 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants