Why is there no effect of flipping the normals using poisson in pc2surfacemesh?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Shishir Reddy
el 19 de Jul. de 2024
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.
Ver también
Categorías
Más información sobre Preprocessing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!