Skip to content

text_loadOCRHMMClassifierNM

textfunctionOpenCV 5.0.0
import { text_loadOCRHMMClassifierNM } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSfilename
FUNCTIONtext_loadOCRHMMClassifierNM
RETURN TYPEtext_OCRHMMDecoder_ClassifierCallback | null
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Allow to implicitly load the default character classifier when creating an OCRHMMDecoder object.

deprecated: loadOCRHMMClassifier instead

text_loadOCRHMMClassifierNM(filename: EmbindString): text_OCRHMMDecoder_ClassifierCallback | null;
filename

The XML or YAML file with the classifier model (e.g. OCRHMM_knn_model_data.xml)

The KNN default classifier is based in the scene text recognition method proposed by Lukás Neumann & Jiri Matas in [Neumann11b]. Basically, the region (contour) in the input image is normalized to a fixed size, while retaining the centroid and aspect ratio, in order to extract a feature vector based on gradient orientations along the chain-code of its perimeter. Then, the region is classified using a KNN model trained with synthetic data of rendered characters with different standard font types.

Returns

The text_OCRHMMDecoder_ClassifierCallback | null result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.