-
Notifications
You must be signed in to change notification settings - Fork 1
/
cl3.m
37 lines (35 loc) · 848 Bytes
/
cl3.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% Read in original RGB image.
rgbImage = imread('c2_rgb.jpg');
% Extract color channels.
redChannel = rgbImage(:,:,1); % Red channel
greenChannel = rgbImage(:,:,2); % Green channel
blueChannel = rgbImage(:,:,3); % Blue channel
% Display them all.
subplot(3, 3, 2);
imshow(rgbImage);
fontSize = 20;
title('Original RGB Image')
subplot(3, 3, 4);
imshow(redChannel);
title('Red Channel')
subplot(3, 3, 5);
imshow(greenChannel);
title('Green Channel')
subplot(3, 3, 6);
imshow(blueChannel);
title('Blue Channel')
subplot(3,3,1);
imshow(rgb2hsv(rgbImage));
title('HSV Mapping')
subplot(3,3,3);
imshow(rgb2gray(rgbImage));
title('Gray Mapping')
subplot(3, 3, 7);
imshow(255 - redChannel);
title('Cyan Channel')
subplot(3, 3, 8);
imshow(255 - greenChannel);
title('Magenta Channel')
subplot(3, 3, 9);
imshow(255 - blueChannel);
title('Yellow Channel')