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")

回答(1 个)

Shishir Reddy
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 CenterFile Exchange 中查找有关 Preprocessing 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by