Use addCube() to draw a bounding box

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

Use addCube() to draw a bounding box

ZOUZOU
Hi,

I want to draw a bounding box, then I found the code of drawTBoundingBox class(pcl::people::PersonCluster), and the tutorial Moment of inertia and eccentricity based descriptors,  they both use addCube(), the reslut is like below:

But when I run the code, the cube is solid, so I can't see point cloud anymore... as the image below:


What I want is the bounding box like the tutorial, but I don't know how to do to solve this problem.
I really appreciate any help.
Thanks~
New for computer vision
Reply | Threaded
Open this post in threaded view
|

Re: Use addCube() to draw a bounding box

noname
Hi,

maybe the code is outdated and/or some pre-/post-setup code is elsewhere?
Looking at the PCL sources in
http://docs.ros.org/hydro/api/pcl/html/pcl__visualizer_8cpp_source.html#l02128,
there is "actor->GetProperty ()->SetRepresentationToWireframe ();", have
you checked that it is still in the implementation of your PCL version?
Or simply tried reproducing (i.e. copy-pasting) that code yourself?
Seems Wireframe representation doesn't work in your case?

Or maybe you could try adding something along the lines of
"viewer.setShapeRenderingProperties(PCL_VISUALIZER_OPACITY, ...)"? Seems
more like a hack though ...

kind regards

On 03.08.2016 16:29, ZOUZOU wrote:

> Hi,
>
> I want to draw a bounding box, then I found the code of *drawTBoundingBox*
> class(pcl::people::PersonCluster), and the tutorial /Moment of inertia and
> eccentricity based descriptors/,  they both use addCube(), the reslut is
> like below:
> <http://www.pcl-users.org/file/n4042466/moment_of_inertia.png>
> But when I run the code, the cube is solid, so I can't see point cloud
> anymore... as the image below:
> <http://www.pcl-users.org/file/n4042466/screenshot-1470233552.png>
>
> What I want is the bounding box like the tutorial, but I don't know how to
> do to solve this problem.
> I really appreciate any help.
> Thanks~
>
>
>
> -----
> New for computer vision
> --
> View this message in context: http://www.pcl-users.org/Use-addCube-to-draw-a-bounding-box-tp4042466.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: Use addCube() to draw a bounding box

ZOUZOU
Hi,

Thank you for the help!! :)
I use the trunk version and there is no longer "actor->GetProperty ()->SetRepresentationToWireframe ();"  in addCube().
But according to solutions you gave, I found a function setRepresentationToWireframeForAllActors() in pcl::visualization::PCLVisualizer, and it works!!

Thanks again!!! (>v<)

New for computer vision
Reply | Threaded
Open this post in threaded view
|

Re: Use addCube() to draw a bounding box

Tomanlon
This post has NOT been accepted by the mailing list yet.
 hi i am facing the same problem,can you share you code for me .thank you in advance