HALCON Reference Manual 10.0.2
Table of Contents / Segmentation / Classification ClassesClassesClasses | | | Operators

learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox (Operator)

Name

learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox — Train a classificator using a multi-channel image.

Signature

learn_ndim_box(Foreground, Background, MultiChannelImage : : ClassifHandle : )

Herror learn_ndim_box(const Hobject Foreground, const Hobject Background, const Hobject MultiChannelImage, const Hlong ClassifHandle)

Herror T_learn_ndim_box(const Hobject Foreground, const Hobject Background, const Hobject MultiChannelImage, const Htuple ClassifHandle)

Herror learn_ndim_box(Hobject Foreground, Hobject Background, Hobject MultiChannelImage, const HTuple& ClassifHandle)

void HRegion::LearnNdimBox(const HRegion& Background, const HImage& MultiChannelImage, const HClassBox& ClassifHandle) const

void HRegionArray::LearnNdimBox(const HRegionArray& Background, const HImageArray& MultiChannelImage, const HClassBox& ClassifHandle) const

void HClassBox::LearnNdimBox(const HRegionArray& Foreground, const HRegionArray& Background, const HImageArray& MultiChannelImage) const

void HOperatorSetX.LearnNdimBox(
[in] IHUntypedObjectX* Foreground, [in] IHUntypedObjectX* Background, [in] IHUntypedObjectX* MultiChannelImage, [in] VARIANT ClassifHandle)

void HImageX.LearnNdimBox(
[in] IHRegionX* Foreground, [in] IHRegionX* Background, [in] IHClassBoxX* ClassifHandle)

void HRegionX.LearnNdimBox(
[in] IHRegionX* Background, [in] IHImageX* MultiChannelImage, [in] IHClassBoxX* ClassifHandle)

void HClassBoxX.LearnNdimBox(
[in] IHRegionX* Foreground, [in] IHRegionX* Background, [in] IHImageX* MultiChannelImage)

static void HOperatorSet.LearnNdimBox(HObject foreground, HObject background, HObject multiChannelImage, HTuple classifHandle)

void HImage.LearnNdimBox(HRegion foreground, HRegion background, HClassBox classifHandle)

void HRegion.LearnNdimBox(HRegion background, HImage multiChannelImage, HClassBox classifHandle)

void HClassBox.LearnNdimBox(HRegion foreground, HRegion background, HImage multiChannelImage)

Description

learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox trains the classificator ClassifHandleClassifHandleClassifHandleClassifHandleclassifHandle with the gray values of MultiChannelImageMultiChannelImageMultiChannelImageMultiChannelImagemultiChannelImage using the points in ForegroundForegroundForegroundForegroundforeground as training sample. The points in BackgroundBackgroundBackgroundBackgroundbackground are to be rejected by the classificator. The classificator trained thus can be used in class_ndim_boxclass_ndim_boxclass_ndim_boxClassNdimBoxClassNdimBox to segment multi-channel images. ForegroundForegroundForegroundForegroundforeground are the points that should be found, BackgroundBackgroundBackgroundBackgroundbackground contains the points that should not be found.

Each pixel is trained once during the training process. For points in ForegroundForegroundForegroundForegroundforeground the class “0” is used, while for BackgroundBackgroundBackgroundBackgroundbackground “1” is used. Pixels are trained by alternating points from ForegroundForegroundForegroundForegroundforeground with points from BackgroundBackgroundBackgroundBackgroundbackground. If one region is smaller than the other, pixels are taken cyclically from the smaller region until the larger region is exhausted. learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox later accepts only points that can be classified into class “0”.

From a user's point of view the key difference between learn_ndim_normlearn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNorm and learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox is that in the latter case the rejection class affects the classification process itself. Here, a hyper plane is generated that separates ForegroundForegroundForegroundForegroundforeground and BackgroundBackgroundBackgroundBackgroundbackground classes, so that no points in feature space are classified incorrectly. As for learn_ndim_normlearn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNorm, however, an overlap between ForegroundForegroundForegroundForegroundforeground and BackgroundBackgroundBackgroundBackgroundbackground class is allowed. This has its effect on the return value Quality. The larger the overlap, the smaller this value.

Attention

All channels must be of the same type.

Parallelization

Parameters

ForegroundForegroundForegroundForegroundforeground (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Foreground pixels to be trained.

BackgroundBackgroundBackgroundBackgroundbackground (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Background pixels to be trained (rejection class).

MultiChannelImageMultiChannelImageMultiChannelImageMultiChannelImagemultiChannelImage (input_object)  multichannel-image(-array) objectHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / int4 / real)

Multi-channel training image.

ClassifHandleClassifHandleClassifHandleClassifHandleclassifHandle (input_control)  class_box HClassBox, HTupleHClassBox, HTupleHClassBoxX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Handle of the classifier.

Complexity

Let N be the number of generated hyper-cuboids and A be the area of the larger input region. Then the runtime complexity is O(N * A).

Result

learn_ndim_boxlearn_ndim_boxlearn_ndim_boxLearnNdimBoxLearnNdimBox returns 2 (H_MSG_TRUE) if all parameters are correct and there is an active classificator. The behavior with respect to the input images can be determined by setting the values of the flags 'no_object_result'"no_object_result""no_object_result""no_object_result""no_object_result" and 'empty_region_result'"empty_region_result""empty_region_result""empty_region_result""empty_region_result" with set_systemset_systemset_systemSetSystemSetSystem. If necessary, an exception is raised.

Possible Predecessors

create_class_boxcreate_class_boxcreate_class_boxCreateClassBoxCreateClassBox, draw_regiondraw_regiondraw_regionDrawRegionDrawRegion

Possible Successors

class_ndim_boxclass_ndim_boxclass_ndim_boxClassNdimBoxClassNdimBox, descript_class_boxdescript_class_boxdescript_class_boxDescriptClassBoxDescriptClassBox

Alternatives

learn_class_boxlearn_class_boxlearn_class_boxLearnClassBoxLearnClassBox, learn_ndim_normlearn_ndim_normlearn_ndim_normLearnNdimNormLearnNdimNorm

Module

Foundation


Table of Contents / Segmentation / Classification ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH