-
Notifications
You must be signed in to change notification settings - Fork 1
/
gs.m
41 lines (41 loc) · 823 Bytes
/
gs.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
38
39
40
41
img = imread('neggg.jpg');
i7 = img;
i6 = img;
i5 = img;
i4 = img;
i3 = img;
i2 = img;
i1 = img;
i0 = img;
i7 = double(bitand(img,128));
i6 = double(bitand(img,64));
i5 = double(bitand(img,32));
i4 = double(bitand(img,16));
i3 = double(bitand(img,8));
i2 = double(bitand(img,4));
i1 = double(bitand(img,2));
i0 = double(bitand(img,1));
subplot(2,2,1);
imshow(i7);
title('Bit plane 7');
subplot(2,2,2);
imshow(i6);
title('Bit plane 6');
subplot(2,2,3);
imshow(i5);
title('Bit plane 5');
subplot(2,2,4);
imshow(i4);
title('Bit plane 4');
subplot(2,2,1);
imshow(i3);
title('Bit plane 3');
subplot(2,2,2);
imshow(i2);
title('Bit plane 2');
subplot(2,2,3);
imshow(i1);
title('Bit plane 1');
subplot(2,2,4);
imshow(i0);
title('Bit plane 0');