非局部中值滤波器 - 类型 'double' 输入参数的未定义函数



我正试图从这里使用非局部均值滤波函数来清理一些图像。当我运行代码时,我会得到错误Undefined function 'image2vectors_double' for input arguments of type 'double'。你对如何解决这个问题有什么建议吗?我使用path将包含非本地中值滤波器代码的文件夹添加到Matlab路径中,还复制了脚本所在文件夹中的文件。

这是代码:

IM(m,:,:) = fitsread(Image.fits);
Options.kernelratio=4;
Options.windowratio=4;
Options.verbose=true;
J=NLMF(IM,Options);
figure,
subplot(1,2,1),imshow(IM); title('Noisy image')
subplot(1,2,2),imshow(J); title('NL-means image');

这是因为这个函数是一个.c文件,您需要编译它才能与Matlab一起使用,还有这些函数:

vectors_nlmeans_single.c
image2vectors_single.c
vectors_nlmeans_double.c

如果您仔细查看文件NLMF.m的注释部分,您将看到以下内容:

% First Compile c-code!!!!, with :
%   mex vectors_nlmeans_single.c -v
%   mex image2vectors_single.c -v
%   mex vectors_nlmeans_double.c -v
%   mex image2vectors_double.c -v

我现在不能测试它,但应该可以了。

最新更新