Herror ::do_ocv_simple (
    Hobject Pattern,
    const HTuple &OCVHandle,
    const HTuple &PatternName,
    const HTuple &AdaptPos,
    const HTuple &AdaptSize,
    const HTuple &AdaptAngle,
    const HTuple &AdaptGray,
    const HTuple &Threshold,
    double *Quality
)
Herror ::do_ocv_simple (
    Hobject Pattern,
    const HTuple &OCVHandle,
    const HTuple &PatternName,
    const HTuple &AdaptPos,
    const HTuple &AdaptSize,
    const HTuple &AdaptAngle,
    const HTuple &AdaptGray,
    const HTuple &Threshold,
    HTuple *Quality
)
double HImage::DoOcvSimple (
    const HTuple &OCVHandle,
    const HTuple &PatternName,
    const HTuple &AdaptPos,
    const HTuple &AdaptSize,
    const HTuple &AdaptAngle,
    const HTuple &AdaptGray,
    const HTuple &Threshold
) const
HTuple HImageArray::DoOcvSimple (
    const HTuple &OCVHandle,
    const HTuple &PatternName,
    const HTuple &AdaptPos,
    const HTuple &AdaptSize,
    const HTuple &AdaptAngle,
    const HTuple &AdaptGray,
    const HTuple &Threshold
) const

Verification of a pattern using an OCV tool.

::do_ocv_simple evaluates the pattern in (Pattern). Before the evaluation the good-pattern has be trained by using the operator ::traind_ocv_proj. Both patterns should have roughly the same (relative) extent and shape. To specify which of the trained patterns is used as reference its name is specified in PatternName. The next four parameters influence the automatic adaption: AdaptPos and AdaptSize refer to the geometry of the pattern. AdaptPos specifies whether a shift of the position will be adapted automatically. AdaptSize is used to adapt to changes in the size of the pattern. AdaptAngle is not yet implemented. The parameter AdaptGray controls the adaption to changes of the grayvalues. This comprises additive and multiplicative changes of the intensity.

The parameter Threshold specifies the minimum difference of the gray values to be treated as an error. In this case the percentage of wrong pixels is returned. If the value is below 0 the sum of all errors normalized with respect to the size is returned.

The result of the operator is the Quality of the pattern with a value between 0 and 1. The value 1 corresponds to a pattern with no faults. The value 0 corresponds to a very big fault.


Parameters

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

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

PatternName (input_control)
string(-array) -> HTuple.char *
Name of the character.
Default value: ''a''

AdaptPos (input_control)
string -> HTuple.char *
Adaption to vertical and horizontal translation.
Default value: ''true''
List of values: ''true'', ''false''

AdaptSize (input_control)
string -> HTuple.char *
Adaption to vertical and horizontal scaling of the size.
Default value: ''true''
List of values: ''true'', ''false''

AdaptAngle (input_control)
string -> HTuple.char *
Adaption to changes of the orientation (not yet implemented).
Default value: ''false''
List of values: ''false''

AdaptGray (input_control)
string -> HTuple.char *
Adaption to additive and scaling gray value changes.
Default value: ''true''
List of values: ''true'', ''false''

Threshold (input_control)
number -> HTuple.double
Minimum difference between objects.
Default value: 10
Suggested values: -1, 0, 1, 5, 10, 15, 20, 30, 40, 50, 60, 80, 100, 150

Quality (output_control)
real(-array) -> (HTuple.) double *
Evaluation of the character.
Typical range of values: 0.0 <= Quality <= 1.0


Result

::do_ocv_simple returns H_MSG_TRUE, if the handle and the characters are correct. Otherwise, an exception handling is raised.


Possible Predecessors

::traind_ocr_class_box, ::trainf_ocr_class_box, ::read_ocv, ::threshold, ::connection, ::select_shape


Possible Successors

::close_ocv


See also

::create_ocv_proj


Module

Optical character verification



Copyright © 1996-2002 MVTec Software GmbH