help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

octave equivalent for Harris corner detector


From: Seetha Parameswaran
Subject: octave equivalent for Harris corner detector
Date: Thu, 14 Feb 2013 22:00:44 +0530


Hi all,

Is there any efficient Octave equivalent for Matlab corner function to detect corners using Harris corner detector.

the function i use currently is as given below. But it is not detecting the corners correctly.

function [corners,R] = harris(I,sigma,Rmin)
%    I - image
%    sigma - determines the size of the window function (gaussian)
%    Rmin - threshold for determining corners (cornerness measure R>Rmin)
% OUTPUT
%    corners [2 n_corners] - x and y coordinates of found corners
%    R - the 'cornerness measure' map

k = 0.06;
% Empirical testing  has indicated that values of k = 0.04 to 0.06 
% Compute gradiants 
[Ix,Iy] = gradient(double(I));
gs = fspecial('gaussian',6*sigma,sigma); % size of window = 6*sigma
A = filter2(gs,Ix.*Ix);
B = filter2(gs,Iy.*Iy);
C = filter2(gs,Ix.*Iy);

% Compute determinant and trace of M; and cornerness measure R
detM = A.*B-C.^2;
traceM = A+B;
R = detM-k*traceM.^2;

% Threshold R and find its local maxima
thresh = R>Rmin;
maxima = local_maxima(R);
corners_mask = thresh & maxima;
[r,c] = find(corners_mask);
corners = [c(:)'; r(:)'];



--
Thanks & Regards,
Seetha

reply via email to

[Prev in Thread] Current Thread [Next in Thread]