answersLogoWhite

0

%%%fim1 is our image%%%

[ r c ] = size(fim1);

even=zeros(r,(c/2));

%first level decomposition

%one even dimension

for j = 1:1:r

a=2;

for k =1:1:(c/2)

even(j,k)=fim1(j,a);

a=a+2;

end

end

%one odd dim

odd=zeros(r,(c/2));

for j = 1:1:r

a=1;

for k =1:1:(c/2)

odd(j,k)=fim1(j,a);

a=a+2;

end

end

[ lenr lenc ]=size(odd) ;

%one dim haar

for j = 1:1:lenr

for k =1:1:lenc

fhigh(j,k)=odd(j,k)-even(j,k);

flow(j,k)=even(j,k)+floor(fhigh(j,k)/2);

end

end

%2nd dimension

[len2r len2c ]=size(flow);

for j = 1:1:(len2c)

a=2;

for k =1:1:(len2r/2)

%even separation of one dim

leven(k,j)=flow(a,j);

heven(k,j)=fhigh(a,j);

a=a+2;

end

end

%odd separtion of one dim

for j = 1:1:(len2c)

a=1;

for k =1:1:(len2r/2)

lodd(k,j)=flow(a,j);

hodd(k,j)=fhigh(a,j);

a=a+2;

end

end

%2d haar

[ len12r len12c ]=size(lodd) ;

for j = 1:1:len12r

for k =1:1:len12c

%2nd level hh

f2lhigh(j,k)=lodd(j,k)-leven(j,k);

%2nd level hl

f2llow(j,k)=leven(j,k)+floor(f2lhigh(j,k)/2);

%2nd level lh

f2hhigh(j,k)=hodd(j,k)-heven(j,k);

%2nd level ll

f2hlow(j,k)=heven(j,k)+floor(f2hhigh(j,k)/2);

end

end

% level=level-1;

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you decompose an image in matlab code?

To decompose an image in MATLAB, you can use the im2col function to reshape the image into overlapping or non-overlapping blocks, or apply techniques like Discrete Wavelet Transform (DWT) using the wavedec2 function for multi-resolution analysis. For example, to perform a wavelet decomposition, you can use: [coeffs, sizes] = wavedec2(image, level, 'waveletname'); Replace level with the desired decomposition level and 'waveletname' with the chosen wavelet type. You can then extract the approximation and detail coefficients from coeffs as needed.


Gram schmidt matlab code for orthonormalizing set of vectors?

gram schmidt matlab code


Matlab code of convolutional coding and viterbi algorithm?

matlab code for convolutional coding and BCH coding


Code for circular convolution matlab?

Please check the help files of the matlab circular convolution . Matlab already has a readymade function for it.


How you write code in matlab?

To write code in MATLAB, you can use the MATLAB Editor, which allows you to create scripts and functions. You begin by opening a new script file, where you can input your code, including variables, loops, and functions. Once your code is written, you can save the file with a .m extension and run it by typing the filename in the command window. MATLAB also provides extensive documentation and built-in help to assist with coding.


Speech synthesis and analysis code in matlab?

try dsplpc


How do you modulate in matlab without using matlab tools?

You would have to write your own code for a modulation (Matlab has a convolution function not in the tools), otherwise you can use its built in function in the signal processing toolbox.


How do you run a matlab code without installing the matlab.... I mean if any online option is available?

>>input_img = imread['n.jpg']; >>imshow[input_img];


What is code validation in Matlab and Simulink?

i want to do validation to my image folder


How do you make graph from an equation in Matlab?

Initially, the equation can be directly realized using Matlab source code. Then various inputs can be applied to it. These values can easily be plotted on a graph using plot or stem command in Matlab.


Discrete fourier transform of an image in c code?

i want c code for fourier transform?


Matlab code for poisson distribution and its process?

menu ki pata :p