Module ImageProcessing¶
The module ImageProcessing contains the following static classes:
| Class | Description |
|---|---|
The module ImageProcessing contains the following classes:
| Class | Description |
|---|---|
AffineMatrix |
A matrix class useful for affine 2D geometric transformations. |
Date |
A date. |
LicenseData |
License data. |
LicenseException |
Exception class for license exceptions. |
Point |
A point in two-dimensional euclidean space. |
Class AffineMatrix¶
A matrix class useful for affine 2D geometric transformations.
Namespace: Ngi
Module: ImageProcessing
The class AffineMatrix implements the following interfaces:
| Interface | |—— —-| | IEquatableAffineMatrix | | ISerializable |
The class AffineMatrix contains the following properties:
| Property | Get | Set | Description |
|---|---|---|---|
M11 |
* | The element m11 (row 1, column 1) of the matrix. | |
M12 |
* | The element m12 (row 1, column 2) of the matrix. | |
M13 |
* | The element m13 (row 1, column 3) of the matrix. | |
M21 |
* | The element m21 (row 2, column 1) of the matrix. | |
M22 |
* | The element m22 (row 2, column 2) of the matrix. | |
M23 |
* | The element m23 (row 2, column 3) of the matrix. | |
M31 |
* | The element m31 (row 3, column 1) of the matrix. | |
M32 |
* | The element m32 (row 3, column 2) of the matrix. | |
M33 |
* | The element m33 (row 3, column 3) of the matrix. | |
[index] |
* | * | The matrix values as a parametrized property. |
Determinant |
* | The determinant of the matrix. | |
Trace |
* | The trace of the matrix. | |
Inverse |
* | The inverse of the matrix. | |
Translation |
* | Retrieve the translation vector from the matrix. | |
Scaling |
* | Retrieve the scaling vector from the matrix. | |
Rotation |
* | Retrieve the rotation from the matrix. |
The class AffineMatrix contains the following methods:
| Method | Description |
|---|---|
ResetToIdentity |
Reset the matrix to the identity matrix in place. |
Scale |
Scale the matrix in place. |
Translate |
Translate the matrix in place. |
Rotate |
Rotate the matrix in place. |
Description¶
The matrix has the following form:
If the values are accessed in array form, the following equalities hold:
values[0] = m11
values[1] = m21
values[2] = m12
values[3] = m22
values[4] = m13
values[5] = m23
The size of the matrix is implicitely 3x3. Only the values of the first two rows are stored in the matrix. The values of the third row are fixed to 0, 0, 1.
The inverse of an affine matrix is still an affine matrix. TODO Serialization of objects to/from a data_list.
Default Constructor¶
Constructor AffineMatrix¶
AffineMatrix()
Default constructor.
Presets the matrix as the identity matrix: $ I={bmatrix} 1 & 0 & 0 0 & 1 & 0 0 & 0 & 1 {bmatrix} $
Constructors¶
Constructor AffineMatrix¶
AffineMatrix(System.Double m11, System.Double m12, System.Double m13, System.Double m21, System.Double m22, System.Double m23)
Constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
m11 |
System.Double |
The element m11. |
m12 |
System.Double |
The element m12. |
m13 |
System.Double |
The element m13. |
m21 |
System.Double |
The element m21. |
m22 |
System.Double |
The element m22. |
m23 |
System.Double |
The element m23. |
Presets the matrix with specific values for the elements of the first two rows:
$ M={bmatrix} m_1_1 & m_1_2 & m_1_3 m_2_1 & m_2_2 & m_2_3 0 & 0 & 1 {bmatrix} $
Constructor AffineMatrix¶
AffineMatrix(RotationMatrix rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
RotationMatrix |
The right hand side. |
Converts a rotation matrix to an affine matrix.
Constructor AffineMatrix¶
AffineMatrix(TranslationMatrix rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
TranslationMatrix |
The right hand side. |
Converts a translation matrix to an affine matrix.
Constructor AffineMatrix¶
AffineMatrix(RigidMatrix rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
RigidMatrix |
The right hand side. |
Converts a rigid matrix to an affine matrix.
Constructor AffineMatrix¶
AffineMatrix(IsotropicScalingMatrix rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
IsotropicScalingMatrix |
The right hand side. |
Converts an isotropic scaling matrix to an affine matrix.
Constructor AffineMatrix¶
AffineMatrix(ScalingMatrix rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
ScalingMatrix |
The right hand side. |
Converts a scaling matrix to an affine matrix.
Constructor AffineMatrix¶
AffineMatrix(SimilarityMatrix rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
SimilarityMatrix |
The right hand side. |
Converts a similarity matrix to an affine matrix.
Constructor AffineMatrix¶
AffineMatrix(Pose rhs)
Conversion constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
rhs |
Pose |
The right hand side. |
Converts a pose to an affine matrix.
Properties¶
Property [index]¶
System.Double [index]
The matrix values as a parametrized property.
This property allows you to retrieve the implicit values also, but you cannot set them.
Property Translation¶
VectorDouble Translation
Retrieve the translation vector from the matrix.
An affine transformation matrix can be composed of translation, scale, and rotation. This method retrieves the translation.
Property Scaling¶
VectorDouble Scaling
Retrieve the scaling vector from the matrix.
An affine transformation matrix can be composed of translation, scale, and rotation. This method retrieves the scaling.
Property Rotation¶
VectorDouble Rotation
Retrieve the rotation from the matrix.
An affine transformation matrix can be composed of translation, scale, and rotation. This method retrieves the rotation. Normally, both rotation values should be the same or very close. If not, this indicates that there is considerable shear.
Static Methods¶
Method Multiply¶
AffineMatrix Multiply(AffineMatrix a, AffineMatrix b)
Multiply two matrices.
The method Multiply has the following parameters:
| Parameter | Type | Description |
|---|---|---|
a |
AffineMatrix |
The first matrix. |
b |
AffineMatrix |
The second matrix. |
Return the product of the two matrices.
Methods¶
Method ResetToIdentity¶
void ResetToIdentity()
Reset the matrix to the identity matrix in place.
Returns a reference to this object.
Method Scale¶
void Scale(VectorDouble scaling)
Scale the matrix in place.
The method Scale has the following parameters:
| Parameter | Type | Description |
|---|---|---|
scaling |
VectorDouble |
The scaling vector. |
Return a reference to the matrix.
Method Translate¶
void Translate(VectorDouble translation)
Translate the matrix in place.
The method Translate has the following parameters:
| Parameter | Type | Description |
|---|---|---|
translation |
VectorDouble |
The translation vector. |
Return a reference to the matrix.
Method Rotate¶
void Rotate(System.Double angle)
Rotate the matrix in place.
The method Rotate has the following parameters:
| Parameter | Type | Description |
|---|---|---|
angle |
System.Double |
The rotation angle. |
Return a reference to the matrix.
Class Date¶
A date.
Namespace: Ngi
Module:
The class Date implements the following interfaces:
| Interface | |—— —-| | IEquatableDate | | ISerializable |
The class Date contains the following properties:
| Property | Get | Set | Description |
|---|---|---|---|
Year |
* | * | The year part of the date. |
Month |
* | * | The month part of the date. |
Day |
* | * | The day part of the date. |
The class Date contains the following methods:
| Method | Description |
|---|---|
ToString |
Provide string representation for debugging purposes. |
Description¶
A date consists of a day (of the month), a month (of the year) and a year. It is used to specify calendar dates.
The date class does not do any validation. Non-existing dates can be specified.
Constructors¶
Constructor Date¶
Date(System.Int32 year, System.Int32 month, System.Int32 day)
Default constructor.
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
year |
System.Int32 |
|
month |
System.Int32 |
|
day |
System.Int32 |
Properties¶
Class LicenseData¶
License data.
Namespace: Ngi
Module:
The class LicenseData implements the following interfaces:
| Interface | |—— —-| | IEquatableLicenseData | | ISerializable |
The class LicenseData contains the following properties:
| Property | Get | Set | Description |
|---|---|---|---|
Valid |
* | * | The validity of the license_data. |
ProductId |
* | * | The product id. |
LicenseNumber |
* | * | The license number. |
ExpirationDate |
* | * | The expiration date. Only trials have an expiration date. |
UpdateExpirationDate |
* | * | The update expiration date. |
ImageProcessingModule |
* | * | The image processing module. |
CameraModule |
* | * | The camera module. |
AnalysisMeasuringModule |
* | * | The analysis and measurement module. |
TemplateMatchingModule |
* | * | The template matching module. |
BarcodeMatrixcodeModule |
* | * | The barcode and matrixcode module. |
OcrOcvModule |
* | * | The ocr and ocv module. |
CadPdfModule |
* | * | The cad and pdf module. |
HalconInterfaceModule |
* | * | The HALCON interface module. |
NVisionDesigner |
* | * | Flag set for nVision Designer (True: nVision Designer, False: nVision Runtime). |
NVisionUltimate |
* | * | Flag set for nVision Designer Ultimate (True: nVision Ultimate, False: nVision MV/Lab). |
Modules |
* | Provide the module validity encoded in a 32 bit integer. |
The class LicenseData contains the following methods:
| Method | Description |
|---|---|
ToString |
Provide string representation for debugging purposes. |
Description¶
Properties¶
Property LicenseNumber¶
System.String LicenseNumber
The license number.
The license number is the serial number coded into the dongle or the license key in the case of a software license.
Property ExpirationDate¶
Date ExpirationDate
The expiration date. Only trials have an expiration date.
Property UpdateExpirationDate¶
Date UpdateExpirationDate
The update expiration date.
Software built after the update expiration date will not run.
Property AnalysisMeasuringModule¶
System.Boolean AnalysisMeasuringModule
The analysis and measurement module.
Property TemplateMatchingModule¶
System.Boolean TemplateMatchingModule
The template matching module.
Property BarcodeMatrixcodeModule¶
System.Boolean BarcodeMatrixcodeModule
The barcode and matrixcode module.
Property NVisionDesigner¶
System.Boolean NVisionDesigner
Flag set for nVision Designer (True: nVision Designer, False: nVision Runtime).
Property NVisionUltimate¶
System.Boolean NVisionUltimate
Flag set for nVision Designer Ultimate (True: nVision Ultimate, False: nVision MV/Lab).
Property Modules¶
System.Int32 Modules
Provide the module validity encoded in a 32 bit integer.
The modules are encoded bitwise. The image_processing_module is bit 0, the analysis_measuring_module is bit 1, the template_matching_module is bit 2, the barcode_matrixcode_module is bit 3, the ocr_ocv_module is bit 4, the cad_pdf_module is bit 7 and the halcon_interface_module is bit 8.
n_vision_designer is bit 5 and n_vision_ultimate is bit 6. In total there is room for 20 modules in the licensing key.Previsously, the code was written so that if a module is added like the ones that are already there, previously issued licenses would gain access to the module automatically.
Now the code is written that previously issued license do not gain access to future modules automatically.
Class LicenseException¶
Exception class for license exceptions.
Namespace: Ngi
Module:
Description¶
License exceptions are used in the wrapper generator, when functions from modules are called, which are not licensed. The license check is made in the static constructor of the related C# classes.
Class Point¶
A point in two-dimensional euclidean space.
Namespace: Ngi
Module: ImageProcessing
The class Point implements the following interfaces:
| Interface | |—— —-| | IEquatablePointPointCoordinateVariant | | ISerializable | | INotifyPropertyChanged |
The class Point contains the following variant parameters:
| Variant | Description |
|---|---|
Coordinate |
The coordinate type of the point object. |
The class Point contains the following properties:
| Property | Get | Set | Description |
|---|---|---|---|
X |
* | * | |
Y |
* | * |
The class Point contains the following methods:
| Method | Description |
|---|---|
Move |
Move point. |
ToString |
Provide string representation for debugging purposes. |
Description¶
A point can be seen as a vector rooted at the origin in two-dimensional space.
The following operations are implemented: operator== : comparison for equality. operator != : comparison for inequality. operator- : negation, directly implemented. operator+= : addition, directly implemented. operator+ : addition, implemented through boost::additive operator-= : subtraction, directly implemented. operator- : subtraction, implemented through boost::additive operator= : multiplication, directly implemented. operator : multiplication, implemented through boost::multiplicative operator/= : division, directly implemented. operator/ : division, implemented through boost::multiplicative
Variants¶
Variant Coordinate¶
The coordinate type of the point object.
The variant parameter Coordinate has the following types:
| Type |
|---|
Int32 |
Double |
Coordinates of points can be of different types.
Constructors¶
Constructor Point¶
Point(System.Object x, System.Object y)
Constructs a point at origin (0, 0).
The constructor has the following parameters:
| Parameter | Type | Description |
|---|---|---|
x |
System.Object |
|
y |
System.Object |
Static Methods¶
Method VectorBetweenPoints¶
Vector VectorBetweenPoints(Point from, Point to)
Calculates the vector between two points.
The method VectorBetweenPoints has the following parameters:
| Parameter | Type | Description |
|---|---|---|
from |
Point |
The first point. |
to |
Point |
The second point. |
Method Distance¶
System.Double Distance(Point a, Point b)
Calculates the distance between two points.
The method Distance has the following parameters:
| Parameter | Type | Description |
|---|---|---|
a |
Point |
|
b |
Point |
Method DistanceSquared¶
System.Double DistanceSquared(Point a, Point b)
Calculates the squared distance between two points.
The method DistanceSquared has the following parameters:
| Parameter | Type | Description |
|---|---|---|
a |
Point |
The first point. |
b |
Point |
The second point. |
Methods¶
Method Move¶
Point Move(Vector movement)
Move point.
The method Move has the following parameters:
| Parameter | Type | Description |
|---|---|---|
movement |
Vector |
Movement vector. |
Moves a point by a vector.
The moved point.