Skip to content

read_ocvReadOcvReadOcvread_ocvT_read_ocv🔗

Short description🔗

read_ocvReadOcvReadOcvread_ocvT_read_ocv — Reading an OCV tool from file.

Signature🔗

read_ocv( filename.read FileName, out ocv OCVHandle )void ReadOcv( const HTuple& FileName, HTuple* OCVHandle )static void HOperatorSet.ReadOcv( HTuple fileName, out HTuple OCVHandle )def read_ocv( file_name: str ) -> HHandle

Herror T_read_ocv( 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)

public HOCV( string fileName )

void HOCV::ReadOcv( const HString& FileName )

void HOCV::ReadOcv( const char* FileName )

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

void HOCV.ReadOcv( string fileName )

Description🔗

read_ocvReadOcv reads an OCV tool from file. The tool will contain the same information that it contained when saving it with write_ocvWriteOcv. 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_simpleDoOcvSimple.

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

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

FileNamefileNamefile_name (input_control) filename.read → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of the file which has to be read.

Default: 'test_ocv'"test_ocv"
File extension: .ocv

OCVHandleOCVHandleocvhandle (output_control) ocv → (handle)HTuple (HHandle)HOCV, HTuple (IntPtr)HHandleHtuple (handle)

Handle of read OCV tool.

Example🔗

(C++)

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)\;

Result🔗

read_ocvReadOcv returns 2 (H_MSG_TRUE), if the file is correct. Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

write_ocvWriteOcv

Possible successors

do_ocv_simpleDoOcvSimple, close_ocvCloseOcv

See also

read_ocrReadOcr

Module🔗

OCR/OCV