【正文】
end。 max_local(index) = val(index)。 highest~=second_highest。 second_highest = ordfilt2(val, nb1, mask)。 nb = sum(mask(:))。disk39。end function [row,col,max_local] = findLocalMaximum(val,radius) % Determine the local maximum of a given value % % % INPUT % ===== % val : the NxM matrix containing values % radius : the radius of the neighborhood % % OUTPUT % ====== % row : the row position of the local maxima % col : the column position of the local maxima % max_local : the NxM matrix containing values of val on unique local maximum % % EXAMPLE % ======= % [l,c,m] = findLocalMaximum(img,radius)。 % % find local maxima greater than threshold [r,c] = find(max_local=t)。 t = *max(max_local(:))。 % find local maxima on 3x3 neighborgood [r,c,max_local] = findLocalMaximum(cim,3*s_I)。)。 Ixy = conv2(Ix.*Iy, g, 39。same39。)。 Ix2 = conv2(Ix.^2, g, 39。gaussian39。 % sum of the Autocorrelation matrix s_I = sigma。same39。)。 % image derivatives Ix = conv2(im, dx, 39。 dx = x .* exp(x.*x/(2*s_D*s_D)) ./ (s_D*s_D*s_D*sqrt(2*pi))。 % derivative masks s_D = *sigma。 end end end function points = kp_harris(im) % Extract keypoints using Harris algorithm (with an improvement % version) % INPUT % ===== % im : the graylevel image % % OUTPUT % ====== % points : the interest points extracted % % REFERENCES % ========== % . Harris and . Stephens. A bined corner and edge detector, % Proceedings Fourth Alvey Vision Conference, Manchester. % pp 147151, 1988. % % Alison Noble, Descriptions of Image Surfaces, PhD thesis, Department % of Engineering Science, Oxford University 1989, p45. % % C. Schmid, R. Mohrand and C.