voronoin - is there any conection between output vertices and cells c and v and input coordinate vector?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Voronoi Diagram 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!