我正在尝试使用小波变换来过滤图像。我尝试使用此处的函数mdwt:http://www.mathworks.com/matlabcentral/fileexchange/6391-wavelets-based-denoising/content/mdwt.m,以及此链接中的其他函数,如下所示:
img = imread('A10T_1.jpg');
h = daubcqf(4,'min');
L = 1;
y = mdwt(img,h,L);问题是在我得到的最后一行:One or more output arguments not assigned during call to,Error in => y = mdwt(img,h,L);
问题出在哪里?函数mdwt只包含声明,没有其他内容,我可以看到问题所在。有人能帮我解决这个问题吗?或者,有没有其他方法可以在不使用这些函数的情况下使用小波变换对图像进行过滤?
提前谢谢。
编辑:
现在我试着用下面的代码显示使用小波变换去噪后的图像:
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'); 但是我得到了一个错误
??? 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);去噪函数是这样的:http://www.mathworks.com/matlabcentral/fileexchange/6391-wavelets-based-denoising/content/denoise.m
问题出在哪里?
发布于 2012-06-12 03:18:23
该集合中的许多文件都是用C编写的MEX文件。M文件仅用于文档,但由于您没有编译MEX文件,因此MATLAB正在尝试为代码本身运行M文件。您需要为您的平台构建它们,然后才能运行代码。
尝试阅读提供的编译文档,这相当于在该目录中运行“INSTALL.txt”。
您的下一个挑战将是这些代码是旧的,并且您可能会遇到与较新的MATLAB版本的兼容性问题。但是试一试,看看会发生什么。
发布于 2012-06-12 03:56:11
您尝试使用的函数定义为
function [y,L] = mdwt(x,h,L);当您在代码中调用该函数时,您只分配了第一个输出参数
y = ...该函数有两个输出参数,
[y,L] = ...在使用函数时,您必须同时指定这两个参数。
https://stackoverflow.com/questions/10986056
复制相似问题