% function op=haar2(v)
clear all;
clc;
v=imread('test1.jpg');
%v=rgb2gray(v);
col=max(size(v));
row=min(size(v));
inp=v;
op=zeros(col,row);
while(col>64)
len=0;
while(len<2)
for j=1:row
for i=0:col/2-1
op(j,i+1)=(v(j,2*i+2)+v(j,2*i+1))*.5;
op(j,col/2+i+1)=(v(j,2*i+1)-v(j,2*i+2))*.5;
end
end
v=op';
len=len+1;
end
col=col/2;
row=row/2;
v=op';
end
imshow(uint8(v));
Can you post the code for inverse Haar Transform?
ReplyDelete