How can i get RGB value if i have position(x,y)
Mostrar comentarios más antiguos
if i have position of image(pixel) . How can i get RGB value of this position?
Respuesta aceptada
Más respuestas (2)
Andrew Fowler
el 21 de En. de 2012
Since RGB images are really 3D matrices, you can use the squeeze command :
pixelRGB = squeeze(yourImage(x,y,:));
Sukuchha
el 22 de En. de 2012
use function impixel if you have image processing toolbox
P = impixel(RGB,c,r)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!