Operators |
This chapter contains operators for sample-based identification.
With sample-based identification, trained objects can be identified based on characteristic features like texture or color. This allows you to identify objects that do not carry bar codes or data codes. Compared to the classification approaches described in chapter Classification, the preparation and training for sample-based identification is very convenient as no complex parameter tuning is required. Sample-based identification is capable of differentiating a large number of objects. The identification is robust against rotation, scale, and illumination changes as well as against occlusions, clutter, and moderate perspective distortions. Furthermore, the identification is robust against moderate deformations of the object and, within certain limits, it even allows to identify products stored in bulk. On the other hand, this means that objects cannot be distinguished if they appear identical except for one of the characteristics the identification is robust against. Note that sample-based identification works only with textured objects.
Sample-based identification can identify only one object at the same time. This means that each query image, or more precisely the domain of each query image, must not contain multiple objects.
(1) | (2) |
(3) | (4) |
In the following, the steps that are required to use sample-based identification are described briefly.
First, a sample identifier must be provided by creating and preparing a new sample identifier with
The preparation is essential to adapt the internal data structure of the sample identifier to the kind of objects to be identified. Alternatively, an already prepared sample identifier, which has been written to file with write_sample_identifier, can be read from file with read_sample_identifier.
A prepared sample identifier can be thought of as a warehouse, optimized to handle a specific group of objects.
Then, the prepared sample identifier has to be trained with samples of the individual objects to be identified. For this, the operators
are used. Note that it is possible to retrain the sample identifier at any time. For this, samples can be removed from the sample identifier with the operator remove_sample_identifier_training_data and new samples can be added to the sample identifier with the operator add_sample_identifier_training_data. If the kind of the objects to be identified does not change too much, it is not necessary to repeat the preparation of the sample identifier. To use the picture from above, the training corresponds to filling the warehouse.
Finally, the trained sample identifier can be applied to identify objects with
When you no longer need the sample identifier, you destroy it by passing the handle to
In addition to the operators mentioned above, the following operators can be used to administrate the sample identifier. With remove_sample_identifier_preparation_data the data that were added to the sample identifier can be removed in order to exclude them from being used for the preparation. The operators set_sample_identifier_object_info and get_sample_identifier_object_info can be used to assign and query labels, i.e, names, to the individual objects. The latter operator can further be used to determine some additional information about the number of objects available for preparation and training. Finally, the operators set_sample_identifier_param and get_sample_identifier_param can be used to set and retrieve control parameters of the sample identifier.
In the following, the most important terms that are used in the context of sample-based identification are described:
An object to be identified by sample-based identification.
The index of an object. This index can be seen as a label of the object, which is set while adding preparation data or training data to the SampleIdentifier . The object index is the most important result of the operator apply_sample_identifier. With the operator set_sample_identifier_object_info, a descriptive name can be set for each object, which eases the interpretation of the identification results.
One sample or view of an object. Sometimes, also the term “sample image” is used to refer to object samples.
This term is used as a synonym for “object sample”, if the emphasis lies on the image.
The index of an object sample. Note that for each object, this index is set individually starting with 0. Therefore, the object sample index is unambiguous only together with the respective object index.
The adaptation of the internal data structure of the sample identifier to the features of a typical set of object samples that may appear during the identification process.
An object that has been added to the sample identifier with add_sample_identifier_preparation_data.
An object sample of a preparation object. The preparation is typically done based on multiple preparation samples per object.
The collection of all preparation samples.
The training of the sample identifier. In this step, the sample identifier learns to differentiate all given objects.
An object that has been added to the sample identifier with add_sample_identifier_training_data or which is the result of reusing preparation data as training data. In contrast to preparation objects, all training objects are labeled with a unique object index.
An object sample of a training object. The training is typically done based on multiple training samples per object.
The collection of all training samples.
An image, in which an object is visible that should be identified with sample-based identification.
Operators |