Surfel visualization? Can surfel structure show with different radius?

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

Surfel visualization? Can surfel structure show with different radius?

vul3xm4bp6
Hello, everyone!

I have a little problem that I can not visualize surfel structure with different radius.

The surfel is built as:

        for(int i=0;i<PointCloudPtr->size();i++){
                Surfel.x=PointCloudPtr->points[i].x;
                Surfel.y=PointCloudPtr->points[i].y;
                Surfel.z=PointCloudPtr->points[i].z;
                Surfel.normal_x=Normal->points[i].normal_x;
                Surfel.normal_y=Normal->points[i].normal_y;
                Surfel.normal_z=Normal->points[i].normal_z;
                Surfel.radius=PointCloudPtr->points[i].z/(focal*std::abs(Surfel.normal_z)*(std::sqrtf(2)));
                rgb=*reinterpret_cast<int*>(&PointCloudPtr->points[i].rgb);
                uint8_t r = (rgb >> 16) & 0x0000ff;
                uint8_t g = (rgb >> 8)  & 0x0000ff;
                uint8_t b = (rgb )  & 0x0000ff;
                Surfel.rgba=((uint32_t)r) << 16 | ((uint32_t)g) << 8 | ((uint32_t)b);
                SurfelPtr->push_back(Surfel);
                }

I use following code to show the surfel, but it seems not scale with respect to each radius.
  viewer->addPointCloud<pcl::PointSurfel> (Surfel,"surfel1",v1);

Is there are other way to show the surfel?
Or I need to transform surfel to polygon representation?

another question is that the "rgba" is in uint32_t, however in pointxyzrgb, color is represented as rgb which is float. How could I transform them properly??

I think the transform code on the above is wrong.

Thanks! :)

(Sorry for delete the previous topic since I had not confirmation mailing list subscription...)
Reply | Threaded
Open this post in threaded view
|

Re: Surfel visualization? Can surfel structure show with different radius?

aichim
Administrator
Hi,

The PCLVisualizer::addPointCloud method only uses the XYZ information. An option for you would be to go through the points of your cloud and display each point as an oriented disc, but you will have to get dirty with VTK in order to get good performance out of it.

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



On Feb 28, 2013, at 8:02 AM, vul3xm4bp6 <[hidden email]> wrote:

> Hello, everyone!
>
> I have a little problem that I can not visualize surfel structure with
> different radius.
>
> The surfel is built as:
>
>        for(int i=0;i<PointCloudPtr->size();i++){
>                Surfel.x=PointCloudPtr->points[i].x;
>                Surfel.y=PointCloudPtr->points[i].y;
>                Surfel.z=PointCloudPtr->points[i].z;
>                Surfel.normal_x=Normal->points[i].normal_x;
>                Surfel.normal_y=Normal->points[i].normal_y;
>                Surfel.normal_z=Normal->points[i].normal_z;
>
> Surfel.radius=PointCloudPtr->points[i].z/(focal*std::abs(Surfel.normal_z)*(std::sqrtf(2)));
>                rgb=*reinterpret_cast<int*>(&PointCloudPtr->points[i].rgb);
>                uint8_t r = (rgb >> 16) & 0x0000ff;
>                uint8_t g = (rgb >> 8)  & 0x0000ff;
>                uint8_t b = (rgb )  & 0x0000ff;
>                Surfel.rgba=((uint32_t)r) << 16 | ((uint32_t)g) << 8 |
> ((uint32_t)b);
>                SurfelPtr->push_back(Surfel);
>                }
>
> I use following code to show the surfel, but it seems not scale with respect
> to each radius.
>  viewer->addPointCloud<pcl::PointSurfel> (Surfel,"surfel1",v1);
>
> Is there are other way to show the surfel?
> Or I need to transform surfel to polygon representation?
>
> another question is that the "rgba" is in uint32_t, however in pointxyzrgb,
> color is represented as rgb which is float. How could I transform them
> properly??
>
> I think the transform code on the above is wrong.
>
> Thanks! :)
>
> (Sorry for delete the previous topic since I had not confirmation mailing
> list subscription...)
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Surfel-visualization-Can-surfel-structure-show-with-different-radius-tp4026480.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: Surfel visualization? Can surfel structure show with different radius?

vul3xm4bp6
Hmm...I see!
I will try VTK to implement the 3D viewer!
Thank you! :)

Reply | Threaded
Open this post in threaded view
|

Re: Surfel visualization? Can surfel structure show with different radius?

Finfa
Hi,

I have the same problem than you. Did you find out any solution to visualize the surfels?

Cheers :)