%Steganography using transform of steg image %figure 4.55 to 4.61
%Results table 4.7
% MAIN PROGRAM of Steganography in spatial domain
clc;
clear all;
close all;
cover= imread('logo2.tif');
message= rgb2gray(imread('C:\Users\Ashish\Pictures\test images\hand.jpg'));
x = cover; % cover message
y = message; % message image
% disp('order of FrFT are following: ')
% a=rand(1)
% b=rand(1)
n=4;
S = uint8(bitor(bitand(x,bitcmp(2^n-1,8)),bitshift(y,n-8))); % stego
S=double(S);
% S1=frft2d(S,[a,b]); % to transmit
S1=dct2(S);
% S2=frft2d(S1,[-a,-b]); % at reciever: inverse of S1
S2=idct2(S1);
S3=uint8(real(S2)); % real part of S2
E = uint8(bitand(255,bitshift(S3,8-n))); %Extracted
origImg = double(x); % cover image
distImg = double(S1); % transform image
[M N] = size(origImg);
distImg1=imresize(distImg,[M N]);
error = origImg - distImg1;
MSE = sum(sum(error .* error)) / (M * N);
if(MSE > 0)
PSNR = 10*log10(M*N./MSE);
else
PSNR = 99;
end
disp('PSNR of cover to transformed steganographic image is')
disp(abs(PSNR))
origImg = double(y); % message image
distImg = double(E); % extracted image
[M N] = size(origImg);
distImg1=imresize(distImg,[M N]);
error = origImg - distImg1;
MSE = sum(sum(error .* error)) / (M * N);
if(MSE > 0)
PSNR = 10*log10(M*N./MSE);
else
PSNR = 99;
end
disp('PSNR of message image to extracted image is')
disp(abs(PSNR))
figure,
subplot(321),imshow(x);title('1.Cover image')
subplot(322),imshow(y);title('2.Message to be Hide')
subplot(323),imshow((abs(S)),[]);title('3.Stegnographic Image')
subplot(324),imshow(log(abs(S1)),[]);title('4.DCT of Steganographic Image to Transmit')
subplot(325),imshow(real(S2),[]); title('5.Inverse DCT of Stegano Image')
subplot(326),imshow(real(E),[]); title('6.Extracted Image from Figure.4')
MATLAB.rar_LSB_LSB steganography_Steganography LSB_lsb steganog
版权申诉
41 浏览量
2022-09-23
18:49:25
上传
评论
收藏 3KB RAR 举报
寒泊
- 粉丝: 75
- 资源: 1万+
最新资源
- 20240429_112025.m4a
- 91fdd461elb59a4ce8dfcfc46bc283a7.msi
- Image_1715565894150.jpg
- 计算机网络.docx
- Oracle Instant Client for Linux x86-64 (64-bit) Version 11.1.0.7
- dataExpr.tom-block.1.RData
- 实战验证过的最新远程Tomcat调试方式(基于IDEA2023/2024, JDK1.8, TOMCAT9, WIN10的)
- 200SMART与V20变频器RTU通讯.smart
- 天使插件4.019版-成品
- weinxin小程序仿ofo共享单车
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈