-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitSlicing.m
39 lines (37 loc) · 1.02 KB
/
bitSlicing.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
originalImage=imread('C:/Users/Admin/Downloads/lena512.mat');
Bitplane=bitget(originalImage,1);
figure;
subplot(4,2,1);
imshow(logical(Bitplane));
title('Bit plane 1');
Bitplane=bitget(originalImage,2);
subplot(4,2,2);
imshow(logical(Bitplane));
title('Bit plane 2');
Bitplane=bitget(originalImage,3);
subplot(4,2,3);
imshow(logical(Bitplane));
title('Bit plane 3');
Bitplane=bitget(originalImage,4);
subplot(4,2,4);
imshow(logical(Bitplane));
title('Bit plane 4');
Bitplane=bitget(originalImage,5);
subplot(4,2,5);
imshow(logical(Bitplane));
title('Bit plane 5');
Bitplane=bitget(originalImage,6);
subplot(4,2,6);
imshow(logical(Bitplane));
title('Bit plane 6');
Bitplane=bitget(originalImage,7);
subplot(4,2,7);
imshow(logical(Bitplane));
title('Bit plane 7');
Bitplane=bitget(originalImage,8);
subplot(4,2,8);
imshow(logical(Bitplane));title('Bit plane 8');
figure;
Bitplane=bitget(originalImage,8)*(2^8)+bitget(originalImage,7)*(2^7);
imshow(logical(Bitplane));
title('Bit plane 8 and 7');