필터 지우기
필터 지우기

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
topolowa
topolowa 2016년 9월 9일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Voronoi Diagram에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by