0% found this document useful (0 votes)
28 views

DIP Assignment UH

This document describes an image processing assignment to extract the 8 bit planes of a grayscale image, replace one bit plane at a time with a watermarked logo image, and reconstruct the grayscale image for each bit plane replacement. It reads in an original grayscale image and watermark logo, extracts the 8 bit planes of the original, pads the logo to match the original image size, replaces one bit plane at a time with the logo values, reconstructs the grayscale image for each replacement, and displays the original and reconstructed images. Code is provided to perform these steps.

Uploaded by

UmAir Xajid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

DIP Assignment UH

This document describes an image processing assignment to extract the 8 bit planes of a grayscale image, replace one bit plane at a time with a watermarked logo image, and reconstruct the grayscale image for each bit plane replacement. It reads in an original grayscale image and watermark logo, extracts the 8 bit planes of the original, pads the logo to match the original image size, replaces one bit plane at a time with the logo values, reconstructs the grayscale image for each replacement, and displays the original and reconstructed images. Code is provided to perform these steps.

Uploaded by

UmAir Xajid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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