IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
DeepFlow2dImgLvl1.h
1 // DeepFlow2dImgLvl1.h:
3 // --------------------
4 //
14 
15 #ifndef __IPSDKIPLREGISTRATION_DEEPFLOW2DIMGLVL1_H__
16 #define __IPSDKIPLREGISTRATION_DEEPFLOW2DIMGLVL1_H__
17 
23 #include <IPSDKImage/Image/BaseImage.h>
24 
25 // Attributes headers
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/InDeepFlowParams.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InSingleImg1.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InSingleImg2.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/Optional/InOptRealSeqImg.h>
30 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1RealImg.h>
31 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk2RealImg.h>
32 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk3RealImg.h>
33 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk4RealImg.h>
34 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk5RealImg.h>
35 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk6RealImg.h>
36 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk7RealImg.h>
37 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk8RealImg.h>
38 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutRealImg1.h>
39 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutRealImg2.h>
40 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutRealSeqImg.h>
41 
42 namespace ipsdk {
43 namespace imaproc {
44 namespace registration {
45 
48 
49 // declare processor class
50 IPSDK_DECLARE_LVL1_PROCESSOR(REP_ASYNC1, IPSDKIPLRegistration, DeepFlow2dImg,
51  matchSize(_pInSingleImg1, _pInSingleImg2) &&
52  matchSize(eMatchImageSizeType::eMIST_XYZC, _pInSingleImg1, _pOutRealImg1) &&
53  ipsdk::imaproc::customImageProperty(_pOutRealSeqImg, matchDeepFlow2d(_pInSingleImg1)) &&
55  matchSize(_pInOptRealSeqImg, _pOutRealSeqImg),
57  (((ipsdk)(imaproc)(attr))(InSingleImg1))
58  (((ipsdk)(imaproc)(attr))(InSingleImg2))
59  (((ipsdk)(imaproc)(attr))(InDeepFlowParams))
60  (((ipsdk)(imaproc)(attr))(InOptRealSeqImg))
61  (((ipsdk)(imaproc)(attr))(OutOptWk1RealImg))
62  (((ipsdk)(imaproc)(attr))(OutOptWk2RealImg))
63  (((ipsdk)(imaproc)(attr))(OutOptWk3RealImg))
64  (((ipsdk)(imaproc)(attr))(OutOptWk4RealImg))
65  (((ipsdk)(imaproc)(attr))(OutOptWk5RealImg))
66  (((ipsdk)(imaproc)(attr))(OutOptWk6RealImg))
67  (((ipsdk)(imaproc)(attr))(OutOptWk7RealImg))
68  (((ipsdk)(imaproc)(attr))(OutOptWk8RealImg))
69  (((ipsdk)(imaproc)(attr))(OutRealImg1)(customOutput)(createSeqFromImage(_pInSingleImg1, 2)))
70  (((ipsdk)(imaproc)(attr))(OutRealImg2)(customOutput)(createSeqFromImage(_pInSingleImg1, 2)))
71  (((ipsdk)(imaproc)(attr))(OutRealSeqImg)(customOutput)(outputDeepFlow2d(_pInSingleImg1))))
72 
73 // methods
74 public:
75 
76 protected:
80 
81  processor::RetrievalResult provideProcessor(const boost::shared_ptr<core::BaseAction>& pProcessor,
82  const core::BasePriority& priority,
83  core::ActionProviderPtr& pProvider);
84 
85 
86  processor::RetrievalResult gaussianSmoothing(const ipsdk::image::ImageConstPtr& pInImg,
87  const ipsdk::image::ImagePtr& pOutImg,
88  const ipsdk::ipReal32& sigma,
89  const core::BasePriority& priority,
90  core::ActionProviderPtr& pProvider);
91 
92 
93  processor::RetrievalResult meanSmoothing(const ipReal64 factor,
94  const core::BasePriority& priority,
95  core::ActionProviderPtr& pProvider);
96 
97  processor::RetrievalResult erase(const core::BasePriority& priority,
98  core::ActionProviderPtr& pProvider,
99  const ipsdk::image::ImagePtr& pOutImg);
100 
102  const ipsdk::image::ImagePtr& pOutImg,
103  const core::BasePriority& priority,
104  core::ActionProviderPtr& pProvider);
105 
106  processor::RetrievalResult multiplyScalar(const core::BasePriority& priority,
107  core::ActionProviderPtr& pProvider);
108 
109  processor::RetrievalResult copy(const core::BasePriority& priority,
110  core::ActionProviderPtr& pProvider);
111 
112  processor::RetrievalResult calc(const core::BasePriority& priority,
113  core::ActionProviderPtr& pProvider);
114 
115  BoolResult allocCurScale();
116  BoolResult allocForLevel(const boost::shared_ptr<BaseInputImageAttribute>& pInImgAttr,
117  const boost::shared_ptr<BaseOutputImageAttribute>& pOutImgAttr,
118  const ipUInt32 level, const ipUInt64 nbFrames);
119  BoolResult allocForLevel(const boost::shared_ptr<BaseOutputImageAttribute>& pInImgAttr,
120  const boost::shared_ptr<BaseOutputImageAttribute>& pOutImgAttr,
121  const ipUInt32 level);
122 
123 // attributes
124 protected:
127  ipUInt32 _nbLayers;
128 
130  ipUInt32 _level;
131 
133  ipBool _bCopyPerformed;
134 };
135 
138 
139 } // end of namespace registration
140 } // end of namespace imaproc
141 } // end of namespace ipsdk
142 
143 #endif // __IPSDKIPLREGISTRATION_DEEPFLOW2DIMGLVL1_H__
ProcessingResult< eRetrievalResultType > RetrievalResult
IPSDK_FORCEINLINE void copy(T *dest, const T *src, ipUInt64 nbElts)
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
uint64_t ipUInt64
IPSDKIPLREGISTRATION_API CustomImageInfoPtr createSeqFromImage(const ImageAttributeConstPtr &pInputAttribute, const ipUInt32 nbFrames)
Initializer for a sequence according to a given image.
IPSDKBASEPROCESSING_API RulePtr none()
boost::shared_ptr< BaseImage > ImagePtr
double ipReal64
ipsdk::core::ExecResult preProcess()
method called before processing
utility functions for DeepFlowing transformation output attribute initialization management ...
Definition of import/export macro for library.
Utility functions for Deep Flow parameters.
processor::OutputInitializerPtr customOutput(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo)
CustomCheckedImagePropertyPtr matchDeepFlow2d(const ImageAttributeConstPtr &pInputAttribute)
rule allowing to check motion transform warping parameters validity
boost::shared_ptr< const BaseImage > ImageConstPtr
bool ipBool
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type isSet(const boost::shared_ptr< AttributeType > &pAttribute)
boost::shared_ptr< BaseActionProvider > ActionProviderPtr
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafCollType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_LeafColl > >::type >::type, RulePtr >::type matchSize(const boost::shared_ptr< AttributeType > &pAttribute, const ipUInt32 targetSize)
IPSDKIPLREGISTRATION_API CustomImageInfoPtr outputDeepFlow2d(const ImageAttributeConstPtr &pInputAttribute)
function allowing to create a "DeepFlow transformation 2d" image initializer
IPSDKBASEPROCESSING_API RulePtr If(const RulePtr &pPredicate, const RulePtr &pRuleTrue)
float ipReal32
uint32_t ipUInt32