How to find a specific row and column RGB matrix
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Arpit Bhatt
il 15 Apr 2021
Modificato: Arpit Bhatt
il 29 Apr 2021
Hello. I want to select a RGB matrix from one image (For example as rows-200 to 220 and coloumn 230to246 matrix) and want to find pixel location of same matrix in another image. For that I wrote below program.Here I1 is first image,I2 is second image and Irefmat is specific matrix from image I1 which I want to find in I2.
Irefmat=I1(100:120,100:120);
red=I2(:,:,1);
green=I2(:,:,2);
blue=I2(:,:,3);
mask=red == Irefmat
green == Irefmat
blue == Irefmat ;
[rows,columns]=find(mask);
subplot(2,2,1);
imshow(mask);
But error is coming. Looking forward for some help!!!
3 Commenti
Constantino Carlos Reyes-Aldasoro
il 15 Apr 2021
IT would be easier to help if you illustrate your problem with actual images.
Risposta accettata
Image Analyst
il 16 Apr 2021
I do exactly that in my demo of normxcorr2(). I extract out a rectangular ROI (white onion) from an image (that contains the onion) and then find it in the image. I use the same image, but you could just as well find it in a different image.
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!