TIHoughSpace.h
Go to the documentation of this file.
1 #ifndef ialgo_TIHoughSpace_included
2 #define ialgo_TIHoughSpace_included
3 
4 
5 // Qt includes
6 #include <QtCore/QMultiMap>
7 
8 // ACF includes
9 #include <istd/TIndex.h>
10 #include <imath/TVector.h>
11 
12 
13 namespace ialgo
14 {
15 
16 
20 template <int Dimensions, class Element = double>
21 class TIHoughSpace: virtual public iser::ISerializable
22 {
23 public:
24  class ResultsConsumer: virtual public istd::IPolymorphic
25  {
26  public:
31  virtual QList<int> GetSupportedNeghboursCount() const = 0;
32 
36  virtual void OnProcessingBegin(
38  const Element& minValue) = 0;
42  virtual void OnProcessingEnd(const TIHoughSpace<Dimensions, Element>& space) = 0;
53  virtual bool OnMaximumFound(
55  const istd::TIndex<Dimensions>& position,
56  const Element& value,
57  const Element* neghboursPtr,
58  int neghboursCount,
59  Element& minValue) = 0;
60  };
61 
66  {
79  };
80 
84  virtual istd::TIndex<Dimensions> GetSpaceSize() const = 0;
85 
89  virtual bool CreateHoughSpace(const istd::TIndex<Dimensions>& size, const Element& initValue = 0) = 0;
90 
94  virtual bool IsDimensionWrapped(int dimensionIndex) const = 0;
95 
99  virtual ExtensionMode GetExtensionMode(int dimensionIndex) const = 0;
100 
104  virtual void IncreaseValueAt(const imath::TVector<Dimensions>& position, Element value) = 0;
105 
109  virtual void SmoothHoughSpace(const istd::TIndex<Dimensions>& iterations) = 0;
115  virtual bool AnalyseHoughSpace(
116  const Element& minValue,
117  ResultsConsumer& resultProcessor) const = 0;
118 
122  virtual bool ExtractToBitmap(iimg::IBitmap& bitmap) const = 0;
123 
129  virtual bool GetSpacePosition(const imath::TVector<Dimensions>& position, imath::TVector<Dimensions>& result) const = 0;
130 
134  virtual double GetSpaceDistance(const imath::TVector<Dimensions>& position1, const imath::TVector<Dimensions>& position2) const = 0;
135 
139  virtual double GetSpaceDistance2(const imath::TVector<Dimensions>& position1, const imath::TVector<Dimensions>& position2) const = 0;
140 };
141 
142 
143 } // namespace ialgo
144 
145 
146 #endif // !ialgo_TIHoughSpace_included
147 
148 
Space extension mode is unknown.
Definition: TIHoughSpace.h:70
ExtensionMode
Describe how the space is extended, it means how the area outside of space should be interpreted...
Definition: TIHoughSpace.h:65
virtual bool OnMaximumFound(const TIHoughSpace< Dimensions, Element > &space, const istd::TIndex< Dimensions > &position, const Element &value, const Element *neghboursPtr, int neghboursCount, Element &minValue)=0
Will be called when some local maximum is reached.
Space is calculated as it is extended with the same values as border value.
Definition: TIHoughSpace.h:78
virtual void IncreaseValueAt(const imath::TVector< Dimensions > &position, Element value)=0
Increase the value at specified position.
virtual bool ExtractToBitmap(iimg::IBitmap &bitmap) const =0
Extract this Hough space to some gray scale bitmap.
virtual void SmoothHoughSpace(const istd::TIndex< Dimensions > &iterations)=0
Smooth this space with specified stronness.
virtual QList< int > GetSupportedNeghboursCount() const =0
Get list of number of neighbours supprted by this consumer.
virtual void OnProcessingBegin(const TIHoughSpace< Dimensions, Element > &space, const Element &minValue)=0
Called when processing is started.
virtual istd::TIndex< Dimensions > GetSpaceSize() const =0
Get size of this Hough space.
virtual double GetSpaceDistance(const imath::TVector< Dimensions > &position1, const imath::TVector< Dimensions > &position2) const =0
Get distance between two hough space positions considering the space wrapping.
virtual double GetSpaceDistance2(const imath::TVector< Dimensions > &position1, const imath::TVector< Dimensions > &position2) const =0
Get square of distance between two hough space positions considering the space wrapping.
virtual bool GetSpacePosition(const imath::TVector< Dimensions > &position, imath::TVector< Dimensions > &result) const =0
Get position in space for some input.
virtual bool IsDimensionWrapped(int dimensionIndex) const =0
Check if this space is wrapped horizontaly, it means the the left pixel is neighbour of the right one...
virtual ExtensionMode GetExtensionMode(int dimensionIndex) const =0
Get extension mode for single dimension.
Space is calculated as it is extended with zeroes.
Definition: TIHoughSpace.h:74
Template interface for Hough space.
Definition: TIHoughSpace.h:21
virtual bool CreateHoughSpace(const istd::TIndex< Dimensions > &size, const Element &initValue=0)=0
Create Hough space with specified size.
virtual void OnProcessingEnd(const TIHoughSpace< Dimensions, Element > &space)=0
Called when processing is finished.
virtual bool AnalyseHoughSpace(const Element &minValue, ResultsConsumer &resultProcessor) const =0
Analyse this Hough space to find set of local maximums.

© 2007-2017 Witold Gantzke and Kirill Lepskiy