Herror ::learn_ndim_box (
    Hobject Foreground,
    Hobject Background,
    Hobject MultiChannelImage,
    const HTuple &ClassifHandle
)
void HRegion::LearnNdimBox (
    const HRegionArray &Background,
    const HImageArray &MultiChannelImage,
    const HTuple &ClassifHandle
) const
void HRegionArray::LearnNdimBox (
    const HRegionArray &Background,
    const HImageArray &MultiChannelImage,
    const HTuple &ClassifHandle
) const

Train the current classificator using a multi-channel image.

::learn_ndim_box trains the classificator ClassifHandle with the gray values of MultiChannelImage using the points in Foreground as training sample. The points in Background are to be rejected by the classificator. The classificator trained thus can be used in ::learn_ndim_box to segment multi-channel images. Foreground are the points that have to be found, Background contains the points which shall not be found.

Each pixel is trained once during the training process. For points in Foreground the class ``0'' is used, while for Background ``1'' is used. Pixels are trained by alternating points from Foreground with points from Background. If one region is smaller than the other, pixels are taken cyclically from the smaller region until the larger region is exhausted. ::learn_ndim_box later accepts only points which can be classified into class ``0''.


Attention

All channels must be of the same type and have the same size.


Parameters

Foreground (input_object)
region(-array) -> Hobject: HRegion(Array)
Foreground pixels to be trained.

Background (input_object)
region(-array) -> Hobject: HRegion(Array)
Background pixels to be trained (rejection class).

MultiChannelImage (input_object)
multichannel-image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 / real / direction / cyclic )
Multi-channel training image.

ClassifHandle (input_control)
class_box -> HTuple.long
Classificator's handle number.


Complexity

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


Result

::class_ndim_box returns 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' and 'empty_region_result' with ::set_system. If necessary, an exception is raised.


Possible Predecessors

::create_class_box, ::draw_region


Possible Successors

::class_ndim_box, ::descript_class_box


Alternatives

::learn_class_box


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH