Can I embed a image in the following algorithm?

6 Ansichten (letzte 30 Tage)
akash bais
akash bais am 23 Jan. 2017
Kommentiert: Walter Roberson am 25 Jan. 2017
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)

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 23 Jan. 2017
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 Kommentare
akash bais
akash bais am 25 Jan. 2017
I can upload the commented code if you want
Walter Roberson
Walter Roberson am 25 Jan. 2017
Replace
[Z,map]=rgb2ind(A,256);
With assigning the desired data to Z

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by