Herror ::concat_obj (
    Hobject Objects1,
    Hobject Objects2,
    Hobject *ObjectsConcat
)

Concatenate two iconic object tuples.

::concat_obj concatenates the two tuples of iconic objects Objects1 and Objects2 into a new object tuple ObjectsConcat. Hence, this tuple contains all the objects of the two input tuples:

ObjectsConcat = [Objects1,Objects2]

In ObjectsConcat the objects of Objects1 are stored first, followed by the objects of Objects2. The order of the objects is preserved. As usual, only the objects are copied, and not the corresponding images and regions, i.e., no new memory is allocated. ::concat_obj is designed especially for HALCON/C. In languages like Smalltalk, Prolog, and C++ it is not needed.

::concat_obj should not be confused with ::union1 or ::union2, in which regions are merged, i.e., in which the number of objects is modified.

::concat_obj can be used to concatenate objects of different image object types (e.g., images and XLD contours) into a single object. This is only recommended if it is necessary to accumulate in a single object variable, for example, the results of an image processing sequence. It should be noted that the only operators that can handle such object tuples of mixed type are ::concat_obj, ::copy_obj, ::select_obj, and ::disp_obj. For technical reasons, object tuples of mixed type must not be created in HDevelop.


Parameters

Objects1 (input_object)
object(-array) -> Hobject: HObject(Array)
Object tuple 1.

Objects2 (input_object)
object(-array) -> Hobject: HObject(Array)
Object tuple 2.

ObjectsConcat (output_object)
object-array -> Hobject * : HObjectArray
Concatenated objects.


Example
/* generate a tuple of a circle and a rectangle */

gen_circle(&Circle,200.0,400.0,23.0);
gen_rectangle1(&Rectangle,23.0,44.0,203.0,201.0);
concat_obj(Circle,Rectangle,&CirclAndRectangle);
clear_obj(Circle); clear_obj(Rectangle);
disp_region(CircleAndRectangle,WindowHandle);

Complexity

Runtime complexity: O(|Objects1| + |Objects2|);

Memory complexity of the result objects: O(|Objects1| + |Objects2|)


Result

::concat_obj returns H_MSG_TRUE if all objects are contained in the HALCON database. If the input is empty the behavior can be set via ::set_system('no_object_result',<Result>). If necessary, an exception is raised.


See also

::count_obj, ::copy_obj, ::select_obj, ::disp_obj


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH