Borrar filtros
Borrar filtros

voronoin - is there any conection between output vertices and cells c and v and input coordinate vector?

2 visualizaciones (últimos 30 días)
I am using comand [c,v] = voronoin(x); first I remove all the cells c, which have at least 1 element == 1:
ind = cellfun(@(xx)all(xx~=1),c);
Afterwards, using custom cellfun I am calculateing area of each voronoi cells Ap, and indices of each voronoi cell Vp:
[Vp,Ap] = cellfun(@ voronoinVert,c,v,'UniformOutput',false);
That works fast and perfect. Finally I want to know which of my input point x is contained in each of voronoi cell c with vertices Vp. I am runing inpolygon, which is very good function, but my x vector contains on average 5e5 points. I am filtering all the points x with coordinates outside the bounding box of given voronoi cell, but still it takes 10-20 min for iteration. So, to recapitulate, is there any connection bwtween ordering of input x points to the ordering of output c and v, so I could avoid inpolygon?
thank you very much for the help,
Ina
  2 comentarios
topolowa
topolowa el 9 de Sept. de 2016
yes, of course. I found the reason. I have few duplicated points in x. It was very unlikelly to have it, by the nature of experiment, but here it is. Thanks again for the disscussion Ina

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Voronoi Diagram en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by