ReadIDMax
The ReadIDMax function finds and decodes 1D or 2D symbols (1D/Stacked, Data Matrix, QR Code and Postal) within a region of interest. You can configure the ReadIDMax function for a variety of symbologies, a number of results, and to handle a high degree of rotation and perspective distortion. Optionally, You can also use the ReadIDMax function to train Data Matrix and QR Code models, and verify quality metrics. You can use the ReadIDMax function to locate and decode 1D or 2D symbols.
1D Symbologies
The ReadIDMax function supports decoding multiple 1D symbologies in the same image, including:
- Code 128
- Code 39
- Interleaved 2 of 5
- Pharmacode
- UPC/EAN
- Code 93
- Codabar
- MSI
- Code 25
- PDF417
- DataBar
- DataBar Limited
- DataBar Expanded
- EAN.UCC Composite
- POSTNET
- PLANET
- Japan Post
- Australian Post
- UPU
- Intelligent Mail Barcode
2D Symbologies
The ReadIDMax function can locate and decode 2D symbols, including:
- Data Matrix
- QR Code
- MaxiCode
- Aztec Code
- DotCode
The function can locate multiple 2D symbols, but unlike 1D symbols, all the symbols must be the same symbology type. For example, if the image contained a mixture of Data Matrix and QR Code symbols, and the Symbology Group parameter of the function is set to Data Matrix, the function ignores the QR Code symbols and only returns the Data Matrix symbols.
You can train the function to decode the same type of 2D symbol by:
- Establishing the size of the symbol grid size;
- The 2D symbology type; and
- The error checking and correction (ECC) method the symbol uses to verify the accuracy of the data it contains.
Cognex recommends training the ReadIDMax function when the 2D symbols used in the application all share the same characteristics. Training the ReadIDMax function can improve its performance, especially when all the symbols to be decoded share the same qualities.
If the 2D symbols can vary in grid size or polarity, do not train the function, and instead allow it to consider all possible settings when decoding a 2D symbol. By not training the ReadIDMax function, it can decode a wider variety of symbols without needing to reconfigure it.
1D/2D Image Requirements
The ReadIDMax function requires minimal configuration before scanning 1D symbols, but you must consider the following requirements for input images:
-
All symbols must be greater than 50 pixels in length, while the maximum width of any module cannot exceed 10 pixels.
Note: A module is the narrowest element of the symbol (either a space or a bar). - For linear symbologies (where modules have different widths, but uniform heights), a module must be at least 1.6 pixels in width and 50 pixels high. For Postal Codes (where the modules are of uniform width, but varying height), a module must be at least 2.5 pixels in width.
- A quiet zone (an area on either end of a symbol that contains no marks) must be present and at least the minimum size specified in the print specification for the symbology type.
- The contrast between modules and the background must be at least 32 grey levels.
- The pixel aspect ratio can be no greater than 1.35 to 1.
2D symbols have fewer image requirements. In general, there must be a quiet zone (or margin) surrounding the symbol on all four sides that is equal to the width of one module inside the symbol itself.
IDMax® and IDQuick™
The ReadIDMax function offers two processing modes for the decoding algorithm:
- Choose IDQuick for high-speed decoding of symbols that are well formed and appear in high contrast.
- Choose IDMax for advanced image processing and image-analysis techniques for challenging images.
By default, the function uses IDMax. However, you can experiment with IDQuick to determine how it affects the performance of the function in the application.
Results
Only symbols that are found and decoded generate results. For each symbol in an image, the ReadIDMax function generates the following results through Vision Data Access functions:
- The decoded string.
- The angular orientation of the found symbol, in degrees.
- A location (Row/Column) for the center of the symbol.
- The particular symbology of the symbol.
- Codes and modifiers from the ISO/IEC to uniquely identify the symbology according to industry standards.
ReadIDMaxInputs
Syntax: ReadIDMax(Image,Fixture.Row,Fixture.Column,Fixture.Theta,Region.X,Region.Y,Region.High,Region.Wide,Region.Angle,Symbology Group,Maximum Results,Advanced Decode Mode,Enable Training,1D Symbologies.Code 128,1D Symbologies.Code 39,1D Symbologies.I2of5,1D Symbologies.Pharmacode,1D Symbologies.UPC/EAN,1D Symbologies.Code 93,1D Symbologies.Codabar,Stacked Symbologies.PDF 417,Stacked Symbologies.DataBar,Stacked Symbologies.DataBar Limited,Stacked Symbologies.DataBar Expanded,Stacked Symbologies.EAN.UCC Composite,Postal Symbologies.POSTNET,Postal Symbologies.PLANET,Postal Symbologies.Japan Post,Postal Symbologies.Australia Post,Postal Symbologies.UPU,Postal Symbologies.Intelligent Mail Barcode,Decode Settings.Perspective,Decode Settings.QRMode,Decode Settings.Ignore Polarity,Decode Settings.Allow Flexible Grid Size,Decode Settings.Symbol Damage,Decode Settings.Checksum,DecodeSettings.Polarity,Decode Settings.Omnidirectional,DecodeSettings.Sort Mode,Decode Settings.Allow Identical 1D Symbols,Decode Settings.Expand UPC-E,Decode Settings.Rectangular Extension,Decode Settings.Minimum Decodes Before Output,Verify,Timeout,Show)
Parameter | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
This parameter must reference a spreadsheet cell that contains an Image data structure. By default, this parameter references A0, the cell containing the AcquireImage Image data structure. This parameter can also reference other Image data structures, such as those returned by the Vision Tool Image functions. For more information, see AcquireImage and Image. Note: If using a color vision system, the function must reference an Image function (for example, ColorToGreyscaleFilter), which converts the color image to greyscale.
|
|||||||||||||||||||||||||||
Defines the Region of Interest (ROI) relative to a Fixture input or the output of a Vision Tool function's image coordinate system. Setting the ROI relative to a Fixture ensures that if the Fixture is rotated or translated, the ROI will be rotated or translated in relation to the Fixture. For more information, see Fixture and Vision Tools Functions. The default setting is (0,0,0), the top leftmost corner of the image.
|
|||||||||||||||||||||||||||
The Region of Interest (ROI) specifies the region of the image that undergoes analysis and creates a rectangular image region that can be transformed and rotated. For more information, see Interactive Graphics Mode. Tip: With this parameter
selected, you can press the Maximize
Region button on the property sheet's toolbar to maximize the region and cover the entire image.
|
|||||||||||||||||||||||||||
Specifies one of the symbology groups to read.
|
|||||||||||||||||||||||||||
Specifies the maximum number of symbols to be located and decoded (1 to 128; default = 1). Note: If this parameter's specified value exceeds the number of symbols in the ROI , the function continues to search for the specified number of symbols. If the number of symbols in the ROI varies, the execution time of the function can be reduced by lowering the Timeout parameter setting.
|
|||||||||||||||||||||||||||
Specifies the setting used to decode Data Matrix or 1D/Stacked symbology groups.
|
|||||||||||||||||||||||||||
When enabled, trains a model of the first symbol read. Training the function may improve performance, especially when all the symbols to be decoded share similar characteristics. Trained information is retained until this checkbox is disabled. To retrain a symbol, disable the checkbox, then enable the checkbox again. Tip: It is recommended to have only one symbol in the Region when training is enabled.
|
|||||||||||||||||||||||||||
1D Symbologies |
Specifies which 1D Symbologies to read (multiple symbologies can be selected and read).
|
||||||||||||||||||||||||||
Specifies which Stacked Symbologies to read (multiple symbologies can be selected and read).
|
|||||||||||||||||||||||||||
Specifies which Stacked Symbologies to read (multiple symbologies can be selected and read).
|
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
Specifies whether the print quality tests (also known as quality verification metrics) are performed. For more information, see ID.
Note:
|
|||||||||||||||||||||||||||
Specifies the amount of time, in milliseconds (0 to 30000), to search for a valid ID symbol before execution is halted and #ERR is returned. Setting the value to 0 disables the setting and a timeout is not applied. Note: At times, the ReadIDMax function may exceed the specified Timeout parameter value by varying percentages. If this happens, adjust the Timeout parameter value lower to compensate for the overage.
|
|||||||||||||||||||||||||||
Specifies the display mode for the ReadIDMax graphical overlay on the image. Note: The Show parameter is only implemented for Data Matrix and QR Code symbols.
|
ReadIDMax Outputs
Returns |
An IDMax data structure containing the decoded alphanumeric string, or #ERR if any of the input parameters are invalid. |
Results |
When the function is initially inserted into a cell, a result table is inserted in the spreadsheet. The number of indexed strings returned in the result table is equal to the value entered in the Maximum Results parameter. If no symbol can be located and decoded, #ERR is returned. |
ReadIDMaxVision Data Access Functions
The number of Vision Data Access functions automatically added to the spreadsheet vary depending on the Maximum Results setting and whether the Verify checkbox is enabled. By default, the Maximum Results parameter is configured to locate and decode one symbol and the Verify checkbox is disabled. In this case, when the ReadIDMax function is initially created, a single Vision Data Access function is automatically inserted into the spreadsheet:
String |
GetString(IDMax, [Index]) |
Returns the alphanumeric string encoded in the indexed symbol. |
When the ReadIDMax function is initially created:
- If the Maximum Results are configured to locate and decode more than one symbol, additional IDMax Vision Data Access functions are automatically inserted into the spreadsheet.
-
If the Verify checkbox is enabled, the function performs additional quality verification metrics, and additional Vision Data Access functions are automatically inserted into the spreadsheet. The functions that are inserted vary based on the selected Symbology Group.
Additional data elements can also be accessed using the ReadIDMax Vision Data Access functions. For more information, see IDMax.
- If the Maximum Results are increased or the Verify checkbox is enabled after the ReadIDMax function is initially created, the additional Vision Data Access functions are not automatically inserted into the spreadsheet. In addition, the Verify checkbox must be enabled before the additional Vision Data Access functions can execute in the spreadsheet.
- For Data Matrix symbols, the base 256 latch character (Decimal 231 Hex E7) causes encoded data to be processed as bytes, per the Data Matrix ISO/IEC 16022 specification. Use the GetString IDMax function to return the encoded data. For more information, see IDMax.