Extract original image from watermarked image

1 visualización (últimos 30 días)
rolack KIKISSAGBE
rolack KIKISSAGBE el 14 de Ag. de 2020
Respondida: Image Analyst el 14 de Ag. de 2020
I would like to extract the original image from the marked image based on this code which hides a text in an image
Help me
%%%% code to insert text in image
I=imread('path folder');
imshow(I);
a=double(I);
s=a;
texte=' adhjadhjhjahjhjazdhbj'
k=0;
if size(texte)<size(a,1)*size(a,2)
for j=1:size(a,2)
for i=1:size(a,1)
k=k+1;
if k<size(texte,2)
s(j,i,1)=floor(a(j,i,1)/16)*16+texte(k)-16*floor(texte(k)/16);
s(j,i,3)=floor(a(j,i,3)/16)*16+floor(texte(k)/16);
end
if k==size(texte,2)+1
s(j,i,1)=floor( a(j,i,1)/16)*16+128-16*floor(128/16);
s(j,i,3)=floor( s(j,i,3)/16)*16+floor(128/16);
end
end
end
else
print('Texte trop long');
end
ba=uint8(s);
imwrite(ba,'path file');
imshow(ba);
%%% extract text from marked image
imo=imread(path folder);
imshow(imo);
text=[];
i=1;j=1;
a=double(imo);
part1=a(j,i,1)-16*floor(a(j,i,1)/16);
part2=a(j,i,3)-16*floor(a(j,i,3)/16);
textp=double(part2*16+part1);
while(textp~=128)
text=[text,textp];
i=i+1;
if i>size(a,1)
j=j+1;
i=1;
end
part1=a(j,i,1)-16*floor(a(j,i,1)/16);
part2=a(j,i,3)-16*floor(a(j,i,3)/16);
textp=part2*16+part1;
end
text=char(text);
print(text);
This code work perfectly!!!!
Help me now to extract original image from marked image.
Thks

Respuestas (1)

Image Analyst
Image Analyst el 14 de Ag. de 2020
See attached example that hides an image in another image and then recovers it.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by