IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
KMeansPosterizeImgLvl1.h
1 // KMeansPosterizeImgLvl1.h:
3 // -------------------------
4 //
14 
15 #ifndef __IPSDKIPLCLASSIFICATION_KMEANSPOSTERIZEIMGLVL1_H__
16 #define __IPSDKIPLCLASSIFICATION_KMEANSPOSTERIZEIMGLVL1_H__
17 
22 
23 // Attributes headers
24 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/InClustersCenters.h>
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InClassImg.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InHomogeneousImg.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutPosterizedImg.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/Doubles.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/Optional/InOptSingleGreyMaskImg.h>
30 
31 namespace ipsdk {
32 namespace imaproc {
33 namespace classif {
34 
37 
38 // declare processor class
39 IPSDK_DECLARE_LVL1_PROCESSOR(ASYNC1, IPSDKIPLClassification, KMeansPosterizeImg,
40  ipsdk::imaproc::matchSize(eMatchImageSizeType::eMIST_3d, _pInHomogeneousImg, _pInClassImg) &&
41  ipsdk::imaproc::classif::clustersCentersCollMatchImgSize(_pInClustersCenters, _pInHomogeneousImg) &&
42  ipsdk::imaproc::matchSizeAndType(_pInHomogeneousImg, _pOutPosterizedImg) &&
43  ipsdk::processor::If(ipsdk::processor::isSet(_pInOptSingleGreyMaskImg),
44  ipsdk::imaproc::matchSize(eMatchImageSizeType::eMIST_3d, _pInHomogeneousImg, _pInOptSingleGreyMaskImg),
46  (((ipsdk)(imaproc)(attr))(InHomogeneousImg))
47  (((ipsdk)(imaproc)(attr))(InClustersCenters))
48  (((ipsdk)(imaproc)(attr))(InClassImg))
49  (((ipsdk)(imaproc)(attr))(InOptSingleGreyMaskImg))
50  (((ipsdk)(imaproc)(attr))(OutPosterizedImg)(ipsdk::imaproc::duplicateInOut)(_pInHomogeneousImg)))
51 
52 // methods
53 public:
54 
55 protected:
56 
57 // attributes
58 protected:
59  attr::DoublesPtr _pFlattenedClustersCenters;
60 };
61 
64 
65 } // end of namespace classif
66 } // end of namespace imaproc
67 } // end of namespace ipsdk
68 
69 #endif // __IPSDKIPLCLASSIFICATION_KMEANSPOSTERIZEIMGLVL1_H__
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
IPSDKBASEPROCESSING_API RulePtr none()
Utility functions for K-Means attribute rules management.
processor::OutputInitializerPtr duplicateInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
boost::shared_ptr< ipsdk::imaproc::attr::Doubles > DoublesPtr
shared pointer to ipsdk::imaproc::Doubles
Definition: Doubles.h:124
Definition of import/export macro for library.
IPSDKIPLCLASSIFICATION_API boost::shared_ptr< processor::BaseNodeCollRule > clustersCentersCollMatchImgSize(const boost::shared_ptr< const attr::InClustersCenters > &pClustersCentersAttribute, const ImageAttributeConstPtr &pImgAttribute)
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type isSet(const boost::shared_ptr< AttributeType > &pAttribute)
IPSDKBASEPROCESSING_API RulePtr If(const RulePtr &pPredicate, const RulePtr &pRuleTrue)