ClassesClasses | | Operators

prepare_sample_identifierT_prepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifier (Operator)

Name

prepare_sample_identifierT_prepare_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)

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

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_identifierPrepareSampleIdentifierPrepareSampleIdentifierPrepareSampleIdentifier prepares the given SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier using the preparation data, which have been set with add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData.

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 SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier must be adapted to the kind of objects to be identified.

To prepare the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier, first, all the relevant sample images of the objects to be identified must be added with add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData. Then, with the call of prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierPrepareSampleIdentifier, the internal data structure of the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier 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 RemovePreparationDataRemovePreparationDataRemovePreparationDataRemovePreparationDataremovePreparationData to '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_identifierReadSampleIdentifierReadSampleIdentifierReadSampleIdentifier).

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_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingData (see train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifierTrainSampleIdentifier 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" is set to '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_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData 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_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData is taken unchanged. But note that the object sample index may be changed, because it is renumbered consecutively, starting with zero.

Execution Information

Parameters

SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifier (input_control)  sample_identifier HSampleIdentifier, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the sample identifier.

RemovePreparationDataRemovePreparationDataRemovePreparationDataRemovePreparationDataremovePreparationData (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Indicates if the preparation data should be removed.

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

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

GenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  attribute.name-array HTupleHTupleHtuple (string) (string) (HString) (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"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  attribute.value-array HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Generic parameter value.

Default value: []

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

Result

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

Possible Predecessors

add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationData

Possible Successors

write_sample_identifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifierWriteSampleIdentifier, add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingData, train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifierTrainSampleIdentifier

Alternatives

read_sample_identifierread_sample_identifierReadSampleIdentifierReadSampleIdentifierReadSampleIdentifier

See also

create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifier, apply_sample_identifierapply_sample_identifierApplySampleIdentifierApplySampleIdentifierApplySampleIdentifier, set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamSetSampleIdentifierParam, get_sample_identifier_paramget_sample_identifier_paramGetSampleIdentifierParamGetSampleIdentifierParamGetSampleIdentifierParam, get_sample_identifier_object_infoget_sample_identifier_object_infoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfo, remove_sample_identifier_preparation_dataremove_sample_identifier_preparation_dataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationData, remove_sample_identifier_training_dataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingData, write_sample_identifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifierWriteSampleIdentifier, serialize_sample_identifierserialize_sample_identifierSerializeSampleIdentifierSerializeSampleIdentifierSerializeSampleIdentifier, deserialize_sample_identifierdeserialize_sample_identifierDeserializeSampleIdentifierDeserializeSampleIdentifierDeserializeSampleIdentifier, clear_sample_identifierclear_sample_identifierClearSampleIdentifierClearSampleIdentifierClearSampleIdentifier, set_sample_identifier_object_infoset_sample_identifier_object_infoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfo

Module

Matching


ClassesClasses | | Operators