Image reading and processing

조회 수: 10 (최근 30일)
Usha Silwal
Usha Silwal 2019년 9월 11일
답변: Sourav Bairagya 2019년 9월 16일
How do I generate just the red channel, from the colourful image that I have attached below?
  댓글 수: 3
Usha Silwal
Usha Silwal 2019년 9월 11일
try.jpg
This is the image I am working on and I just need to display the blue channel of the image.
Jon
Jon 2019년 9월 12일
How is the image encoded? Please provide the matrix you are plotting

댓글을 달려면 로그인하십시오.

채택된 답변

Sourav Bairagya
Sourav Bairagya 2019년 9월 16일
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개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by