123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- /***********************************************************
- * File generated by the HALCON-Compiler hcomp version 20.11
- * Usage: Interface to C++
- *
- * Software by: MVTec Software GmbH, www.mvtec.com
- ***********************************************************/
- #ifndef HCPP_HCLASSGMM
- #define HCPP_HCLASSGMM
- namespace HalconCpp
- {
- // Represents an instance of a Gaussian mixture model.
- class LIntExport HClassGmm : public HHandle
- {
- public:
- // Create an uninitialized instance
- HClassGmm():HHandle() {}
- // Copy constructor
- HClassGmm(const HClassGmm& source) : HHandle(source) {}
- // Copy constructor
- HClassGmm(const HHandle& handle);
- // Create HClassGmm from handle, taking ownership
- explicit HClassGmm(Hlong handle);
- bool operator==(const HHandle& obj) const
- {
- return HHandleBase::operator==(obj);
- }
- bool operator!=(const HHandle& obj) const
- {
- return HHandleBase::operator!=(obj);
- }
- protected:
- // Verify matching semantic type ('class_gmm')!
- virtual void AssertType(Hphandle handle) const;
- public:
- // Deep copy of all data represented by this object instance
- HClassGmm Clone() const;
- /*****************************************************************************
- * Operator-based class constructors
- *****************************************************************************/
- // read_class_gmm: Read a Gaussian Mixture Model from a file.
- explicit HClassGmm(const HString& FileName);
- // read_class_gmm: Read a Gaussian Mixture Model from a file.
- explicit HClassGmm(const char* FileName);
- #ifdef _WIN32
- // read_class_gmm: Read a Gaussian Mixture Model from a file.
- explicit HClassGmm(const wchar_t* FileName);
- #endif
- // create_class_gmm: Create a Gaussian Mixture Model for classification
- explicit HClassGmm(Hlong NumDim, Hlong NumClasses, const HTuple& NumCenters, const HString& CovarType, const HString& Preprocessing, Hlong NumComponents, Hlong RandSeed);
- // create_class_gmm: Create a Gaussian Mixture Model for classification
- explicit HClassGmm(Hlong NumDim, Hlong NumClasses, Hlong NumCenters, const HString& CovarType, const HString& Preprocessing, Hlong NumComponents, Hlong RandSeed);
- // create_class_gmm: Create a Gaussian Mixture Model for classification
- explicit HClassGmm(Hlong NumDim, Hlong NumClasses, Hlong NumCenters, const char* CovarType, const char* Preprocessing, Hlong NumComponents, Hlong RandSeed);
- #ifdef _WIN32
- // create_class_gmm: Create a Gaussian Mixture Model for classification
- explicit HClassGmm(Hlong NumDim, Hlong NumClasses, Hlong NumCenters, const wchar_t* CovarType, const wchar_t* Preprocessing, Hlong NumComponents, Hlong RandSeed);
- #endif
- /***************************************************************************
- * Operators *
- ***************************************************************************/
- // Classify an image with a Gaussian Mixture Model.
- HRegion ClassifyImageClassGmm(const HImage& Image, double RejectionThreshold) const;
- // Add training samples from an image to the training data of a Gaussian Mixture Model.
- void AddSamplesImageClassGmm(const HImage& Image, const HRegion& ClassRegions, double Randomize) const;
- // Get the training data of a Gaussian Mixture Model (GMM).
- HClassTrainData GetClassTrainDataGmm() const;
- // Add training data to a Gaussian Mixture Model (GMM).
- void AddClassTrainDataGmm(const HClassTrainData& ClassTrainDataHandle) const;
- // Selects an optimal combination from a set of features to classify the provided data.
- HTuple SelectFeatureSetGmm(const HClassTrainData& ClassTrainDataHandle, const HString& SelectionMethod, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Score);
- // Selects an optimal combination from a set of features to classify the provided data.
- HTuple SelectFeatureSetGmm(const HClassTrainData& ClassTrainDataHandle, const HString& SelectionMethod, const HString& GenParamName, double GenParamValue, HTuple* Score);
- // Selects an optimal combination from a set of features to classify the provided data.
- HTuple SelectFeatureSetGmm(const HClassTrainData& ClassTrainDataHandle, const char* SelectionMethod, const char* GenParamName, double GenParamValue, HTuple* Score);
- #ifdef _WIN32
- // Selects an optimal combination from a set of features to classify the provided data.
- HTuple SelectFeatureSetGmm(const HClassTrainData& ClassTrainDataHandle, const wchar_t* SelectionMethod, const wchar_t* GenParamName, double GenParamValue, HTuple* Score);
- #endif
- // Create a look-up table using a gaussian mixture model to classify byte images.
- HClassLUT CreateClassLutGmm(const HTuple& GenParamName, const HTuple& GenParamValue) const;
- // Clear a Gaussian Mixture Model.
- static void ClearClassGmm(const HClassGmmArray& GMMHandle);
- // Clear a Gaussian Mixture Model.
- void ClearClassGmm() const;
- // Clear the training data of a Gaussian Mixture Model.
- static void ClearSamplesClassGmm(const HClassGmmArray& GMMHandle);
- // Clear the training data of a Gaussian Mixture Model.
- void ClearSamplesClassGmm() const;
- // Deserialize a serialized Gaussian Mixture Model.
- void DeserializeClassGmm(const HSerializedItem& SerializedItemHandle);
- // Serialize a Gaussian Mixture Model (GMM).
- HSerializedItem SerializeClassGmm() const;
- // Read a Gaussian Mixture Model from a file.
- void ReadClassGmm(const HString& FileName);
- // Read a Gaussian Mixture Model from a file.
- void ReadClassGmm(const char* FileName);
- #ifdef _WIN32
- // Read a Gaussian Mixture Model from a file.
- void ReadClassGmm(const wchar_t* FileName);
- #endif
- // Write a Gaussian Mixture Model to a file.
- void WriteClassGmm(const HString& FileName) const;
- // Write a Gaussian Mixture Model to a file.
- void WriteClassGmm(const char* FileName) const;
- #ifdef _WIN32
- // Write a Gaussian Mixture Model to a file.
- void WriteClassGmm(const wchar_t* FileName) const;
- #endif
- // Read the training data of a Gaussian Mixture Model from a file.
- void ReadSamplesClassGmm(const HString& FileName) const;
- // Read the training data of a Gaussian Mixture Model from a file.
- void ReadSamplesClassGmm(const char* FileName) const;
- #ifdef _WIN32
- // Read the training data of a Gaussian Mixture Model from a file.
- void ReadSamplesClassGmm(const wchar_t* FileName) const;
- #endif
- // Write the training data of a Gaussian Mixture Model to a file.
- void WriteSamplesClassGmm(const HString& FileName) const;
- // Write the training data of a Gaussian Mixture Model to a file.
- void WriteSamplesClassGmm(const char* FileName) const;
- #ifdef _WIN32
- // Write the training data of a Gaussian Mixture Model to a file.
- void WriteSamplesClassGmm(const wchar_t* FileName) const;
- #endif
- // Calculate the class of a feature vector by a Gaussian Mixture Model.
- HTuple ClassifyClassGmm(const HTuple& Features, Hlong Num, HTuple* ClassProb, HTuple* Density, HTuple* KSigmaProb) const;
- // Evaluate a feature vector by a Gaussian Mixture Model.
- HTuple EvaluateClassGmm(const HTuple& Features, double* Density, double* KSigmaProb) const;
- // Train a Gaussian Mixture Model.
- HTuple TrainClassGmm(Hlong MaxIter, double Threshold, const HString& ClassPriors, double Regularize, HTuple* Iter) const;
- // Train a Gaussian Mixture Model.
- HTuple TrainClassGmm(Hlong MaxIter, double Threshold, const char* ClassPriors, double Regularize, HTuple* Iter) const;
- #ifdef _WIN32
- // Train a Gaussian Mixture Model.
- HTuple TrainClassGmm(Hlong MaxIter, double Threshold, const wchar_t* ClassPriors, double Regularize, HTuple* Iter) const;
- #endif
- // Compute the information content of the preprocessed feature vectors of a GMM.
- HTuple GetPrepInfoClassGmm(const HString& Preprocessing, HTuple* CumInformationCont) const;
- // Compute the information content of the preprocessed feature vectors of a GMM.
- HTuple GetPrepInfoClassGmm(const char* Preprocessing, HTuple* CumInformationCont) const;
- #ifdef _WIN32
- // Compute the information content of the preprocessed feature vectors of a GMM.
- HTuple GetPrepInfoClassGmm(const wchar_t* Preprocessing, HTuple* CumInformationCont) const;
- #endif
- // Return the number of training samples stored in the training data of a Gaussian Mixture Model (GMM).
- Hlong GetSampleNumClassGmm() const;
- // Return a training sample from the training data of a Gaussian Mixture Models (GMM).
- HTuple GetSampleClassGmm(Hlong NumSample, Hlong* ClassID) const;
- // Add a training sample to the training data of a Gaussian Mixture Model.
- void AddSampleClassGmm(const HTuple& Features, Hlong ClassID, double Randomize) const;
- // Return the parameters of a Gaussian Mixture Model.
- Hlong GetParamsClassGmm(Hlong* NumClasses, HTuple* MinCenters, HTuple* MaxCenters, HString* CovarType) const;
- // Create a Gaussian Mixture Model for classification
- void CreateClassGmm(Hlong NumDim, Hlong NumClasses, const HTuple& NumCenters, const HString& CovarType, const HString& Preprocessing, Hlong NumComponents, Hlong RandSeed);
- // Create a Gaussian Mixture Model for classification
- void CreateClassGmm(Hlong NumDim, Hlong NumClasses, Hlong NumCenters, const HString& CovarType, const HString& Preprocessing, Hlong NumComponents, Hlong RandSeed);
- // Create a Gaussian Mixture Model for classification
- void CreateClassGmm(Hlong NumDim, Hlong NumClasses, Hlong NumCenters, const char* CovarType, const char* Preprocessing, Hlong NumComponents, Hlong RandSeed);
- #ifdef _WIN32
- // Create a Gaussian Mixture Model for classification
- void CreateClassGmm(Hlong NumDim, Hlong NumClasses, Hlong NumCenters, const wchar_t* CovarType, const wchar_t* Preprocessing, Hlong NumComponents, Hlong RandSeed);
- #endif
- };
- // forward declarations and types for internal array implementation
- template<class T> class HSmartPtr;
- template<class T> class HHandleBaseArrayRef;
- typedef HHandleBaseArrayRef<HClassGmm> HClassGmmArrayRef;
- typedef HSmartPtr< HClassGmmArrayRef > HClassGmmArrayPtr;
- // Represents multiple tool instances
- class LIntExport HClassGmmArray : public HHandleBaseArray
- {
- public:
- // Create empty array
- HClassGmmArray();
- // Create array from native array of tool instances
- HClassGmmArray(HClassGmm* classes, Hlong length);
- // Copy constructor
- HClassGmmArray(const HClassGmmArray &tool_array);
- // Destructor
- virtual ~HClassGmmArray();
- // Assignment operator
- HClassGmmArray &operator=(const HClassGmmArray &tool_array);
- // Clears array and all tool instances
- virtual void Clear();
- // Get array of native tool instances
- const HClassGmm* Tools() const;
- // Get number of tools
- virtual Hlong Length() const;
- // Create tool array from tuple of handles
- virtual void SetFromTuple(const HTuple& handles);
- // Get tuple of handles for tool array
- virtual HTuple ConvertToTuple() const;
- protected:
- // Smart pointer to internal data container
- HClassGmmArrayPtr *mArrayPtr;
- };
- }
- #endif
|