| Customize Help
| Save Settings

MocrVerifyString



Function Map
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
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 2D 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
Click to summarizeValue Description
Click to summarize 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