add_samples_image_class_mlpT_add_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpadd_samples_image_class_mlp (Operator)

Name

add_samples_image_class_mlpT_add_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpadd_samples_image_class_mlp — Add training samples from an image to the training data of a multilayer perceptron.

Signature

add_samples_image_class_mlp(Image, ClassRegions : : MLPHandle : )

Herror T_add_samples_image_class_mlp(const Hobject Image, const Hobject ClassRegions, const Htuple MLPHandle)

void AddSamplesImageClassMlp(const HObject& Image, const HObject& ClassRegions, const HTuple& MLPHandle)

void HImage::AddSamplesImageClassMlp(const HRegion& ClassRegions, const HClassMlp& MLPHandle) const

void HClassMlp::AddSamplesImageClassMlp(const HImage& Image, const HRegion& ClassRegions) const

static void HOperatorSet.AddSamplesImageClassMlp(HObject image, HObject classRegions, HTuple MLPHandle)

void HImage.AddSamplesImageClassMlp(HRegion classRegions, HClassMlp MLPHandle)

void HClassMlp.AddSamplesImageClassMlp(HImage image, HRegion classRegions)

def add_samples_image_class_mlp(image: HObject, class_regions: HObject, mlphandle: HHandle) -> None

Description

add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlpadd_samples_image_class_mlp adds training samples from the image ImageImageImageImageimageimage to the multilayer perceptron (MLP) given by MLPHandleMLPHandleMLPHandleMLPHandleMLPHandlemlphandle. add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlpadd_samples_image_class_mlp is used to store the training samples before a classifier to be used for the pixel classification of multichannel images with classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlpclassify_image_class_mlp is trained. add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlpadd_samples_image_class_mlp works analogously to add_sample_class_mlpadd_sample_class_mlpAddSampleClassMlpAddSampleClassMlpAddSampleClassMlpadd_sample_class_mlp. Because here the MLP is always used for classification, OutputFunctionOutputFunctionOutputFunctionOutputFunctionoutputFunctionoutput_function = 'softmax'"softmax""softmax""softmax""softmax""softmax" must be specified when the MLP is created with create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlpcreate_class_mlp. The image ImageImageImageImageimageimage must have a number of channels equal to NumInputNumInputNumInputNumInputnumInputnum_input, as specified with create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlpcreate_class_mlp. The training regions for the NumOutputNumOutputNumOutputNumOutputnumOutputnum_output pixel classes are passed in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions. Hence, ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions must be a tuple containing NumOutputNumOutputNumOutputNumOutputnumOutputnum_output regions. The order of the regions in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions determines the class of the pixels. If there are no samples for a particular class in ImageImageImageImageimageimage an empty region must be passed at the position of the class in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions. With this mechanism it is possible to use multiple images to add training samples for all relevant classes to the MLP by calling add_samples_image_class_mlpadd_samples_image_class_mlpAddSamplesImageClassMlpAddSamplesImageClassMlpAddSamplesImageClassMlpadd_samples_image_class_mlp multiple times with the different images and suitably chosen regions. The regions in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions should contain representative training samples for the respective classes. Hence, they need not cover the entire image. The regions in ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions should not overlap each other, because this would lead to the fact that in the training data the samples from the overlapping areas would be assigned to multiple classes, which may lead to slower convergence of the training and a lower classification performance.

Execution Information

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters

ImageImageImageImageimageimage (input_object)  (multichannel-)image objectHImageHObjectHImageHobject (byte / cyclic / direction / int1 / int2 / uint2 / int4 / real)

Training image.

ClassRegionsClassRegionsClassRegionsClassRegionsclassRegionsclass_regions (input_object)  region-array objectHRegionHObjectHRegionHobject

Regions of the classes to be trained.

MLPHandleMLPHandleMLPHandleMLPHandleMLPHandlemlphandle (input_control, state is modified)  class_mlp HClassMlp, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

MLP handle.

Result

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

Possible Predecessors

create_class_mlpcreate_class_mlpCreateClassMlpCreateClassMlpCreateClassMlpcreate_class_mlp

Possible Successors

train_class_mlptrain_class_mlpTrainClassMlpTrainClassMlpTrainClassMlptrain_class_mlp, write_samples_class_mlpwrite_samples_class_mlpWriteSamplesClassMlpWriteSamplesClassMlpWriteSamplesClassMlpwrite_samples_class_mlp

Alternatives

read_samples_class_mlpread_samples_class_mlpReadSamplesClassMlpReadSamplesClassMlpReadSamplesClassMlpread_samples_class_mlp

See also

classify_image_class_mlpclassify_image_class_mlpClassifyImageClassMlpClassifyImageClassMlpClassifyImageClassMlpclassify_image_class_mlp, add_sample_class_mlpadd_sample_class_mlpAddSampleClassMlpAddSampleClassMlpAddSampleClassMlpadd_sample_class_mlp, clear_samples_class_mlpclear_samples_class_mlpClearSamplesClassMlpClearSamplesClassMlpClearSamplesClassMlpclear_samples_class_mlp, get_sample_num_class_mlpget_sample_num_class_mlpGetSampleNumClassMlpGetSampleNumClassMlpGetSampleNumClassMlpget_sample_num_class_mlp, get_sample_class_mlpget_sample_class_mlpGetSampleClassMlpGetSampleClassMlpGetSampleClassMlpget_sample_class_mlp, add_samples_image_class_svmadd_samples_image_class_svmAddSamplesImageClassSvmAddSamplesImageClassSvmAddSamplesImageClassSvmadd_samples_image_class_svm

Module

Foundation