简体   繁体   中英

Output of delaunay triangulation from lidar data

I have to generate the mesh of the 3D-point cloud. So I used the delaunay function to perform the triangulation of points. The lidar data is a result of a human head scanning.

dt = delaunay(X,Y); 
trisurf(dt,X,Y,Z);

When I used delaunay with two inputs it gives me output but not perfect. So I used three inputs ( X,Y,Z )

dt = delaunay(X,Y,Z); 
trisurf(dt,X,Y,Z);

But now the result comes out worse. I don't know what the problem is?


This is the full code that I have written:

load Head_cloud_point.txt; 
data = Head_cloud_point; 

for i = 1 : 3 
    X = data(:, 1); 
end 

for i = 1 : 3 
    Y = data(:, 2); 
end 

for i = 1 : 3 
    Z = data(:, 3); 
end 

[m n] = size(X); 
[o p] = size(Y); 
[r s] = size(Z); 
[XI,YI]= meshgrid(X(m,n),Y(o,p)); 
ZI = interp2(X,Y,Z,XI,YI); 
% dt = delaunay(X,Y); 
% trisurf(dt,X,Y,ZI); 

Head_cloud_point is the file with X,Y,Z coordinates. I have to generate the mesh using these coordinates.

Well, Delaunay is not going to do the trick directly here, neither the 2D nor the 3D version. The main reason is the way Delaunay is working. You can get some of the way, but the result is in general not going to be perfect.

You have not specified whether the poing cloud is the surface of the head, or the entire inner of the head (though another answer indicates the former).

First remember that Delaunay is going to triangulate the convex hull of the data, filling out any concavities, eg a C-like shape will have the inner part of the C triangulated (Ending like a mirrored D triangulation).

Assuming the point cloud is the surface of the head.

When using 2D Delaunay on all (X,Y), it can not distinguish between coordinates at the top of the head and at the bottom/neck, so it will mix those when generating the triangulation. Basically you can not have two layers of skin for the same (X,Y) coordinate.

One way to circumvent this is to split the data in a top and bottom part, probably around the height of the tip of the nose, triangulate them individually and merge the result. That could give something fairly nice to look at, though there are other places where there are similar issues, for example around the lips and ears. You may also have to connect the two triangulations, which is somewhat difficult to do.

Another alternative could be to transform the (X,Y,Z) to spherical coordinates (radius, theta, gamma) with origin in the center of the head and then using 2D Delaunay on (theta,gamma). That may not work well around the ear, where there can be several layers of skin at the same (theta,gamma) direction, where again Delaunay will mix those. Also, at the back of the head (at the coordinate discontinuity) some connections will be missing. But at the rest of the head, results are probably nice. The Delaunay triangulation in (theta, gamma) is not going to be a Delaunay triangulation in (X,Y,Z) (the circumcircle associated with each triangle may contain other point in its interior), but for visualization purposes, it is fine.

When using the 3D Delaunay using (X,Y,Z), then all concavities are filled out, especially around the tip of the nose and the eyes. In this case you will need to remove all elements/rows in the triangulation matrix that represents something "outside" the head. That seems difficult to do with the data at hand.

For the perfect result, you need another tool. Try search for something like:

meshing of surface point cloud

Since you have a cloud of raw data representing a 3D surface, you need to do a 3D surface interpolation to remove the noise. This will determine a function z=f(x,y) that best fits your data. To do that, you can use griddata, triscatteredinterp (deprecated) or interp2. Note: From the context of your question, I assumed you use MATLAB. [EDIT] As you indicated that your data represents a head, the surface of a head which is a spheroid, it is not a function of the form z=f(x,y). See this post concerning possible solutions to visualizing spherical surfaces http://www.mathworks.com/matlabcentral/newsreader/view_thread/2287 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM