do_ocv_simpleT_do_ocv_simpleDoOcvSimpleDoOcvSimpledo_ocv_simple(算子)
名称
do_ocv_simpleT_do_ocv_simpleDoOcvSimpleDoOcvSimpledo_ocv_simple — 使用 OCV 工具验证模式。
签名
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)
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)
static void HOperatorSet.DoOcvSimple(HObject pattern, HTuple OCVHandle, HTuple patternName, HTuple adaptPos, HTuple adaptSize, HTuple adaptAngle, HTuple adaptGray, HTuple threshold, out HTuple quality)
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)
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) -> float
描述
do_ocv_simpledo_ocv_simpleDoOcvSimpleDoOcvSimpleDoOcvSimpledo_ocv_simple evaluates the pattern in (PatternPatternPatternPatternpatternpattern).
Before the evaluation the good-pattern has to be trained by using
the operator traind_ocv_projtraind_ocv_projTraindOcvProjTraindOcvProjTraindOcvProjtraind_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 PatternNamePatternNamePatternNamePatternNamepatternNamepattern_name.
The next four parameters influence the automatic adaption:
AdaptPosAdaptPosAdaptPosAdaptPosadaptPosadapt_pos 和 AdaptSizeAdaptSizeAdaptSizeAdaptSizeadaptSizeadapt_size refer to the geometry
of the pattern. AdaptPosAdaptPosAdaptPosAdaptPosadaptPosadapt_pos specifies whether a shift of the
position will be adapted automatically. AdaptSizeAdaptSizeAdaptSizeAdaptSizeadaptSizeadapt_size
is used to adapt to changes in the size of the pattern.
AdaptAngleAdaptAngleAdaptAngleAdaptAngleadaptAngleadapt_angle is not implemented.
The parameter AdaptGrayAdaptGrayAdaptGrayAdaptGrayadaptGrayadapt_gray controls the adaption to changes of
the gray values. This comprises additive and multiplicative changes
of the intensity.
The parameter ThresholdThresholdThresholdThresholdthresholdthreshold 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 QualityQualityQualityQualityqualityquality 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.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
PatternPatternPatternPatternpatternpattern (输入对象) singlechannelimage(-array) → objectHImageHObjectHImageHobject (byte)
Characters to be verified.
OCVHandleOCVHandleOCVHandleOCVHandleOCVHandleocvhandle (输入控制) ocv → HOCV, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the OCV tool.
PatternNamePatternNamePatternNamePatternNamepatternNamepattern_name (输入控制) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Name of the character.
默认值:
'a'
"a"
"a"
"a"
"a"
"a"
AdaptPosAdaptPosAdaptPosAdaptPosadaptPosadapt_pos (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Adaption to vertical and horizontal translation.
默认值:
'true'
"true"
"true"
"true"
"true"
"true"
值列表:
'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
AdaptSizeAdaptSizeAdaptSizeAdaptSizeadaptSizeadapt_size (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Adaption to vertical and horizontal scaling of
the size.
默认值:
'true'
"true"
"true"
"true"
"true"
"true"
值列表:
'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
AdaptAngleAdaptAngleAdaptAngleAdaptAngleadaptAngleadapt_angle (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Adaption to changes of the orientation
(not implemented).
默认值:
'false'
"false"
"false"
"false"
"false"
"false"
值列表:
'false'"false""false""false""false""false"
AdaptGrayAdaptGrayAdaptGrayAdaptGrayadaptGrayadapt_gray (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Adaption to additive and scaling gray value changes.
默认值:
'true'
"true"
"true"
"true"
"true"
"true"
值列表:
'false'"false""false""false""false""false", 'true'"true""true""true""true""true"
ThresholdThresholdThresholdThresholdthresholdthreshold (输入控制) number → HTuplefloatHTupleHtuple (real) (double) (double) (double)
Minimum difference between objects.
默认值:
10
建议值:
-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
QualityQualityQualityQualityqualityquality (输出控制) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Evaluation of the character.
值范围:
0.0
≤
Quality
Quality
Quality
Quality
quality
quality
≤
1.0
结果
do_ocv_simpledo_ocv_simpleDoOcvSimpleDoOcvSimpleDoOcvSimpledo_ocv_simple 返回 2 (H_MSG_TRUE)
, if
the handle and the characters are correct.否则,将抛出异常。
可能的前趋
traind_ocr_class_boxtraind_ocr_class_boxTraindOcrClassBoxTraindOcrClassBoxTraindOcrClassBoxtraind_ocr_class_box,
trainf_ocr_class_boxtrainf_ocr_class_boxTrainfOcrClassBoxTrainfOcrClassBoxTrainfOcrClassBoxtrainf_ocr_class_box,
read_ocvread_ocvReadOcvReadOcvReadOcvread_ocv,
thresholdthresholdThresholdThresholdThresholdthreshold,
connectionconnectionConnectionConnectionConnectionconnection,
select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape
可能的后继
close_ocvclose_ocvCloseOcvCloseOcvCloseOcvclose_ocv
另见
create_ocv_projcreate_ocv_projCreateOcvProjCreateOcvProjCreateOcvProjcreate_ocv_proj
模块
光学字符识别/光学字符验证