pointcloud visible region detection

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

pointcloud visible region detection

shome
I have a pointcloud which is nearly cylindrical. I need to find out which
points are visible from a sensor located at origin(0,0,0). Can I use ray
tracing for this purpose?



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

Re: pointcloud visible region detection

Sérgio Agostinho

No. The probability of your rays hitting your 3D points is zero. Raytracing works for meshes, not pointclouds.

 

Cheers

 

From: [hidden email]
Sent: Friday, October 27, 2017 6:28 PM
To: [hidden email]
Subject: [PCL-users] pointcloud visible region detection

 

I have a pointcloud which is nearly cylindrical. I need to find out which

points are visible from a sensor located at origin(0,0,0). Can I use ray

tracing for this purpose?

 

 

 

--

Sent from: http://www.pcl-users.org/

_______________________________________________

[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: pointcloud visible region detection

shome
I actually have a mesh(ply format). Now what are my options? Can I use
VoxelGridOcclusionEstimation? How do I set the camera location. The
VoxelGridOcclusionEstimation has sensor_orientation and sensor_origin. But
How do I set them as they are private.



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

Re: pointcloud visible region detection

denix56
Maybe you should try to use vtkSelectVisiblePoints it vtkHardwareSelector?

28 окт. 2017 г. 7:11 пользователь "shome" <[hidden email]> написал:
I actually have a mesh(ply format). Now what are my options? Can I use
VoxelGridOcclusionEstimation? How do I set the camera location. The
VoxelGridOcclusionEstimation has sensor_orientation and sensor_origin. But
How do I set them as they are private.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[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: pointcloud visible region detection

shome
This post was updated on .
is it from vtk.org  https://www.vtk.org <https://www.vtk.org

I saw the api, i couldnt find any way to set the camera location and camera orientation.
can you kindly provide any sample code?



--
Sent from: http://www.pcl-users.org/
_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: pointcloud visible region detection

denix56
yes

29 окт. 2017 г. 13:49 пользователь "shome" <[hidden email]> написал:
is it from vtk.org  https://www.vtk.org <https://www.vtk.org>



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[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: pointcloud visible region detection

shome
This post was updated on .
I tried to get the visible region in a sphere whose center satisfies one of
the following:
a. center is along x
b. center is along y
c. center is along z
d. center is along x z plane
e. center is along y z plane
f. center is along x y plane
The sesnor is at the origin with zero rotationn.

I tried to  use the voxelgridOcclusionEstimation class to determine the
visible region in the cloud as seen by the sensor

voxelgridOcclusionEstimation yeilds wierd results. I all cases it seemed
that the sphere contents in the first octant were processed properly.
spheres in other octants were fully occluded.



My code is:

    Eigen::Quaternionf quat(1,0,0,0);
    cloud_in->sensor_origin_  = Eigen::Vector4f(0,0,0,0);

    cloud_in->sensor_orientation_= quat;
    pcl::VoxelGridOcclusionEstimation<pcl::PointXYZ> voxelFilter;
    voxelFilter.setInputCloud (cloud_in);

    float leaf_size=atof(argv[2]);
    voxelFilter.setLeafSize (leaf_size, leaf_size, leaf_size);
    voxelFilter.initializeVoxelGrid();

    std::vector<Eigen::Vector3i,
Eigen::aligned_allocator&lt;Eigen::Vector3i> > occluded_voxels;

    for (size_t i=0;i<cloud_in->size();i++)
    {

        PointT pt=cloud_in->points[i];

        Eigen::Vector3i grid_cordinates=voxelFilter.getGridCoordinates (pt.x, pt.y,
pt.z);

        int grid_state;

        int ret=voxelFilter.occlusionEstimation( grid_state, grid_cordinates );

        if (grid_state==1)
        {
            cloud_occluded->push_back(cloud_in->points[i]);
        }
        else
        {
        cloud_visible->push_back(cloud_in->points[i]);
        }

    }



--
Sent from: http://www.pcl-users.org/
_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users