this is the first part to hide image in image using lsb. how to get the messege from the cove ? i tried to get it but i coudn't ... please i want it in my study

1 visualización (últimos 30 días)
close all;
imtool close all;
clear;
workspace;
cover = imread('pigs.tif');
message = imread('dpg.tif');
%display on screen the two images
figure(1), imshow(cover); title('Cover Image');
figure(2), imshow(message);title('Message Image');
%change to double to work with addition below
cover=double(cover);
message=double(message);
%imbed = no. of bits of message image to embed in cover image
imbed=4;
%shift the message image over (8-imbed) bits to right
%messageshift=bitshift(message,-(8-imbed));
%show the message image with only embed bits on screen
%must shift from LSBs to MSBs
messageshift=uint8(bitshift(message,-(8-imbed)));
showmess=uint8(messageshift);
showmess=bitshift(showmess,8-imbed);
figure(3),imshow(showmess);title('4 Bit Image to Hide');
%now zero out imbed bits in cover image
coverzero = cover;
for i=1:imbed
coverzero=bitset(coverzero,i,0);
end
cove=uint8(coverzero);
%now add message image and cover image
stego = imadd(cove,messageshift);
figure(4),imshow(stego);title('Stego image');
%save files if need to
%4 bit file that was embedded = same as file extracted
imwrite(stego,'stego22.tif');
  2 comentarios
hudof najeeb
hudof najeeb el 13 de Dic. de 2016
i want the second part to get the message(original image) from cover image please
Guillaume
Guillaume el 13 de Dic. de 2016
By using bitshift with an offset of 4 on your message, you're destroying half of the bits of your message. It is therefore impossible to recover it.
Also, why is the message initially converted to double if you're then going to convert it (twice!) to uint8. Also, what is the purpose of showmess that is never used anywhere (and is just the initial message with bits 0:imbed set to 0)

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by