MIL_ID ImageBufId, | //in |
MIL_ID FontContextOcrId, | //in |
MIL_ID OcrResultId | //in |
This function reads an unknown string from the specified target image using the specified OCR font context. All existing font controls and constraints (which can be set with MocrControl() and MocrSetConstraint() respectively) are taken into account, and results are stored in the specified result buffer. Results can be read from the result buffer using the MocrGetResult() function.
This function assumes that the string to be read has the same length as specified in the font, and that the target string characters have the same type, size, and spacing as the characters in OCR font context used for calibration (either automatically with MocrCalibrateFont() or manually with MocrControl()). This is particularly important when using an M_CONSTRAINED OCR font context.
For best results, the angle of the string(s) to be read should be as close to 0 as possible.
You can limit the operation to a region of the image buffer, using a rectangular region of interest (ROI) set using MbufSetRegion().
When reading multiple strings, performing a search at an angle or using the M_GENERAL OCR font context, the target image should have a clearly-defined threshold between the characters and their background. Note that the threshold must preserve the shape of the characters. Broken and/or touching characters can degrade the results.
Note that before performing a read operation, the OCR font context must be preprocessed (MocrPreprocess()).
Specifies the identifier of the image which contains the string to be read.
This image buffer can only have a rectangular region of interest (ROI) defined using MbufSetRegion() (with or without rotation). In addition, the region must be defined in vector format from a graphics list (M_VECTOR or M_VECTOR_AND_RASTER). An error will be generated if the ROI is only in raster format (M_RASTER) or a non-rectangular shape.
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |