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 (최근 30일)
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
hudof najeeb
hudof najeeb 2016년 12월 13일
i want the second part to get the message(original image) from cover image please
Guillaume
Guillaume 2016년 12월 13일
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)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by