15 #ifndef __IPSDKIPLCLASSIFICATION_KMEANSIMGLVL1_H__ 16 #define __IPSDKIPLCLASSIFICATION_KMEANSIMGLVL1_H__ 19 #include <IPSDKIPL/IPSDKIPLClassification/Processor/KMeansAssignImg/KMeansAssignImgLvl1.h> 20 #include <IPSDKIPL/IPSDKIPLClassification/Processor/KMeansPPClusterInit/KMeansPPClusterInitLvl1.h> 21 #include <IPSDKIPL/IPSDKIPLClassification/Processor/KMeansComputeCompactness/KMeansComputeCompactnessLvl1.h> 25 #include <IPSDKIPL/IPSDKIPLUtility/Processor/CopyImg/CopyImgLvl1.h> 28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/InOutOptClustersPptiesColl.h> 29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/OutKMeansAssignmentInfo.h> 30 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/ClusterEltInfo.h> 31 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/Doubles.h> 32 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/UIntegers64.h> 33 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InHomogeneousImg.h> 34 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutClassImg.h> 35 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Optional/OutOptPosterizedImg.h> 36 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWkClassImg.h> 37 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptClustersCentersShiftTolerance.h> 38 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InNbClusters.h> 39 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNbAttempts.h> 40 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNbMaxIter.h> 41 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/OutCompactness.h> 42 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/Optional/InOptSingleGreyMaskImg.h> 48 class KMeansCentersRandomInitLvl1;
49 class LocateMostEccentricClusterEltLvl1;
50 class KMeansPosterizeImgLvl1;
57 ipsdk::imaproc::matchSize(eMatchImageSizeType::eMIST_3d, _pInHomogeneousImg, _pOutClassImg) &&
59 ipsdk::imaproc::matchSizeAndType(_pInHomogeneousImg, _pOutOptPosterizedImg)) &&
61 ipsdk::imaproc::matchSizeAndType(_pOutClassImg, _pOutOptWkClassImg)) &&
64 ipsdk::imaproc::matchSize(eMatchImageSizeType::eMIST_3d, _pInHomogeneousImg, _pInOptSingleGreyMaskImg),
67 (((
ipsdk)(imaproc)(attr))(InHomogeneousImg))
68 (((
ipsdk)(imaproc)(attr))(InOptSingleGreyMaskImg))
69 (((
ipsdk)(imaproc)(attr))(InOptNbAttempts))
70 (((
ipsdk)(imaproc)(attr))(InOptNbMaxIter))
71 (((
ipsdk)(imaproc)(attr))(InNbClusters))
72 (((
ipsdk)(imaproc)(attr))(InOptClustersCentersShiftTolerance))
73 (((
ipsdk)(imaproc)(attr))(OutClustersCenters)(allocate))
74 (((
ipsdk)(imaproc)(attr))(OutCompactness))
76 (((
ipsdk)(imaproc)(attr))(OutOptPosterizedImg))
84 void finalizeClustersCenters();
85 void computeNewCenters();
86 bool checkCentersShift();
89 const core::BasePriority& priority,
93 const core::BasePriority& priority,
97 const core::BasePriority& priority,
101 const core::BasePriority& priority,
105 const core::BasePriority& priority,
110 const attr::ClusterEltInfo& mostEccentricClusterEltInfo,
111 const core::BasePriority& priority,
115 const core::BasePriority& priority,
119 const core::BasePriority& priority,
123 const core::BasePriority& priority,
127 const core::BasePriority& priority,
131 const core::BasePriority& priority,
135 const core::BasePriority& priority,
139 const core::BasePriority& priority,
144 const boost::shared_ptr<core::BaseAction>& pProcessor,
158 boost::shared_ptr<KMeansAssignImgLvl1> _pKMeansAssignProcessor;
159 boost::shared_ptr<KMeansPPClusterInitLvl1> _pKMeansInitCentersProcessor;
160 boost::shared_ptr<LocateMostEccentricClusterEltLvl1> _pLocateEmptyClusterSubstituteProcessor;
161 boost::shared_ptr<KMeansComputeCompactnessLvl1> _pKMeansComputeCompactnessProcessor;
162 boost::shared_ptr<util::CopyImgLvl1> _pSetCurClassImgAsBestProcessor;
163 boost::shared_ptr<util::CopyImgLvl1> _pCopyBestClassImgToOutClassImgProcessor;
164 boost::shared_ptr<KMeansPosterizeImgLvl1> _pPosterizeProcessor;
168 std::vector<ipReal64> _oldFlattenedClustersCenters;
169 std::vector<ipReal64> _flattenedClustersCenters;
170 std::vector<ipReal64> _flattenedClustersStdDeviations;
172 std::vector<ipReal64> _bestFlattenedClustersCenters;
187 #endif // __IPSDKIPLCLASSIFICATION_KMEANSIMGLVL1_H__ ProcessingResult< eRetrievalResultType > RetrievalResult
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
IPSDKBASEPROCESSING_API RulePtr none()
Utility functions for K-Means attribute rules management.
boost::shared_ptr< BaseImage > ImagePtr
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type ifIsSet(const boost::shared_ptr< AttributeType > &pAttribute, const RulePtr &pRuleTrue)
Definition of import/export macro for library.
processor::OutputInitializerPtr customOutput(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo)
Utility functions for k-means attribute output initialization management.
boost::shared_ptr< const BaseImage > ImageConstPtr
#define IPSDK_DECLARE_STATIC_RESULT_COLL(AttributeType, CollType)
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type isSet(const boost::shared_ptr< AttributeType > &pAttribute)
boost::shared_ptr< BaseActionProvider > ActionProviderPtr
IPSDKIPLCLASSIFICATION_API CustomImageInfoPtr outputKMeans(const ImageAttributeConstPtr &pInputAttribute, const boost::shared_ptr< const attr::InNbClusters > &pNbClustersAttribute)
IPSDKIPLCLASSIFICATION_API CustomCheckedImagePropertyPtr allowedClassImgBuffersFromNbClusters(const boost::shared_ptr< const attr::InNbClusters > &pInNbClustersAttribute)
[Output] information resulting from assignment step in k-means algorithm
Definition: OutKMeansAssignmentInfo.h:45
boost::shared_ptr< ipsdk::imaproc::attr::KMeansAssignmentInfo > KMeansAssignmentInfoPtr
shared pointer to ipsdk::imaproc::attr::KMeansAssignmentInfo
Definition: KMeansAssignmentInfo.h:154
IPSDKBASEPROCESSING_API RulePtr If(const RulePtr &pPredicate, const RulePtr &pRuleTrue)