Click here to show toolbars of the Web Online Help System: show toolbars
 

Filters
Filter values by
  • Context controls
  • Result buffer controls
| Customize Help
| Save Settings

MdmrControl



Function Map
Synopsis
Control a SureDotOCR context or result buffer setting, add or delete a font or string model to or from a context, or remove results from a result buffer.
Syntax
void MdmrControl(
MIL_ID ContextOrResultDmrId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue //in
)
Description

This function allows you to control a setting of a SureDotOCR context or a SureDotOCR result buffer. This function also allows you to add or delete a font or string model from a context, or to remove all results from a result buffer. To inquire about a context, call MdmrInquire(). To get results from a result buffer, call MdmrGetResult().

To control the fonts and string models held by a SureDotOCR context, call MdmrControlFont() and MdmrControlStringModel(), respectively.

For a successful read operation, you must specify an explicit value for the control types that set the diameter of the dots in the string's characters (M_DOT_DIAMETER) and the dimensions of the rectangular region in which to read strings (M_STRING_BOX_HEIGHT and M_STRING_BOX_WIDTH).

You must preprocess the SureDotOCR context after you have finished adjusting context settings and before calling MdmrRead(). To know if a context needs to be preprocessed, call MdmrInquire() with M_PREPROCESSED.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, MdmrControl() internally calls the MIL_DOUBLE version of this function (MdmrControlDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (MdmrControlInt64()).
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
ContextOrResultDmrId

Specifies the identifier of the SureDotOCR context or result buffer to control. The context must have been previously allocated on the system using MdmrAlloc(). The result buffer must have been previously allocated on the system using MdmrAllocResult().

ControlType

Specifies the setting to change.

See the Parameter associations section for possible values that can be specified.

ControlValue

Specifies the setting's new value.

See the Parameter associations section for possible values that can be specified.

The following ControlType and corresponding ControlValue parameter settings are used to control a setting of the SureDotOCR context specified with the ContextOrResultDmrId parameter. SureDotOCR can only read strings that adhere to these settings (they apply to all strings in the context).

function map For controlling a SureDotOCR context setting
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_DOT_DIAMETER

Sets the diameter of the dots that make up the characters in the strings. INQ

(summarize)
Click to summarize Value > 0.0

Specifies the diameter, in pixels.

Click to summarize M_FOREGROUND_VALUE

Sets the foreground of the characters in the strings. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_FOREGROUND_BLACK.

Click to summarize M_FOREGROUND_BLACK

Specifies that the string can be read if the foreground of its characters is darker than the background. For example, black characters on a white surface.

(summarize)
Click to summarize M_FOREGROUND_WHITE

Specifies that the string can be read if the foreground of its characters is lighter than the background. For example, white characters on a black surface.

(summarize)
Click to summarize M_MAX_INTENSITY

Sets the maximum pixel intensity of a character's dots. M_MAX_INTENSITY only has an effect if M_MAX_INTENSITY_MODE is set to M_USER_DEFINED. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 255.0.

Click to summarize 0.0 <= Value <= 255.0

Specifies the maximum pixel intensity.

Click to summarize M_MAX_INTENSITY_MODE

Sets how to establish the maximum pixel intensity of a character's dots. For a dot to be part of a character, its pixel intensity must be less than or equal to the maximum intensity. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies to automatically establish the maximum pixel intensity of a character's dots. By default, SureDotOCR considers dots with any pixel intensity less than or equal to 255.0.

(summarize)
Click to summarize M_USER_DEFINED

Specifies to use the maximum pixel intensity value set with M_MAX_INTENSITY.

Click to summarize M_MIN_CONTRAST

Sets the minimum contrast of a character. M_MIN_CONTRAST only has an effect if M_MIN_CONTRAST_MODE is set to M_USER_DEFINED. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 15.0.

Click to summarize 0.0 <= Value <= 255.0

Specifies the minimum contrast.

Click to summarize M_MIN_CONTRAST_MODE

Sets how to establish the minimum contrast (difference in pixel intensity) between a character (foreground) and its background. For a character to be read, its contrast must be greater than or equal to the minimum contrast. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies to automatically establish the minimum contrast of characters. By default, SureDotOCR will not read characters with a contrast less than 15.0.

(summarize)
Click to summarize M_USER_DEFINED

Specifies to use the minimum contrast value set with M_MIN_CONTRAST.

Click to summarize M_MIN_INTENSITY

Sets the minimum pixel intensity of a character's dots. M_MIN_INTENSITY only has an effect if M_MIN_INTENSITY_MODE is set to M_USER_DEFINED. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize 0.0 <= Value <= 255.0

Specifies the minimum pixel intensity.

Click to summarize M_MIN_INTENSITY_MODE

Sets how to establish the minimum pixel intensity of a character's dots. For a dot to be part of a character, its intensity must be greater than or equal to the minimum intensity. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies to automatically establish the minimum pixel intensity of character dots. By default, SureDotOCR considers dots with any pixel intensity greater than or equal to 0.0.

(summarize)
Click to summarize M_USER_DEFINED

Specifies to use the minimum pixel intensity value set with M_MIN_INTENSITY.

Click to summarize M_SPACE_SIZE_MAX

Sets the value with which to determine the maximum distance between two characters in a string. This value is interpreted according to M_SPACE_SIZE_MAX_MODE. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 3.0.

Click to summarize Value > 0.0

Specifies the maximum distance value.

Click to summarize M_SPACE_SIZE_MAX_MODE

Sets how to determine the maximum distance between two characters in a string. If the actual distance between two characters is greater than the maximum distance, the read operation considers them part of separate strings. M_SPACE_SIZE_MAX_MODE indicates how to interpret M_SPACE_SIZE_MAX. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_CHAR_WIDTH_FACTOR.

Click to summarize M_CHAR_WIDTH_FACTOR

Specifies that the maximum distance between two characters in a string is determined by multiplying the M_SPACE_SIZE_MAX value by the string's maximum character width, in pixels. For example, if M_SPACE_SIZE_MAX is set to 3 (M_DEFAULT), the maximum distance between two characters in a string is equivalent to three times the string's maximum character width.

(summarize)
Click to summarize M_DISABLE

Specifies no maximum space size. This is equivalent to allowing an infinite amount of maximum space. In this case, no amount of space between aligned characters can cause them to be part of separate strings. This does not apply to characters on separate lines or severely misaligned characters.

(summarize)
Click to summarize M_SPACE_SIZE_MIN

Sets the value with which to determine the minimum distance between two characters in a string. This value is interpreted according to M_SPACE_SIZE_MIN_MODE. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 1.0.

Click to summarize Value > 0.0

Specifies the minimum distance value.

Click to summarize M_SPACE_SIZE_MIN_MODE

Sets how to determine the minimum distance between two characters in a string. If the actual distance between two characters is less than the specified value, SureDotOCR does not consider there to be a space. M_SPACE_SIZE_MIN_MODE indicates how to interpret M_SPACE_SIZE_MIN. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_CHAR_WIDTH_FACTOR.

Click to summarize M_CHAR_WIDTH_FACTOR

Specifies that the minimum distance between two characters in a string is determined by multiplying the M_SPACE_SIZE_MIN value by the string's maximum character width, in pixels. For example, if M_SPACE_SIZE_MIN is set to 1 (M_DEFAULT), the minimum distance between two characters in a string is equivalent to the string's maximum character width.

(summarize)
Click to summarize M_DISABLE

Specifies no minimum space size. This is equivalent to allowing an infinite amount of minimum space. In this case, no amount of space between characters in a string can cause SureDotOCR to recognize an actual space.

(summarize)
Click to summarize M_STRING_BOX_HEIGHT

Sets the height of the rectangular region that encloses the strings to read. The height is oriented along the vertical axis that is perpendicular to the string's base. M_STRING_BOX_HEIGHT only has an effect if M_STRING_BOX_SIZE_MODE is set to M_USER_DEFINED. INQ

(summarize)
Click to summarize Value > 0.0

Specifies the height, in pixels.

Click to summarize M_STRING_BOX_SIZE_MODE

Sets how to establish the size of the rectangular region that encloses the strings to read. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_USER_DEFINED.

Click to summarize M_USER_DEFINED

Specifies that the size of the rectangular region in which to read strings is defined by the M_STRING_BOX_HEIGHT and M_STRING_BOX_WIDTH settings.

Click to summarize M_STRING_BOX_WIDTH

Sets the width of the rectangular region that encloses the strings to read. The width is oriented along the axis that represents the string's base. M_STRING_BOX_WIDTH only has an effect if M_STRING_BOX_SIZE_MODE is set to M_USER_DEFINED. INQ

(summarize)
Click to summarize Value > 0.0

Specifies the width, in pixels.

Click to summarize M_TIMEOUT

Sets the maximum read time for MdmrRead(), in msec. No results are returned if the read operation times out. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 2000.0 msec.

Click to summarize M_DISABLE

Specifies an infinite amount of read time.

Click to summarize Value >= 0.0

Specifies the maximum read time, in msec.

The following ControlType and corresponding ControlValue parameter settings are used to add fonts or string models to, or delete fonts or string models from, the SureDotOCR context specified with the ContextOrResultDmrId parameter.

function map For adding fonts or string models to, or deleting fonts or string models from, a SureDotOCR context
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_FONT_ADD

Adds an empty font to the context. To add characters to a font, use MdmrImportFont(). You can also add characters to a font, or modify its settings, using MdmrControlFont(). The maximum number of fonts in a context is 255. To inquire the number of fonts in the context, call MdmrInquire() with M_NUMBER_OF_FONTS.

When you add an empty font, the dimensions of its dot-matrix template are initially set to 5 columns and 7 rows. If the font is empty, you can change these values by calling MdmrControlFont() with M_FONT_SIZE_COLUMNS and M_FONT_SIZE_ROWS.

(summarize)
Click to summarize M_DEFAULT

Same as M_NEW_LABEL.

Click to summarize M_NEW_LABEL

Specifies to add a font with an automatically assigned label. To inquire about the label, use MdmrInquireFont() with M_FONT_LABEL_VALUE. To change the label, use MdmrControlFont() with M_FONT_LABEL_VALUE.

(summarize)
Click to summarize Value > 0

Specifies to add a font with the indicated label, as an integer. The label must be unique among all font labels in the context.

(summarize)
Click to summarize M_FONT_DELETE

Deletes one or all fonts from the context.

(summarize)
Click to summarize M_DEFAULT

Same as M_ALL.

Click to summarize

Specifies to delete the font by indicating its index.

(summarize)
Parameters

Set this parameter to the following:

Value >= 0

Specifies the index of the font to delete.

Click to summarize

Specifies to delete the font by indicating its label.

(summarize)
Parameters

Set this parameter to the following:

Value > 0

Specifies the label of the font to delete.

Click to summarize M_ALL

Specifies to delete all fonts.

Click to summarize M_STRING_ADD

Adds an empty string model to a context. To add character constraints to the string model, or to modify its settings, use MdmrControlStringModel(). The maximum number of string models in a context is 255. To inquire the number of string models in a context, call MdmrInquire() with M_NUMBER_OF_STRING_MODELS.

(summarize)
Click to summarize M_DEFAULT

Same as M_NEW_LABEL.

Click to summarize M_NEW_LABEL

Specifies to add a string model with an automatically assigned label. To inquire about the label, use MdmrInquireStringModel() with M_STRING_LABEL_VALUE. To change the label, use MdmrControlStringModel() with M_STRING_LABEL_VALUE.

(summarize)
Click to summarize Value > 0

Specifies to add a string model with the indicated label, as an integer. The label must be unique among all string model labels in the context.

(summarize)
Click to summarize M_STRING_DELETE

Deletes one or all string models from a context.

(summarize)
Click to summarize M_DEFAULT

Same as M_ALL.

Click to summarize

Specifies to delete the string model by indicating its index.

(summarize)
Parameters

Set this parameter to the following:

Value >= 0

Specifies the index of the string model to delete.

Click to summarize

Specifies to delete the string model by indicating its label.

(summarize)
Parameters

Set this parameter to the following:

Value > 0

Specifies the label of the string model to delete.

Click to summarize M_ALL

Specifies to delete all string models.

The following ControlType and corresponding ControlValue parameter settings are used to control the SureDotOCR result buffer specified with the ContextOrResultDmrId parameter.

function map For controlling a SureDotOCR result buffer
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_RESET

Removes all results from the SureDotOCR result buffer. This does not delete the result buffer identifier, as is the case with MdmrFree().

(summarize)
Click to summarize M_DEFAULT

Specifies the default behavior.

Click to summarize M_RESULT_OUTPUT_UNITS

Sets whether to return results in pixels or world units. This essentially sets the output coordinate system to use. The setting of this control type will only affect functions within this module which return positional results. This control type can be changed at any time to return results in the required output units. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ACCORDING_TO_CALIBRATION.

Click to summarize M_ACCORDING_TO_CALIBRATION

Specifies that results are returned in world units if the result was calculated on an image associated with a camera calibration context; otherwise, specifies that results are returned in pixel units.

Click to summarize M_PIXEL

Specifies that results are returned in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies that results are returned in world units, with respect to the relative coordinate system. If world units are specified, calling MstrGetResult() generates an error if the result was not calculated on a calibrated image.

(summarize)
Click to summarize M_STOP_READ

Stops the current read operation. You can only perform this operation from another thread of higher priority. No results are returned if you stop the read operation.

(summarize)
Click to summarize M_DEFAULT

Specifies the default behavior.

Type specific versions of the function when using a C compiler under 64-bit
void MdmrControlInt64 (MIL_ID ContextOrResultDmrId, MIL_INT64 ControlType, MIL_INT64 ControlValue)
Parameters

ContextOrResultDmrId

See ContextOrResultDmrId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

void MdmrControlDouble (MIL_ID ContextOrResultDmrId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue)
Parameters

ContextOrResultDmrId

See ContextOrResultDmrId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; mildmr.lib.
DLL Requires mil.dll; mildmr.dll.
DOT DIAMETER FOREGROUND VALUE DEFAULT FOREGROUND BLACK FOREGROUND WHITE MAX INTENSITY DEFAULT MAX INTENSITY MODE DEFAULT AUTO USER DEFINED MIN CONTRAST DEFAULT MIN CONTRAST MODE DEFAULT AUTO USER DEFINED MIN INTENSITY DEFAULT MIN INTENSITY MODE DEFAULT AUTO USER DEFINED SPACE SIZE MAX DEFAULT SPACE SIZE MAX MODE DEFAULT CHAR WIDTH FACTOR DISABLE SPACE SIZE MIN DEFAULT SPACE SIZE MIN MODE DEFAULT CHAR WIDTH FACTOR DISABLE STRING BOX HEIGHT STRING BOX SIZE MODE DEFAULT USER DEFINED STRING BOX WIDTH TIMEOUT DEFAULT DISABLE FONT ADD DEFAULT NEW LABEL FONT DELETE DEFAULT ALL STRING ADD DEFAULT NEW LABEL STRING DELETE DEFAULT ALL RESET DEFAULT RESULT OUTPUT UNITS DEFAULT ACCORDING TO CALIBRATION PIXEL WORLD STOP READ DEFAULT