Why is there no effect of flipping the normals using poisson in pc2surfacemesh?
7 次查看(过去 30 天)
显示 更早的评论
I am using following code to reconstruct a surface with poisson using pc2surfacemesh. I have reconstructed the surface twice, once with normal looking into the inside of the model. The second time mirrored so pointing outwards. There was no difference between the two mesh. I don't know where to look at the code to determine the reconstruction. My question is does the function correct the normal when calculating.
ptcloud = pcread('Auto_Filter_35.ply');
pcshow(ptcloud)
% flip normals
ptcloud.Normal = -ptcloud.Normal;
% Subsampling of ptCloud because of runtime
gridstep = 0.007;
ptCloudDownSampled = pcdownsample(ptcloud,"gridAverage",gridstep);
%% Construct surface mesh from the point cloud data using the Poisson method, and display the surface mesh.
tic
depth = 12;
mesh = pc2surfacemesh(ptCloudDownSampled,"poisson",depth);
surfaceMeshShow(mesh)
toc
writeSurfaceMesh(mesh,"AutoMesh35_flipedNormal.ply")
0 个评论
回答(1 个)
Shishir Reddy
2024-7-19
Hi Lars
I see that you are trying to flip the normal using the statement ptcloud.Normal = -ptcloud.Normal but you are noticing that there was no difference observed between the two mesh .
This is because MATLAB's ‘pcread’ function does not automatically compute normals when loading a point cloud from a file. So, before manipulating or visualising, normals must be computed manually.
This can be done by using the ‘pcnormals’ function.
ptcloud = pcread('Auto_Filter_35.ply');
ptcloud.Normal = pcnormals(ptCloud);
Now, as the normals are computed, you can flip them and proceed with the surface reconstruction.
For more understanding, kindly refer to the example which is explained in the following documentation :
I hope this helps.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Preprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!