MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB图像处理] 求助 关于blockproc的错误代码 (https://www.labfans.com/bbs/showthread.php?t=10863)

huaxiahun 2010-03-02 22:43

求助 关于blockproc的错误代码
 
请高手看看,帮帮我,我实在是无能为力了,谢啦O(∩_∩)O~
出错代码:
fun=@(block_struct) max(block_struct.data(:))*ones(size(block_struct.data));
I=blockproc('moon.jpg',[6 6],fun);
错误信息:
??? Error using ==> BLOCKPROC
Argument 'Input' failed validation with error:
Invalid input image. The input image to BLOCKPROC should be either a
numeric matrix or a string filename with a valid extension. See the
documentation for BLOCKPROC for a list of readable file formats and their
extensions.

Error in ==> blockproc>parse_inputs at 369
parser.parse(varargin{:});

Error in ==> blockproc at 161
parsed_args = parse_inputs(varargin{:});
下面是一段正确的代码:
fun = @(block_struct) std2(block_struct.data) * ones(size(block_struct.data));
I2 = blockproc('moon.jpg',[6 6],fun);
为什么使用max(x(:))时,出现错误,请高手指教。

如果源代码没法更改,那么如何实现我想要的结果,及实现对6*6区域内的矩阵所有元素取最大值。


所有时间均为北京时间。现在的时间是 11:09

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.