What is the error in the function fun defined in the code below to find std deviation?
Afficher commentaires plus anciens
% % 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);
Réponses (0)
Catégories
En savoir plus sur Blocked Images dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!