do_ocv_simpleDoOcvSimpleDoOcvSimpledo_ocv_simpleT_do_ocv_simple
Short description
do_ocv_simpleDoOcvSimpleDoOcvSimpledo_ocv_simpleT_do_ocv_simple — Verification of a pattern using an OCV tool.
Signature
do_ocv_simple( image Pattern, ocv OCVHandle, string PatternName, string AdaptPos, string AdaptSize, string AdaptAngle, string AdaptGray, number Threshold, out real Quality )void DoOcvSimple( const 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 )static void HOperatorSet.DoOcvSimple( HObject pattern, HTuple OCVHandle, HTuple patternName, HTuple adaptPos, HTuple adaptSize, HTuple adaptAngle, HTuple adaptGray, HTuple threshold, out HTuple quality )def do_ocv_simple( pattern: HObject, ocvhandle: HHandle, pattern_name: MaybeSequence[str], adapt_pos: str, adapt_size: str, adapt_angle: str, adapt_gray: str, threshold: float ) -> Sequence[float]
def do_ocv_simple_s( pattern: HObject, ocvhandle: HHandle, pattern_name: MaybeSequence[str], adapt_pos: str, adapt_size: str, adapt_angle: str, adapt_gray: str, threshold: float ) -> floatHerror T_do_ocv_simple( const 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 )
HTuple HImage::DoOcvSimple( const HOCV& OCVHandle, const HTuple& PatternName, const HString& AdaptPos, const HString& AdaptSize, const HString& AdaptAngle, const HString& AdaptGray, double Threshold ) const
double HImage::DoOcvSimple( const HOCV& OCVHandle, const HString& PatternName, const HString& AdaptPos, const HString& AdaptSize, const HString& AdaptAngle, const HString& AdaptGray, double Threshold ) const
double HImage::DoOcvSimple( const HOCV& OCVHandle, const char* PatternName, const char* AdaptPos, const char* AdaptSize, const char* AdaptAngle, const char* AdaptGray, double Threshold ) const
double HImage::DoOcvSimple( const HOCV& OCVHandle, const wchar_t* PatternName, const wchar_t* AdaptPos, const wchar_t* AdaptSize, const wchar_t* AdaptAngle, const wchar_t* AdaptGray, double Threshold ) const (Windows only)
HTuple HOCV::DoOcvSimple( const HImage& Pattern, const HTuple& PatternName, const HString& AdaptPos, const HString& AdaptSize, const HString& AdaptAngle, const HString& AdaptGray, double Threshold ) const
double HOCV::DoOcvSimple( const HImage& Pattern, const HString& PatternName, const HString& AdaptPos, const HString& AdaptSize, const HString& AdaptAngle, const HString& AdaptGray, double Threshold ) const
double HOCV::DoOcvSimple( const HImage& Pattern, const char* PatternName, const char* AdaptPos, const char* AdaptSize, const char* AdaptAngle, const char* AdaptGray, double Threshold ) const
double HOCV::DoOcvSimple( const HImage& Pattern, const wchar_t* PatternName, const wchar_t* AdaptPos, const wchar_t* AdaptSize, const wchar_t* AdaptAngle, const wchar_t* AdaptGray, double Threshold ) const (Windows only)
HTuple HImage.DoOcvSimple( HOCV OCVHandle, HTuple patternName, string adaptPos, string adaptSize, string adaptAngle, string adaptGray, double threshold )
double HImage.DoOcvSimple( HOCV OCVHandle, string patternName, string adaptPos, string adaptSize, string adaptAngle, string adaptGray, double threshold )
HTuple HOCV.DoOcvSimple( HImage pattern, HTuple patternName, string adaptPos, string adaptSize, string adaptAngle, string adaptGray, double threshold )
double HOCV.DoOcvSimple( HImage pattern, string patternName, string adaptPos, string adaptSize, string adaptAngle, string adaptGray, double threshold )
Description
do_ocv_simpleDoOcvSimple evaluates the pattern in (Patternpatternpattern).
Before the evaluation the good-pattern has to be trained by using
the operator traind_ocv_projTraindOcvProj. 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 PatternNamepatternNamepattern_name.
The next four parameters influence the automatic adaption:
AdaptPosadaptPosadapt_pos and AdaptSizeadaptSizeadapt_size refer to the geometry
of the pattern. AdaptPosadaptPosadapt_pos specifies whether a shift of the
position will be adapted automatically. AdaptSizeadaptSizeadapt_size
is used to adapt to changes in the size of the pattern.
AdaptAngleadaptAngleadapt_angle is not implemented.
The parameter AdaptGrayadaptGrayadapt_gray controls the adaption to changes of
the gray values. This comprises additive and multiplicative changes
of the intensity.
The parameter Thresholdthresholdthreshold 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 Qualityqualityquality 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.
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters
Patternpatternpattern (input_object) singlechannelimage(-array) → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)
Characters to be verified.
OCVHandleOCVHandleocvhandle (input_control) ocv → (handle)HTuple (HHandle)HOCV, HTuple (IntPtr)HHandleHtuple (handle)
Handle of the OCV tool.
PatternNamepatternNamepattern_name (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)
Name of the character.
Default: 'a'"a"
AdaptPosadaptPosadapt_pos (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
Adaption to vertical and horizontal translation.
Default: 'true'"true"
List of values: 'false', 'true'"false", "true"
AdaptSizeadaptSizeadapt_size (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
Adaption to vertical and horizontal scaling of
the size.
Default: 'true'"true"
List of values: 'false', 'true'"false", "true"
AdaptAngleadaptAngleadapt_angle (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
Adaption to changes of the orientation
(not implemented).
Default: 'false'"false"
List of values: 'false'"false"
AdaptGrayadaptGrayadapt_gray (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)
Adaption to additive and scaling gray value changes.
Default: 'true'"true"
List of values: 'false', 'true'"false", "true"
Thresholdthresholdthreshold (input_control) number → (real)HTuple (double)HTuple (double)floatHtuple (double)
Minimum difference between objects.
Default: 1010
Suggested values: -1.0, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 100.0, 150.0-1.0, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 60.0, 80.0, 100.0, 150.0
Qualityqualityquality (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)
Evaluation of the character.
Value range: 0.0 ≤ Quality ≤ 1.0
Result
do_ocv_simpleDoOcvSimple returns 2 (H_MSG_TRUE), if
the handle and the characters are correct.
Otherwise, an exception is raised.
Combinations with other operators
Combinations
Possible predecessors
traind_ocr_class_boxTraindOcrClassBox, trainf_ocr_class_boxTrainfOcrClassBox, read_ocvReadOcv, thresholdThreshold, connectionConnection, select_shapeSelectShape
Possible successors
close_ocvCloseOcv
See also
create_ocv_projCreateOcvProj
Module
OCR/OCV