How to import images to this function? need help
Mostrar comentarios más antiguos
function sp = LoG(varargin)
% USAGE:
% sp = LoG(<input image>, <minimum radius>, <maximal raidus> , <detection threshold>);
% Get arguments and/or default values
[im, Rmin, Rmax, peakthr] = checkargs(varargin(:));
if size(im,3) >1
img = rgb2gray(im);
else
img = im;
end
img = double(img);
block = [];
for s = Rmin:Rmax
h = -(s^2) * fspecial('log',s*5,s); % minus just so max is what we want
result = imfilter(img,h,'replicate');
% creates a scale space block to find location and scale of nuclei
block = cat(3,block, result);
end
[Cxy, indx] = max(block,[],3);
G = fspecial('gaussian', 20, 2);
Cxy_g = imfilter(Cxy, G,'symmetric');
ir_max = imregionalmax(Cxy_g);
ir_max = ir_max.*Cxy_g;
ir_med = imdilate(ir_max,strel('disk',min(Rmax,6),0));
ir_max = (ir_med == ir_max).*ir_max;
[r, c] = find(ir_max>peakthr);
sp = struct('radius',[],'x',[],'y',[],'px',[],'py',[],'resp',0);
for p = 1:length(r)
sp(p).x = c(p);
sp(p).y = r(p);
sp(p).radius = indx(r(p),c(p)) + Rmin - 1;
sp(p).resp = Cxy(r(p),c(p));
end
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Variables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!