How to get the matching pixel co-ordination(x,y) of two matrices ?

조회 수: 1 (최근 30일)
Piyum Rangana
Piyum Rangana 2017년 5월 26일
답변: KSSV 2017년 5월 27일
Here I mentioned the two matrices which include x and y co-ordinations of pixels of two different regions of an image. I want to get the matching pixel co-ordinations(x and y) of these two matrices( A and B). How can I do this ... please help me ..(please note that first column of the matrices is X co-ordination and the second column is y co-ordination)
A =
96 97
96 98
96 99
96 100
96 101
95 102
95 103
94 104
94 105
93 106
93 107
B =
174 270
173 271
172 272
171 273
95 102
169 275
169 276
93 107
  댓글 수: 2
Image Analyst
Image Analyst 2017년 5월 26일
Please define "matching pixel co-ordinations". I see that some rows of the arrays are common to both and some are not. Are you just wondering if there is a function like ismember()? Or do you want something else?
Piyum Rangana
Piyum Rangana 2017년 5월 27일
편집: Piyum Rangana 2017년 5월 27일
I this case the no of rows of the two matrices are not same. That's the case. I use ismember function as below.
id = find(ismember(A',B','rows'))
But MATLAb says
"Inputs A and B must be matrices with the same number of columns in the 'rows' case."
How can I apply it in to matrices which have different no of rows ?
(note : I meant common pixel co-ordinations for both matrices as _ matching pixel co-ordinations ' in the previously)

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

답변 (1개)

KSSV
KSSV 2017년 5월 27일
Use
id = find(ismember(A,B,'rows'))
instead of
id = find(ismember(A',B','rows'))

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by