Mesh normals after Poisson reconstruction

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

Mesh normals after Poisson reconstruction

gishten
Hello PCL users!

I'm involved in a project where we've successfully reconstructed a pointcloud using Poisson reconstruction. However, I realized that the normals of the mesh were not included in the final result, as discussed in this mail http://www.pcl-users.org/pcl-Poisson-and-colored-meshes-td3889663.html

The responder suggests re-doing the normal estimation step, but I have not been able to do find a way to do that with a mesh. I've checked the API,this mailing list, and I've tried to do it myself, but no dice. Can anyone please suggest where I should look?

//Jonathan
Reply | Threaded
Open this post in threaded view
|

Re: Mesh normals after Poisson reconstruction

aichim
Administrator
Hi,

The PolygonMesh structure contains a PointCloud2 (mesh.cloud), which you can convert to a PointCloud<PointXYZ> with fromROSMsg(...) and feed into NormalEstimation or just use it directly.

Cheers,
Alex

On Mar 5, 2013, at 10:16 AM, gishten <[hidden email]> wrote:

> Hello PCL users!
>
> I'm involved in a project where we've successfully reconstructed a
> pointcloud using Poisson reconstruction. However, I realized that the
> normals of the mesh were not included in the final result, as discussed in
> this mail
> http://www.pcl-users.org/pcl-Poisson-and-colored-meshes-td3889663.html
>
> The responder suggests re-doing the normal estimation step, but I have not
> been able to do find a way to do that with a mesh. I've checked the API,this
> mailing list, and I've tried to do it myself, but no dice. Can anyone please
> suggest where I should look?
>
> //Jonathan
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Mesh-normals-after-Poisson-reconstruction-tp4026573.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: Mesh normals after Poisson reconstruction

Thomas Whelan
In reply to this post by gishten
You can get the points out of the mesh like so;

    pcl::PointCloud<pcl::PointXYZRGB> points;
    pcl::fromROSMsg(mesh->cloud, points);

Then compute the normals, if you want to put them back;

    pcl::toROSMsg(pointsNormals, mesh->cloud);

Tom

On Tue, Mar 5, 2013 at 6:16 PM, gishten <[hidden email]> wrote:
Hello PCL users!

I'm involved in a project where we've successfully reconstructed a
pointcloud using Poisson reconstruction. However, I realized that the
normals of the mesh were not included in the final result, as discussed in
this mail
http://www.pcl-users.org/pcl-Poisson-and-colored-meshes-td3889663.html

The responder suggests re-doing the normal estimation step, but I have not
been able to do find a way to do that with a mesh. I've checked the API,this
mailing list, and I've tried to do it myself, but no dice. Can anyone please
suggest where I should look?

//Jonathan



--
View this message in context: http://www.pcl-users.org/Mesh-normals-after-Poisson-reconstruction-tp4026573.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: Mesh normals after Poisson reconstruction

gishten
Thanks Tom, I was unaware of the from/toROSMsg convention.

After I've done:

        pcl::concatenateFields(points, *normals, *cloud_with_normals);
        pcl::toROSMsg(*cloud_with_normals,mesh->cloud);
        pcl::io::saveOBJFile("mesh.obj", mesh);

I've checked and yes, the normals are generated and concatenated, making their way to mesh->cloud. However, I still end up with an obj-file with only vertices and faces, shouldn't I be able to save the normals as well? Or do I need to write my own save function to do that?

//Jonathan