ICF 3.1.1.10
Technical documentation of ICF Libraries
CPreciseBlobProcessorComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iblob_CPreciseBlobProcessorComp_included
7#define iblob_CPreciseBlobProcessorComp_included
8
9
10// ICF includes
13#include <iimg/CScanlineMask.h>
14#include <imeas/INumericValue.h>
17
18
19namespace iipr
20{
21
22
27{
28public:
30
31 I_BEGIN_COMPONENT(CPreciseBlobProcessorComp);
32 I_REGISTER_SUBELEMENT(ThresholdContraints);
33 I_REGISTER_SUBELEMENT_INTERFACE(ThresholdContraints, imeas::INumericConstraints, ExtractThresholdContraints);
34 I_REGISTER_SUBELEMENT_INTERFACE(ThresholdContraints, istd::IChangeable, ExtractThresholdContraints);
35 I_ASSIGN(m_thresholdParamIdAttrPtr, "ThresholdParamId", "ID of threshold value in parameter set (imeas::INumericValue)", false, "Threshold");
36 I_ASSIGN(m_defaultThresholdCompPtr, "DefaultThreshold", "Threshold used if not specified in parameters", false, "DefaultThreshold");
37 I_ASSIGN(m_isThresholdRelativeParamIdAttrPtr, "IsThresholdRelativeParamId", "ID of flag (if threshold is relative) in parameter set (iprm::IEnableableParam)", false, "IsRelative");
38 I_ASSIGN(m_defaultIsThresholdRelativeCompPtr, "DefaultIsThresholdRelative", "Flag if the threshold is relative (if not specified in parameters)", false, "DefaultIsThresholdRelative");
39 I_ASSIGN(m_resultConsumerCompPtr, "ResultConsumer", "Consumer of result messages with geometrical layout", false, "ResultConsumer");
40 I_ASSIGN(m_tempConsumerCompPtr, "TempConsumer", "Consumer of temporary result messages with geometrical layout", false, "TempConsumer");
41 I_END_COMPONENT;
42
44 {
45 MI_FOUND_BLOB = 0x9354f0
46 };
47
49
50 // static methods
62 static bool DoCalculateBlobs(
63 const istd::CRange& valueRange,
64 bool isRangeRelative,
65 const iipr::IBlobFilterParams* filterParamsPtr,
66 const iimg::CScanlineMask& imageMask,
67 const iimg::IBitmap& image,
69 ilog::IMessageConsumer* resultConsumerPtr = nullptr,
70 ilog::IMessageConsumer* tempMessageConsumerPtr = nullptr);
71
72protected:
73 // reimplemented (iipr::CBlobProcessorCompBase)
74 virtual bool CalculateBlobs(
75 const iprm::IParamsSet* paramsPtr,
76 const iipr::IBlobFilterParams* filterParamsPtr,
77 const i2d::IObject2d* aoiPtr,
78 const iimg::IBitmap& image,
79 iipr::IFeaturesConsumer& result) override;
80
81private:
82 I_ATTR(QByteArray, m_thresholdParamIdAttrPtr);
83 I_REF(imeas::INumericValue, m_defaultThresholdCompPtr);
84 I_ATTR(QByteArray, m_isThresholdRelativeParamIdAttrPtr);
85 I_REF(iprm::IEnableableParam, m_defaultIsThresholdRelativeCompPtr);
86 I_REF(ilog::IMessageConsumer, m_resultConsumerCompPtr);
87 I_REF(ilog::IMessageConsumer, m_tempConsumerCompPtr);
88
89 // static template methods for subelement access
90 template <class InterfaceType>
91 static InterfaceType* ExtractThresholdContraints(CPreciseBlobProcessorComp& component)
92 {
93 return const_cast<imeas::CGeneralNumericConstraints*>(&component.s_thresholdContraints);
94 }
95
96 static const imath::CFixedPointManip s_thresholdPercentManip;
97 static const imath::CGeneralUnitInfo s_thresholdUnitInfo;
98 static const imeas::CGeneralNumericConstraints::Info s_thresholdMinInfo;
99 static const imeas::CGeneralNumericConstraints::Info s_thresholdMaxInfo;
100 static const imeas::CGeneralNumericConstraints s_thresholdContraints;
101};
102
103
104} // namespace iipr
105
106
107#endif // !iblob_CPreciseBlobProcessorComp_included
108
109
Common interface for describing the 2D-objects.
Definition IObject2d.h:30
Representation of a 2D-region as container of bitmap line scans.
Definition of single plane bitmap.
Definition IBitmap.h:24
Implementation of image processor using convolution kernel.
virtual bool CalculateBlobs(const iprm::IParamsSet *paramsPtr, const iipr::IBlobFilterParams *filterParamsPtr, const i2d::IObject2d *aoiPtr, const iimg::IBitmap &image, iipr::IFeaturesConsumer &result) override
static bool DoCalculateBlobs(const istd::CRange &valueRange, bool isRangeRelative, const iipr::IBlobFilterParams *filterParamsPtr, const iimg::CScanlineMask &imageMask, const iimg::IBitmap &image, iipr::IFeaturesConsumer &result, ilog::IMessageConsumer *resultConsumerPtr=nullptr, ilog::IMessageConsumer *tempMessageConsumerPtr=nullptr)
Calculate complete convolution with all parameters as static function.
Interface for parameters of the blob filtering.
Common interface for a features container consuming feature objects.
Allow to extract some features from the image.
Common interface for a message container consuming information objects (messages).
Implementation of imath::IDoubleManip interface for fixed point arithmentic.
General implementation of the IUnitInfo interface.
Simple implementation of imeas::INumericConstraints interface.
Describe additional meta information for set of numeric values.
General parameter set containing list of numeric values.
Interface for objects which can be enabled/disabled.
Set of general parameters.
Definition IParamsSet.h:29
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains the image processing classes.

© Witold Gantzke and Kirill Lepskiy