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!