How to test if points are inside a point cloud model

I have a point cloud of a tree trunk, imported as a ply file. It is a point cloud so the tree trunk is not a surface, but points with gaps in between.
I also have the 3D coordinates of a bunch of points. How do I remove those points that are not inside the tree trunk? The model is not parallel with the axes by the way.
Here's a dropbox link for the ply file. Coordinates and values of the points are in the attached all_control_points.mat file. There's no code yet except the ones to generate this data.
https://www.dropbox.com/s/vf5id1hv0anruzx/Trunk%20Only.ply?dl=0

2 comentarios

darova
darova el 1 de Ag. de 2019
Can you post your code and data please?
Sorry for not including this. I have updated the question with the data. The ply file of the point cloud is too big so I'm sharing a dropbox link for it. There's no code yet except the ones used to generate the data.

Iniciar sesión para comentar.

 Respuesta aceptada

darova
darova el 1 de Ag. de 2019
Hi. I wrote a script and somehow it works 0_0. See attached script
This is what i ahieved
img0.png img1.png img2.png
Maybe someone can please explain why (and how) it works
% xc,yc,zc - control points (red on the image)
% xt,yt,zt - tree point (blue on the image)
ri = sqrt(xt(it).^2 + yt(it).^2); % radius of tree points
ri1 = griddata(xt(it), yt(it), zt(it), ri, ...
xc,yc,zc);
griddata() generates radius for points inside only (NaN for other)

2 comentarios

Thank you so much, it works! I don't know why the griddata works either though.
Also, how did you determine that the model should be rotated by 75 degrees?
darova
darova el 2 de Ag. de 2019
It's approximately. Just wanted the tree axis to be parallel to Z

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2019a

Preguntada:

el 1 de Ag. de 2019

Comentada:

el 2 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by