compare_objcompare_objCompareObjCompareObjcompare_obj (Operator)
Name
compare_objcompare_objCompareObjCompareObjcompare_obj
— Compare iconic objects regarding equality.
Signature
void CompareObj(const HObject& Objects1, const HObject& Objects2, const HTuple& Epsilon, HTuple* IsEqual)
Hlong HObject::CompareObj(const HObject& Objects2, const HTuple& Epsilon) const
Hlong HObject::CompareObj(const HObject& Objects2, double Epsilon) const
Hlong HImage::CompareObj(const HImage& Objects2, const HTuple& Epsilon) const
Hlong HImage::CompareObj(const HImage& Objects2, double Epsilon) const
Hlong HRegion::CompareObj(const HRegion& Objects2, const HTuple& Epsilon) const
Hlong HRegion::CompareObj(const HRegion& Objects2, double Epsilon) const
Hlong HXLD::CompareObj(const HXLD& Objects2, const HTuple& Epsilon) const
Hlong HXLD::CompareObj(const HXLD& Objects2, double Epsilon) const
Hlong HXLDCont::CompareObj(const HXLDCont& Objects2, const HTuple& Epsilon) const
Hlong HXLDCont::CompareObj(const HXLDCont& Objects2, double Epsilon) const
Hlong HXLDPoly::CompareObj(const HXLDPoly& Objects2, const HTuple& Epsilon) const
Hlong HXLDPoly::CompareObj(const HXLDPoly& Objects2, double Epsilon) const
Hlong HXLDPara::CompareObj(const HXLDPara& Objects2, const HTuple& Epsilon) const
Hlong HXLDPara::CompareObj(const HXLDPara& Objects2, double Epsilon) const
Hlong HXLDModPara::CompareObj(const HXLDModPara& Objects2, const HTuple& Epsilon) const
Hlong HXLDModPara::CompareObj(const HXLDModPara& Objects2, double Epsilon) const
Hlong HXLDExtPara::CompareObj(const HXLDExtPara& Objects2, const HTuple& Epsilon) const
Hlong HXLDExtPara::CompareObj(const HXLDExtPara& Objects2, double Epsilon) const
static void HOperatorSet.CompareObj(HObject objects1, HObject objects2, HTuple epsilon, out HTuple isEqual)
int HObject.CompareObj(HObject objects2, HTuple epsilon)
int HObject.CompareObj(HObject objects2, double epsilon)
int HImage.CompareObj(HImage objects2, HTuple epsilon)
int HImage.CompareObj(HImage objects2, double epsilon)
int HRegion.CompareObj(HRegion objects2, HTuple epsilon)
int HRegion.CompareObj(HRegion objects2, double epsilon)
int HXLD.CompareObj(HXLD objects2, HTuple epsilon)
int HXLD.CompareObj(HXLD objects2, double epsilon)
int HXLDCont.CompareObj(HXLDCont objects2, HTuple epsilon)
int HXLDCont.CompareObj(HXLDCont objects2, double epsilon)
int HXLDPoly.CompareObj(HXLDPoly objects2, HTuple epsilon)
int HXLDPoly.CompareObj(HXLDPoly objects2, double epsilon)
int HXLDPara.CompareObj(HXLDPara objects2, HTuple epsilon)
int HXLDPara.CompareObj(HXLDPara objects2, double epsilon)
int HXLDModPara.CompareObj(HXLDModPara objects2, HTuple epsilon)
int HXLDModPara.CompareObj(HXLDModPara objects2, double epsilon)
int HXLDExtPara.CompareObj(HXLDExtPara objects2, HTuple epsilon)
int HXLDExtPara.CompareObj(HXLDExtPara objects2, double epsilon)
Description
The operator compare_objcompare_objCompareObjCompareObjCompareObjcompare_obj
compares iconic objects regarding
equality. The iconic objects are passed in the two input parameters
Objects1Objects1Objects1Objects1objects1objects_1
and Objects2Objects2Objects2Objects2objects2objects_2
in form of (possibly mixed)
tuples of images, regions, or XLDs.
The n-th object in Objects1Objects1Objects1Objects1objects1objects_1
is compared to the n-th object in
Objects2Objects2Objects2Objects2objects2objects_2
(for all n).
If the two passed object tuples have the same length and if all objects
are equal, the parameter IsEqualIsEqualIsEqualIsEqualisEqualis_equal
is set to 1, otherwise to 0.
For a short description of the iconic objects that are available in HALCON
see the introduction of chapter Object.
Depending on the type of the input objects, different conditions must be
met for the equality of two objects. In the following, the conditions
for each possible iconic object are listed:
- Images:
-
For all channels, the gray values of the respective pixels must
not differ by more than EpsilonEpsilonEpsilonEpsilonepsilonepsilon
. Note that images are
only compared within their domain (ROI) and they are only equal
if they have the same domain (ROI).
- Regions:
-
The regions must be equal. The parameter EpsilonEpsilonEpsilonEpsilonepsilonepsilon
has no
effect for the comparison of regions.
- XLD contours:
-
XLD contours must have the same number of points and attributes.
The point coordinates and the attribute values must not differ by
more than EpsilonEpsilonEpsilonEpsilonepsilonepsilon
.
- XLD polygons:
-
XLD polygons must have the same number of line segments. The
length and the orientation of these segments as well as the
coordinates of the control points must not differ by more than
EpsilonEpsilonEpsilonEpsilonepsilonepsilon
.
- XLD parallels and extended XLD parallels:
-
XLD parallels must have an identical index of the start and end
line segment of the parallels of the first polygon (P1) and the
second polygon (P2) as well as identical pointers to the
underlying contours.
- Modified XLD parallels:
-
For modified XLD parallels, the same conditions apply as for XLD
parallels and extended XLD parallels. Furthermore, the distances
between the line segments of the parallel polygons must be
identical.
Note that compare_objcompare_objCompareObjCompareObjCompareObjcompare_obj
compares all objects regarding their
actual content. In contrast test_equal_objtest_equal_objTestEqualObjTestEqualObjTestEqualObjtest_equal_obj
compares only
regions regarding their actual content while for all other objects
their location in memory is compared.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
Objects1Objects1Objects1Objects1objects1objects_1
(input_object) object(-array) →
objectHObjectHObjectHObjectHobject
Reference objects.
Objects2Objects2Objects2Objects2objects2objects_2
(input_object) object(-array) →
objectHObjectHObjectHObjectHobject
Test objects.
EpsilonEpsilonEpsilonEpsilonepsilonepsilon
(input_control) number →
HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Maximum allowed difference between two gray values or
coordinates etc.
Default value: 0.0
Suggested values: 0.0, 1.e-5
IsEqualIsEqualIsEqualIsEqualisEqualis_equal
(output_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Boolean result value.
Result
The operator compare_objcompare_objCompareObjCompareObjCompareObjcompare_obj
returns the value 2 (H_MSG_TRUE) if the
parameters are correct. The behavior in case of empty input (no input
objects available) is set via the operator
set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)
. If the number of
objects differs an exception is raised.
See also
test_equal_objtest_equal_objTestEqualObjTestEqualObjTestEqualObjtest_equal_obj
,
test_equal_regiontest_equal_regionTestEqualRegionTestEqualRegionTestEqualRegiontest_equal_region
Module
Foundation