How do I resolve a syntax error when using BLOCKPROC?

function [normim, mask, maskind] = aridgesegment(im, blksze, thresh)
im = normalize(im,0,1); % normalise to have zero mean, unit std dev
fun = inline('std(x(:))*ones(size(x))');
stddevim = blockproc(im, [blksze blksze], fun);
mask = stddevim > thresh; maskind = find(mask);
% Renormalise image so that the ridge regions have zero mean, unit % standard deviation. im = im - mean(im(maskind)); normim = im/std(im(maskind));
Error using ==> BLOCKPROC Argument 'Function' failed validation with error: Invalid block function. BLOCKPROC expects the user function, FUN, to be a valid function handle.
Error in ==> blockproc>parse_inputs at 369 parser.parse(varargin{:});
Error in ==> blockproc at 161 parsed_args = parse_inputs(varargin{:});
Error in ==> aridgesegment at 50 stddevim = blockproc(im, [blksze blksze], fun);

 採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 2 月 24 日

1 投票

please read help about function blockproc
eg
fun = @(block_struct)std2(block_struct.data) * ones(size(block_struct.data)));
stddevim = blockproc(im, [blksze blksze], fun);

その他の回答 (1 件)

dee koshy
dee koshy 2012 年 2 月 24 日

0 投票

oh Thankyou sooo much! :):)

カテゴリ

ヘルプ センター および File ExchangeImage Processing and Computer Vision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by