Skip to content

reduce_ocr_class_svmReduceOcrClassSvmReduceOcrClassSvmreduce_ocr_class_svmT_reduce_ocr_class_svmπŸ”—

Short descriptionπŸ”—

reduce_ocr_class_svmReduceOcrClassSvmReduceOcrClassSvmreduce_ocr_class_svmT_reduce_ocr_class_svm β€” Approximate a trained SVM-based OCR classifier by a reduced SVM.

SignatureπŸ”—

reduce_ocr_class_svm( ocr_svm OCRHandle, string Method, integer MinRemainingSV, real MaxError, out ocr_svm OCRHandleReduced )void ReduceOcrClassSvm( const HTuple& OCRHandle, const HTuple& Method, const HTuple& MinRemainingSV, const HTuple& MaxError, HTuple* OCRHandleReduced )static void HOperatorSet.ReduceOcrClassSvm( HTuple OCRHandle, HTuple method, HTuple minRemainingSV, HTuple maxError, out HTuple OCRHandleReduced )def reduce_ocr_class_svm( ocrhandle: HHandle, method: str, min_remaining_sv: int, max_error: float ) -> HHandle

Herror T_reduce_ocr_class_svm( const Htuple OCRHandle, const Htuple Method, const Htuple MinRemainingSV, const Htuple MaxError, Htuple* OCRHandleReduced )

HOCRSvm HOCRSvm::ReduceOcrClassSvm( const HString& Method, Hlong MinRemainingSV, double MaxError ) const

HOCRSvm HOCRSvm::ReduceOcrClassSvm( const char* Method, Hlong MinRemainingSV, double MaxError ) const

HOCRSvm HOCRSvm::ReduceOcrClassSvm( const wchar_t* Method, Hlong MinRemainingSV, double MaxError ) const (Windows only)

HOCRSvm HOCRSvm.ReduceOcrClassSvm( string method, int minRemainingSV, double maxError )

DescriptionπŸ”—

reduce_ocr_class_svmReduceOcrClassSvm reduces the classification time of an SVM based OCR classifier OCRHandleOCRHandleocrhandle by returning a reduced copy of it in OCRHandleReducedOCRHandleReducedocrhandle_reduced. The parameters Methodmethodmethod, MinRemainingSVminRemainingSVmin_remaining_sv and MaxErrormaxErrormax_error have the same meaning as in reduce_class_svmReduceClassSvm and are described there. Please note that classification time can also be significantly reduced with a preprocessing step in create_ocr_class_svmCreateOcrClassSvm, which possibly introduces less errors.

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)

Original handle of SVM-based OCR-classifier.

Methodmethodmethod (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Type of postprocessing to reduce number of SVs.

Default: 'bottom_up'"bottom_up"
List of values: 'bottom_up'"bottom_up"

MinRemainingSVminRemainingSVmin_remaining_sv (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Minimum number of remaining SVs.

Default: 22
Suggested values: 2, 3, 4, 5, 7, 10, 15, 20, 30, 502, 3, 4, 5, 7, 10, 15, 20, 30, 50
Restriction: MinRemainingSV >= 2

MaxErrormaxErrormax_error (input_control) real β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Maximum allowed error of reduction.

Default: 0.0010.001
Suggested values: 0.0001, 0.0002, 0.0005, 0.001, 0.002, 0.005, 0.01, 0.02, 0.050.0001, 0.0002, 0.0005, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05
Restriction: MaxError > 0.0

OCRHandleReducedOCRHandleReducedocrhandle_reduced (output_control) ocr_svm β†’ (handle)HTuple (HHandle)HOCRSvm, HTuple (IntPtr)HHandleHtuple (handle)

SVMHandle of reduced OCR classifier.

ResultπŸ”—

If the parameters are valid the operator reduce_ocr_class_svmReduceOcrClassSvm 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

Possible successors

do_ocr_single_class_svmDoOcrSingleClassSvm, do_ocr_multi_class_svmDoOcrMultiClassSvm, get_support_vector_ocr_class_svmGetSupportVectorOcrClassSvm, get_support_vector_num_ocr_class_svmGetSupportVectorNumOcrClassSvm

See also

create_ocr_class_svmCreateOcrClassSvm

ReferencesπŸ”—

Bernhard SchΓΆlkopf, Alexander J.Smola: β€œLearning with Kernels”; The MIT Press, London; 1999.

ModuleπŸ”—

OCR/OCV