[EDIT: Thu May 12 22:58:48 UTC 2011 Duplicate Removed - MKF]
i am working on a project named water marking using super resolution .. i want to ask a small question .. how can i take the photo size 256*256 (host image) .. resize it to make it 64*48 then put the resized image down the host image using NPT (logo image) .. so finally the host image will be resized to 256*244 and down it the logo image will be 64*48 ! please help me with its code !

5 Kommentare

Walter Roberson
Walter Roberson am 4 Mai 2011
What is NPT ?
Do I understand correctly that you will embed the watermarking image (64*48) in to the 256*256 image, and then that watermarked image will be resized to 256*244, and you wish to be able to extract the full 64*48 watermark from the resized image?
Is it known what resizing algorithm will be used? Will it be simple cropping, or will it be resizing changing the aspect ratio?
Nada
Nada am 4 Mai 2011
i want to rezise the (host) 256*256 to make it 64*48 .. then embed it to the bottom of the host image and that will make the host image 256*244 ..
it means we will resize the host image twice .. at first 64*48(down)
then 256*244(up) .. then embed them together
Walter Roberson
Walter Roberson am 4 Mai 2011
Normally when something is embedded, the image stays the same size.
To check: the final image you want to get out should be 256 x 256, but one edge of it should consist of a smaller version of original image?
I'm not sure what the purpose of this would be? I don't see what it has to do with superresolution for example.
Nada
Nada am 4 Mai 2011
hmmm .. fine !
all what i need is what u said !
a 256*256 image where its lower part is the same image but with smaller size 64*48 !
it is a task .. i really dunno how is it related to super resolution but it is a task ! any help with coding ??
Nada
Nada am 4 Mai 2011
clear
[A,map]=imread('lena256.bmp');
A=double(A);
[m,n]=size(A);
ps=zeros(12,256);
ips=1;
jps=1;
for i=1:8:m;
for j=1:8:n;
C=dct2(A(i:i+7,j:j+7));
DC=[1 1 0 0 0 0 0 0; 1 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;];
ps(ips,jps)=C(1,3);
ps(ips+1,jps)=C(2,2);
ps(ips+2,jps)=C(3,1);
C=C.*DC;
ips=ips+3;
if(ips>12)
jps=jps+1;
ips=1;
else
end
B(i:i+7,j:j+7)=C;
end
end
for i=1:8:m;
for j=1:8:n;
DD=B(i:i+7,j:j+7);
%DD=DD.*DC;
D(i:i+7,j:j+7)=idct2(DD);
end
end
figure(1)
imshow(A,map)
figure(2)
imshow(D,map)
ips=1;
jps=1;
for i=1:8:m;
for j=1:8:n;
DD=B(i:i+7,j:j+7);
DD(1,3)=ps(ips,jps);
DD(2,2)=ps(ips+1,jps);
DD(3,1)=ps(ips+2,jps);
ips=ips+3;
if(ips>12)
jps=jps+1;
ips=1;
else
end
D(i:i+7,j:j+7)=idct2(DD);
end
end
figure(3)
imshow(D,map)
i need to take figure 3 then do what i told u about !

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 4 Mai 2011

0 Stimmen

I = imread('cameraman.tif'); %sample
I(end-63:end,1:48) = imresize(I,[64 48]); %engine
imtool(I) %view

1 Kommentar

Nada
Nada am 4 Mai 2011
clear
[A,map]=imread('lena256.bmp');
A=double(A);
[m,n]=size(A);
ps=zeros(12,256);
ips=1;
jps=1;
for i=1:8:m;
for j=1:8:n;
C=dct2(A(i:i+7,j:j+7));
DC=[1 1 0 0 0 0 0 0; 1 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0;];
ps(ips,jps)=C(1,3);
ps(ips+1,jps)=C(2,2);
ps(ips+2,jps)=C(3,1);
C=C.*DC;
ips=ips+3;
if(ips>12)
jps=jps+1;
ips=1;
else
end
B(i:i+7,j:j+7)=C;
end
end
for i=1:8:m;
for j=1:8:n;
DD=B(i:i+7,j:j+7);
%DD=DD.*DC;
D(i:i+7,j:j+7)=idct2(DD);
end
end
figure(1)
imshow(A,map)
figure(2)
imshow(D,map)
ips=1;
jps=1;
for i=1:8:m;
for j=1:8:n;
DD=B(i:i+7,j:j+7);
DD(1,3)=ps(ips,jps);
DD(2,2)=ps(ips+1,jps);
DD(3,1)=ps(ips+2,jps);
ips=ips+3;
if(ips>12)
jps=jps+1;
ips=1;
else
end
D(i:i+7,j:j+7)=idct2(DD);
end
end
figure(3)
imshow(D,map)
i need to take figure 3 and do what i wrote in the Q.
any help please??

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