| MIL 10 Reference
| Customize Help
| Save Settings

MocrVerifyString



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Next
Synopsis
Verify a known string in an image.
Syntax
void MocrVerifyString(
MIL_ID ImageBufId, //in
MIL_ID FontContextOcrId, //in
MIL_CONST_TEXT_PTR String, //in
MIL_ID OcrResultId //in
)
Description

This function determines whether a known string is present in the target image, and evaluates the quality of the string. This operations can be performed more quickly with MocrVerifyString() than with MocrReadString(). After verification, the specified result buffer can be read with the MocrGetResult() function.

If string location is disabled (using MocrControl() with M_SKIP_STRING_LOCATION), use a child buffer to limit the search area for best results.

The verification can only be performed on a single string and not multiple strings. When dealing with multiple lines of text in a target image, the returned string is the first one found within the target image. Note that this is not necessarily the first string within the target image. The string is located according to its OCR font context type, constraints, and processing controls. Once located, the string can then be read and compared against the validation string provided by this function.

You can limit the operation to a region of the image buffer, using a rectangular region of interest (ROI) set using MbufSetRegion().

For a more robust search, use an M_CONSTRAINED OCR font context. You can change the type of context using MocrControl() with M_CONTEXT_CONVERT.

Blank characters cannot be verified and will be ignored.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ImageBufId

Specifies the identifier of the target image containing the string to be verified.

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.

FontContextOcrId

Specifies the identifier of the OCR font context to use to verify the string in the target image.

String

Specifies the character string to be verified in the sample target image.

function map For specifying the ASCII characters
CollapseValue Description
Collapse MIL_TEXT("String") 1

Specifies the character string to be verified in the sample target image. This string must be null-terminated.

Note that blank characters cannot be verified and will cause a MIL error.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

OcrResultId

Specifies the OCR result buffer in which to place the verification results.

Compilation information
Header Include mil.h.
Library Use mil.lib; milocr.lib.
DLL Requires mil.dll; milocr.dll.
PROC RASTER