Method and apparatus for industrial identification mark verification
10061946 ยท 2018-08-28
Inventors
Cpc classification
G06K7/1447
PHYSICS
G06K5/00
PHYSICS
International classification
G06K7/10
PHYSICS
G06K19/06
PHYSICS
G06K5/00
PHYSICS
G08C21/00
PHYSICS
Abstract
The invention provides methods and apparatus for analysis of images of direct part mark identification codes to measure and assess a print quality. Methods to assess the quality of a direct part mark identification code are presented that provide diagnostic information of a code that cannot be assessed using verification methods that require the results of a valid decoding step.
Claims
1. A computer-implemented method for verifying a direct part mark inspection code, the method comprising: acquiring an image of the code; attempting, using one or more processing devices, to decode the code using the image; and if the attempt to decode the code is unsuccessful: locating the code, using the one or more processing devices, in the image to provide a code location; and measuring, using the one or more processing devices, aspects of a mark quality using the image and the code location in the image; wherein the step of measuring the aspects of the mark quality includes one of more of: calculating a quality of a continuous finder pattern based on one or more of a ratio of actual to expected dark modules in the continuous finder pattern, a ratio of actual to expected light modules in the continuous finder pattern, and a ratio of dark to light pixels in solid lines of the continuous finder pattern; calculating a quality of a discontinuous finder pattern based on one or more of a ratio of actual to expected dark modules in the discontinuous finder pattern, and a ratio of actual to expected light modules in the discontinuous finder pattern; and performing a histogram analysis on a quiet zone in the image.
2. The method according to claim 1 wherein the step of measuring aspects of a mark quality includes the step of performing the histogram analysis on the quiet zone, and at least one of the step of calculating the quality of the continuous finder pattern and the step of calculating the quality of the discontinuous finder pattern.
3. The method according to claim 1 wherein the step of measuring aspects of a mark quality further comprises one or more of evaluating a clocking pattern of the code in the image and evaluating a matrix size of the code in the image.
4. The method according to claim 1, further comprising, after the step of measuring the aspects of the mark quality, generating an overlay graphic in the acquired image to visually highlight a portion of the image associated with the measured aspects of the mark quality.
5. The method according to claim 1, further comprising, if the attempt to decode the code is unsuccessful, computing an image sharpness score based on identifying edge direction and edge magnitudes for edgelets associated with features in the image.
6. The method according to claim 1 further comprising, if the step of measuring the aspects of the mark quality indicates a pass result for the quiet zone and at least one of the continuous finder pattern and the discontinuous finder pattern, evaluating a supplemental metric that includes one or more of a symbol separability test and a module separability test.
7. The method according to claim 1 wherein the step of calculating the quality of the continuous finder pattern includes calculating a multiplication product of the ratio of actual to expected dark modules in the continuous finder pattern, the ratio of actual to expected light modules in the continuous finder pattern, and the ratio of dark to light pixels in solid lines of the continuous finder pattern.
8. The method according to claim 1 wherein the step of calculating the quality of the discontinuous finder pattern includes calculating a multiplication product of the ratio of actual to expected dark modules in the discontinuous finder pattern and the ratio of actual to expected light modules in the discontinuous finder pattern.
9. The method according to claim 1, further comprising reporting an image deficiency if the histogram analysis of the quiet zone does not indicate a bimodal distribution.
10. A method for verifying a direct part mark inspection code, the method comprising: acquiring an image of the code; attempting to locate the code in the image; attempting to decode the code using the image; at least one of generating an overlay graphics to highlight a portion of a location of the code and reporting a confidence value for the location of the code; and measuring at least one aspect of a mark quality using the image of the code, if the attempt to decode the code is unsuccessful; wherein the step of measuring the at least one aspect of the mark quality includes calculating a quality of a finder pattern based on identifying one or more of: a quantity of actual dark modules and a quantity of expected dark modules for the finder pattern; a quantity of actual light modules and a quantity of expected light modules for the finder pattern; and a quantity of dark pixels and a quantity of light pixels in solid lines of the finder pattern.
11. The method according to claim 10, further comprising generating a second overlay graphic in the acquired image to visually highlight a portion of the image associated with the measured at least one aspect of the mark quality.
12. The method according to claim 10 wherein the step of measuring at least one aspect of a mark quality comprises evaluating one or more of a clocking pattern of the code in the image and a matrix size of the code in the image.
13. The method according to claim 10 wherein the step of calculating the quality of the finder pattern includes deriving a reflectance threshold from a histogram of the image and identifying one or more of the actual dark modules or one or more of the actual light modules using the reflectance threshold.
14. The method according to claim 13, wherein the step of calculating the quality of the finder pattern further includes calculating a multiplication product of two or more of a ratio of the quantity of actual dark modules to the quantity of expected dark modules, a ratio of the quantity of actual light modules to the quantity of expected light modules, and a ratio of the quantity of dark pixels to the quantity of light pixels.
15. The method according to claim 10 wherein the step of measuring at least one aspect of a mark quality comprises evaluating a symbol separability test.
16. The method according to claim 10 wherein the step of measuring at least one aspect of a mark quality comprises evaluating a module separability test.
17. An apparatus for verifying a direct part mark inspection code, the apparatus comprising: means for acquiring an image of the code; means for attempting to decode the code using the image; means for locating the code in the image if the attempt to decode the code is unsuccessful to provide a code location; means for computing an image sharpness score based on identifying edge directions and edge magnitudes for edgelets associated with features in the image, if the attempt to decode the code is unsuccessful; means for measuring at least one aspect of a mark quality using the image and the code location, if the attempt to decode the code is unsuccessful and the code location is provided, wherein the means for measuring the at least one aspect of the mark quality includes means for one or more of: calculating a quality of a finder pattern based on identifying two or more of: a quantity of actual dark modules and a quantity of expected dark modules for the finder pattern; a quantity of actual light modules and a quantity of expected light modules for the finder pattern; and a quantity of dark pixels and a quantity of light pixels in solid lines of the finder pattern; and performing a histogram analysis on a quiet zone in the image; and means for reporting a deficiency in one or more of the finder pattern and the quiet zone based on the measuring of the at least one aspect of the mark quality.
18. The apparatus of claim 17, wherein the finder pattern is a continuous finder pattern; and wherein the means for calculating the quality of the finder pattern include means for calculating a multiplication product of a ratio of the quantities of actual dark modules and expected dark modules and a ratio of the quantities of actual light modules and expected light modules.
19. The apparatus of claim 17, wherein the finder pattern is a discontinuous finder pattern; and wherein the means for calculating the quality of the finder pattern include means for calculating a multiplication product of a ratio of the quantities of actual dark modules and expected dark modules, a ratio of the quantities of actual light modules and expected light modules, and a ratio of the quantities of dark pixels and light pixels.
20. The apparatus of claim 17, wherein the image sharpness score is computed based on determining a minimum value of: the numerical value of one, and a ratio of an average magnitude of a 10% strongest edge in the image to a difference between an average gray level of a set of 10% lightest pixels in the image and an average gray level of a set of 10% darkest pixels in the image.
Description
BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
(1) These and other features of the present invention will be better understood in view of the following detailed description taken in conjunction with the drawings, in which:
(2)
(3)
(4)
DETAILED DESCRIPTION OF THE INVENTION
(5) A DPMI code 30 can be any one of a plurality of industrial standard encoded symbols, or one of a proprietary nature.
(6) The quiet zone 40 is a clear area free of all other markings that completely surrounds the code. For a data matrix code 32 that is marked or printed with a continuous finder pattern, such as a printed or etched mark, the quiet zone 40 width should be at least the width of one data cell 38. It is recommended that codes that are placed as a series of dots, such as a peened or ink-jet code, should have a quiet zone 40 equal to the width of at least four data cells 38.
(7) The finder pattern 34 consists of a consistent and unique pattern that forms a portion of each code, regardless of the position of the data cells 38. In a data matrix code 32, the finder pattern consists of two orthogonal lines, known as the L pattern. The finder pattern 34 is the key feature used in a code reading algorithm to locate the position of the code in the field of view, thus, a high quality finder pattern 34 is essential to ensure the maximum readability of the code throughout the life cycle of the part.
(8) The clocking pattern 36 are alternating light and dark cells that exist on the perimeter of the code that oppose the finder pattern 34 in a data matrix code 32. The clocking pattern defines the configuration of the pattern of light and dark cells that make up the data region 38 of the code.
(9) Full life cycle traceability requires a permanent marking method, which means that the mark must last for the expected life of the item in the expected environment of its use. The primary marking methods used to place a DPMI code 30 on an object 12 include dot peening, laser marking, chemical etching, and ink jet printing. Though the marking method and code type is a design specification that considers the requirements of the part and the expected operating environment, it is imperative that the marking operation create the DPMI code 30 on the object 12 in such a manner that subsequent reading operations can read and decode the mark.
(10) DPMI code verification is a processing step performed to assess and monitor the process of marking parts, that can be performed using the system 10. shown in
(11) Consistent and uniform illumination is critical in the verification of a DPMI code. System 10 has an illuminator 15 to flood the object 12 with the appropriate type of illumination so that a high contrast image of the DPMI code 30 can be obtained. In an illustrative embodiment of the invention, the illuminator 15 provides multiple modes of illumination, including on-axis bright field illumination, low angle dark field illumination, and diffuse illumination. The mode of illumination that is provided by the illuminator 15 may depend on the marking method used to place the DPMI code 30 on the object 12. For example, dot peened codes have been shown to be well imaged under low angle dark field illumination or diffuse illumination, while ink-jet printed codes on non-specular surfaces have been shown to be well imaged under on-axis bright field illumination.
(12) Digital image data is transmitted from the camera 16 via a communications path 18 to the image analysis system 20. This can be a conventional digital data processor, or a vision processing system of the type commercially available from the assignee hereof, Cognex Corporation, as programmed in accord with the teachings hereof for verification of DPMI images acquired by the camera 16. The image analysis system 20 may have one or more central processing units 22, main memory 24, input-output system 26, and disk drive (or other mass storage device) 28, all of the conventional type.
(13)
(14) In step 44, a method according to the invention attempts to decode the subject DPMI code image. This step is performed in the conventional manner known in the art and involves an application of machine vision tools to locate and identify the individual bars, dots, or other symbols that make up the machine readable portions of the DPMI code and/or the patterns formed thereby, and to discern from the relative position, size, orientation and/or shape thereof the underlying data. In an illustrative embodiment, the steps to decode at step 44 can be found in the reference decode algorithm published by the standards authority that governs the uniformity for which such codes are deployed. For example, the reference decode algorithm for data matrix symbols can be found in International Standard ISO/IEC 16022 Information TechnologyInternational Symbology SpecificationData Matrix (First Edition 2000-05-01), incorporated herein by reference.
(15) The output of the decode step 44 is true or false depending upon the success of the decode algorithm. If the decode step 44 is successful, then standard verification tests can be applied at step 46, and the verification process is completed at step 48. Standard verification tests applied at step 46 depend on the industrial application, type of mark, and the marking method used. For example, data matrix DPMI codes printed with square cells (i.e., paper-based labels or laser marked codes) are verified using the standard verification tests recommended in the above-referenced ISO/IEC 16022 standard. These tests measure print contrast, modulation axial non-uniformity, and unused error correction to grade marks on a letter scale of A through F, where A is excellent and F is fail.
(16) Data matrix DPMI codes that are produced by dot peening or ink-jet printing are best verified at step 46 using the International Aerospace Quality Group (IAQG) Verification standard (SAE Aerospace Standard AS9132, 2002-02, incorporated herein by reference). This standard measures dot size, dot position, and dot ovality to give each mark a grade of A, B, or F, which indicates whether a mark is excellent, acceptable, or fails, respectively. Additionally, each dot is analyzed and assigned a grade, and the overall quality of a DPMI code is the lowest grade achieved by any of the tests.
(17) Regardless of the standard used for the standard verification tests at step 46, a prerequisite of these tests is that the DPMI code be successfully decoded. In the method according to the present invention, successful decoding is not a requirement, since useful information can be provided from verification tests to evaluate and analyze a DPMI marking operation without attaining a successful decode at step 44.
(18) If the output of the decode step 44 is not successful, then processing continues where image characteristics are tested at step 50. Image characteristic tests can include image sharpness, image brightness, and contrastcharacteristics that can provide an assessment of an image without requiring an evaluation of the content of the image.
(19) To evaluate the sharpness of the image as a test of image characteristics at step 50, the edge magnitudes of the image are derived. Convolving the image with an edge detection kernel, such as the 33 Sobel filter provides a list of edge direction and edge magnitudes for edgelets associated with features in the image. A sharpness score can be computed as:
(20)
(21) Where mEdgeLight is the average magnitude of the 10% strongest edge in the image, including the quiet zone; mLight is the average gray level of the 10% lightest pixels in the symbol image including the required quiet zone; and mDark is the average gray level of the 10% darkest pixels in the symbol image including the required quiet zone.
(22) The image sharpness score will compute to be a value ranging between 0 and 1 inclusively. An ideal DPMI code image with a clear background and sufficient background separation has an image sharpness value of 1, while a blurred image has a lower image sharpness value.
(23) An evaluation of the brightness, contrast, and saturation of the image can be tested as the image characteristics tested at step 50. Brightness is a measurement of the overall intensity of the image. Contrast is a measurement of the difference between the intensity of the brightest features in the image and the intensity of the darkest features. Poor contrast will be observed in images that are too bright and washed out, and in images that are too dark. These tests can indicate problems with the image formation systemi.e., the illumination from the illuminator 15 and/or incorrect parameters in the settings for the camera 16.
(24) Step 52 performs a test to determine if the DPMI code can be found in the image. The code finding test can be the portion of the decoding algorithm that is performed to locate the finder pattern in the image that can precede the step of decoding. Such an algorithm can be found in the reference decoding algorithm of the code type under analysis. For example, in the case of a data matrix DPMI code, the reference decoding algorithm can be found in the above referenced ISO/IEC 16022 standard. The reference decode algorithm for the data matrix code provides a sequence of operations to first locate the L pattern and then build expanding search lines to determine the extent of the code to find the clocking pattern.
(25) Alternatively, the test for finding the code in the image can be performed during the decode attempt at step 44, by setting a code found variable to indicate that the code was located in the image. The result of the test to determine if the DPMI code was found in the image will include a score, or confidence value that the code was found.
(26) If the output of the code location step 52 indicates that the code was not found, processing continues to step 54 that reports the code location failure, and the output of the image characteristics test at step 50. Processing concludes at step 56.
(27) If the output of the code location step 52 indicates that the code was found, then processing continues to step 58 to generate overlay graphics, and to report the score from the code location step 52. Overlay graphics can highlight the portion of the image that can be associated with the finder pattern and the clocking pattern.
(28) Processing continues to step 60 where the matrix size is determined and compared to the expected value, to measure an aspect of mark quality. The clocking pattern 36 that was derived in the code location step 52 will determine the size of a cell module 38, upon which the overall matrix size can be derived.
(29) Processing continues at step 62 where the quiet zone and finder patterns are tested to measure an aspect of mark quality. At this step, a reflectance threshold is derived from a histogram of the image 42. In the illustrative embodiment, the acquired image 42 is smoothed with a 33 median filter.
(30) The finder pattern tests performed at step 62 are determined by the code type 76 and marking method 78. For DPMI codes that have a continuous features (i.e., code types that have a continuous pattern, that is marked in a continuous printing method, such as laser or electro-chemical etch), a finder pattern test can evaluate the conformity of each module of the finder pattern. For example, in a data matrix code, as described above, the finder pattern 34 is an L pattern on one half of the code. This type of finder pattern is constructed from a series of continuous modules, each of the same size as the data modules 38. In an illustrative embodiment, the finder pattern test performed at step 62 can be calculated as:
(31)
(32) where N.sub.aD is the actual number of dark modules among the modules ought to be dark (gray value less than the reflectance threshold) in the finder patterns. N.sub.nD is the number of modules ought to be dark (gray value less than the reflectance threshold) in the finder pattern. N.sub.aL is the actual number of light modules among the modules ought to be light (gray value greater than the reflectance threshold) in the finder pattern. N.sub.nL is the number of modules that ought to be light in the finder pattern. N.sub.d is the number of dark pixel (gray value less than the reflectance threshold) in the solid lines of the finder pattern. N.sub.l is the number of light pixel (gray value greater than the reflectance threshold) in the solid lines of the finder pattern.
(33) For DPMI codes that have a discontinuous finder pattern 34, such as those made in a marking method 78 such as dot peened, or dot matrix printed methods, a different finder pattern test can be applied. Here, the individual cells of the L pattern of the symbol are likely to be disconnected from each other, and a measure of finder pattern conformity can be calculated as:
(34)
(35) where N.sub.aD is the actual number of dark modules among the modules ought to be dark (gray value less than the reflectance threshold) in the finder patterns. N.sub.nD is the number of modules ought to be dark (gray value less than the reflectance threshold) in the finder pattern. N.sub.aL is the actual number of light modules among the modules ought to be light (gray value greater than the reflectance threshold) in the finder pattern. N.sub.nL is the number of modules that ought to be light in the finder pattern.
(36) The quiet zone tests performed at step 62 evaluate the region defined as the quiet zone of the symbol located in the image. The quiet zone is typically defined as a region that must be free of all other markings surrounding the symbol on all sides, and for data matrix DPMI codes, the width of this region is at least one data cell width, and wider for other codes, such as the QR code. For DPMI codes, this requirement can be failed if the mark is placed on the part where a surface aberration or defect is present. The features that exist on the surface of the part can result in a quiet zone failure. To evaluate the quiet zone, a histogram analysis can be performed that compares the distribution of gray-level intensities of the image to the distribution of gray-level intensities of the quiet zone. A bimodal distribution is expected for the histogram of the image, while a single mode of light pixels is expected for a conforming quiet zone (if the symbol is dark-on-light; the quiet zone distribution will be a single mode of dark pixels if the symbol is light on dark).
(37) If the tests of the quiet zone and finder pattern result in failures, processing continues to step 64 where the quiet zone and finder pattern deficiencies are reported, to conclude at step 66. If the quiet zone and finder pattern pass the tests at step 62, processing continues to step 68 where the quiet zone and finder pattern test results are reported, with overlay graphics to indicate the location of the finder pattern and quiet zone in the image.
(38) At step 70, supplemental metrics are computed and reported to provide diagnostic information for code verification to measure an aspect of mark quality. At this point, more than likely the reason the code was not able to be decoded at step 44 is that the image under analysis exhibits deficiencies or defects in the data cells 38. Supplemental metrics at step 70 can provide further information that can provide guidance as to the condition of the code.
(39) Supplemental metrics at step 70 can include a symbol separability test to verify that the predominate feature of the image is the symbol. To perform a symbol separability test, a comparison is performed between a histogram of the entire image and a histogram of the portion of the image where the symbol was located at step 52. Assuming that m.sub.0 is the mean value of the dark pixels in the symbol, m.sub.1 is the mean value of the light pixels in the symbol, and T is the reflectance threshold obtained from the histogram of the entire image, the symbol separability test is deemed passed if:
m.sub.0<T<m.sub.1
(40) Supplemental metrics at step 70 can include a module separability test that evaluates the bi-modality characteristic of the data cells 38, that represent binary data bit 1 or 0. Since each DPMI code type 76 contains a data region that contain nominally square modules set out in a regular array, each module can be represented by the average gray value of pixels within the module. In the ideal case, the histogram of the module representation has two well-separated narrow peaks, corresponding to the two states of the modules. The separability of the data cells 38 is defined as:
(41)
(42) Where g is the index of gray level, h(g) is the number of modules where the center has a gray level g; T is the threshold obtained from the histogram of the module representations; sLight is the standard deviation of light modules; sDark is the standard deviation of dark modules; mLight is the mean of light modules; mDark is the mean of dark modules; and
A=mDark+(TmDark)0.15
B=mLight(mLightT)0.15
(43) The value of S.sub.m ranges from 0 to 1 inclusively. A value of 0 indicates significant overlapping between the dark and light modules, which can result in a learn/decode failure. A value closer to 1 indicates good separability, and thus, good readability of the symbol.
(44) One skilled in the art will appreciate that further supplemental tests can be performed at step 70 that may include various code type-specific tests or evaluations. Additionally, aspects of mark quality can be measured at step 70 through the application of any combination of standard verification tests, recommended in the above-referenced ISO/IEC 16022 standard. These tests can include measurement of print contrast, modulation axial non-uniformity, to the extent that such tests can be computed without the results of a successful decode at step 44. Processing concludes at step 72.
(45) Although the invention is shown and described with respect to an illustrative embodiment thereof, it should be appreciated that the foregoing and various other changes, omissions, and additions in the form and detail thereof could be implemented without changing the underlying invention.