Draw Rectangle in PCLVisalizer

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

Draw Rectangle in PCLVisalizer

Tankard
Hi,

I have a plane (estimated with pcl::SACSegmentation<pcl::PointXYZ>) and I want to draw a part of this plane. I have the upper left und the lower right point for the rectangle.

I found no function to draw directly a rectangle into a pcl::visualization::PCLVisualizer.

Is there an easy way to draw a rectangle? It would be nice to color it with RGBA, but this is just nice to have.

And is there an easy way to give a line not just rgb but also an alpha channel?


regards,
Tankard
Reply | Threaded
Open this post in threaded view
|

Re: Draw Rectangle in PCLVisalizer

Radu B. Rusu
Administrator
Did you look here: http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html

There are methods for drawing polygons, cubes, etc.

Cheers,
Radu.
--
http://openperception.org

On 06/05/2013 06:41 AM, Tankard wrote:

> Hi,
>
> I have a plane (estimated with pcl::SACSegmentation<pcl::PointXYZ>) and I
> want to draw a part of this plane. I have the upper left und the lower right
> point for the rectangle.
>
> I found no function to draw directly a rectangle into a
> pcl::visualization::PCLVisualizer.
>
> Is there an easy way to draw a rectangle? It would be nice to color it with
> RGBA, but this is just nice to have.
>
> And is there an easy way to give a line not just rgb but also an alpha
> channel?
>
>
> regards,
> Tankard
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Draw-Rectangle-in-PCLVisalizer-tp4028107.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: Draw Rectangle in PCLVisalizer

Tankard
Ah thanks,

I overlooked addPolygon (const pcl::PlanarPolygon< PointT > &polygon,...).

So the pcl::PlanarPolygon wants a PointCloud with the contour. Is it enought to use the 4 corner points for the contour?

Regards,
Tankard
Reply | Threaded
Open this post in threaded view
|

Re: Draw Rectangle in PCLVisalizer

Tankard
In reply to this post by Radu B. Rusu
Now I tried addPolygon and addCube. Both don't do what I need.

addPolygon:
I don't understand why you can give model coefficients to the polygon when you also need contours.
There is a bug in the visualisation. I draw a rectangle (Edges are 1/1, 1/-1, -1/1, -1/-1, z-position is 1) and look from it along the positive z-axis, then one line is missing. When I rotate and look along the z-axis in negative direction, the rectangle is displayed correct.


Both methods (polygon or cube with z_min == z_max) only draw the contours. Is it possible to draw a filled polygon?


regards,
Tankard

Radu B. Rusu wrote
Did you look here: http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html

There are methods for drawing polygons, cubes, etc.

Cheers,
Radu.
--
http://openperception.org

On 06/05/2013 06:41 AM, Tankard wrote:
> Hi,
>
> I have a plane (estimated with pcl::SACSegmentation<pcl::PointXYZ>) and I
> want to draw a part of this plane. I have the upper left und the lower right
> point for the rectangle.
>
> I found no function to draw directly a rectangle into a
> pcl::visualization::PCLVisualizer.
>
> Is there an easy way to draw a rectangle? It would be nice to color it with
> RGBA, but this is just nice to have.
>
> And is there an easy way to give a line not just rgb but also an alpha
> channel?
>
>
> regards,
> Tankard
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Draw-Rectangle-in-PCLVisalizer-tp4028107.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: Draw Rectangle in PCLVisalizer

Radu B. Rusu
Administrator
Tankard,

I'm pretty sure that you can press "s" in the viewer, after you added a polygon, to switch to surface mode, and hence
see it filed.

Cheers,
Radu.
--
http://openperception.org

On 06/14/2013 04:26 AM, Tankard wrote:

> Now I tried addPolygon and addCube. Both don't do what I need.
>
> addPolygon:
> I don't understand why you can give model coefficients to the polygon when
> you also need contours.
> There is a bug in the visualisation. I draw a rectangle (Edges are 1/1,
> 1/-1, -1/1, -1/-1, z-position is 1) and look from it along the positive
> z-axis, then one line is missing. When I rotate and look along the z-axis in
> negative direction, the rectangle is displayed correct.
>
>
> Both methods (polygon or cube with z_min == z_max) only draw the contours.
> Is it possible to draw a filled polygon?
>
>
> regards,
> Tankard
>
>
> Radu B. Rusu wrote
>> Did you look here:
>> http://docs.pointclouds.org/trunk/classpcl_1_1visualization_1_1_p_c_l_visualizer.html
>>
>> There are methods for drawing polygons, cubes, etc.
>>
>> Cheers,
>> Radu.
>> --
>> http://openperception.org
>>
>> On 06/05/2013 06:41 AM, Tankard wrote:
>>> Hi,
>>>
>>> I have a plane (estimated with pcl::SACSegmentation
>> <pcl::PointXYZ>
>> ) and I
>>> want to draw a part of this plane. I have the upper left und the lower
>>> right
>>> point for the rectangle.
>>>
>>> I found no function to draw directly a rectangle into a
>>> pcl::visualization::PCLVisualizer.
>>>
>>> Is there an easy way to draw a rectangle? It would be nice to color it
>>> with
>>> RGBA, but this is just nice to have.
>>>
>>> And is there an easy way to give a line not just rgb but also an alpha
>>> channel?
>>>
>>>
>>> regards,
>>> Tankard
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.pcl-users.org/Draw-Rectangle-in-PCLVisalizer-tp4028107.html
>>> Sent from the Point Cloud Library (PCL) Users mailing list mailing list
>>> archive at Nabble.com.
>>> _______________________________________________
>>>
>
>> PCL-users@
>
>>   / http://pointclouds.org
>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>
>> _______________________________________________
>
>> PCL-users@
>
>>   / http://pointclouds.org
>> http://pointclouds.org/mailman/listinfo/pcl-users
>
>
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Draw-Rectangle-in-PCLVisalizer-tp4028107p4028267.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: Draw Rectangle in PCLVisalizer

Tankard
I tried pressing "s" but nothing happend. I tried like every letter but still no filled polygon.

Earlier I mentioned a bug in the visualisation, where the contour of the polygon is only displayed correctly when looking from the back. Therefore I made 2 Screenshots of this.