IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
FastCrossCorrelation2dImgLvl2.h
1 // FastCrossCorrelation2dImgLvl2.h:
3 // --------------------------------
4 //
14 
15 #ifndef __IPSDKIPLFILTERING_FASTCROSSCORRELATION2DIMGLVL2_H__
16 #define __IPSDKIPLFILTERING_FASTCROSSCORRELATION2DIMGLVL2_H__
17 
22 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/StatsResult.h>
23 
24 // Attributes headers
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/SubImage/Input/2d/InSubImg2d1.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/SubImage/Input/2d/InSubImg2d2.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutRealImg.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk1RealImg.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk2RealImg.h>
30 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk3RealImg.h>
31 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk4RealImg.h>
32 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1RealImg.h>
33 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk2RealImg.h>
34 
35 namespace ipsdk {
36 namespace imaproc {
37 namespace filter {
38 
41 
42 // declare processor class
43 IPSDK_DECLARE_LVL2_PROCESSOR(REP_ASYNC1, IPSDKIPLFiltering, FastCrossCorrelation2dImg,
44  ipsdk::imaproc::customImageProperty(_pInSubImg2d2, fastCCRule2d(_pInSubImg2d1, _pInSubImg2d2)) &&
45  ipsdk::imaproc::matchSize(_pInSubImg2d1, _pOutWk1RealImg) &&
46  ipsdk::imaproc::matchSize(_pInSubImg2d1, _pOutWk2RealImg) &&
47  ipsdk::imaproc::matchSize(_pInSubImg2d1, _pOutWk3RealImg) &&
48  ipsdk::imaproc::matchSize(_pInSubImg2d1, _pOutWk4RealImg) &&
49  ipsdk::imaproc::matchSize(_pInSubImg2d1, _pOutRealImg) &&
50  (ipsdk::processor::ifIsSet(_pOutOptWk1RealImg,
51  (ipsdk::imaproc::matchSize(_pInSubImg2d2, _pOutOptWk1RealImg)) &&
52  (ipsdk::imaproc::noInSitu(_pInSubImg2d2, _pOutOptWk1RealImg)) &&
53  (ipsdk::imaproc::noInSitu(_pOutWk1RealImg, _pOutOptWk1RealImg)) &&
54  (ipsdk::imaproc::noInSitu(_pOutWk2RealImg, _pOutOptWk1RealImg)) &&
55  (ipsdk::imaproc::noInSitu(_pOutWk3RealImg, _pOutOptWk1RealImg)) &&
56  (ipsdk::imaproc::noInSitu(_pOutWk4RealImg, _pOutOptWk1RealImg)) &&
57  (ipsdk::imaproc::noInSitu(_pOutRealImg, _pOutOptWk1RealImg)))) &&
58  (ipsdk::processor::ifIsSet(_pOutOptWk2RealImg,
59  (ipsdk::imaproc::matchSize(_pInSubImg2d1, _pOutOptWk2RealImg)) &&
60  (ipsdk::imaproc::noInSitu(_pInSubImg2d1, _pOutOptWk2RealImg)) &&
61  (ipsdk::imaproc::noInSitu(_pOutWk1RealImg, _pOutOptWk2RealImg)) &&
62  (ipsdk::imaproc::noInSitu(_pOutWk2RealImg, _pOutOptWk2RealImg)) &&
63  (ipsdk::imaproc::noInSitu(_pOutWk3RealImg, _pOutOptWk2RealImg)) &&
64  (ipsdk::imaproc::noInSitu(_pOutWk4RealImg, _pOutOptWk2RealImg)) &&
65  (ipsdk::imaproc::noInSitu(_pOutRealImg, _pOutOptWk2RealImg)))),
66  (((ipsdk)(imaproc)(attr))(InSubImg2d1))
67  (((ipsdk)(imaproc)(attr))(InSubImg2d2))
68  (((ipsdk)(imaproc)(attr))(OutOptWk1RealImg))
69  (((ipsdk)(imaproc)(attr))(OutOptWk2RealImg))
70  (((ipsdk)(imaproc)(attr))(OutWk1RealImg))
71  (((ipsdk)(imaproc)(attr))(OutWk2RealImg))
72  (((ipsdk)(imaproc)(attr))(OutWk3RealImg))
73  (((ipsdk)(imaproc)(attr))(OutWk4RealImg))
74  (((ipsdk)(imaproc)(attr))(OutRealImg)))
75 
76 // methods
77 public:
78 
79 protected:
83 
84  processor::RetrievalResult provideProcessor(const boost::shared_ptr<core::BaseAction>& pProcessor,
85  const core::BasePriority& priority,
86  core::ActionProviderPtr& pProvider);
87 
88  processor::RetrievalResult meanSmoothing(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
89  processor::RetrievalResult subtractImg(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
90  processor::RetrievalResult stats(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
91  processor::RetrievalResult addScalar(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
92  processor::RetrievalResult erase(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
93  processor::RetrievalResult convert(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
94  processor::RetrievalResult putROI(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
95  processor::RetrievalResult fft(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
96  processor::RetrievalResult conjugate(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
97  processor::RetrievalResult complexMultiply(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
98  processor::RetrievalResult ifft(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
99 
100 // attributes
101 protected:
102  ipBool _bPaddTemplateImg;
103 
106  std::vector <FunctionType> _vFctCalls;
107 
110  ipsdk::image::ImagePtr _pOutImgRe;
111  ipsdk::image::ImagePtr _pOutImgIm;
113 
114 };
115 
118 
119 } // end of namespace filter
120 } // end of namespace imaproc
121 } // end of namespace ipsdk
122 
123 #endif // __IPSDKIPLFILTERING_FASTCROSSCORRELATION2DIMGLVL2_H__
ProcessingResult< eRetrievalResultType > RetrievalResult
#define IPSDK_DECLARE_LVL2_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
Utility functions for fast Cross-Correlation attribute rules management.
boost::shared_ptr< BaseImage > ImagePtr
ipsdk::core::ExecResult preProcess()
method called before processing
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type ifIsSet(const boost::shared_ptr< AttributeType > &pAttribute, const RulePtr &pRuleTrue)
IPSDK_FORCEINLINE void complexMultiply(const simd::Pack< IS, T > &packIn1Re, const simd::Pack< IS, T > &packIn1Im, const simd::Pack< IS, T > &packIn2Re, const simd::Pack< IS, T > &packIn2Im, simd::Pack< IS, T > &packOutRe, simd::Pack< IS, T > &packOutIm)
IPSDKGEOMETRY_API Vector2d convert(const Point2d< T > &pt)
boost::shared_ptr< const BaseImage > ImageConstPtr
bool ipBool
boost::shared_ptr< BaseActionProvider > ActionProviderPtr
Definition of import/export macro for library.
Level 2 algorithm: 2D Cross correlation calculated in the Fourier domain.
Definition: FastCrossCorrelation2dImgLvl2.h:99
boost::shared_ptr< ipsdk::imaproc::attr::StatsResult > StatsResultPtr
shared pointer to ipsdk::imaproc::attr::StatsResult
Definition: StatsResult.h:206
IPSDKIPLFILTERING_API CustomCheckedImagePropertyPtr fastCCRule2d(const ImageAttributeConstPtr &pInput1Attribute, const ImageAttributeConstPtr &pInput2Attribute)
function allowing to define output image 2d size is smaller than the input image or a target size ...