Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BlobDetectorBase.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 
26 #ifndef __BlobDetectorBase_hh__
27 #define __BlobDetectorBase_hh__
28 
29 #include <bias_config.h>
30 #include <string>
31 #include <Base/Image/Image.hh>
32 #include <Base/Math/Vector2.hh>
33 
34 
35 namespace BIAS {
36 
37  /**
38  @struct BIASBlob
39  Helper class to store blob corners
40  @author fkellner/ischiller 07/2008
41  @ingroup g_feature
42  */
43  class BIASFeatureDetector_EXPORT BIASBlob {
44  public:
45  BIASBlob(){weight=0; UL[0]=UL[1]=LR[0]=LR[1]=centerofmass[0]=centerofmass[1]=0; };
46  ~BIASBlob(){};
47 
50  unsigned int weight;
52  } ;
53 
54 
55  /**
56  @class BlobDetectorBase
57  @ingroup g_feature
58  @brief purly virtual interface defining class for blob detectors
59  @author ischiller 08/2008
60  */
61  template <class StorageType>
62  class BIASFeatureDetector_EXPORT BlobDetectorBase
63  {
64  public:
66  virtual ~BlobDetectorBase();
67 
68  /** purely virtual interface definition */
69  virtual int Detect(Image<StorageType>& image,
70  std::vector<BIAS::BIASBlob>& blobs)=0;
71 
72  ///////////////////////////////////////////////////////////////////////
73 
74  inline void SetMaxNumBlobs(const int maxnum){
75  dMaxNumBlobs_ = maxnum;
76  }
77 
78  /**
79  @brief return maximum number of blobs
80  @author ischiller
81  */
82  inline int GetMaxNumBlobs(){
83  return dMaxNumBlobs_;
84  }
85 
86  protected:
87 
88  /// maximum number of corners to return
90  }; // class
91 
92 
93 } // namespace
94 
95 #endif // __BlobDetectorBase_hh__
unsigned int weight
BIAS::Vector2< double > LR
int dMaxNumBlobs_
maximum number of corners to return
Helper class to store blob corners.
purly virtual interface defining class for blob detectors
void SetMaxNumBlobs(const int maxnum)
BIAS::Vector2< double > centerofmass
The image template class for specific storage types.
Definition: Image.hh:78
int GetMaxNumBlobs()
return maximum number of blobs