Binary Mask and gray scale image
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a binary mask and i want to extract the value of a grayscale image in a other variable. How can i do this ?
(if the pixel (159,300) in the mask = 1, and the pixel(159,300)in the grayscale image = 67, return 67 in the variable).
Thanks for your help.
Stéphan
0 comentarios
Respuestas (1)
Sugar Daddy
el 15 de Jul. de 2020
I = imread('circle.jpg');
I = rgb2gray(I);
M = I<125;
figure,subplot(121),imshow(I)
subplot(122),imshow(M)
To access Image index where mask value is 1, simply apply Logical Indexing
L = I(M);
figure,plot(L)
1 comentario
abrassart stephan
el 15 de Jul. de 2020
Editada: Walter Roberson
el 16 de Jul. de 2020
Ver también
Categorías
Más información sobre Author Block Masks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!