Changing rgb data at a certain point in a point cloud

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

Changing rgb data at a certain point in a point cloud

jmanring
Hi,

Is there a way to access the raw rgb data at a particular point in a point cloud? For instance, if I have an organized point cloud called cloud can I do something like this to change the r value of the rgb data:

cloud->point(row, column).r = 100;

I haven't been able to figure it out. Thanks for any help.

jmanring
Reply | Threaded
Open this post in threaded view
|

Re: Changing rgb data at a certain point in a point cloud

Radu B Rusu
Administrator


On 06/22/2012 11:40 AM, jmanring wrote:
> Hi,
>
> Is there a way to access the raw rgb data at a particular point in a point
> cloud? For instance, if I have an organized point cloud called cloud can I
> do something like this to change the r value of the rgb data:
>
> cloud->point(row, column).r = 100;

Yes, that is certainly possible. However "cloud->points" is an std::vector, so you need to use "cloud->at (row
column).r", or alternatively "(*cloud)(row, column).r" if you're a micro-optimization freak like me :)

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

Re: Changing rgb data at a certain point in a point cloud

koen buys-2
In reply to this post by jmanring
On 22 June 2012 20:40, jmanring <[hidden email]> wrote:
> Hi,
>
> Is there a way to access the raw rgb data at a particular point in a point
> cloud? For instance, if I have an organized point cloud called cloud can I
> do something like this to change the r value of the rgb data:
>
> cloud->point(row, column).r = 100;
>

Have a look at the .at method on the pointcloud, this should do what you want:

http://docs.pointclouds.org/trunk/common_2include_2pcl_2point__cloud_8h_source.html#l00292

this only works if you pointcloud is organised.

cloud.at(u,v).r

> I haven't been able to figure it out. Thanks for any help.
>
> jmanring
>
> --
> View this message in context: http://www.pcl-users.org/Changing-rgb-data-at-a-certain-point-in-a-point-cloud-tp4019584.html
> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Changing rgb data at a certain point in a point cloud

jmanring
I actually tried that and couldn't get it to work. I found another solution though. I created another point at the location I wanted to change the color and used cloud->points.pushback(point). Thanks though.

jmanring