Skip to content

traind_ocv_projTraindOcvProjTraindOcvProjtraind_ocv_projT_traind_ocv_proj🔗

Short description🔗

traind_ocv_projTraindOcvProjTraindOcvProjtraind_ocv_projT_traind_ocv_proj — Training of an OCV tool.

Signature🔗

traind_ocv_proj( image Pattern, ocv OCVHandle, string Name, string Mode )void TraindOcvProj( const HObject& Pattern, const HTuple& OCVHandle, const HTuple& Name, const HTuple& Mode )static void HOperatorSet.TraindOcvProj( HObject pattern, HTuple OCVHandle, HTuple name, HTuple mode )def traind_ocv_proj( pattern: HObject, ocvhandle: HHandle, name: MaybeSequence[str], mode: str ) -> None

Herror T_traind_ocv_proj( const Hobject Pattern, const Htuple OCVHandle, const Htuple Name, const Htuple Mode )

void HImage::TraindOcvProj( const HOCV& OCVHandle, const HTuple& Name, const HString& Mode ) const

void HImage::TraindOcvProj( const HOCV& OCVHandle, const HString& Name, const HString& Mode ) const

void HImage::TraindOcvProj( const HOCV& OCVHandle, const char* Name, const char* Mode ) const

void HImage::TraindOcvProj( const HOCV& OCVHandle, const wchar_t* Name, const wchar_t* Mode ) const (Windows only)

void HOCV::TraindOcvProj( const HImage& Pattern, const HTuple& Name, const HString& Mode ) const

void HOCV::TraindOcvProj( const HImage& Pattern, const HString& Name, const HString& Mode ) const

void HOCV::TraindOcvProj( const HImage& Pattern, const char* Name, const char* Mode ) const

void HOCV::TraindOcvProj( const HImage& Pattern, const wchar_t* Name, const wchar_t* Mode ) const (Windows only)

void HImage.TraindOcvProj( HOCV OCVHandle, HTuple name, string mode )

void HImage.TraindOcvProj( HOCV OCVHandle, string name, string mode )

void HOCV.TraindOcvProj( HImage pattern, HTuple name, string mode )

void HOCV.TraindOcvProj( HImage pattern, string name, string mode )

Description🔗

traind_ocv_projTraindOcvProj trains patterns for an OCV tool that has been created using the operators create_ocv_projCreateOcvProj or read_ocvReadOcv. For this training one or multiple patterns are provided to the system. Such a pattern consists of an image with a reduced domain (ROI) for the area of the pattern. Note that the pattern should not only contain foreground pixels (e.g., dark pixels of a character) but also background pixels. This can be implemented e.g., by the smallest surrounding rectangle of the pattern. Without this context an evaluation of the pattern is not possible.

If more than one pattern has to be trained this can be achieved by multiple calls (one for each pattern) or by calling traind_ocv_projTraindOcvProj once with all patterns and a tuple of the corresponding names. The result will be in both cases the same. However using multiple calls will normally result in a longer execution time than using one call with all patterns.

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 modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters🔗

Patternpatternpattern (input_object) singlechannelimage(-array) → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

Pattern to be trained.

OCVHandleOCVHandleocvhandle (input_control, state is modified) ocv → (handle)HTuple (HHandle)HOCV, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the OCV tool to be trained.

Namenamename (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

Name(s) of the object(s) to analyze.

Default: 'a'"a"

Modemodemode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Mode for training (only one mode implemented).

Default: 'single'"single"
List of values: 'single'"single"

Example🔗

(C++)

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

Result🔗

traind_ocv_projTraindOcvProj returns 2 (H_MSG_TRUE), if the handle and the training pattern(s) are correct. Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

write_ocr_trainfWriteOcrTrainf, create_ocv_projCreateOcvProj, read_ocvReadOcv, thresholdThreshold, connectionConnection, select_shapeSelectShape

Possible successors

close_ocvCloseOcv

See also

traind_ocr_class_boxTraindOcrClassBox

Module🔗

OCR/OCV