How to convert RGB image to grayscale image
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
aarti sawant
el 2 de Feb. de 2014
Comentada: DGM
el 30 de Nov. de 2021
Please help me to convert RGB image to grayscale without using rgb2gray().
0 comentarios
Respuesta aceptada
Image Analyst
el 2 de Feb. de 2014
Sounds like homework. You can get the color channels:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
and then do a weighted average of them.
grayImage = a1 * redChannel + a2 * greenChannel + a3 * blueChannel;
Look up standard weights, or pick your own.
3 comentarios
Image Analyst
el 30 de Nov. de 2021
@Soomin Lee try the Math section on these web sites:
Más respuestas (0)
Ver también
Categorías
Más información sobre Modify Image Colors en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!