Herror ::traind_ocv_proj (
    Hobject Pattern,
    const HTuple &OCVHandle,
    const HTuple &Name,
    const HTuple &Mode
)
void HImage::TraindOcvProj (
    const HTuple &OCVHandle,
    const HTuple &Name,
    const HTuple &Mode
) const
void HImageArray::TraindOcvProj (
    const HTuple &OCVHandle,
    const HTuple &Name,
    const HTuple &Mode
) const

Training of an OCV tool.

::traind_ocv_proj trains patterns for an OCV tool that has been created using the operators ::create_ocv_proj or ::read_ocv. For this training one or multiple patterns are offered the system. Such a pattern consists of an image with a reduced domain (ROI) for the area of the pattern. Note that the pattern should not only contain foreground pixels (e.g. dark pixels of a character) but also background pixels. This can be implemented e.g. by the smallest surrounding rectangle of the pattern. Without this context an evaluation of the pattern is not possible.

If more than one pattern has to be trained this can be achieved by multiple calls (one for each pattern) or by calling ::traind_ocv_proj once with all patterns and a tuple of the corresponding names. The result will be in both cases the same. However using multiple calls will normally result in a longer execution time than using one call with all patterns.


Parameters

Pattern (input_object)
image(-array) -> Hobject: HImage(Array)
Pattern to be trained.

OCVHandle (input_control)
ocv -> HTuple.long
Handle of the OCV tool to be trained.

Name (input_control)
string(-array) -> HTuple.char *
Name(s) of the object(s) to analyse.
Default value: ''a''

Mode (input_control)
string -> HTuple.char *
Mode for training (only one mode implemented).
Default value: 'single'
List of values: 'single'


Example
create_ocv_proj("A",&ocv_handle);
draw_region(&ROI,window_handle);
reduce_domain(Image,ROI,&Sample);
traind_ocv_proj(Sample,ocv_handle,"A","single");

Result

::traind_ocv_proj returns H_MSG_TRUE, if the handle and the training pattern(s) are correct. Otherwise, an exception handling is raised.


Possible Predecessors

::write_ocr_trainf, ::create_ocv_proj, ::read_ocv, ::threshold, ::connection, ::select_shape


Possible Successors

::close_ocv


See also

::traind_ocr_class_box


Module

Optical character verification



Copyright © 1996-2002 MVTec Software GmbH