Image reading and processing
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Usha Silwal
el 11 de Sept. de 2019
Respondida: Sourav Bairagya
el 16 de Sept. de 2019
How do I generate just the red channel, from the colourful image that I have attached below?
3 comentarios
Respuesta aceptada
Sourav Bairagya
el 16 de Sept. de 2019
After reading the image properly, you can separate the channels using this code segment.
a=imread('test.jpg');
a_red=a(:,:,1); %RED channel
a_green=a(:,:,2); %GREEN channel
a_blue=a(:,:,3); %BLUE channel
figure;imshow(a);title('Color Image');
figure;imshow(a_red);title('Red Channel');
figure;imshow(a_green);title('Green Channel');
figure;imshow(a_blue);title('Blue Channel');
Now, you can also save each channel as separate image using ‘imwrite’ function. Hope this will help.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox 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!