How to find a specific row and column RGB matrix
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Arpit Bhatt
le 15 Avr 2021
Modifié(e) : Arpit Bhatt
le 29 Avr 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 commentaires
Constantino Carlos Reyes-Aldasoro
le 15 Avr 2021
IT would be easier to help if you illustrate your problem with actual images.
Réponse acceptée
Image Analyst
le 16 Avr 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.
1 commentaire
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!