Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Experiment 7 10-244

Title: To implement Bit Plane Slicing.

Estimated time to complete this experiment: 2 hours

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:

Expected Outcome of Experiment:


Obtaining different types of images by considering the MSB or LSB bit or any other bit of each pixel in an
image.

Books/ Journals/ Websites referred:


 http://www.mathworks.in/help/matlab/

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.

Software & Hardware Required: MATLAB software and PC Hardware


Experiment 7 10-244

Flow Chart:

Start

Read the image in an object


Take the size of image in r

Consider each individual bit of a pixel and


display the image

Plot the image

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.

Real Life Application:


Visually significant information in an image is generally present in MSB bit. Bit plane slicing finds great
application in Steganography and Image Watermarking.
_________________________________________________________________________
_______
Viva Questions:
1. How is bit plane slicing used in Steganography?
 Steganography is the art of hiding information. Here the LSB of the original image is
replaced by the MSB of the secret image.

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.
_________________________________________________________________________
_______

You might also like