Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
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 commentaires
Matt J
Matt J le 8 Sep 2016
Modifié(e) : Matt J le 9 Sep 2016
I think you mean,
[v,c] = voronoin(x);
topolowa
topolowa le 9 Sep 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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Voronoi Diagram dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by