read_ocvT_read_ocvReadOcvReadOcvread_ocv (算子)

名称

read_ocvT_read_ocvReadOcvReadOcvread_ocv — 从文件中读取 OCV 工具。

签名

read_ocv( : : FileName : OCVHandle)

Herror T_read_ocv(const Htuple FileName, Htuple* OCVHandle)

void ReadOcv(const HTuple& FileName, HTuple* OCVHandle)

void HOCV::HOCV(const HString& FileName)

void HOCV::HOCV(const char* FileName)

void HOCV::HOCV(const wchar_t* FileName)   ( Windows only)

void HOCV::ReadOcv(const HString& FileName)

void HOCV::ReadOcv(const char* FileName)

void HOCV::ReadOcv(const wchar_t* FileName)   ( Windows only)

static void HOperatorSet.ReadOcv(HTuple fileName, out HTuple OCVHandle)

public HOCV(string fileName)

void HOCV.ReadOcv(string fileName)

def read_ocv(file_name: str) -> HHandle

描述

read_ocvread_ocvReadOcvReadOcvReadOcvread_ocv reads an OCV tool from file. The tool will contain the same information that it contained when saving it with write_ocvwrite_ocvWriteOcvWriteOcvWriteOcvwrite_ocv。After reading the tool the training can be completed for those patterns which have not been trained so far. Otherwise a pattern comparison can be applied directly by calling do_ocv_simpledo_ocv_simpleDoOcvSimpleDoOcvSimpleDoOcvSimpledo_ocv_simple

As extension '.ocv' is used. If this extension is not given with the file name it will be added automatically.

执行信息

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

参数

FileNameFileNameFileNameFileNamefileNamefile_name (输入控制)  filename.read HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of the file which has to be read.

默认值: 'test_ocv' "test_ocv" "test_ocv" "test_ocv" "test_ocv" "test_ocv"

File extension: .ocv

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

Handle of read OCV tool.

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

read_ocv("ocv_file",&ocv_handle);
for (i=0; i<1000; i++)
{
  grab_image_async(&Image,fg_handle,-1);
  reduce_domain(Image,ROI,&Pattern);
  do_ocv_simple(Pattern,ocv_handle,"A",
                "true","true","false","true",10,
                &Quality);
}
close_ocv(ocv_handle);

结果

read_ocvread_ocvReadOcvReadOcvReadOcvread_ocv returns 2 ( H_MSG_TRUE) , if the file is correct.否则,将抛出异常。

可能的前趋

write_ocvwrite_ocvWriteOcvWriteOcvWriteOcvwrite_ocv

可能的后继

do_ocv_simpledo_ocv_simpleDoOcvSimpleDoOcvSimpleDoOcvSimpledo_ocv_simple, close_ocvclose_ocvCloseOcvCloseOcvCloseOcvclose_ocv

另见

read_ocrread_ocrReadOcrReadOcrReadOcrread_ocr

模块

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