IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
KernelKMeansImgLvl1.h
1 // KernelKMeansImgLvl1.h:
3 // ----------------------
4 //
14 
15 #ifndef __IPSDKIPLCLASSIFICATION_KERNELKMEANSIMGLVL1_H__
16 #define __IPSDKIPLCLASSIFICATION_KERNELKMEANSIMGLVL1_H__
17 
21 
22 // Attributes headers
23 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InHomogeneousImg.h>
24 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InNbClusters.h>
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InNbSamples.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNbAttempts.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/InOptKernelKMeansParams.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutClassImg.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/OutKKMeansCentroids.h>
30 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/PlanIndexedDoubles.h>
31 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/PlanIndexedStatsResult.h>
33 
34 namespace ipsdk {
35 namespace imaproc {
36 namespace classif {
37 
40 
41 // declare processor class
42 IPSDK_DECLARE_LVL1_PROCESSOR(REP_ASYNC1, IPSDKIPLClassification, KernelKMeansImg,
43  ipsdk::imaproc::customImageProperty(_pOutClassImg, matchKernelKMeansClassImg(_pInHomogeneousImg, _pInNbClusters)),
44  (((ipsdk)(imaproc)(attr))(InHomogeneousImg))
45  (((ipsdk)(imaproc)(attr))(InNbClusters))
46  (((ipsdk)(imaproc)(attr))(InNbSamples))
47  (((ipsdk)(imaproc)(attr))(InOptNbAttempts))
48  (((ipsdk)(imaproc)(attr))(InOptKernelKMeansParams))
49  (((ipsdk)(imaproc)(attr))(OutClassImg)(customOutput)(outputKernelKMeans(_pInHomogeneousImg, _pInNbClusters)))
50  (((ipsdk)(imaproc)(attr))(OutKKMeansCentroids)(allocate)))
51 
52 // methods
53 public:
54 
55 protected:
59 
61  void clearIntermediateData();
62 
63 // attributes
64 protected:
66  image::ImageConstPtr _pInSeqImg;
67 
69  ipUInt32 _curNbAttempt;
70 
72  ipReal32 _radialBasisKernelSigma;
73 
76  ipReal32 _accuracyThreshold;
77 
80 
82  attr::PlanIndexedDoublesPtr _pImgSampledValues;
83 
85  ipReal64 _bestSeparation;
86 
88  attr::KKMeansCentroidsPtr _pBestKKMeansCentroids;
89 };
90 
93 
94 } // end of namespace classif
95 } // end of namespace imaproc
96 } // end of namespace ipsdk
97 
98 #endif // __IPSDKIPLCLASSIFICATION_KERNELKMEANSIMGLVL1_H__
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
IPSDKIPLCLASSIFICATION_API CustomCheckedImagePropertyPtr matchKernelKMeansClassImg(const ImageAttributeConstPtr &pInHomogeneousImgAttribute, const boost::shared_ptr< const attr::InNbClusters > &pInNbClustersAttribute)
function allowing to check that output class image matches input image and expected number of cluster...
double ipReal64
ipsdk::core::ExecResult preProcess()
method called before processing
boost::shared_ptr< ipsdk::imaproc::attr::PlanIndexedDoubles > PlanIndexedDoublesPtr
shared pointer to ipsdk::imaproc::PlanIndexedDoubles
Definition: PlanIndexedDoubles.h:49
IPSDKIPLCLASSIFICATION_API CustomImageInfoPtr outputKernelKMeans(const ImageAttributeConstPtr &pInputAttribute, const boost::shared_ptr< const attr::InNbClusters > &pInNbClustersAttribute)
function allowing to create a Kernel KMeans output image initializer
Definition of import/export macro for library.
processor::OutputInitializerPtr customOutput(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo)
Utility functions for Kernel KMeans attribute rules management.
boost::shared_ptr< ipsdk::imaproc::attr::KKMeansCentroids > KKMeansCentroidsPtr
shared pointer to ipsdk::imaproc::attr::KKMeansCentroids
Definition: KKMeansCentroids.h:147
boost::shared_ptr< const BaseImage > ImageConstPtr
IPSDK_DECLARE_GPU_PROCESSING_ALGORITHM(IPSDKIPLFiltering, Convolution2dImg, ipsdk::imaproc::matchSize(_pInSubGpuImg, _pOutImg),(((ipsdk)(imaproc)(attr))(InSubGpuImg))(((ipsdk)(imaproc)(attr))(InKnlXY))(((ipsdk)(imaproc)(attr))(InNormalize))(((ipsdk)(imaproc)(attr))(InConvolBorder2d))(((ipsdk)(imaproc)(attr))(OutImg))) IPSDKCUDA_DECLARE_ALGORITHM_FUNCTION_SELECTOR((InSubGpuImg)(OutImg)) public void clearIntermediateData()
method called before processing
Utility functions for Kernel KMeans attribute output initialization management.
boost::shared_ptr< ipsdk::imaproc::attr::PlanIndexedStatsResult > PlanIndexedStatsResultPtr
shared pointer to ipsdk::imaproc::attr::PlanIndexedStatsResult
Definition: PlanIndexedStatsResult.h:50
float ipReal32
uint32_t ipUInt32