help-octave
[Top][All Lists]
Advanced

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

Re: octave equivalent for Harris corner detector


From: Carnë Draug
Subject: Re: octave equivalent for Harris corner detector
Date: Sun, 17 Feb 2013 17:04:38 +0000

On 14 February 2013 18:00,  <address@hidden> wrote:
> Message: 1
> Date: Thu, 14 Feb 2013 22:00:44 +0530
> From: Seetha Parameswaran <address@hidden>
> To: "address@hidden" <address@hidden>
> Subject: octave equivalent for Harris corner detector
> Message-ID:
>         <address@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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(:)'];

The matlab function to perform this is named "corner" but it's not
implemented yet. If you can write it, I'll gladly add it to the image
package.

Carnë


reply via email to

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