add_sample_identifier_training_dataT_add_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data (算子名称)

名称

add_sample_identifier_training_dataT_add_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data — Add training data to an existing sample identifier.

警告

add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data is obsolete and is only provided for reasons of backward compatibility. New applications should use 该算子s for Deep-Learning-based classification instead, for details see Deep Learning / Classification.

参数签名

add_sample_identifier_training_data(SampleImage : : SampleIdentifier, ObjectIdx, GenParamName, GenParamValue : ObjectSampleIdx)

Herror T_add_sample_identifier_training_data(const Hobject SampleImage, const Htuple SampleIdentifier, const Htuple ObjectIdx, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ObjectSampleIdx)

void AddSampleIdentifierTrainingData(const HObject& SampleImage, const HTuple& SampleIdentifier, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ObjectSampleIdx)

Hlong HImage::AddSampleIdentifierTrainingData(const HSampleIdentifier& SampleIdentifier, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const

Hlong HImage::AddSampleIdentifierTrainingData(const HSampleIdentifier& SampleIdentifier, Hlong ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const

Hlong HSampleIdentifier::AddSampleIdentifierTrainingData(const HImage& SampleImage, const HTuple& ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const

Hlong HSampleIdentifier::AddSampleIdentifierTrainingData(const HImage& SampleImage, Hlong ObjectIdx, const HTuple& GenParamName, const HTuple& GenParamValue) const

static void HOperatorSet.AddSampleIdentifierTrainingData(HObject sampleImage, HTuple sampleIdentifier, HTuple objectIdx, HTuple genParamName, HTuple genParamValue, out HTuple objectSampleIdx)

int HImage.AddSampleIdentifierTrainingData(HSampleIdentifier sampleIdentifier, HTuple objectIdx, HTuple genParamName, HTuple genParamValue)

int HImage.AddSampleIdentifierTrainingData(HSampleIdentifier sampleIdentifier, int objectIdx, HTuple genParamName, HTuple genParamValue)

int HSampleIdentifier.AddSampleIdentifierTrainingData(HImage sampleImage, HTuple objectIdx, HTuple genParamName, HTuple genParamValue)

int HSampleIdentifier.AddSampleIdentifierTrainingData(HImage sampleImage, int objectIdx, HTuple genParamName, HTuple genParamValue)

def add_sample_identifier_training_data(sample_image: HObject, sample_identifier: HHandle, object_idx: Union[int, str], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, int, float]]) -> int

描述

add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data adds training data to an existing sample identifier. This is a prerequisite for the training of the sample identifier with 该算子 train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier.

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

In order to be able to identify objects, the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier must be trained with a representative set of sample images of the objects to be identified. These sample images must be added to the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier with add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data.

With each call of add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data, one SampleImageSampleImageSampleImageSampleImagesampleImagesample_image is added to the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier. The complete training data, which consists of all the sample images that have been added to the sample identifier with multiple calls of add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data, must cover

The domain of the SampleImageSampleImageSampleImageSampleImagesampleImagesample_image should be reduced to the object, which is visible in the image. This is necessary to avoid that the SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier is trained to the background of the sample images.

Note that in contrast to the preparation data, it is essential that the requirements mentioned above are fulfilled. Otherwise, the sample identifier will not be able to identify the objects for which relevant sample images are missing.

Also 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""add_color_info" has been set to 'true'"true""true""true""true""true" in create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier.

Ideally, the images used for preparation and training (see add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data and prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier) are identical. See prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_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 该算子 add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data. These parameters and their corresponding values can be specified by using GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value, respectively. The following values for GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name are possible:

'image_resize_method'"image_resize_method""image_resize_method""image_resize_method""image_resize_method""image_resize_method":

See create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier for a description of this parameter.

List of values: 'none'"none""none""none""none""none", 'scale_factor'"scale_factor""scale_factor""scale_factor""scale_factor""scale_factor", 'subsampling_step'"subsampling_step""subsampling_step""subsampling_step""subsampling_step""subsampling_step", 'image_area'"image_area""image_area""image_area""image_area""image_area"

Default value: If the 'image_resize_method'"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_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier or set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param will be used.

'image_resize_value'"image_resize_value""image_resize_value""image_resize_value""image_resize_value""image_resize_value":

See create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier for a description of this parameter.

Suggested values: 0.25, 0.5, 1.0, 2, 3, 4

Default value: If the 'image_resize_value'"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_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier or set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param will be used.

add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data returns the object sample index of the training sample given in SampleImageSampleImageSampleImageSampleImagesampleImagesample_image. This index can, e.g., be used to remove this sample from the training data, if the sample identifier should be retrained based on a different set of training data.

运行信息

参数表

SampleImageSampleImageSampleImageSampleImagesampleImagesample_image (input_object)  (multichannel-)image objectHImageHObjectHImageHobject (byte)

Image that shows an object.

SampleIdentifierSampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier (input_control)  sample_identifier HSampleIdentifier, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the sample identifier.

ObjectIdxObjectIdxObjectIdxObjectIdxobjectIdxobject_idx (input_control)  integer HTupleUnion[int, str]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Index of the object visible in the SampleImageSampleImageSampleImageSampleImagesampleImagesample_image.

Suggested values: 0, 1, 2, 3, 4, 5

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_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_method", 'image_resize_value'"image_resize_value""image_resize_value""image_resize_value""image_resize_value""image_resize_value"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_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""none", 'scale_factor'"scale_factor""scale_factor""scale_factor""scale_factor""scale_factor", 'subsampling_step'"subsampling_step""subsampling_step""subsampling_step""subsampling_step""subsampling_step", 'image_area'"image_area""image_area""image_area""image_area""image_area", 0.25, 0.5, 0.75, 1.0, 2, 3, 4

ObjectSampleIdxObjectSampleIdxObjectSampleIdxObjectSampleIdxobjectSampleIdxobject_sample_idx (output_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Index of the object sample.

结果

如果参数均有效,算子 add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data 返回值 2 ( H_MSG_TRUE) . If necessary an exception is raised.

可能的前置算子

prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier, read_sample_identifierread_sample_identifierReadSampleIdentifierReadSampleIdentifierReadSampleIdentifierread_sample_identifier

可能的后置算子

train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier

可替代算子

read_sample_identifierread_sample_identifierReadSampleIdentifierReadSampleIdentifierReadSampleIdentifierread_sample_identifier

参考其它

create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier, add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data, apply_sample_identifierapply_sample_identifierApplySampleIdentifierApplySampleIdentifierApplySampleIdentifierapply_sample_identifier, set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param, get_sample_identifier_paramget_sample_identifier_paramGetSampleIdentifierParamGetSampleIdentifierParamGetSampleIdentifierParamget_sample_identifier_param, get_sample_identifier_object_infoget_sample_identifier_object_infoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfoget_sample_identifier_object_info, remove_sample_identifier_preparation_dataremove_sample_identifier_preparation_dataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationDataremove_sample_identifier_preparation_data, remove_sample_identifier_training_dataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingDataremove_sample_identifier_training_data, write_sample_identifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifierWriteSampleIdentifierwrite_sample_identifier, serialize_sample_identifierserialize_sample_identifierSerializeSampleIdentifierSerializeSampleIdentifierSerializeSampleIdentifierserialize_sample_identifier, deserialize_sample_identifierdeserialize_sample_identifierDeserializeSampleIdentifierDeserializeSampleIdentifierDeserializeSampleIdentifierdeserialize_sample_identifier, clear_sample_identifierclear_sample_identifierClearSampleIdentifierClearSampleIdentifierClearSampleIdentifierclear_sample_identifier, set_sample_identifier_object_infoset_sample_identifier_object_infoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfoset_sample_identifier_object_info

模块

Matching