Neigborhood
Show older comments
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 Comments
Jan
on 17 Aug 2011
If P=[p1, ...,pn] how can pi=[pix,piy,piz]? Is P a cell array?
How do you define a normal vector from a set of points? Imagine the points are equally distributed on a sphere or on a line - what is a normal vector?!
How do you define "neighborhood" exactly?
Jan
on 17 Aug 2011
@developer: I do have access to research papers, but it is your turn to read them and compile the contents such, that an answer to your question is possible.
While your P=[p1,...pn] notation is meaningful as a written formula, it is meaningless in MATLAB. Please choose a valid MATLAB format for the inputs, otherwise any suggestion could be more confusing than helpful.
Do you want to ask, how to find the 5 nearest points from a set of points?
developer
on 17 Aug 2011
Jan
on 17 Aug 2011
And the format your points are stored in is... ?
Answers (1)
Jan
on 17 Aug 2011
0 votes
4 Comments
developer
on 17 Aug 2011
Jan
on 17 Aug 2011
Which function are you talking of?
As far as I understand, the query points equal your data points.
developer
on 17 Aug 2011
Jan
on 18 Aug 2011
@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.
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!