GUI red, blue, and green channels

1 回表示 (過去 30 日間)
Caitlin Schmidt
Caitlin Schmidt 2019 年 7 月 21 日
回答済み: Walter Roberson 2019 年 7 月 21 日
I'm working on a problem involving opening an image in a GUI and show it in an axes. I also need to show 3 images for the red, green, and blue channels in three separate axes in the same GUI. I'm having troubling with creating the three other images. Any ideas?

採用された回答

Walter Roberson
Walter Roberson 2019 年 7 月 21 日
[filename, filepath] = uigetfile();
if ~ischar(filename); return; end %user cancel
fullname = fullfile(filepath, filename);
img = imread(fullname);
R = zeros(size(img), class(img));
G = R;
B = R;
R(:,:,1) = img(:,:,1);
G(:,:,2) = img(:,:,2);
B(:,:,3) = img(:,:,3);
imshow(handles.axes_for_RGB, img);
imshow(handles.axes_for_R, R);
imshow(handles.axes_for_G, G);
imshow(handles.axes_for_B, B);

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by