- process_exclusively: true, false, none;
This subslot of parallelization
assigns whether an operator is processed completely exclusively
(`true') by the main HALCON process/thread or not. An exclusive processing
means that no other operator will be processed by HALCON while the
exclusive operator is running. If an exclusive operator is started and other
operators are still running, the processing of the exclusive operator is
delayed until all other (currently running) operators have completed.
An exclusively processed operator is always processed without any
parallelization by the main HALCON thread/process. Note that even if
HALCON is reentrant for most of the operators, there are still some
operators that have to be processed exclusively due to reasons of their
implementation.
If no subslot process_exclusively is filled in with an operator, it is
assumed that the operator needs no completely exclusive processing
(“optimistic” assumption).
If the subslot contains none, the operator is processed by
HALCON independently of other operators (even exclusive ones). This value is
only used internally by MVTec.
- process_mutual: true, false;
This subslot of parallelization assigns
whether HALCON processes an operator under mutual exclusion
(`true') against itself or not. Here, a mutual exclusion means that the same
operator may not run twice or more at the same time (but other HALCON
operators can).
An mutually processed operator is always processed without any
parallelization by the main HALCON thread/process.
If no subslot process_mutual is filled in with an operator, it is
assumed that the operator needs no mutual exclusion (“optimistic”
assumption).
- process_locally: true, false;
This subslot of parallelization assigns,
whether an operator must be processed locally (`true') by a program thread,
or whether it may called by any (“external”) thread without problems.
If process_locally is set to `true', this signals the
programmer that the corresponding operator must be used carefully within
multithreaded applications. The simplest way to avoid any
problems with such operators is to process them all under mutual exclusion
within the main thread of the program.
As a side effect, HALCON processes an operator without
parallelization regardless the settings of the subslots method and domain_split, if process_locally is set to `true'. This avoids
problems with `local' operators and multithreading and makes sense because
`local' operators normally are responsible for graphical interaction and thus
are not suitable for parallelization.
If no subslot process_locally is filled in with an operator, it is
assumed that the operator must be processed “locally” (“pessimistic”
assumption). However, this subslot should be filled in in any case, because
it contains a very useful information for programmers of multithreaded
applications.
- method: none, split_tuple, split_channel,
split_domain, split_partial, split_partial_domain;
This subslot of parallelization can contain one or
more of the strings above and specifies, which type of (automatic)
parallelization the operator is suitable for:
- none:
HALCON does not automatically parallelize the operator.
- split_tuple:
HALCON parallelizes the operator by splitting every input image tuple
into several subsets of the tuple; the tuple subsets are then processed in
parallel.
- split_channel:
HALCON parallelizes by splitting every multichannel (input) image into
several subsets of the channels; the subsets are then processed in
parallel.
- split_domain:
HALCON parallelizes by splitting the domain of every input image into
several parts; the parts are then processed in parallel.
- split_partial, split_partial_domain:
These methods are only used by MVTec to indicate the internal
parallelization of HALCON operators.
If method is set to anything other but `none', the parameter slot
costs_weight must be filled in for every input control parameter
and the parameter slot postprocessing must be filled in for
every output control parameter of the operator (see this page)!
If method is set to `split_domain',
the slot region_postprocessing (see below) must also be set correctly
and may not be omitted!
If the slot process_locally is set to `true', method should be
set to `none', because the operator won't be parallelized then (see
description of process_locally above).
Note that the slot method may contain any combination of the strings
`split_tuple', `split_channel', and `split_domain', because an operator
may be parallelized by using any combination of those three methods. However,
if `none' is specified with the slot method, no other string should be
specified with it in order to keep the description consistent.
If no slot method is filled in with an operator, it is assumed that the
operator is not suitable for being automatically parallelized
(“pessimistic” assumption).
- region_postprocessing: none,
domain_concat_si_inp,domain_concat_mult_inp;
This subslot of parallelization
must (only) be set for operators that are suitable for being parallelized
by splitting the domain of input objects (i.e. slot method
contains `split_domain'). For such operators HALCON supports a simple
postprocessing of output region components: After splitting the domain
of input objects and processing the operator in parallel (within
the subparts of the original domain), HALCON creates the overall
output iconic objects based on the output objects of the parallel
processing. At this, it supports three methods for determining the
domain/region components of overall output objects. Those three methods
correspond to the three possible values of region_postprocessing:
- none:
no postprocessing of region/domain components. Here, HALCON directly
adopts the region components of input objects and re-uses them unchanged
as the region components of the corresponding overall output objects.
This method is especially suitable for operators which output solely
image objects and where the domain is left unchanged, such as
filter operators (e.g. mean_image).
- domain_concat_si_inp:
postprocess region components by concatenation for operators which
have only a single input iconic parameter. Here, HALCON
creates the region components of overall output objects by
concatenating the region components of the corresponding output objects
of the parallel processing. At this, the latter regions must not overlap!
Therefore, domain_concat_si_inp can only be used for operators,
for which the subslot domain_split (see below) is set to `0'.
This method is suitable, for example, for the operator threshold
which outputs a region containing all pixels of a certain gray value
range. Here, HALCON splits the input domain into disjunctive parts,
processes the threshold operator in parallel, and finally concatenates the
single result regions to one overall result region.
- domain_concat_mult_inp:
postprocess region components by concatenation for operators which
have multiple input iconic parameter and which need a specific
handling of the input objects. This method is quite
similar to that above, i.e., HALCON also creates the region
components of overall output objects by concatenating the region
components of the corresponding output objects of the parallel processing.
Again, the latter regions must not overlap! Therefore,
domain_concat_mult_inp can only be used for operators,
for which the subslot domain_split (see below) is set to `0'. For
domain_concat_mult_inp HALCON uses a specific handling of
input objects. Normally, HALCON splits the domains of all
objects of all input iconic parameters in the same manner (e.g. by
splitting into the first and the second half of the chords, independent
from the row index of the chords). This does not mean any problem as long
as all input image domains are the same — especially, if domains of
corresponding objects of different input parameters are the same.
Because then also the split domains will match each other. This
is not the case, if we have to expect that domains of objects of different
input iconic parameters may differ. Here, it may happen that split
domain parts of the first parameter and that of the second parameter
do not overlap because of the simple splitting mechanism which does not
take into account the row index of chords. If so, and if an operator uses,
for example, an intersection of the input domains of different
input parameters for defining the valid domain of the processed
operation, it would get an empty region — in contrast
to the sequential processing of the same operator.
Therefore, we must assign domain_concat_mult_inp for such
operators. This will force HALCON to only split the domains of the
objects of the first input iconic parameter. The domains of input
objects of all other input iconic parameters are left unchanged so that
they fit to the domains of the first input iconic parameter regardless
of their position in the image.
This method is suitable, for example, for the operator add_image
which adds two images and sets the domain of the result image to the
intersection of the domains of the two input images. By defining
domain_concat_mult_inp for add_image, HALCON only
splits the domain of the first image to add, then calculates the
intersection of the split domain parts with the unchanged domain of
the second image in parallel, performs the addition of gray values in
parallel, and finally merges the resulting region components (domains)
by concatenation into the region component of the overall output image
which also contains the added gray values.
- abort_mode: break, cancel, both;
This subslot of parallelization must only be used to determine the supported timeout mode.
In case no timeout is supported, this slot must be omitted.
For an explanation of the different modes, see the reference manual
entry for set_operator_timeout.