Finding x,y coordinates of pixel by RGB color value
Afficher commentaires plus anciens
Hi, Is there a reverse impixel function? I want to find the x and y coordinates of pixels in a color image by searching for them only with a RGB color value. I have tried converting into a binary image and searching for the '1' values by using
BW = im2bw(RGB, level)
and then [rows,cols] = find(BW==1);
but I am confused on how to set a level to implement an RGB value so that only my specific color pixels will show up as white in the binary image.
Is there a better way to find the coordinates of pixels only by using RGB value?
thanks!
Réponse acceptée
Plus de réponses (1)
Franklin Prashanth C
le 22 Jan 2018
Modifié(e) : Image Analyst
le 23 Jan 2018
How can I get these xy coordinate values, so that I can use it.?
[rows, cols] = find(BW==1); or
[rows, columns] = find(mask);
1 commentaire
Image Analyst
le 23 Jan 2018
It just depends on whether you want the columns called "col" or "columns" and whether your binary image is called BW or mask. The ==1 is not necessary and can get deleted.
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!