What is the error in the function fun defined in the code below to find std deviation?
Show older comments
% % Usage: [normim, mask, maskind] = ridgesegment(im, blksze, thresh) % % Arguments: im - Fingerprint image to be segmented. % blksze - Block size over which the the standard % deviation is determined (try a value of 16). % thresh - Threshold of standard deviation to decide if a % block is a ridge region (Try a value 0.1 - 0.2) % % Returns: normim - Image where the ridge regions are renormalised to % have zero mean, unit standard deviation. % mask - Mask indicating ridge-like regions of the image, % 0 for non ridge regions, 1 for ridge regions. % maskind - Vector of indices of locations within the mask. % % Suggested values for a 500dpi fingerprint image: % % [normim, mask, maskind] = ridgesegment(im, 16, 0.1) % % See also: RIDGEORIENT, RIDGEFREQ, RIDGEFILTER
function [normim, mask, maskind] = ridgesegment(im, blksze, thresh)
im = normalise(im,0,1); % normalise to have zero mean, unit std dev
fun = inline('std(x(:))*ones(size(x))');
stddevim = blkproc(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 in ==>blockproc at 219 Invalid output class. The user function, FUN, returned an invalid result. The class of the result was char.
Error in ==> ridgesegment at 62 stddevim = blockproc(im, [blksze blksze],fun);
Answers (0)
Categories
Find more on Blocked Images in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!