필터 지우기
필터 지우기

Neigborhood

조회 수: 1 (최근 30일)
developer
developer 2011년 8월 17일
Hello, I have set of n 3d Points P=[p1,...,pn]
where,
pi=[pix,piy,piz] represent the 3D coordinates of a point , i want to estimate a normal vector ni=[nix,niy,niz] from a set of points in neighborhood Qi=[qi1,qi2,...,qik]
I want to know how can find Q matrix for any point giving some value of k ,like f k=5
  댓글 수: 4
developer
developer 2011년 8월 17일
Yes i want to fine 5 nearest points from a set of points
Jan
Jan 2011년 8월 17일
And the format your points are stored in is... ?

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

답변 (1개)

Jan
Jan 2011년 8월 17일
You can find lot of solutions in the FEX: FEX: Search for nearest neighbor
Perhaps this is fine: FEX: 15562.
If you have the statistics toolbox, look at knnsearch.
  댓글 수: 4
developer
developer 2011년 8월 17일
i am talking about the function that is used in this example
Example:
a = [1 1; 2 2; 3 2; 4 4; 5 6];
b = [1 1; 2 1; 6 2];
[neighbors distances] = kNearestNeighbors(a,b,2);
Output:
neighbors =
1 2
1 2
4 3
distances =
0 1.4142
1.0000 1.0000
2.8284 3.0000
in kNearestNeighbors function 'a' is mention as datamatrix and 'b'
as querymatrix, what i get data matrix will be my 3D data points , but i dont know from where and how can i take query matrix 'b'
Jan
Jan 2011년 8월 18일
@developer: It would be helpful, if you mention where this function is coming from. Although I do not have the chance to look in its documentation (did you do this already?), I guess that this function uses the same input as all other KNN function from the FEX: "a" is the set of points you are searching in, "b" is the set of points you want to find the nearest neighbors of. E.g. imagine any normally distributed random points and you want to find the 10 points nearest to the origin: kNearestNeighbors(randn(1000, 3), [0,0,0], 10) - or perhaps with transposed inputs.
I assume, that for your case "b" equals "a". There might be a method to tell the function that both sets are equal.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by