create_ocv_projT_create_ocv_projCreateOcvProjCreateOcvProjcreate_ocv_proj (算子)

名称

create_ocv_projT_create_ocv_projCreateOcvProjCreateOcvProjcreate_ocv_proj — 基于灰度值投影创建新的 OCV 工具。

签名

create_ocv_proj( : : PatternNames : OCVHandle)

Herror T_create_ocv_proj(const Htuple PatternNames, Htuple* OCVHandle)

void CreateOcvProj(const HTuple& PatternNames, HTuple* OCVHandle)

void HOCV::HOCV(const HTuple& PatternNames)

void HOCV::CreateOcvProj(const HTuple& PatternNames)

void HOCV::CreateOcvProj(const HString& PatternNames)

void HOCV::CreateOcvProj(const char* PatternNames)

void HOCV::CreateOcvProj(const wchar_t* PatternNames)   ( Windows only)

static void HOperatorSet.CreateOcvProj(HTuple patternNames, out HTuple OCVHandle)

public HOCV(HTuple patternNames)

void HOCV.CreateOcvProj(HTuple patternNames)

void HOCV.CreateOcvProj(string patternNames)

def create_ocv_proj(pattern_names: MaybeSequence[str]) -> HHandle

描述

create_ocv_projcreate_ocv_projCreateOcvProjCreateOcvProjCreateOcvProjcreate_ocv_proj creates a new OCV tool. This tool will be used to train good-patterns for the optical character verification. The training is done using the operator traind_ocv_projtraind_ocv_projTraindOcvProjTraindOcvProjTraindOcvProjtraind_ocv_proj。Thus traind_ocv_projtraind_ocv_projTraindOcvProjTraindOcvProjTraindOcvProjtraind_ocv_proj is normally called after create_ocv_projcreate_ocv_projCreateOcvProjCreateOcvProjCreateOcvProjcreate_ocv_proj.

The pattern comparison is based on the gray projections: For every training pattern the horizontal and vertical gray projections are calculated by summing up the gray values along the rows and columns inside the region of the pattern. This operation is applied to the training patterns and the test patterns. For the training patterns the result is stored inside the OCV tool to save runtime while comparing patterns. The OCV is done by comparing the corresponding projections. The Quality is the similarity of the projections.

Input for create_ocv_projcreate_ocv_projCreateOcvProjCreateOcvProjCreateOcvProjcreate_ocv_proj are the names of the patterns (PatternNamesPatternNamesPatternNamesPatternNamespatternNamespattern_names) which have to be trained. The number and the names can be chosen arbitrary. In most case only one pattern will be trained, thus only one name has to be specified. The names will be used when doing the OCV (do_ocv_simpledo_ocv_simpleDoOcvSimpleDoOcvSimpleDoOcvSimpledo_ocv_simple). It is possible to specify more names than actually used. These might be trained later.

To close the OCV tool, i.e. to free the memory, the operator close_ocvclose_ocvCloseOcvCloseOcvCloseOcvclose_ocv is called.

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

PatternNamesPatternNamesPatternNamesPatternNamespatternNamespattern_names (输入控制)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

List of names for patterns to be trained.

默认值: 'a' "a" "a" "a" "a" "a"

OCVHandleOCVHandleOCVHandleOCVHandleOCVHandleocvhandle (输出控制)  ocv HOCV, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the created OCV tool.

示例 (C++ (HALCON 5.0-10.0))

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

结果

create_ocv_projcreate_ocv_projCreateOcvProjCreateOcvProjCreateOcvProjcreate_ocv_proj 返回 2 ( H_MSG_TRUE ),如果参数正确。否则,将抛出异常。

可能的后继

traind_ocv_projtraind_ocv_projTraindOcvProjTraindOcvProjTraindOcvProjtraind_ocv_proj, write_ocvwrite_ocvWriteOcvWriteOcvWriteOcvwrite_ocv, close_ocvclose_ocvCloseOcvCloseOcvCloseOcvclose_ocv

替代

read_ocvread_ocvReadOcvReadOcvReadOcvread_ocv

另见

create_ocr_class_boxcreate_ocr_class_boxCreateOcrClassBoxCreateOcrClassBoxCreateOcrClassBoxcreate_ocr_class_box

模块

光学字符识别/光学字符验证