ICF 3.0.5.47
Technical documentation of ICF Libraries
CHoughLineFromPosFinderComp.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 iipr_CHoughLineFromPosFinderComp_included
7#define iipr_CHoughLineFromPosFinderComp_included
8
9
10// ICF includes
14#include <i2d/CLine2d.h>
15#include <i2d/CPolypoint.h>
19#include <ialgo/CHoughSpace2d.h>
21
22
23namespace iipr
24{
25
26
33 public iproc::TSyncProcessorWrap<IFeatureToFeatureProcessor>
34{
35public:
36 typedef QList<i2d::CLine2d> Lines;
37
39
40 I_BEGIN_COMPONENT(CHoughLineFromPosFinderComp);
41 I_REGISTER_INTERFACE(iproc::IProcessor);
42 I_REGISTER_INTERFACE(IFeatureToFeatureProcessor);
43 I_ASSIGN(m_defaultAngleResAttrPtr, "DefaultAngleResulution", "Resolution of angle grid", true, 360);
44 I_ASSIGN(m_defaultRadiusResAttrPtr, "DefaultRadiusResulution", "Resolution of radius grid", true, 360);
45 I_ASSIGN(m_maxLinesParamIdAttrPtr, "MaxLinesParamId", "ID of max lines parameter in parameter set (imeas::INumericValue)", true, "MaxLines");
46 I_ASSIGN(m_defaultMaxLinesParamCompPtr, "DefaultMaxLinesParam", "Default value of parameter controlling number of maximal found lines", true, "DefaultMaxLinesParam");
47 I_ASSIGN(m_directionParamIdAttrPtr, "DirectionParamId", "ID of direction parameter in parameter set (i2d::IObject2d - line or position)", true, "Direction");
48 I_ASSIGN(m_defaultDirectionParamCompPtr, "DefaultDirectionParam", "Default value of parameter controlling direction", true, "DefaultDirectionParam");
49 I_ASSIGN(m_defaultSmoothKernelAttrPtr, "DefaultSpaceSmoothKernel", "Size of kernel will be used to smooth hough space", true, 10);
50 I_ASSIGN(m_resultConsumerCompPtr, "ResultConsumer", "Consumer of result messages with geometrical layout", false, "ResultConsumer");
51 I_ASSIGN(m_tempConsumerCompPtr, "TempConsumer", "Consumer of temporary result messages with geometrical layout", false, "TempConsumer");
52 I_END_COMPONENT;
53
55 {
56 FOUND_LINE = 0x934d750,
58 };
59
60 // reimplemented (iipr::IFeatureToFeatureProcessor)
62 const iprm::IParamsSet* paramsPtr,
63 const IFeaturesProvider& container,
64 IFeaturesConsumer& results) override;
65
66 // reimplemented (iproc::IProcessor)
68 const iprm::IParamsSet* paramsPtr,
69 const istd::IPolymorphic* inputPtr,
70 istd::IChangeable* outputPtr,
71 bool allowAsync = false,
72 iproc::IProgressManager* progressManagerPtr = nullptr) override;
73
74protected:
75 virtual bool FindLines(
76 const iprm::IParamsSet* paramsPtr,
77 int maxLines,
78 const i2d::CPolypoint& points,
79 IFeaturesConsumer& results);
80
82 i2d::CVector2d CalcHoughPos(const i2d::CVector2d& point1, const i2d::CVector2d& point2) const;
84 void UpdateHoughSpace(const i2d::CVector2d& point1, const i2d::CVector2d& point2);
85
86 // reimplemented (icomp::CComponentBase)
87 void OnComponentCreated() override;
88
89private:
91
92 I_ATTR(QByteArray, m_aoiParamIdAttrPtr);
93 I_ATTR(int, m_defaultAngleResAttrPtr);
94 I_ATTR(int, m_defaultRadiusResAttrPtr);
95 I_ATTR(QByteArray, m_maxLinesParamIdAttrPtr);
96 I_REF(imeas::INumericValue, m_defaultMaxLinesParamCompPtr);
97 I_ATTR(QByteArray, m_directionParamIdAttrPtr);
98 I_REF(i2d::IObject2d, m_defaultDirectionParamCompPtr);
99 I_ATTR(int, m_defaultSmoothKernelAttrPtr);
100 I_REF(ilog::IMessageConsumer, m_resultConsumerCompPtr);
101 I_REF(ilog::IMessageConsumer, m_tempConsumerCompPtr);
102
103 ialgo::CHoughSpace2d m_houghSpace;
104 i2d::CVector2d m_direction;
105 double m_directionAngleTolerance;
106};
107
108
109} // namespace iipr
110
111
112#endif // !iipr_CHoughLineFromPosFinderComp_included
113
114
Definition of a line in 2D-space.
Definition CLine2d.h:26
Definition of the data model for a polygon.
Definition CPolypoint.h:25
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Common interface for describing the 2D-objects.
Definition IObject2d.h:30
Hough space used for 2d Hough transformations.
Finder using Hough transformation to find the lines from the point cloud.
i2d::CVector2d CalcHoughPos(const i2d::CVector2d &point1, const i2d::CVector2d &point2) const
virtual bool FindLines(const iprm::IParamsSet *paramsPtr, int maxLines, const i2d::CPolypoint &points, IFeaturesConsumer &results)
void UpdateHoughSpace(const i2d::CVector2d &point1, const i2d::CVector2d &point2)
i2d::CLine2d CalcCorrespondingLine(const i2d::CVector2d &houghPos) const
virtual iproc::CTaskState DoProcessing(const iprm::IParamsSet *paramsPtr, const istd::IPolymorphic *inputPtr, istd::IChangeable *outputPtr, bool allowAsync=false, iproc::IProgressManager *progressManagerPtr=nullptr) override
virtual iproc::CTaskState DoConvertFeatures(const iprm::IParamsSet *paramsPtr, const IFeaturesProvider &container, IFeaturesConsumer &results) override
Allow to extract some features from another one.
Common interface for a features container consuming feature objects.
Container allowing access to features.
Wrapper allowing to create feature object from some another serializable one.
Common interface for a message container consuming information objects (messages).
Wrapper provider of log-functionality for component based implementations.
General parameter set containing list of numeric values.
Set of general parameters.
Definition IParamsSet.h:29
Represent state of asynchronous operation.
Definition CTaskState.h:28
Interface for all synchrone and asynchrone processors with "push data" model.
Definition IProcessor.h:26
Consume information about progress of some process.
Wrapper of iproc::IProcessor for simple synchrone processor implementations.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains the image processing classes.

© Witold Gantzke and Kirill Lepskiy