Unreadable RGB values almost everywhere in Point Cloud

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unreadable RGB values almost everywhere in Point Cloud

ravijoshi
Hi,

I have following RGB point cloud-

<http://www.pcl-users.org/file/t499210/crop_box.png>

I am using PointPickingEvent to pick a point and print RGB values of it.
However, it prints unreadable values such as following-

x: 0.232886, y: -0.109462, z: 0.708, r: �, g: �, b: �

This is how the callback function is implemented, which is printing these
values-

void pointPickingEventOccurred (const pcl::visualization::PointPickingEvent&
event, void* viewer_void)
{
  int index =  event.getPointIndex();
  if (index == -1) return;

  PointXYZRGB p = point_cloud->points[index];
  std::cout << "x: " << p.x << ", y: " << p.y << ", z: " << p.z << ", r: "
<< p.r << ", g: " << p.g << ", b: " << p.b << std::endl;
}

The PCD file of this point cloud can be downloaded from
[here](https://www.dropbox.com/s/b9hzuqand0b40y0/crop_box.pcd?dl=0)

I am using PCL 1.8.1.99. I just want to know the real RGB values of the
orange colored object for segmenting it out later.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Unreadable RGB values almost everywhere in Point Cloud

intoxica
Reply | Threaded
Open this post in threaded view
|

Re: Unreadable RGB values almost everywhere in Point Cloud

ravijoshi
Just cast 'int' to individual color fields and it worked!.

std::cout << "x: " << p.x << ", y: " << p.y << ", z: " << p.z << ", r: " <<
(int)p.r << ", g: " << (int)p.g << ", b: " << (int)p.b << std::endl;

Thank you!



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users