How to find pixels's neighbours?

I have two vectors of pixels with their position x and y length of vectors is not the same and their length is 520 There is an exemple: A = 20 40 60 120 30 50 100 140 B = 40 20 50 30 the result : pixels (20,30) and (40,50) are the same in two vectors so i have D = 40 20 as a result 50 30

4 Kommentare

Consider using punctuation in your question. I can't make sense of it.
Also, mark your code with the Code-button. I.e
A = [20 40 60 120 30 50 100 140]
B = [40 20 50 30]
Mohamed Amine
Mohamed Amine am 12 Jul. 2012
A = (20,30) (40,50) (60,100) (120,140) B =(20,30) (40,50) result D = (20,30) (40,50)
Ryan
Ryan am 12 Jul. 2012
To clarify, are you trying to locate points in B that are also in A?
Jan
Jan am 12 Jul. 2012
@Mohamed: Do you see the difference in the readability of Sebastian's example code and your one? It would be very helpful, when you edit the original question and insert full stops at the end of each sentence. To learn more about code formatting and asking good questions, follow the "About MATLAB Answers" link on the left side.

Antworten (1)

Sean de Wolski
Sean de Wolski am 12 Jul. 2012

2 Stimmen

doc intersect
And specifically:
intersect(A,B);
or ismember
C = A(ismember(A,B))

2 Kommentare

Image Analyst
Image Analyst am 12 Jul. 2012
Seems like it, based on his comment. But why are these "neighbors" of some pixels? Does this do what his subject line asks?
Sean de Wolski
Sean de Wolski am 12 Jul. 2012
They were selected based on their responses to a survey?

Diese Frage ist geschlossen.

Tags

Gefragt:

am 12 Jul. 2012

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by