Professional Documents
Culture Documents
Experiment 7
Experiment 7
Objective: In this experiment, student should be able to understand how to perform bit plane slicing on an
image and display the image by considering each individual bit each grey level at a time.
PEO to be achieved:
Pre Lab/ Prior Concepts: Basic MATLAB knowledge of the standard formula to perform Bit Plane
Slicing.
______________________________________________________________________________________
Historical Profile:
Separating a digital image into its bit planes is useful for analyzing the relative importance played by each
bit of the image, implying, it determines the adequacy of numbers of bits used to quantize each pixel, useful
for image compression.
New Concepts to be learned: How to set the pixel values based on the values of their individual binary
bits.
Flow Chart:
Start
Stop
Stepwise Procedure:
1. Open Matlab software
2. Goto New Script
3. Write the program code given below.
4. Save the code with an “.m” extension.
5. Run the code to get the output.
Program Code:
A=imread('cameraman.tif');
B=bitget(A,1);
subplot(2,4,1);imshow(logical(B));title('Bit plane 1');
B=bitget(A,2);
subplot(2,4,2);imshow(logical(B));title('Bit plane 2');
B=bitget(A,3);
subplot(2,4,3);imshow(logical(B));title('Bit plane 3');
B=bitget(A,4);
subplot(2,4,4);imshow(logical(B));title('Bit plane 4');
Experiment 7 10-244
B=bitget(A,5);
subplot(2,4,5);imshow(logical(B));title('Bit plane 5');
B=bitget(A,6);
subplot(2,4,6);imshow(logical(B));title('Bit plane 6');
B=bitget(A,7);
subplot(2,4,7);imshow(logical(B));title('Bit plane 7');
B=bitget(A,8);
subplot(2,4,8);imshow(logical(B));title('Bit plane 8');
Output:
Conclusion: Hence we can perform image compression by eliminating the LSB bit planes or some of the
lower bit planes.
2. What is the total number of bits present if the highest grey level in an image is 250
250>127 and 250<=255. Therefore 2^n=255. Therefore n=8 bits.
Experiment 7 10-244
3. What is the application of bit plane slicing in Image Watermarking?
More than one LSB bit of the original image is replaced by MSB bits of the watermarked
image.
_________________________________________________________________________
_______