Skip to content

get_support_vector_ocr_class_svmGetSupportVectorOcrClassSvmGetSupportVectorOcrClassSvmget_support_vector_ocr_class_svmT_get_support_vector_ocr_class_svm🔗

Short description🔗

get_support_vector_ocr_class_svmGetSupportVectorOcrClassSvmGetSupportVectorOcrClassSvmget_support_vector_ocr_class_svmT_get_support_vector_ocr_class_svm — Return the index of a support vector from a trained OCR classifier that is based on support vector machines.

Signature🔗

get_support_vector_ocr_class_svm( ocr_svm OCRHandle, integer IndexSupportVector, out real Index )void GetSupportVectorOcrClassSvm( const HTuple& OCRHandle, const HTuple& IndexSupportVector, HTuple* Index )static void HOperatorSet.GetSupportVectorOcrClassSvm( HTuple OCRHandle, HTuple indexSupportVector, out HTuple index )def get_support_vector_ocr_class_svm( ocrhandle: HHandle, index_support_vector: Sequence[int] ) -> float

Herror T_get_support_vector_ocr_class_svm( const Htuple OCRHandle, const Htuple IndexSupportVector, Htuple* Index )

double HOCRSvm::GetSupportVectorOcrClassSvm( const HTuple& IndexSupportVector ) const

double HOCRSvm.GetSupportVectorOcrClassSvm( HTuple indexSupportVector )

Description🔗

The operator get_support_vector_ocr_class_svmGetSupportVectorOcrClassSvm maps support vectors of a trained SVM-based OCR classifier (given in OCRHandleOCRHandleocrhandle) to the original training data set. The index of the SV is specified with IndexSupportVectorindexSupportVectorindex_support_vector. The index is counted from 0, i.e., IndexSupportVectorindexSupportVectorindex_support_vector must be a number between 0 and NumSupportVectorsnumSupportVectorsnum_support_vectors \(-\) 1, where NumSupportVectorsnumSupportVectorsnum_support_vectors can be determined with get_support_vector_num_ocr_class_svmGetSupportVectorNumOcrClassSvm. The index of this SV in the training data is returned in Indexindexindex. get_support_vector_ocr_class_svmGetSupportVectorOcrClassSvm can, for example, be used to visualize the support vectors. To do so, the train file that has been used to train the SVM must be read with read_ocr_trainfReadOcrTrainf. The value returned in Indexindexindex must be incremented by 11 and can then be used to select the support vectors with select_objSelectObj from the training characters. If more than one train file has been used in trainf_ocr_class_svmTrainfOcrClassSvm Indexindexindex behaves as if all train files had been merged into one train file with concat_ocr_trainfConcatOcrTrainf.

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.

Parameters🔗

OCRHandleOCRHandleocrhandle (input_control) ocr_svm → (handle)HTuple (HHandle)HOCRSvm, HTuple (IntPtr)HHandleHtuple (handle)

OCR handle.

IndexSupportVectorindexSupportVectorindex_support_vector (input_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Number of stored support vectors.

Indexindexindex (output_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Index of the support vector in the training set.

Result🔗

If the parameters are valid the operator get_support_vector_ocr_class_svmGetSupportVectorOcrClassSvm returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

trainf_ocr_class_svmTrainfOcrClassSvm, get_support_vector_num_ocr_class_svmGetSupportVectorNumOcrClassSvm

See also

create_ocr_class_svmCreateOcrClassSvm, read_ocr_trainfReadOcrTrainf, append_ocr_trainfAppendOcrTrainf, concat_ocr_trainfConcatOcrTrainf

Module🔗

OCR/OCV