PCL projection with color

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

PCL projection with color

Sericaia
Hello,

How can I get a projection with color?

I used PCA projection but when I save the reconstructed cloud it doesn't save RGB information..

Obviously, I am using
pcl::PCA<pcl::<b>PointXYZRGB > pca;
pcl::PointCloud< pcl::PointXYZRGB > proj;
       
any guesses?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: PCL projection with color

aichim
Administrator
Hi,

Probably the code is not copying the RGB information, you can do it separately, the PCA projection in xyz-space will not influence the colors.

Cheers,
Alex
---
http://www.alexichim.com
http://www.openperception.org




On May 17, 2013, at 3:59 PM, Sericaia <[hidden email]> wrote:

> Hello,
>
> How can I get a projection with color?
>
> I used PCA projection but when I save the reconstructed cloud it doesn't
> save RGB information..
>
> Obviously, I am using
> pcl::PCA<pcl::&lt;b>PointXYZRGB* > pca;
> pcl::PointCloud< pcl::*PointXYZRGB *> proj;
>
> any guesses?
>
> Thanks
>
>
>
> --
> View this message in context: http://www.pcl-users.org/PCL-projection-with-color-tp4027869.html
> Sent from the Point Cloud Library (PCL) Users mailing list 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: PCL projection with color

hymione
This post has NOT been accepted by the mailing list yet.
I still have not yet gotten your idea. How can  I recover the RGB color after implementing the projection, particularly use "pca.project()" ? Could you give a litte bit piece of code to do that ? Thanks
Reply | Threaded
Open this post in threaded view
|

Re: PCL projection with color

Sericaia
Hm... you need to do that manually.. 

I dont know if that is the best solution, but what I've done is project manually ech point and add XYZ coordinates from the point projected to a new cloud and RGB from the point in the cloud without projection...

It works with me.. 

pcl::PointXYZRGB projected, reconstructed;
pcl::PointCloud< pcl::PointXYZRGB > cloudi = *cloud->makeShared();
pcl::PointCloud<pcl::PointXYZRGB> finalCloud;

for(size_t i = 0; i < cloud->size(); i++)
{
pca.project (cloudi[i], projected);
pca.reconstruct (projected, reconstructed);
//assign colors
projected.r = cloudi[i].r;
projected.g = cloudi[i].g;
projected.b = cloudi[i].b;

//add point to cloud
finalCloud.push_back(projected);
 }

hope it helps... whats your project about?

2013/5/23 hymione [via Point Cloud Library (PCL) Users mailing list] <[hidden email]>
I still have not yet gotten your idea. How can  I recover the RGB color after implementing the projection, particularly use "pca.project()" ? Could you give a litte bit piece of code to do that ? Thanks


If you reply to this email, your message will be added to the discussion below:
http://www.pcl-users.org/PCL-projection-with-color-tp4027869p4027970.html
To unsubscribe from PCL projection with color, click here.
NAML



--
Daniela Alexandra E. G. Borges
MSc student @ Instituto Superior Técnico | www.ist.utl.pt