Created
July 18, 2020 21:45
-
-
Save ehzawad/806dfba78465df2c5a92895cc03a5350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img = imread('amy_adams.jpg'); % Read image | |
red = img(:,:,1); % Red channel | |
green = img(:,:,2); % Green channel | |
blue = img(:,:,3); % Blue channel | |
a = zeros(size(img, 1), size(img, 2)); | |
just_red = cat(3, red, a, a); | |
just_green = cat(3, a, green, a); | |
just_blue = cat(3, a, a, blue); | |
disp(just_green); | |
% back_to_original_img = cat(3, red, green, blue); | |
% figure, imshow(img), title('Original image') | |
% figure, imshow(just_red), title('Red channel') | |
% figure, imshow(just_green), title('Green channel') | |
% figure, imshow(just_blue), title('Blue channel') | |
% figure, imshow(back_to_original_img), title('Back to original image') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment