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

1. Q. Extract all 8 bit planes of any gray scale image.

Show the original image and all bit planes.


Now use the binary image Logo.bmp (180 x 22) as a watermark and replace the ith bit plane of
the original image with values from Logo.bmp by padding Logo.png with pixel values to match
image dimensions as per original image. Reconstruct the gray scale image Ji for 1 < i < 8. Show
each reconstructed and original image.
% November
reading the image
30, 2016
img=imread('season.tif');
%extracting the 8 bit planes
PB1=bitget(img,1);
PB2=bitget(img,2);
PB3=bitget(img,3);
PB4=bitget(img,4);
PB5=bitget(img,5);
PB6=bitget(img,6);
PB7=bitget(img,7);
PB8=bitget(img,8);

Assignment
#2

Digital Image Processing

logo=imread('logo.bmp');
bits=size(logo);
for

end

GROUP MEMBERS
row= 1:bits(1)
PC HASSAN KHAN
for col= 1:bits(2)
P8(row,col)=logo(row,col);
PC UMAIR SAJID
end
MCS, NUST

Plane1=zeros(size(img));
% setting the bits of plane1
Plane1=bitset(Plane1,8,PB8);
Plane1=bitset(Plane1,7,PB7);
Plane1=bitset(Plane1,6,PB6);
Plane1=bitset(Plane1,5,PB5);
Plane1=bitset(Plane1,4,PB4);
Plane1=bitset(Plane1,3,PB3);
Plane1=bitset(Plane1,2,PB2);
Plane1=bitset(Plane1,1,PB1);
% reconstructing the Plane1
Plane1=uint8(Plane1);
figure,imshow(Plane1);

THE END

You might also like