245 lines
12 KiB
C++
245 lines
12 KiB
C++
/***********************************************************
|
|||
|
|
* File generated by the HALCON-Compiler hcomp version 18.05
|
||
|
|
* 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_id')!
|
||
|
|
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);
|
||
|
|
|
||
|
|
// 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);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/***************************************************************************
|
||
|
|
* 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;
|
||
|
|
|
||
|
|
// Read a measure object from a file.
|
||
|
|
void ReadMeasure(const HString& FileName);
|
||
|
|
|
||
|
|
// Read a measure object from a file.
|
||
|
|
void ReadMeasure(const char* FileName);
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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;
|
||
|
|
|
||
|
|
// 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);
|
||
|
|
|
||
|
|
// 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);
|
||
|
|
|
||
|
|
};
|
||
|
|
|
||
|
|
// forward declarations and types for internal array implementation
|
||
|
|
|
||
|
|
template<class T> class HSmartPtr;
|
||
|
|
template<class T> class HHandleBaseArrayRef;
|
||
|
|
|
||
|
|
typedef HHandleBaseArrayRef<HMeasure> 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
|