Inverse curvelet transform fdct_wrapping, ifdct_wrapping
8 views (last 30 days)
Show older comments
Following is test code for inserting watermark using curvelet transform(wrapping).Curvelet transform is invertible, hence results of forward transform and inverse should be same and hence get errors in extraction logic.However i am experiencing some problem.dont know where i am going wrong.Can someone help me. thanking in anticipation.
if true
clear all;
close all;
a=imread('sat55.jpg'); a=a(:,:,3);
% a=resize_nbyn(a);
b=mat2tiles(a,[64 64]);
is_real=0;
level=3;
location=3;
jnd=.2;
w=ones(16,22);
w(1:8,1:22)=-1
C=fdct_wrapping((b{18,5}),is_real,1,4,8) ;
Ct = C;
%modify coefficients
%comment next 2 lines to compute without modifications
add_coeff=abs(Ct{1,level}{1,location}).*(w*jnd) ;
Ct{1,level}{1,location}=Ct{1,level}{1,location}+add_coeff;
%take inverse
tic; restored_img= uint8(abs(ifdct_wrapping(Ct,is_real,64,64))); toc;
%take forward
tic; re_transform= fdct_wrapping(restored_img,is_real,1,4,8); toc;
%compare the coefficients. should be same.
abs(Ct{1,level}{1,location}-re_transform{1,level}{1,location})
end
1 Comment
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!