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

Superior University Lahore: Assignment 7

Uploaded by

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

Superior University Lahore: Assignment 7

Uploaded by

ArSLan CHeEmAa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Faculty of Computer Science & IT

Assignment 7
Student Name Student ID Program Contact Number Email Address
Arslan Ahmed BSEM-F16- BS(SE) +92 3454175704 [email protected]
104

SUPERIOR UNIVERSITY LAHORE


Assignment 7

Implement using MATLAB: Data Hiding Method using Bit Plane Slicing
Code:
clear variables;
close all;
im = imread('lena.bmp');
figure(1);
imshow(im
title('Original Image'
[m, n, o] = size(im
figure(2); imshow(im(:,:,1)); title('Red Plane');
figure(3); imshow(im(:,:,2)); title('Green Plane');
figure(4); imshow(im(:,:,3)); title('Blue Plane');

R(:,:) = im(:,:,1);
for i = 1:m
for j=1:n
for k=1:8
bitplanesR(i, j, k) = bitget(im(i, j, 1), k
end
end
end

for i=1:8
figure(5);
subplot(2, 4, i
titleString = 'bit planes(RED PLANE)';
imagesc(uint8(bitplanesR(:,:,i)));
axis equal

colormap(gray);%
title([titleString int2str(i-1)]);
end

bitplanesR(:,:,1) =0;
bitplanesR(:,:,2) =0;

for i=1:8
figure(6);
subplot(2, 4, i);
titleString = 'bit planes(RED PLANE)';
imagesc(uint8(bitplanesR(:,:,i)));
axis equal;

colormap(gray);
title([titleString int2str(i-1)]);
end

b1 = zeros(m,n);
b1(:,:) = 0;
for i = 1:m
for j = 1:n for k = 1:8 %
b1(i,j) = b1(i,j) + bitplanesR(i,j,k)*(2^(k-1));
end
end
end

figure(7);
imshow(uint8(b1));
title('Recovered Red Plane');
b1 = uint8(b1); %

OUTPUT#

You might also like