Newsgroups: sci.image.processing,comp.graphics.algorithms
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!pipex!uunet!newsgate.watson.ibm.com!hawnews.watson.ibm.com!hawnews!admin!danebury!ricky
From: ricky@hursley.ibm.com (Rick Turner)
Subject: Re: Looking for Corner Detection Algorithm
Originator: news@hercules.hursley.ibm.com
Message-ID: <1994Nov28.084334.64487@hursley.ibm.com>
Sender: news@hursley.ibm.com (Usenet news handler)
Date: Mon, 28 Nov 1994 08:43:34 GMT
Reply-To: shadowfax@vnet.ibm.com
Disclaimer: This posting represents the poster's views, not necessarily those of IBM.
References: <3b316i$du9@fstgds15.tu-graz.ac.at> <3b5j5k$g43@falcon.ccs.uwo.ca>
Nntp-Posting-Host: danebury.hursley.ibm.com
Organization: IBM UK Laboratories Ltd.
Lines: 24
Xref: glinda.oz.cs.cmu.edu sci.image.processing:11111 comp.graphics.algorithms:10571

Detecting corners can be fairly simple - depends how well defined your
corners are. Another complication is in (say) a cube, where 3 faces meet
at a vertex, rather than two lines. Anyway, the algorithm is simple:

1) run an edge detector over the image (I use a probabilistic Canny)
2) for each edgel found, compute an 'edge histogram'. To do this, take
   a window around the edgel. Inside the window, compute the angle to all
   other edgels in the window, and store the angles in the histogram.
3) Process the edge histogram and see if this is a corner
    - straight lines give 2 peaks 180 degrees apart
    - simple corners give 2 peaks not 180 degrees apart (for the corner of
      a square seen face on, the peaks would be 90 degrees apart).
    - one peak means your line ends at that point
    - more than two peaks means you have lines that cross, or multiple edge
      vertices (like our cube). Sorting out the possible cases can be tricky.

Curves and curved corners tend to defeat this simple algorithm unless you
are very careful - in this case, you may need to combine a line follower 
with the edge histograms and process sets of histograms looking for 
changes.

If you need more info, drop me an e-mail offline.

Rick
