Can I embed a image in the following algorithm?
1 回表示 (過去 30 日間)
古いコメントを表示
I have successfully added data into the image using the following code and algorithm image is attached below but now I want to embed an image inside an image (steganography) Please suggest proper method to do it



instead of data, Please suggest a method
clc;
clear all;
fprintf('The image matrix A-');
fprintf('\n');
A=imread('airplane.bmp');
figure(1), imshow(A); title('Original Image (Cover Image)');
[Z,map]=rgb2ind(A,256);
p=size(Z);
disp(p);
B=Z;
B(2:2:end,:) = fliplr(Z(2:2:end,:));
C=reshape(B',1,[]);
disp(Z)
fprintf('Inverse S-scan of A-');
fprintf('\n');
disp(C);
fprintf('Size Of Inverse S-scan Matrix-');
fprintf('\n');
z=size(C);
t=z(1)*z(2);
disp(t);
for n=1:1:t
if (n==1)
D(n)=C(1,1);
elseif n>1
D(n)=C(1,(n-1))-C(1,n);
end
end
for n=1:1:t
if (n==1)
E(n)=D(1,1);
else
if(D(n)>0)
E(n)=D(1,n)+1;
else
E(n)=D(1,n);
end
end
end
for n=1:1:t
if(n<2)
F(n)=E(1,n)+1;
else
F(n)=E(n);
end
end
for n=1:1:t
if(n==1)
G(n)=F(1,1);
else
G(n)=C(1,n-1)-F(1,n);
end
end
M=reshape(G,p(1),p(2));
M(:,2:2:end)=flipud(M(:,2:2:end));
M=M.';
N=ind2rgb(M,map);
figure(2);imshow(N);title('Stego Image');
peaksnr = psnr(M,B)
err = immse(M,B)
0 件のコメント
採用された回答
Walter Roberson
2017 年 1 月 23 日
Images are just a type of data. Reshape it to a vector if you need to. If the image size is not fixed then be sure to embed information about the image size.
4 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Encryption / Cryptography についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!