do_ocv_simple ( Pattern : : OCVHandle, PatternName, AdaptPos, AdaptSize, AdaptAngle, AdaptGray, Threshold : Quality )

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) -> object : byte
Characters to be verified.

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

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

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

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

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

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

Threshold (input_control)
number -> real
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) -> real
Evaluation of the character.
Typical range of values: 0.0 <= Quality <= 1.0


Result

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


Parallelization Information

do_ocv_simple is reentrant and processed without parallelization.


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-2005 MVTec Software GmbH