Image reading and processing

1 回表示 (過去 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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by