how can combine two neighbour site(cell) in voronoi diagram? - merge

How can I combine two neighbour site(cell) in voronoi diagram?
I decide in my project combine two neighbour site(cell) in voronoi diagram, can any one help me?

The dual Delaunay triangulation can be represented by a much simpler data structure. You can mark those triangle edges which are dual to the Voronoi edge you need to remove as invalid.

Related

How can I visualise the 3D voronoi diagram in MATLAB?

I don't understand the documentation that describes the visualisation of voronoi regions in MATLAB.
the documentation says the following:
You can plot individual bounded cells of an N-D Voronoi diagram. To do this, use the convhulln function to compute the vertices of the facets that make up the Voronoi cell. Then, use patch or other plotting functions to generate the figure.
I have a set of 3D points (P) that I calculated voronoin for using [v,c]=voronoin(P)
What do I do next to visualise this ?
voronoin always generates a row of inf values in v. So how can I use v to generate/visualise the voronoi regions/diagram?
Thanks

How can I limit number of triangles in delaunay triangulation?

I want to generate a polyhedron which its vertices are specified. To this end, I use delaunayTriangulation command, but there is a problem and that is high number of triangular faces.So, is there any way to limitation of number of triangular faces? For example,I would like to generate a polyhedron by 8 triangular faces.
Thanks in advance.
My understanding of how a Delaunay triangle is created is that it is using the halfway point, on a lines to the nearest proximal neighbours, to nearest surrounding points to define the edge of the triangle surrounding a point. At its most basic to create 8 triangles you would need 8 points; you would have to accommodate the edge effects but you would have 8 facets or triangles. If you are specifying the vertices of the triangles instead of the central points you will probably get a lot more triangles that required and also may not be getting an appropriate depiction of the analysis you are looking for. Matlab has the capacity to control edge effects in a 2d depiction. HTH, Mark

How can I obtain Voronoi diagram on a Red Blood Cell using XYZ coordinate of points and face connectivity data from Delaunay triangulation?

UPDATE (1/12/14): Dear all, I have been trying all I can to code the algorithm by Dr Darren below in MATLAB but I am yet to succeed with it. I humbly request that a good Samaritan should kindly help me with the code and share the m-file. Thanks once again.
I intend to obtain Voronoi diagram on RBC using MATLAB/FORTRAN. I need the following specific information.
Voronoi vertex using the normal vector for each Delaunay triangle;
Order of each Voronoi polygon;
Voronoi vertex lists that define the Voronoi polygons;
Component of normals on the Voronoi polygons;
Areas of the Voronoi polygons;
Centroids of the Voronoi polygons;
Finally, plot Voronoi polygons using PATCH;
Please find link to corresponding text files RBC_1 which contain XYZ node coordinates on the RBC and RBC_2 which contain face connectivity data from Delaunay triangulation (RBC_1 and RBC_2 are in Zip file).
https://www.dropbox.com/s/slan053xbr2e864/RBC.zip?dl=0
I have tried to follow the work of John Burkardt for unit sphere: http://people.sc.fsu.edu/~jburkardt/m_src/sphere_voronoi/sphere_voronoi.html but its not working.
Thank you in advance.
N.B Any comment and advice will be highly appreciated.
Looking at your files, you have a set of points P in R^3 and a (2-manifold) surface triangulation T of your geometry:
This can easily be turned into a surface voronoi complex V by noting that the voronoi complex is dual to the underlying triangulation T. This means the following:
for each primary edge Ei in T there is a dual edge Vi in the voronoi complex.
for each primary node Pi in P there is a dual cell Vc in the voronoi complex.
Each dual edge in the voronoi complex spans between the centre of the circumballs of the triangles that are adjacent to the associated primary edge in the triangulation.
This duality implies the following algorithm for the construction of the voronoi complex:
calculate circumcentres CC for all triangles in T
for (all edges Ei in T)
find triangles [Ti,Tj] in T adjacent to edge Ei
push voronoi edge Vi between centres [CC(Ti),CC(Tj)]
associate edge Vi with voronoi cells associated with edge endpoints [Pi,Pj] in Ei
endfor
Putting this into practice gives the following voronoi complex for your mesh:
As others have pointed out, your question is very extensive, and I won't try to answer everything here.
I have made a set of dual mesh construction routines available here. Nonetheless, based on the slew of emails that you've bombarded me with over the weekend, let me make a few remarks: (i) you should invest some effort to understand a bit of computational geometry -- don't just blindly use the code provided, and (ii) if you do use the code provided, ensure that you make an effort to reference it appropriately.

How to draw 2nd order Voronoi diagram in Matlab?

The Matlab function voronoi(x,y) gives the first order Voronoi diagram for the set of points $(x,y)$ e.g.
Can we use this function to draw a higher order such as 2nd order Voronoi diagram? By the order of a Voronoi diagram means the number of closest points. For example the regular Voronoi diagram is called first order because the cells have a single point that is closest to any place in the cell. A second order Voronoi diagram will have cells which are identified by the two closest points.
This previous question Higher order voronoi diagram discuss a similar problem but not in Matlab.
IMO you can use the closest pair of the sites and a dendogram and the k-order voronoi is an overlay of x k-order voronoi but without the intersecting edges.

voronoi diagram matlab

I was wondering how I show/plot a voronoi diagram in the below FCM method? Also is there a method where you can watch the programme from the figure as it places and computes each point in matlab? Almost like a running trailer.
[centers, U, objFun] = fcm(data, 6);
plot(data(:,1), data(:,2),'o');
maxU = max(U);
index1 = find(U(1, :) == maxU);
index2 = find(U(2, :) == maxU);
line(data(index1,1),data(index1, 2),'linestyle','none',...
'marker','*','color','g');
line(data(index2,1),data(index2, 2),'linestyle','none',...
'marker', '*','color','r');
This should be the same for k-means and FCM, btw.
To get the Voronoi diagram, you need to compute the Delaunay triangulation, then place a side of the Voronoi diagram orthogonal on the mean of each Delaunay edge.
There are efficient algorithms for Delaunay in at least 2D and 3D. This is quite closely related to computing the convex hull. Plus, as you don't have many cluster centers, the scalability is not that hard.
However, you have one big problem: your data is 6 dimensional. This means that the sides of your Voronoi cells are in fact 5-dimensional, and they will not trivially map to a reasonable 2d projection.
Computing the Voronoi diagram in the 2D projection that you are using however will be inaccurate. You could try to compute the Voronoi cells in 6D, and map all the corners of the voronoi cells into 2D, then connect neighboring corners. But that may yield a big mess of lines, and is not particularly helpful IMHO.
Sorry, as far as I know, Voronoi cell visualization is mostly useful for understanding k-means in 2D and if you have a good 3D visualization engine in 3D.
Don't get me wrong: Voronoi cells is exactly what k-means cluster look like. They're not spheres or blobs or stars. They are Voronoi cells: the cell exactly is the area that would be assigned to a particular mean.
Have a look at this image from Wikipedia:
The black lines are the borders (which in a 2D data set are simple 1d lines) that separate the clusters. In the top center there is a blue object just right of the line. It is blue, because it is on the right of the line - it is in the Voronoi cell of the blue mean.
This is a key drawback of k-means: it does not have the notion of size as in spatial extend for a cluster. They only have a center, and the data is split on the orthogonal hyperplane inbetween of two neighboring centers. For this particular data set, k-means *does not have a chance to split the data correctly! It hasn't converged to a "bad" local minimum, but the correct solution cannot be found by k-means, because the clusters have different size (and there is not enough gap inbetween for k-means to be lucky). To properly cluster this data set, you actually need an EM-like notion of cluster size or a density based method. If k-means were able to detect that the green clusters is about twice as big as the blue ones, it would probably work much better (but then it almost were EM already anyway)