Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

9/16/2015 Bit­Plane 

Slicing | IMAGE PROCESSING

Email address... Submit

HOME TABLE OF CONTENTS ABOUT ME CONTACT ME PAID PROJECTS

IMAGE PROCESSING
Lets Learn together... Happy Reading GRAB YOUR FREE
GIFT TODAY
" Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference "-Robert Frost

 
Recent Posts
How to use different images and color maps on a same figure ...
Display different images on same figure Display stack of images with same colormap Display Stack of Images with LIKE "IMAGE
different colormap Display...
PROCESSING"
More » Support this blog by leaving
K­means Clustering your valuable comments and a
       Clustering can be defined as the grouping of data points based on some commonality or similarity between the like on Facebook Fan Page.
points.                    ... THANKS FOR READING

More »
Multilook Technique for speckle reduction ADD ME
Consider a stack of images  affected by speckle noise of a same scene.  In order to reduce the speckle, the
availability of the stack of...
IMAGE PROCESSING
More »
Follow

+ 329

Bit­Plane Slicing

            Digitally, an image is represented in terms of pixels.
These pixels can be expressed further in terms of bits.
Consider the image ‘coins.png’ and the pixel representation of the image. Its Totally Random

Consider the pixels that are bounded within the yellow line. The binary formats for those values are (8­
bit representation) Subscribe Now:

Subscribe in a reader

YOU ARE HERE

TAGS

http://angeljohnsy.blogspot.com/2012/11/bit­plane­slicing.html 1/6
9/16/2015 Bit­Plane Slicing | IMAGE PROCESSING

The binary format for the pixel value 167 is 10100111
GUI  Components  in
Similarly, for 144 it is 10010000 MATLAB  Removing
This 8­bit image is composed of eight 1­bit planes. Image  noise  Image
Plane 1 contains the lowest order bit of all the pixels in the image. Conversion  Photoshop
effects  in  MATLAB  Edge
detection  MATLAB
BUILT_IN  FUNCTIONS
Morphological  Image
Processing  Array  functions  in
MATLAB  Video  Processing  Files
Object  Identification  Optical
illusion  Shapes  Templates
Histogram  equalization  Image
Compression  Image  Arithmetic  Image
Geometry

And plane 8 contains the highest order bit of all the pixels in the image. Followers

Join this site
with Google Friend Connect

Members (56)  More »

Let’s see how we can do this using MATLAB Already a member? Sign in

A=[167 133 111
      144 140 135
      159 154 148]

B=bitget(A,1);  %Lowest order bit of all pixels
‘bitget’ is a MATLAB function used to fetch  a bit from the specified position from all the pixels.
B=[1 1 1
      0 0 1
      1 0 0]
B=bitget(A,8);%Highest order bit of all pixels
B=[1 1 0
      1 1 1 
      1 1 1]

MATLAB CODE:
%Bit Planes from 1 to 8. Output Format: Binary

A=imread('coins.png');

B=bitget(A,1);
figure,
subplot(2,2,1);imshow(logical(B));title('Bit plane 1');

B=bitget(A,2);
subplot(2,2,2);imshow(logical(B));title('Bit plane 2');

B=bitget(A,3);
subplot(2,2,3);imshow(logical(B));title('Bit plane 3');

B=bitget(A,4);
subplot(2,2,4);imshow(logical(B));title('Bit plane 4');

http://angeljohnsy.blogspot.com/2012/11/bit­plane­slicing.html 2/6
9/16/2015 Bit­Plane Slicing | IMAGE PROCESSING

B=bitget(A,5);
figure,
subplot(2,2,1);imshow(logical(B));title('Bit plane 5');

B=bitget(A,6);
subplot(2,2,2);imshow(logical(B));title('Bit plane 6');

B=bitget(A,7);
subplot(2,2,3);imshow(logical(B));title('Bit plane 7');

B=bitget(A,8);
subplot(2,2,4);imshow(logical(B));title('Bit plane 8');

http://angeljohnsy.blogspot.com/2012/11/bit­plane­slicing.html 3/6
9/16/2015 Bit­Plane Slicing | IMAGE PROCESSING

Image reconstruction using n bit planes.

1.     The nth plane in the pixels are multiplied by the constant 2^n­1
2.     For instance, consider the matrix
A= A=[167 133 111
      144 140 135
      159 154 148] and the respective bit format

         
3.     Combine the 8 bit plane and 7 bit plane.
For 10100111, multiply the 8 bit plane with 128 and 7 bit plane with 64.
(1x128)+(0x64)+(1x0)+(0x0)+(0x0)+(1x0)+(1x0)+(1x0)=128

4.     Repeat this process for all the values in the matrix and the final result will be
[128 128 64
 128 128 128
128 128 128]

MATLAB CODE:
%Image reconstruction by combining 8 bit plane and 7 bit plane
A=imread('coins.png');
B=zeros(size(A));
B=bitset(B,7,bitget(A,7));
B=bitset(B,8,bitget(A,8));
B=uint8(B);
figure,imshow(B);

Image reconstructed using 8 and 7 bit planes

Explanation:
‘bitset’ is used to set  a bit at a specified position. Use ‘bitget’ to get the bit at the positions 7 and 8 from
all the pixels in matrix A and use ‘bitset’ to set these bit values at the positions 7 and 8 in the matrix B.

%Image reconstruction by combining 8,7,6 and 5 bit planes
A=imread('coins.png');
B=zeros(size(A));
B=bitset(B,8,bitget(A,8));
B=bitset(B,7,bitget(A,7));
http://angeljohnsy.blogspot.com/2012/11/bit­plane­slicing.html 4/6
9/16/2015 Bit­Plane Slicing | IMAGE PROCESSING

B=bitset(B,6,bitget(A,6));
B=bitset(B,5,bitget(A,5));
B=uint8(B);
figure,imshow(B);

Image reconstructed using 5,6,7 and 8 bit planes

 Like "IMAGE PROCESSING" page

Your Reactions:  Useful (2) Interesting (1) Not bad (0) :‐( (0)

5 comments:
punya said...
thanx a lot
November 5, 2012 at 5:55 PM

Vera Luzzi said...
thanks a lot, i tried to use GIMP to union these planes but i failed :D
December 25, 2013 at 3:01 PM

jepsy dicruz said...
Thank you very much!!!
April 17, 2014 at 9:10 AM

eng guray said...
thank you..........
May 14, 2014 at 2:20 PM

Abder­Rahman said...
Thanks for the nice tutorial!
July 31, 2015 at 8:53 PM

Enjoyed Reading? Share Your Views

http://angeljohnsy.blogspot.com/2012/11/bit­plane­slicing.html 5/6
9/16/2015 Bit­Plane Slicing | IMAGE PROCESSING

Enter your comment...

Comment as:  Paulal John (Google) Sign out

 
Publish Preview   Notify me

Today's Popular Posts

FACE DETECTION ­ MATLAB CODE
                                  Lets see how to detect face, nose, mouth and eyes using the MATLAB built­in class and
function. Based on...

Matlab code: Histogram equalization without using histeq function
               It is the re­distribution of gray level values uniformly. Let’s consider a 2 dimensional image which has
values rangin...

Sobel edge detection
         The gradient of the image is calculated for each pixel position in the image. The procedure and t...

Bit­Plane Slicing
            Digitally, an image is represented in terms of pixels. These pixels can be expressed further in terms of bits.
Consider t...

MATLAB PROGRAM : 2D MEDIAN FILTERING FOR SALT AND PEPPER NOISE WITHOUT USING medfilt2 FUNCTION
MEDIAN FILTER: In digital Image processing , removing the noise is one of the preprocessing techniques. The image noise may
be termed ...

Powered by Blogger.

1340025
 
Bloggers ­ Meet Millions of Bloggers

Google ping Hypersmash.com 

http://angeljohnsy.blogspot.com/2012/11/bit­plane­slicing.html 6/6

You might also like