i am trying to build my new wavelet. i used wavemngr but an error occured while doing decomposition using the new wavelet. kindly help me out..this is the code i used

image2=('C:\Users\hp\Desktop\data\1 (1).JPG');
[h l]= newwavelet(image2)
WAVEMNGR('add','shivjoshi','josh',1,'','newwavelet')
OUT1 = WAVEMNGR('read')
[C,S] = wavedec2(image2,2,'josh');
here in 2nd line h and l have high and low pass coefficients the code is working upto 4th line when i use OUT1 = WAVEMNGR('read') my new added wavelet is showing but in the 5th line error occured that file 'josh' doesnt exist

 Réponse acceptée

You should have an M-file that just defines the scaling filter for an orthogonal wavelet
So for example:
function h = newwavelet(wname)
h = [-0.0106
0.0329
0.0308
-0.1870
-0.0280
0.6309
0.7148
0.2304];
end
Then, first delete what you have already done.
wavemngr('del','josh');
Then, re-add
wavemngr('add','shivjoshi','josh',1,'','newwavelet.m')
Next, check that the wavelet is there
wavemngr('read')
Finally, create some data to test
Im = randn(10,10);
[C,S] = wavedec2(Im,1,'josh');

5 commentaires

'h' is necessary to be a column vector or we can use row vector too??
i do this too...but i am facing with the same problem...same error occurred
It does not have to be a column vector. Not sure what to tell you, this works for me exactly as I have shown it. I'm not sure why you have this:
[h l]= newwavelet(image2)
You would never do the above. Especially since your call to wavemngr.m specifices newwavelet.m as the file that defines the scaling filter.
Did you repeat my steps exactly? Using everything that I've done? Just to show yourself it works.
this is my new code
image2=('C:\Users\hp\Desktop\data\1 (1).JPG');
wavemngr('del','josh');
[h]= newwavelet(image2);
WAVEMNGR('add','shivjoshi','josh',1,'','newwavelet.m')
OUT1 = WAVEMNGR('read')
[C,S] = wavedec2(image2,2,'josh');
my h matrix is of 1*124 and this is the error occured
??? Error using ==> imread at 374 File "josh" does not exist.
Error in ==> sift at 23 image = imread(imageFile);
Error in ==> newwavelet at 3 [im, des, loc] = sift(image);
Error in ==> wfilters at 74 F = feval(fname,wname);
Error in ==> wavedec2 at 53 [Lo_D,Hi_D] = wfilters(IN3,'d');
Error in ==> main at 9 [C,S] = wavedec2(image2,2,'josh');
why are you inputting image2 into newwavelet? You do NOT input the image data into newwavelet.m. newwavelet.m should take only one input argument and that input argument should be wname. Just like I have done above in my example. MATLAB will call newwavelet.m with
newwavelet('josh')
and that should return a 1-D vector that is the scaling filter.
So if your newwavelet.m function does not work with:
h = newwavelet('josh');
then you are doing it wrong.
i got d answer sir....thnks a lot :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by