CPreciseBlobProcessorComp.h
Go to the documentation of this file.
1 #ifndef iblob_CPreciseBlobProcessorComp_included
2 #define iblob_CPreciseBlobProcessorComp_included
3 
4 
5 // ACF includes
7 #include <iimg/CScanlineMask.h>
8 
9 // ACF-Solutions includes
10 #include <imeas/INumericValue.h>
13 
14 
15 namespace iblob
16 {
17 
18 
23 {
24 public:
26 
27  I_BEGIN_COMPONENT(CPreciseBlobProcessorComp);
28  I_REGISTER_SUBELEMENT(ThresholdContraints);
29  I_REGISTER_SUBELEMENT_INTERFACE(ThresholdContraints, imeas::INumericConstraints, ExtractThresholdContraints);
30  I_REGISTER_SUBELEMENT_INTERFACE(ThresholdContraints, istd::IChangeable, ExtractThresholdContraints);
31  I_ASSIGN(m_thresholdParamIdAttrPtr, "ThresholdParamId", "ID of threshold value in parameter set (imeas::INumericValue)", false, "Threshold");
32  I_ASSIGN(m_defaultThresholdCompPtr, "DefaultThreshold", "Threshold used if not specified in parameters", false, "DefaultThreshold");
33  I_ASSIGN(m_isThresholdRelativeParamIdAttrPtr, "IsThresholdRelativeParamId", "ID of flag (if threshold is relative) in parameter set (iprm::IEnableableParam)", false, "IsRelative");
34  I_ASSIGN(m_defaultIsThresholdRelativeCompPtr, "DefaultIsThresholdRelative", "Flag if the threshold is relative (if not specified in parameters)", false, "DefaultIsThresholdRelative");
35  I_ASSIGN(m_resultConsumerCompPtr, "ResultConsumer", "Consumer of result messages with geometrical layout", false, "ResultConsumer");
36  I_ASSIGN(m_tempConsumerCompPtr, "TempConsumer", "Consumer of temporary result messages with geometrical layout", false, "TempConsumer");
37  I_END_COMPONENT;
38 
39  enum MessageId
40  {
41  MI_FOUND_BLOB = 0x9354f0
42  };
43 
45 
46  // static methods
58  static bool DoCalculateBlobs(
59  const istd::CRange& valueRange,
60  bool isRangeRelative,
61  const iblob::IBlobFilterParams* filterParamsPtr,
62  const iimg::CScanlineMask& imageMask,
63  const iimg::IBitmap& image,
65  ilog::IMessageConsumer* resultConsumerPtr = NULL,
66  ilog::IMessageConsumer* tempMessageConsumerPtr = NULL);
67 
68 protected:
69  // reimplemented (iblob::CBlobProcessorCompBase)
70  virtual bool CalculateBlobs(
71  const iprm::IParamsSet* paramsPtr,
72  const iblob::IBlobFilterParams* filterParamsPtr,
73  const i2d::IObject2d* aoiPtr,
74  const iimg::IBitmap& image,
75  iipr::IFeaturesConsumer& result);
76 
77 private:
78  I_ATTR(QByteArray, m_thresholdParamIdAttrPtr);
79  I_REF(imeas::INumericValue, m_defaultThresholdCompPtr);
80  I_ATTR(QByteArray, m_isThresholdRelativeParamIdAttrPtr);
81  I_REF(iprm::IEnableableParam, m_defaultIsThresholdRelativeCompPtr);
82  I_REF(ilog::IMessageConsumer, m_resultConsumerCompPtr);
83  I_REF(ilog::IMessageConsumer, m_tempConsumerCompPtr);
84 
85  // static template methods for subelement access
86  template <class InterfaceType>
87  static InterfaceType* ExtractThresholdContraints(CPreciseBlobProcessorComp& component)
88  {
89  return &component.m_thresholdContraints;
90  }
91 
92  imeas::CGeneralNumericConstraints m_thresholdContraints;
93 };
94 
95 
96 } // namespace iblob
97 
98 
99 #endif // !iblob_CPreciseBlobProcessorComp_included
100 
101 
virtual bool CalculateBlobs(const iprm::IParamsSet *paramsPtr, const iblob::IBlobFilterParams *filterParamsPtr, const i2d::IObject2d *aoiPtr, const iimg::IBitmap &image, iipr::IFeaturesConsumer &result)
static bool DoCalculateBlobs(const istd::CRange &valueRange, bool isRangeRelative, const iblob::IBlobFilterParams *filterParamsPtr, const iimg::CScanlineMask &imageMask, const iimg::IBitmap &image, iipr::IFeaturesConsumer &result, ilog::IMessageConsumer *resultConsumerPtr=NULL, ilog::IMessageConsumer *tempMessageConsumerPtr=NULL)
Calculate complete convolution with all parameters as static function.
Describe additional meta information for set of numeric values.
Implementation of image processor using convolution kernel.
General parameter set containing list of numeric values.
Definition: INumericValue.h:20
Common interface for a features container consuming feature objects.
Interface for parameters of the blob filtering.
Simple implementation of imeas::INumericConstraints interface.

© 2007-2017 Witold Gantzke and Kirill Lepskiy