Train the current classifier using a multi-channel image.
learn_ndim2__ trains the current classifier (type 2) with the gray values of MultiChannelImage using the points in Foreground as training sample. The points in Background are to be rejected by the classifier. The classifier trained thus can be used in class_ndim2__ to segment multi-channel images.
Before calling learn_ndim2__, a classifier must be activated. This can be done by calling create_classif2 or set_classif2. More information on this can be obtained from the description of learn_classif2.
Each pixel is trained once during the training process. For points in Foreground the class ``0'' is used, whilw 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. class_ndim2__ later accepts only points which can be classified into class ``0''.
All channels must be of the same type and have the same size.
Foreground (input_object) |
region(-array) -> object |
Foreground pixels to be trained. |
Background (input_object) |
region(-array) -> object |
Background pixels to be trained (rejection class). |
MultiChannelImage (input_object) |
multichannel-image(-array) -> object : byte / int4 / real |
Multi-channel training image. |
NumberOfChannels (input_control) |
integer -> integer |
Number of gray channels. | |
Default value: 3 | |
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8 |
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).
learn_ndim2__ returns TRUE if all parameters are correct and there is an active classifier. The behaviour 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.
create_classif2, set_classif2, draw_region
class_ndim2__, descript_classif2