Type Mapping
Parameters to nodes
| Procedure parameter | Node | Notes |
|---|---|---|
Control, element type |
INT64 |
|
Control, element types with |
FLOAT64 |
An integer the procedure returns for a real output is converted. |
Control, element type |
STRING |
A file name is resolved inside the script folder. |
Any of the above with |
ARRAY_OF_INT64, ARRAY_OF_FLOAT64, ARRAY_OF_STRING |
|
Control, strings mixed with numbers |
refused ( |
|
Control, |
no node |
An input must be bound to the group’s store; an output goes to the store by default. See Modules, Groups and the Store. |
Iconic, object class |
image group |
|
Iconic input, region or contour (XLD) |
refused ( |
|
Iconic output, region or contour (XLD) |
no node |
Convert it in the procedure, for example with |
A vector parameter (dimension 1 or 2) on a node |
refused ( |
Bind it to the store, or use a tuple with several values instead. |
Types from sem_type
When type_list is empty, the type is taken from sem_type where it says one:
-
integergives an integer; -
real,angle.andpoint.give a real,numberan integer or a real; -
stringandfilename*give a string; -
the handle labels
handle,dict,window,message,message_queue,serial,socketand any*_model(shape_model,ncc_model, …) give a handle.
Any other sem_type is kept as a label and needs a type_list or an interface file.
A type_list of integer alone beside a handle label is read as a handle, and the log names the parameter with a warning. Before HALCON 18 handles were integers, and some of MVTec’s own procedures still document a model that way, for example ModelID of dev_display_shape_matching_results (type_list integer, sem_type shape_model). Any other type_list is taken as it is.
The node name is the parameter name in kebab case (MinScore → min-score), lower case, only a-z, 0-9, - and _. The original name is the node’s display name. The parameter’s description ends with its unit, min, max and default, for example the lowest gray value (min 0, max 255, default 128). An input node starts at the parameter’s default value.
Images
An image parameter is a group of four nodes:
| Node | Type | Content |
|---|---|---|
|
RAW |
The pixels, row by row without padding; 16-bit values little-endian. |
|
UINT64 |
Width in pixels. |
|
UINT64 |
Height in pixels. |
|
STRING |
|
pixel-type |
Image input becomes | Image output from |
|---|---|---|
|
|
|
|
|
– |
|
|
|
|
|
|
|
|
– |
-
An input image is checked before the procedure runs: a known pixel type, width and height above 0, exactly width × height × bytes per pixel bytes, and a pixel type and channel count the parameter accepts. A failed check ends the run with
-3. -
LumiScan X cameras put their 12 bits at the top of the 16-bit word. Set
mono12Shiftto4for such a module to give the procedure values from 0 to 4095. -
An image output must be exactly one image of pixel type
byte(one or three channels) oruint2(one channel). Anything else fails the run with-10003: convert it in the procedure (convert_image_type,scale_image_max).
Copy time
Every image is copied into HALCON before the procedure runs, and every image output is copied out of HALCON after it. The copy adds to the run time. For a 5-megapixel frame (2448 × 2048) a development PC took per direction:
pixel-type |
Copy time per direction |
|---|---|
|
about 1 to 3 ms |
|
about 3 to 10 ms |
|
about 13 to 27 ms |
The time grows with the number of bytes; your PC may be faster or slower. Where the cycle time is tight, prefer mono8, and pass only the images the procedure needs.
The closed type set
HALCON has no user-defined types. The Script Runner, the interface file and the type checks know exactly these names:
-
element types of control values:
integer,real,string,handle; -
object classes of iconic objects:
image,region,xld; -
pixel types:
byte,int1,int2,uint2,int4,int8,real,complex,cyclic,direction,vector_field; -
multiplicity:
false(one),true(several),optional; -
dimension:
0,1or2.
A name outside this set refuses the procedure and names the parameter. sem_type is a free label, not a type: any label is kept.