ClassesClassesClassesClasses | | | | Operators

prepare_sample_identifierT_prepare_sample_identifierPrepareSampleIdentifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifier (Operator)

Name

prepare_sample_identifierT_prepare_sample_identifierPrepareSampleIdentifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifier — Adapt the internal data structure of a sample identifier to the objects to be identified.

Signature

prepare_sample_identifier( : : SampleIdentifier, RemovePreparationData, GenParamName, GenParamValue : )

Herror T_prepare_sample_identifier(const Htuple SampleIdentifier, const Htuple RemovePreparationData, const Htuple GenParamName, const Htuple GenParamValue)

Herror prepare_sample_identifier(const HTuple& SampleIdentifier, const HTuple& RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue)

void HSampleIdentifier::PrepareSampleIdentifier(const HTuple& RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue) const

void PrepareSampleIdentifier(const HTuple& SampleIdentifier, const HTuple& RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue)

void HSampleIdentifier::PrepareSampleIdentifier(const HString& RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HSampleIdentifier::PrepareSampleIdentifier(const char* RemovePreparationData, const HTuple& GenParamName, const HTuple& GenParamValue) const

void HOperatorSetX.PrepareSampleIdentifier(
[in] VARIANT SampleIdentifier, [in] VARIANT RemovePreparationData, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

void HSampleIdentifierX.PrepareSampleIdentifier(
[in] BSTR RemovePreparationData, [in] VARIANT GenParamName, [in] VARIANT GenParamValue)

static void HOperatorSet.PrepareSampleIdentifier(HTuple sampleIdentifier, HTuple removePreparationData, HTuple genParamName, HTuple genParamValue)

void HSampleIdentifier.PrepareSampleIdentifier(string removePreparationData, HTuple genParamName, HTuple genParamValue)

Description

prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifier prepares the given SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier using the preparation data, which have been set with add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData.

For an explanation of the concept of sample-based identification see the introduction of chapter Identification / Sample-Based.

In order to achieve the maximum identification rate, the internal data structure of the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier must be adapted to the kind of objects to be identified.

To prepare the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier, first, all the relevant sample images of the objects to be identified must be added with add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData. Then, with the call of prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifier, the internal data structure of the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier is adapted to the features of the provided sample images.

This process needs a lot of resources. Both, memory consumption and runtime are fairly high. E.g., if 100 sample images are used to prepare the sample identifier, approximately 300 MB of memory are required and the runtime will be in the range of a few minutes. If 1000 sample images are used, expect a memory consumption of about 2 GB and a runtime in the range of an hour.

Especially the preparation data requires a lot of memory. Typically, this data is no longer needed after the preparation of the sample identifier. Therefore, it can be removed by setting the parameter RemovePreparationDataRemovePreparationDataRemovePreparationDataRemovePreparationDataRemovePreparationDataremovePreparationData to 'true'"true""true""true""true""true".

As an alternative to the preparation, e.g., if you are not able to spend this much memory and/or time, and if you are fine with a slightly higher misidentification rate, you can just read a sample identifier that was previously prepared with samples of similar object kinds from file (see read_sample_identifierread_sample_identifierReadSampleIdentifierread_sample_identifierReadSampleIdentifierReadSampleIdentifier).

To reuse the preparation data for the training, you can derive training data from the preparation data. This saves the effort to add training data separately with add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingData (see train_sample_identifiertrain_sample_identifierTrainSampleIdentifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifier for a description of the training of the sample identifier). Note that the training data require far less memory than the preparation data. If the generic parameter 'copy_preparation_data_to_training_data'"copy_preparation_data_to_training_data""copy_preparation_data_to_training_data""copy_preparation_data_to_training_data""copy_preparation_data_to_training_data""copy_preparation_data_to_training_data" is set to 'true'"true""true""true""true""true" (which is the default), for all sample images that have been added with add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData and for which the object index has been set, training data is automatically derived. The object index that has been set with add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData is taken unchanged. But note that the object sample index may be changed, because it is renumbered consecutively, starting with zero.

Parallelization

Parameters

SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier (input_control)  sample_identifier HSampleIdentifier, HTupleHTupleHSampleIdentifier, HTupleHSampleIdentifierX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the sample identifier.

RemovePreparationDataRemovePreparationDataRemovePreparationDataRemovePreparationDataRemovePreparationDataremovePreparationData (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Indicates if the preparation data should be removed.

Default value: 'true' "true" "true" "true" "true" "true"

List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

GenParamNameGenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name-array HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Generic parameter name.

Default value: []

List of values: 'copy_preparation_data_to_training_data'"copy_preparation_data_to_training_data""copy_preparation_data_to_training_data""copy_preparation_data_to_training_data""copy_preparation_data_to_training_data""copy_preparation_data_to_training_data"

GenParamValueGenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value-array HTupleHTupleHTupleVARIANTHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double) (BSTR / Hlong / double) (char* / Hlong / double)

Generic parameter value.

Default value: []

List of values: 'false'"false""false""false""false""false", 'true'"true""true""true""true""true"

Result

If the parameters are valid, the operator prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifier returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors

add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData

Possible Successors

write_sample_identifierwrite_sample_identifierWriteSampleIdentifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifier, add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingData, train_sample_identifiertrain_sample_identifierTrainSampleIdentifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifier

Alternatives

read_sample_identifierread_sample_identifierReadSampleIdentifierread_sample_identifierReadSampleIdentifierReadSampleIdentifier

See also

create_sample_identifiercreate_sample_identifierCreateSampleIdentifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifier, apply_sample_identifierapply_sample_identifierApplySampleIdentifierapply_sample_identifierApplySampleIdentifierApplySampleIdentifier, set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParam, get_sample_identifier_paramget_sample_identifier_paramGetSampleIdentifierParamget_sample_identifier_paramGetSampleIdentifierParamGetSampleIdentifierParam, get_sample_identifier_object_infoget_sample_identifier_object_infoGetSampleIdentifierObjectInfoget_sample_identifier_object_infoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfo, remove_sample_identifier_preparation_dataremove_sample_identifier_preparation_dataRemoveSampleIdentifierPreparationDataremove_sample_identifier_preparation_dataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationData, remove_sample_identifier_training_dataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingData, write_sample_identifierwrite_sample_identifierWriteSampleIdentifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifier, serialize_sample_identifierserialize_sample_identifierSerializeSampleIdentifierserialize_sample_identifierSerializeSampleIdentifierSerializeSampleIdentifier, deserialize_sample_identifierdeserialize_sample_identifierDeserializeSampleIdentifierdeserialize_sample_identifierDeserializeSampleIdentifierDeserializeSampleIdentifier, clear_sample_identifierclear_sample_identifierClearSampleIdentifierclear_sample_identifierClearSampleIdentifierClearSampleIdentifier, set_sample_identifier_object_infoset_sample_identifier_object_infoSetSampleIdentifierObjectInfoset_sample_identifier_object_infoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfo

Module

Matching


ClassesClassesClassesClasses | | | | Operators