Thread Subject: Harris Corner Detection (Help me about theory and programs)

Subject: Harris Corner Detection (Help me about theory and programs)

From: Gavrilo Bozovic

Date: 26 Jun, 2008 06:30:19

Message: 1 of 4

This question doesn't have anything to do with Matlab, does it?

Start looking here:

http://en.wikipedia.org/wiki/Harris_affine_region_detector

And then, don't forget that Google is your friend for such
problems ;-)

Subject: Harris Corner Detection (Help me about theory and programs)

From: Novina Soraya

Date: 30 Jun, 2008 08:14:01

Message: 2 of 4

how do i read this Matlab program:
input_im=double(grayscale_image);


sigma_g=1.5;
sigma_a=5;
nPoints=30;

[EnIm]= HarrisCorner(input_im,sigma_g,sigma_a,0.04,0);

function [harris_energy] = HarrisCorner
(in,sigma_g,sigma_a,k,method)

in=double(in);

if(method==0)
    Lx=gDer(sum(in,3),sigma_g,1,0);
    Ly=gDer(sum(in,3),sigma_g,0,1);
end

Lx2=Lx.^2;
Ly2=Ly.^2;
LxLy=Lx.*Ly;

Lx2=gDer(Lx2,sigma_a,0,0);
Ly2=gDer(Ly2,sigma_a,0,0);
LxLy=gDer(LxLy,sigma_a,0,0);

harris_energy = Lx2.*Ly2-LxLy.^2-k*(Lx2+Ly2).^2;

function [H]= gDer(f,sigma, iorder,jorder)

f=f;

x=-3:3;

Gauss=1/(sqrt(2 * pi) * sigma)* exp((x.^2)/(-2 * sigma *
sigma) );

switch(iorder)
case 0
    Gx= Gauss/sum(Gauss);
case 1
    Gx = -(x/sigma^2).*Gauss;
    Gx = Gx./(sum(sum(x.*Gx)));
end

H = filter2(Gx,f);

switch(jorder)
case 0
    Gy= Gauss/sum(Gauss);
case 1
    Gy = -(x/sigma^2).*Gauss;
    Gy = Gy./(sum(sum(x.*Gy)));

end
H = filter2(Gy',H);

"would u help me to understand it, Gavrilo??"


"Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in
message <g3vd1r$ebi$1@fred.mathworks.com>...
> This question doesn't have anything to do with Matlab,
does it?
>
> Start looking here:
>
> http://en.wikipedia.org/wiki/Harris_affine_region_detector
>
> And then, don't forget that Google is your friend for such
> problems ;-)

Subject: Harris Corner Detection (Help me about theory and programs)

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 30 Jun, 2008 09:25:52

Message: 3 of 4

In article <g4a4k9$ih$1@fred.mathworks.com>,
Novina Soraya <nov_inspired@yahoo.com> wrote:
>how do i read this Matlab program:

Please be more specific in your question. If you are unfamiliar with
matlab code in general, please read the Getting Started section
of the matlab help information. If there are built-in functions
that you are unfamiliar with, then the Matlab help will explain
them (sometimes admittedly not very thoroughly.)


>function [harris_energy] = HarrisCorner
>(in,sigma_g,sigma_a,k,method)

>if(method==0)
> Lx=gDer(sum(in,3),sigma_g,1,0);
> Ly=gDer(sum(in,3),sigma_g,0,1);
>end
>
>Lx2=Lx.^2;
>Ly2=Ly.^2;

I would read those lines as indicating that method *must* be 0.
If it were any other value, then neither Lx nor Ly would have
been assigned a value by the time that the Lx2 and Ly2 assignments
were to be executed.
--
  "There is no greater calling than to serve your fellow men.
   There is no greater contribution than to help the weak.
   There is no greater satisfaction than to have done it well."
                                              -- Walter Reuther

Subject: Harris Corner Detection (Help me about theory and programs)

From: Jonas

Date: 12 Aug, 2009 15:22:19

Message: 4 of 4

"Novina Soraya" <nov_inspired@yahoo.com> wrote in message <g4a4k9$ih$1@fred.mathworks.com>...

> function [harris_energy] = HarrisCorner
> (in,sigma_g,sigma_a,k,method)
>
> in=double(in);
>
> if(method==0)
> Lx=gDer(sum(in,3),sigma_g,1,0);
> Ly=gDer(sum(in,3),sigma_g,0,1);
> end
>
> Lx2=Lx.^2;
> Ly2=Ly.^2;
> LxLy=Lx.*Ly;
>
> Lx2=gDer(Lx2,sigma_a,0,0);
> Ly2=gDer(Ly2,sigma_a,0,0);
> LxLy=gDer(LxLy,sigma_a,0,0);
>
> harris_energy = Lx2.*Ly2-LxLy.^2-k*(Lx2+Ly2).^2;
>
> function [H]= gDer(f,sigma, iorder,jorder)
>
> f=f;
>
> x=-3:3;
>
> Gauss=1/(sqrt(2 * pi) * sigma)* exp((x.^2)/(-2 * sigma *
> sigma) );
>
> switch(iorder)
> case 0
> Gx= Gauss/sum(Gauss);
> case 1
> Gx = -(x/sigma^2).*Gauss;
> Gx = Gx./(sum(sum(x.*Gx)));
> end
>
> H = filter2(Gx,f);
>
> switch(jorder)
> case 0
> Gy= Gauss/sum(Gauss);
> case 1
> Gy = -(x/sigma^2).*Gauss;
> Gy = Gy./(sum(sum(x.*Gy)));
>
> end
> H = filter2(Gy',H);

This code is really good - where is it from? who wrote it? i hate using code without accrediting the author...

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com