Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CornerDetectorHarris.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #ifndef __CornerDetectorHarris_hh__
26 #define __CornerDetectorHarris_hh__
27 
28 #include "CornerDetectorGradient.hh"
29 
30 namespace BIAS {
31 
32  /**
33  @class CornerDetectorHarris
34  @ingroup g_feature
35  @brief Harris corner detector, detects grey value corners in images.
36 
37  Computes Harris corners as described in:
38  [1] C. Harris, M. Stephens: A combined corner and edge detector.
39  Proceedings of the 4th Alvey Vision Conference, p.147-151, 1988.
40  Corners are found by evaluating the Eigenvalues of the structure
41  tensor matrix A. Harris and Stephens note that exact computation of
42  the eigenvalues is computationally expensive, since it requires the
43  computation of a square root, and instead suggest the following
44  cornerness function Mc, where k is a tunable sensitivity parameter:
45  (1) Mc = det(A) - k * trace(A)^2
46  Values from 0.04 to 0.15 have been found as feasible for k.
47 
48  @bug CalculationType int does not work, use float instead.
49  @author koeser 09/2004
50  */
51  template <class StorageType, class CalculationType>
52  class BIASFeatureDetector_EXPORT CornerDetectorHarris
53  : public CornerDetectorGradient<StorageType, CalculationType>
54  {
55  public:
58 
59  /** @brief Set sensitivity parameter for corner detection (should
60  be within the range 0.04 to 0.15, see also [1]).*/
61  void SetSensitivityParameter(double k) { _Scale = k; };
62 
63  /** @brief Return current value of the sensitivity parameter for
64  corner detection (see [1]).*/
65  double GetSensitivityParameter() { return _Scale; };
66 
67  protected:
68  /// weight of trace in harris approximation
69  double _Scale;
70 
71  /** @brief Computes the Harris approximation of the smaller eigenvalue of
72  the structure tensor A over the image and stores it in _Cornerness
73  (Mc = det(A) - scale * trace(A)^2). Also fills up _FeatList.
74  @author koeser 09/2004
75  @todo optimize for ROI usage */
76  virtual int _ComputeCornerness(Image<CalculationType>& Cornerness);
77  }; // class
78 
79 } // namespace
80 
81 
82 #endif // __CornerDetectorHarris_hh__
double GetSensitivityParameter()
Return current value of the sensitivity parameter for corner detection (see [1]). ...
Harris corner detector, detects grey value corners in images.
base class for all gradient based corner detectors
void SetSensitivityParameter(double k)
Set sensitivity parameter for corner detection (should be within the range 0.04 to 0...