/*********************************************************** * File generated by the HALCON-Compiler hcomp version 20.11 * Usage: Interface to C++ * * Software by: MVTec Software GmbH, www.mvtec.com ***********************************************************/ #ifndef HCPP_HMEASURE #define HCPP_HMEASURE namespace HalconCpp { // Represents an instance of a tool to measure distances. class LIntExport HMeasure : public HHandle { public: // Create an uninitialized instance HMeasure():HHandle() {} // Copy constructor HMeasure(const HMeasure& source) : HHandle(source) {} // Copy constructor HMeasure(const HHandle& handle); // Create HMeasure from handle, taking ownership explicit HMeasure(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 ('measure')! virtual void AssertType(Hphandle handle) const; public: // Deep copy of all data represented by this object instance HMeasure Clone() const; /***************************************************************************** * Operator-based class constructors *****************************************************************************/ // gen_measure_arc: Prepare the extraction of straight edges perpendicular to an annular arc. explicit HMeasure(const HTuple& CenterRow, const HTuple& CenterCol, const HTuple& Radius, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AnnulusRadius, Hlong Width, Hlong Height, const HString& Interpolation); // gen_measure_arc: Prepare the extraction of straight edges perpendicular to an annular arc. explicit HMeasure(double CenterRow, double CenterCol, double Radius, double AngleStart, double AngleExtent, double AnnulusRadius, Hlong Width, Hlong Height, const HString& Interpolation); // gen_measure_arc: Prepare the extraction of straight edges perpendicular to an annular arc. explicit HMeasure(double CenterRow, double CenterCol, double Radius, double AngleStart, double AngleExtent, double AnnulusRadius, Hlong Width, Hlong Height, const char* Interpolation); #ifdef _WIN32 // gen_measure_arc: Prepare the extraction of straight edges perpendicular to an annular arc. explicit HMeasure(double CenterRow, double CenterCol, double Radius, double AngleStart, double AngleExtent, double AnnulusRadius, Hlong Width, Hlong Height, const wchar_t* Interpolation); #endif // gen_measure_rectangle2: Prepare the extraction of straight edges perpendicular to a rectangle. explicit HMeasure(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, Hlong Width, Hlong Height, const HString& Interpolation); // gen_measure_rectangle2: Prepare the extraction of straight edges perpendicular to a rectangle. explicit HMeasure(double Row, double Column, double Phi, double Length1, double Length2, Hlong Width, Hlong Height, const HString& Interpolation); // gen_measure_rectangle2: Prepare the extraction of straight edges perpendicular to a rectangle. explicit HMeasure(double Row, double Column, double Phi, double Length1, double Length2, Hlong Width, Hlong Height, const char* Interpolation); #ifdef _WIN32 // gen_measure_rectangle2: Prepare the extraction of straight edges perpendicular to a rectangle. explicit HMeasure(double Row, double Column, double Phi, double Length1, double Length2, Hlong Width, Hlong Height, const wchar_t* Interpolation); #endif /*************************************************************************** * Operators * ***************************************************************************/ // Serialize a measure object. HSerializedItem SerializeMeasure() const; // Deserialize a serialized measure object. void DeserializeMeasure(const HSerializedItem& SerializedItemHandle); // Write a measure object to a file. void WriteMeasure(const HString& FileName) const; // Write a measure object to a file. void WriteMeasure(const char* FileName) const; #ifdef _WIN32 // Write a measure object to a file. void WriteMeasure(const wchar_t* FileName) const; #endif // Read a measure object from a file. void ReadMeasure(const HString& FileName); // Read a measure object from a file. void ReadMeasure(const char* FileName); #ifdef _WIN32 // Read a measure object from a file. void ReadMeasure(const wchar_t* FileName); #endif // Extracting points with a particular gray value along a rectangle or an annular arc. void MeasureThresh(const HImage& Image, double Sigma, double Threshold, const HString& Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const; // Extracting points with a particular gray value along a rectangle or an annular arc. void MeasureThresh(const HImage& Image, double Sigma, double Threshold, const char* Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const; #ifdef _WIN32 // Extracting points with a particular gray value along a rectangle or an annular arc. void MeasureThresh(const HImage& Image, double Sigma, double Threshold, const wchar_t* Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const; #endif // Delete a measure object. void CloseMeasure() const; // Extract a gray value profile perpendicular to a rectangle or annular arc. HTuple MeasureProjection(const HImage& Image) const; // Reset a fuzzy function. void ResetFuzzyMeasure(const HString& SetType) const; // Reset a fuzzy function. void ResetFuzzyMeasure(const char* SetType) const; #ifdef _WIN32 // Reset a fuzzy function. void ResetFuzzyMeasure(const wchar_t* SetType) const; #endif // Specify a normalized fuzzy function for edge pairs. void SetFuzzyMeasureNormPair(const HTuple& PairSize, const HString& SetType, const HFunction1D& Function) const; // Specify a normalized fuzzy function for edge pairs. void SetFuzzyMeasureNormPair(double PairSize, const HString& SetType, const HFunction1D& Function) const; // Specify a normalized fuzzy function for edge pairs. void SetFuzzyMeasureNormPair(double PairSize, const char* SetType, const HFunction1D& Function) const; #ifdef _WIN32 // Specify a normalized fuzzy function for edge pairs. void SetFuzzyMeasureNormPair(double PairSize, const wchar_t* SetType, const HFunction1D& Function) const; #endif // Specify a fuzzy function. void SetFuzzyMeasure(const HString& SetType, const HFunction1D& Function) const; // Specify a fuzzy function. void SetFuzzyMeasure(const char* SetType, const HFunction1D& Function) const; #ifdef _WIN32 // Specify a fuzzy function. void SetFuzzyMeasure(const wchar_t* SetType, const HFunction1D& Function) const; #endif // Extract straight edge pairs perpendicular to a rectangle or an annular arc. void FuzzyMeasurePairing(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, const HString& Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance) const; // Extract straight edge pairs perpendicular to a rectangle or an annular arc. void FuzzyMeasurePairing(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, const char* Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance) const; #ifdef _WIN32 // Extract straight edge pairs perpendicular to a rectangle or an annular arc. void FuzzyMeasurePairing(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, const wchar_t* Pairing, Hlong NumPairs, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowPairCenter, HTuple* ColumnPairCenter, HTuple* FuzzyScore, HTuple* IntraDistance) const; #endif // Extract straight edge pairs perpendicular to a rectangle or an annular arc. void FuzzyMeasurePairs(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowEdgeCenter, HTuple* ColumnEdgeCenter, HTuple* FuzzyScore, HTuple* IntraDistance, HTuple* InterDistance) const; // Extract straight edge pairs perpendicular to a rectangle or an annular arc. void FuzzyMeasurePairs(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowEdgeCenter, HTuple* ColumnEdgeCenter, HTuple* FuzzyScore, HTuple* IntraDistance, HTuple* InterDistance) const; #ifdef _WIN32 // Extract straight edge pairs perpendicular to a rectangle or an annular arc. void FuzzyMeasurePairs(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* RowEdgeCenter, HTuple* ColumnEdgeCenter, HTuple* FuzzyScore, HTuple* IntraDistance, HTuple* InterDistance) const; #endif // Extract straight edges perpendicular to a rectangle or an annular arc. void FuzzyMeasurePos(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const HString& Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const; // Extract straight edges perpendicular to a rectangle or an annular arc. void FuzzyMeasurePos(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const char* Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const; #ifdef _WIN32 // Extract straight edges perpendicular to a rectangle or an annular arc. void FuzzyMeasurePos(const HImage& Image, double Sigma, double AmpThresh, double FuzzyThresh, const wchar_t* Transition, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* FuzzyScore, HTuple* Distance) const; #endif // Extract straight edge pairs perpendicular to a rectangle or annular arc. void MeasurePairs(const HImage& Image, double Sigma, double Threshold, const HString& Transition, const HString& Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const; // Extract straight edge pairs perpendicular to a rectangle or annular arc. void MeasurePairs(const HImage& Image, double Sigma, double Threshold, const char* Transition, const char* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const; #ifdef _WIN32 // Extract straight edge pairs perpendicular to a rectangle or annular arc. void MeasurePairs(const HImage& Image, double Sigma, double Threshold, const wchar_t* Transition, const wchar_t* Select, HTuple* RowEdgeFirst, HTuple* ColumnEdgeFirst, HTuple* AmplitudeFirst, HTuple* RowEdgeSecond, HTuple* ColumnEdgeSecond, HTuple* AmplitudeSecond, HTuple* IntraDistance, HTuple* InterDistance) const; #endif // Extract straight edges perpendicular to a rectangle or annular arc. void MeasurePos(const HImage& Image, double Sigma, double Threshold, const HString& Transition, const HString& Select, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* Distance) const; // Extract straight edges perpendicular to a rectangle or annular arc. void MeasurePos(const HImage& Image, double Sigma, double Threshold, const char* Transition, const char* Select, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* Distance) const; #ifdef _WIN32 // Extract straight edges perpendicular to a rectangle or annular arc. void MeasurePos(const HImage& Image, double Sigma, double Threshold, const wchar_t* Transition, const wchar_t* Select, HTuple* RowEdge, HTuple* ColumnEdge, HTuple* Amplitude, HTuple* Distance) const; #endif // Translate a measure object. void TranslateMeasure(const HTuple& Row, const HTuple& Column) const; // Translate a measure object. void TranslateMeasure(double Row, double Column) const; // Prepare the extraction of straight edges perpendicular to an annular arc. void GenMeasureArc(const HTuple& CenterRow, const HTuple& CenterCol, const HTuple& Radius, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AnnulusRadius, Hlong Width, Hlong Height, const HString& Interpolation); // Prepare the extraction of straight edges perpendicular to an annular arc. void GenMeasureArc(double CenterRow, double CenterCol, double Radius, double AngleStart, double AngleExtent, double AnnulusRadius, Hlong Width, Hlong Height, const HString& Interpolation); // Prepare the extraction of straight edges perpendicular to an annular arc. void GenMeasureArc(double CenterRow, double CenterCol, double Radius, double AngleStart, double AngleExtent, double AnnulusRadius, Hlong Width, Hlong Height, const char* Interpolation); #ifdef _WIN32 // Prepare the extraction of straight edges perpendicular to an annular arc. void GenMeasureArc(double CenterRow, double CenterCol, double Radius, double AngleStart, double AngleExtent, double AnnulusRadius, Hlong Width, Hlong Height, const wchar_t* Interpolation); #endif // Prepare the extraction of straight edges perpendicular to a rectangle. void GenMeasureRectangle2(const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Length1, const HTuple& Length2, Hlong Width, Hlong Height, const HString& Interpolation); // Prepare the extraction of straight edges perpendicular to a rectangle. void GenMeasureRectangle2(double Row, double Column, double Phi, double Length1, double Length2, Hlong Width, Hlong Height, const HString& Interpolation); // Prepare the extraction of straight edges perpendicular to a rectangle. void GenMeasureRectangle2(double Row, double Column, double Phi, double Length1, double Length2, Hlong Width, Hlong Height, const char* Interpolation); #ifdef _WIN32 // Prepare the extraction of straight edges perpendicular to a rectangle. void GenMeasureRectangle2(double Row, double Column, double Phi, double Length1, double Length2, Hlong Width, Hlong Height, const wchar_t* Interpolation); #endif }; // forward declarations and types for internal array implementation template class HSmartPtr; template class HHandleBaseArrayRef; typedef HHandleBaseArrayRef HMeasureArrayRef; typedef HSmartPtr< HMeasureArrayRef > HMeasureArrayPtr; // Represents multiple tool instances class LIntExport HMeasureArray : public HHandleBaseArray { public: // Create empty array HMeasureArray(); // Create array from native array of tool instances HMeasureArray(HMeasure* classes, Hlong length); // Copy constructor HMeasureArray(const HMeasureArray &tool_array); // Destructor virtual ~HMeasureArray(); // Assignment operator HMeasureArray &operator=(const HMeasureArray &tool_array); // Clears array and all tool instances virtual void Clear(); // Get array of native tool instances const HMeasure* 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 HMeasureArrayPtr *mArrayPtr; }; } #endif