| MIL 10 Reference
| Customize Help
| Save Settings

MstrRead



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
Synopsis
Read strings from a target image.
Syntax
void MstrRead(
MIL_ID ContextId, //in
MIL_ID TargetImageId, //in
MIL_ID ResultId //in
)
Description

This function reads one or more strings from the specified target image using the specified String Reader context. All specifications, such as the number of strings to read in the target image, the speed and/or robustness settings, the constraints on the characters in the string, and the font used, depend on the settings of the String Reader context, which can be set using MstrControl(), MstrSetConstraint() and MstrEditFont(). All settings are taken into account by MstrRead(), and results are stored in the specified result buffer. Results can be read from the result buffer using the MstrGetResult() function.

For a string to be read, it must not only meet all of the restrictions placed on it by the String Reader context, but it must also obey the basic rules of a string. That is, it must be a linear sequence of regular characters.

The string read will be ordered in the natural Latin-based reading order. The position of a string is the position of the center of the bounding box of its first character.

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

The target image must be 1-band 8-bit unsigned, and cannot exceed a maximum size of 65536x65536 pixels.

Note that before performing a read operation, the String Reader context must have at least one font, one character, and one string; it must also be preprocessed (MstrPreprocess()).

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
ContextId

Specifies the String Reader context to use for the read operation. The String Reader context must have been previously allocated on the required system using MstrAlloc(), and preprocessed using MstrPreprocess().

TargetImageId

Specifies the target image in which to read the strings.

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.

ResultId

Specifies the result buffer in which to write the results of the read operation.

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