add_sample_identifier_preparation_dataT_add_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data (Operator)
add_sample_identifier_preparation_dataT_add_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
— Add preparation data to an existing sample identifier.
Warning
add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
is obsolete and is only provided for
reasons of backward compatibility. New applications should use the operators
for Deep-Learning-based classification instead, for details see
Deep Learning / Classification.
Signature
void AddSampleIdentifierPreparationData(const HObject& SampleImage, const HTuple& SampleIdentifier, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ObjectSampleIdx)
Hlong HImage::AddSampleIdentifierPreparationData(const HSampleIdentifier& SampleIdentifier, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const
Hlong HImage::AddSampleIdentifierPreparationData(const HSampleIdentifier& SampleIdentifier, Hlong ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const
Hlong HSampleIdentifier::AddSampleIdentifierPreparationData(const HImage& SampleImage, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const
Hlong HSampleIdentifier::AddSampleIdentifierPreparationData(const HImage& SampleImage, Hlong ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const
static void HOperatorSet.AddSampleIdentifierPreparationData(HObject sampleImage, HTuple sampleIdentifier, HTuple objectIdx, HTuple genParamName, HTuple genParamValue, out HTuple objectSampleIdx)
int HImage.AddSampleIdentifierPreparationData(HSampleIdentifier sampleIdentifier, HTuple objectIdx, HTuple genParamName, HTuple genParamValue)
int HImage.AddSampleIdentifierPreparationData(HSampleIdentifier sampleIdentifier, int objectIdx, HTuple genParamName, HTuple genParamValue)
int HSampleIdentifier.AddSampleIdentifierPreparationData(HImage sampleImage, HTuple objectIdx, HTuple genParamName, HTuple genParamValue)
int HSampleIdentifier.AddSampleIdentifierPreparationData(HImage sampleImage, int objectIdx, HTuple genParamName, HTuple genParamValue)
Description
add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
adds preparation data to an
existing sample identifier. This is a prerequisite for the preparation of
the sample identifier with the operator prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier
.
For an explanation of the concept of sample-based identification
see the introduction of chapter Legacy / Identification.
To achieve the maximum identification rate, the internal data structure of
the sample identifier must be adapted to the objects to be identified. For
this, it is useful to provide sample images of all kinds of objects to be
identified.
With each call of add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
, features
of one SampleImageSampleImageSampleImagesampleImagesample_image
are added to the SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier
. The
complete preparation data, which consists of all features of all sample
images that have been added to the sample identifier with multiple calls of
add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
, should cover
-
all kinds of objects to be identified and
-
all different views of the objects that may appear during the
identification process, sampled to at least 45 degrees.
The domain of the SampleImageSampleImageSampleImagesampleImagesample_image
should be reduced to the object,
which is visible in the image. This is necessary to avoid that the
SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier
is adapted to the background of the sample images.
If you cannot provide preparation data that fulfills all of the above
mentioned requirements, the sample identifier may be prepared as well, but
the identification rate may be slightly worse.
Note that you must provide RGB color images, if the generic parameter
'add_color_info'"add_color_info""add_color_info""add_color_info""add_color_info" has been set to 'true'"true""true""true""true" in
create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier
.
Ideally, the images used for preparation and training (see
add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data
and
train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier
) are identical. This can easily be realized
by reusing the preparation data for the training of the
SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier
. To be able to reuse the preparation data, the
index of the object must be given in ObjectIdxObjectIdxObjectIdxobjectIdxobject_idx
. Otherwise, the
ObjectIdxObjectIdxObjectIdxobjectIdxobject_idx
can be set to 'unknown'"unknown""unknown""unknown""unknown". See
prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier
for an explanation on how to reuse
preparation data for the training of the sample identifier.
The following generic parameters can be used to influence the behavior of
the operator add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
. These
parameters and their corresponding values can be specified by using
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
, respectively. The
following values for GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
are possible:
- 'image_resize_method'"image_resize_method""image_resize_method""image_resize_method""image_resize_method":
-
See
create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier
for a description of this parameter.
List of values:
'none'"none""none""none""none", 'scale_factor'"scale_factor""scale_factor""scale_factor""scale_factor",
'subsampling_step'"subsampling_step""subsampling_step""subsampling_step""subsampling_step", 'image_area'"image_area""image_area""image_area""image_area"
Default:
If the 'image_resize_method'"image_resize_method""image_resize_method""image_resize_method""image_resize_method" is not set
explicitly by this operator, the value that has been set with
create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier
or set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param
will be used.
- 'image_resize_value'"image_resize_value""image_resize_value""image_resize_value""image_resize_value":
-
See create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier
for a description of this parameter.
Suggested values:
0.25, 0.5, 1.0,
2, 3, 4
Default:
If the 'image_resize_value'"image_resize_value""image_resize_value""image_resize_value""image_resize_value" is not set
explicitly by this operator, the value that has been set with
create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier
or set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param
will be used.
add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
returns the object sample
index of the preparation sample given in SampleImageSampleImageSampleImagesampleImagesample_image
. This index
can, e.g., be used to remove this sample from the preparation data, if the
sample identifier should be prepared based on a different set of
preparation data.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
Parameters
SampleImageSampleImageSampleImagesampleImagesample_image
(input_object) (multichannel-)image →
objectHImageHObjectHObjectHobject (byte)
Image that shows an object.
SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier
(input_control) sample_identifier →
HSampleIdentifier, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the sample identifier.
ObjectIdxObjectIdxObjectIdxobjectIdxobject_idx
(input_control) integer →
HTupleUnion[int, str]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
Index of the object visible in the SampleImageSampleImageSampleImagesampleImagesample_image
.
Default:
'unknown'
"unknown"
"unknown"
"unknown"
"unknown"
Suggested values:
'unknown'"unknown""unknown""unknown""unknown", 0, 1, 2, 3, 4, 5
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
(input_control) attribute.name-array →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Generic parameter name.
Default:
[]
List of values:
'image_resize_method'"image_resize_method""image_resize_method""image_resize_method""image_resize_method", 'image_resize_value'"image_resize_value""image_resize_value""image_resize_value""image_resize_value"
GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
(input_control) attribute.value-array →
HTupleSequence[Union[str, int, float]]HTupleHtuple (real / string / integer) (double / string / int / long) (double / HString / Hlong) (double / char* / Hlong)
Generic parameter value.
Default:
[]
Suggested values:
'none'"none""none""none""none", 'scale_factor'"scale_factor""scale_factor""scale_factor""scale_factor", 'subsampling_step'"subsampling_step""subsampling_step""subsampling_step""subsampling_step", 'image_area'"image_area""image_area""image_area""image_area", 0.25, 0.5, 0.75, 1.0, 2, 3, 4
ObjectSampleIdxObjectSampleIdxObjectSampleIdxobjectSampleIdxobject_sample_idx
(output_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Index of the object sample.
Result
If the parameters are valid, the operator
add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data
returns the value 2 (
H_MSG_TRUE)
. If
necessary an exception is raised.
Possible Predecessors
create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier
,
read_sample_identifierread_sample_identifierReadSampleIdentifierReadSampleIdentifierread_sample_identifier
Possible Successors
prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier
Alternatives
read_sample_identifierread_sample_identifierReadSampleIdentifierReadSampleIdentifierread_sample_identifier
See also
add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data
,
train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier
,
apply_sample_identifierapply_sample_identifierApplySampleIdentifierApplySampleIdentifierapply_sample_identifier
,
set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param
,
get_sample_identifier_paramget_sample_identifier_paramGetSampleIdentifierParamGetSampleIdentifierParamget_sample_identifier_param
,
get_sample_identifier_object_infoget_sample_identifier_object_infoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfoget_sample_identifier_object_info
,
remove_sample_identifier_preparation_dataremove_sample_identifier_preparation_dataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationDataremove_sample_identifier_preparation_data
,
remove_sample_identifier_training_dataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingDataremove_sample_identifier_training_data
,
write_sample_identifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifierwrite_sample_identifier
,
serialize_sample_identifierserialize_sample_identifierSerializeSampleIdentifierSerializeSampleIdentifierserialize_sample_identifier
,
deserialize_sample_identifierdeserialize_sample_identifierDeserializeSampleIdentifierDeserializeSampleIdentifierdeserialize_sample_identifier
,
clear_sample_identifierclear_sample_identifierClearSampleIdentifierClearSampleIdentifierclear_sample_identifier
,
set_sample_identifier_object_infoset_sample_identifier_object_infoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfoset_sample_identifier_object_info
Module
Matching