Question

I'm trying to filter an image using Wavelet Tranform. I tried to use the function mdwt from here : http://www.mathworks.com/matlabcentral/fileexchange/6391-wavelets-based-denoising/content/mdwt.m, and the other functions from this link , like this :

img = imread('A10T_1.jpg');       
h = daubcqf(4,'min');
L = 1;
y = mdwt(img,h,L);

The problem is that at the last line I get : One or more output arguments not assigned during call to, Error in => y = mdwt(img,h,L);

Where is the problem? The function mdwt contains only the declaration, nothing more, and I can see that's the problem. Can anyone help me to solve me this ? Or there is any other method to filter an image using Wavelet Transform without using these functions ?

Thanks in advance.

EDIT :

Now I'm tring to show the image denoised usind wavelet Transform with this code :

RGB = imread('small.jpg');
 J = imnoise(RGB,'salt & pepper',0.05);h = daubcqf(6);  
      noisyLena = J;
      figure; colormap(gray); imagesc(RGB); title('Original Image');
       figure; colormap(gray); imagesc(noisyLena); title('Noisy Image'); 
%       Denoise lena with the default method based on the DWT
      [denoisedLena,xn,opt1] = denoise(noisyLena,h);
      figure; colormap(gray); imagesc(denoisedLena); title('denoised Image');  

but I get the error

??? The matrix row dimension must be of size m*2^(L)

Error in ==> denoise at 171
  [xd , LL]= mdwt(double(i),h,L);

Error in ==> wavelet_start at 20
      [denoisedLena,xn,opt1] = denoise(noisyLena,h);

where denoise function is this : http://www.mathworks.com/matlabcentral/fileexchange/6391-wavelets-based-denoising/content/denoise.m

where is the problem ?

Was it helpful?

Solution

Many of the files in that collection are MEX files, written in C. The M-file is only for documentation, but since you don't have the MEX file compiled, MATLAB is trying to run the M-file for the code itself. You need to build them for your platform before you can run the code.

Try reading the INSTALL.txt documentation provided, which amounts to running "compile" in that directory.

Your next challenge will be that this code is old, and you may have compatibility issues with more recent MATLAB versions. But try it, see what happens.

OTHER TIPS

The function you are trying to use is defined as

function [y,L] = mdwt(x,h,L);

When you call the function in your code you are only assigning the first output-parameter

y = ...

The function has two output parameters,

[y,L] = ...

you have to assign both when using the function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top