Industrial Automation

    

Blog

Insights about OCR Vision Applications with CIJ Printers (Part 3 of 3)

This article is the third of three articles about OCR vision applications with continuous inkjet printers (CIJ). In the first article I discussed in details about the typical print output achieved with CIJ printers at high speed. I showed real-world images of such prints and showed the wide variation between similar characters that can be printed by the same printer head. I explained the great challenge for any OCR algorithm in solving such CIJ applications issues. In the second article, I provided some basics about CIJ printer technical concepts and discussed possible faults during high-speed printing on production lines. I showed how to become familiar with the common defects that may be inherent in the specific line you are trying to automate. I also showed a set of images of typical defects for CIJ printers. If you haven't read the first and second articles yet, I recommend reading them before proceeding further in the current article.

In this third article, you will learn about the different vision solutions possible with Microscan vision technology. AutoVISION Software incorporates many possible vision tools to choose from, including OCR algorithms with trainable characters, as well as vision tools that are simpler but can be highly effective in the inspection of CIJ print. So how do we know which strategy to follow? In some cases, simple pixel-based algorithms can solve many of the common printing problems of a CIJ printer setup. In some cases pixel-based tools are more effective than OCR tools. Later on I'm going to describe the machine vision concepts of each approach. I will also point out the advantages and disadvantages of each method. I will provide guidelines for when to use each strategy, and when one strategy may be more effective than another strategy. Once you have this knowledge you will be able to create powerful vision inspection systems for high-speed production lines with CIJ printers using simple components that allow for a rapid yet highly effective design process. Below are listed various potential vision solutions that are used to solve inline inspection applications challenges of CIJ-printed characters at high speed. They are divided into three primary groups:

  • Group 1 - Pixel-Based Vision Tools: Vision algorithms performed on pixel values to find edges or to count pixels within a range of grey levels. Such vision tools are used for various vision inspections - not only for print inspections.
  • Group 2 - OCR tools with match data input, to compare the read text with a matching data which is the expected result.
  • Group 3 - OCR tools with custom pass/fail logic, which apply advanced logic in order to qualify/disqualify the inspected product.

Group 1 - Pixel based solutions: The most basic solution possible is a system that does not analyze the characters to convert them to ASCII form, but analyze the image in pixels level. It would use vision tools to check basic characteristics of an image. This method may result in a high number of false rejects.

Option 1:   This option allows you to check presence or absence of printed text by counting the character pixels over an even background. Refer to the screen capture below, which uses the Presence/Absence Tool in AutoVISION to check if there is anything printed in the sample area. The pixels highlighted in yellow are those that fall inside the range of gray values that are considered printed ink. The nominal count result for this case is ~7436 pixels, as seen below. When the result is much lower or much higher, this raises a warning. Such a solution is more effective when the overall intensity levels are consistent. Frequent changes in illumination or changes in ink level would result in a high rate of false failures.

Option 2: We can check the dimensions of the printed characters by detecting character edges and measuring the distance. See the example below, performed in AutoVISION with the Measure Tool. This strategy is effective for finding the most common defect of CIJ printers, which is a missing top line or bottom line of dots. A shorter measurement than usual results, signifying a print defect. Once such a problem occurs, it is there to stay until it is fixed. Therefore, raising a warning is rather noticeable in such cases. When possible, adding a special rectangle character on the end of the line makes the results more reliable. The dimensional measurement will be performed on the rectangle instead of on a character. This way the measurement result is more consistent. When done correctly, this solution has a low probability of false failures.

Option 3: Using the OCV Tool in AutoVISION, we can compare each snapshot to a trained pattern. During the analysis of the acquired image, the differences in pixel level between the current image and the trained pattern is translated into a numeric percentage. A user-defined tolerance level of this percentage is the pass/fail criteria. This method is effective when printed text is high quality, and there is not much variation from print to print. This should be used in higher-quality CIJ printers at slower speeds. It is important to notice that this method requires a trained pattern, meaning that it is appropriate for applications in which the print data is the same for all products for a long period of time. A change in the print data forces a new Train action.

Group 2 - OCR Tools with Match String Input The options in this category are solutions that identify the characters using the OCR Tool, convert them into ASCII form, and then simply compare the data to a match string sent from the printer or any other remote device. The match string can be also permanent when applicable, without the need to communicate with a remote device. In this solution the data that is read by the camera is compared to the match data as-is. The probability for false rejects with this method is very high. The reason is that we set a high demand from the  inspection system to overcome the extremely high variations in the characters from product to product and to classify every single character correctly. In such conditions it is very hard for OCR algorithms to read all characters correctly for all products without errors.

Option 1: Read the printed characters using the OCR Tool in AutoVISION to see if they are readable or not. A read failure event will occur when the system cannot recognize one character. This will raise a warning. Such solutions might generate a high rate of false failures if the print quality is not well controlled.

To improve the consistency of the results, using the advanced features of Microscan's latest OCR Tool (IntelliText - named by Tim O'Neel, our incomparable Senior Technical Writer) as well as using AutoVISION's built-in morphological image processing algorithms, can yield dramatic improvements. See the images below for a demonstration of a simple €Connect € function, which connects the dots after applying morphological functions to the pixels, to create a more readable OCR image.

Before:

After:

Option 2: Read the printed characters using the OCR Tool, then compare them to a match string input sent remotely or just saved in memory. Both options are possible in AutoVISION. Match string data can be sent from a remote device over various communication protocols, as well as from the printer itself or another remote device. See the examples below from the AutoVISION user interface for match string input.

An example for sending match string remotely using a telnet connection with Microscan vision cameras can be seen below in a short telnet log. The remote device is communicating with the camera via text commands. This can be done from any host application or printer with the ability to send text to a remote device.

Option 3: This option is used for simple €track and trace € solutions. The camera reads the printed characters using the OCR Tool, then sends out the read data to a remote server as ASCII values to be recorded in a data base for a later use.


Group 3 - OCR Tools with Custom Pass/Fail Logic In this category, the described solutions would also read the data using the OCR Tool, but would not necessarily use the ASCII value to compare to a match string or to output to a remote system. The solution here is to analyze the data content and structure locally in the camera using advanced logic tools in AutoVISION, then provide a pass/fail decision based on that analysis. Here there is no need for a remote device to send match data to the camera (saving communication cables or HW modules). The camera is just checking the readability of the printed text. It uses OCR to read the characters but does not compare them one-to-one with a match string. Let's look at some examples in order to develop a better understanding.

Option 1: We can check if the structure of the printed information is correct. For example, let's look at a given €best before € date, which is printed in this format: DD/MM/YYYY. In this case, the camera would only verify if the structure is as follows: <2 digits=""><2 digits=""><4 digits="">. It would not check what digits are actually printed, but would only verify that it is a digit and not a letter or another kind of character. In the example below which is taken from AutoVISION (OCR IntelliText tool), we see how to instruct the camera in what date format to expect. Then the camera will verify the data format using the OCR Tool without sending out the actual characters. In order to define such a custom pass/fail criteria, we use the widely known €Regular Expression € methodology. This is a text pattern match/search syntax that is very popular among contemporary software developers.

See the links below for more information about Regular Expressions:

https://en.wikipedia.org/wiki/Regular_expression

http://regexone.com/

Regular Expression syntax is beyond the scope of this article. I may publish a dedicated article about Regular Expressions in the future, including usage examples, depending on reader requests.

REGEX Example 1 (from the AutoVISION Software User Manual:

Option 2: Let's look at another use of Regular Expressions below, also from the AutoVISION Software User Manual. But this example will include conditional results. Here we can see the power of the REGEX language, which enables us to define several options as a pass result. In the expression below, a print-out of the months JUN or FEB is defined as a pass result, while the prefix EXP is a must show on every print:

Option 3: Using the OCR Tool we can verify that the number of detected characters is correct, disregarding the specific characters or read results. That would be a simple inspection, but would still be a more sophisticated check than presence/absence of CIJ print. Simple inspections many times can be more than enough to give a real-time warning of production line problems. In the example below, look carefully in the list of output results of the OCR Tool, There we see the parameter: €˜Number of Characters Found € = 8. Obviously, such inspection decreases the chances of failure, as we don't care if some digit is classified as 6 instead of 5. We only look at the total number of the characters found in the line. This, together with other inspection methods shown above, can create €œa reliable inspection system with a low rate of false failures."

We can design a pass/fail check to make sure that our printed data is valid by checking each character if it is a digit or a letter, without identification of the specific character. For example, in the case of printer output that includes only digits, no letters are allowed. Using Regular Expression language, we easily define such a pass-fail criteria on the read data which fails if a letter is found among the read characters. The expression [0-9] in REGEX syntax means €˜Any digit between zero and 9'. So when the input is a letter or any other sign character which is not a digit, it will raise a failure.

For example, such a match expression expects any 3 digits as output, while the actual digit values are not important:

This OCR result will pass, as all 3 detected characters are digits.

This OCR result will fail, as one of the characters is a letter and not a digit.

Option 5: As a more advanced solution, we can use combinations of the methods above. For example, using match data sent from a printer, as well as REGEX logic to create clever pass/fail definitions. Or using OCR tool as well as pixel based tool to qualify the printed info. With the flexibility of AutoVISION configurations, we can be creative. Notice that not all the read data must be checked on each inspection. Comparing sub strings of the data each time can save us false failures. For example: compare only first and last digit of each line, or compare each cycle a different pair of digits on each line randomly, improves the reliability of the results, as checking less info means less error probability. When that is enough to catch the real defects on the production line, there is no need to check more than that.

False failures and overall reliability of a solution

Achieving a reliable inspection system is having a system with very low false failures. False failure is a failure result which is given for a good product. This is definitely an unwanted situation, and one   which is probably not acceptable to any production manager in any factory. Therefore, the solution engineer should strive to create reliable inspection systems that  raise a failure only when there was a real defect product on the line. With CIJ applications, we already know that it is not easy to reach high reliability if we set high demands from our system. So introducing clever custom pass/fail criteria in our inspection system like shown above, enables us to reach high reliability of inspection results, yet effectively solving the problem of the production line.

Summary In the table below are listed the main features of the solutions groups discussed in this article.

To conclude, I would like to emphasize that understanding the nature of the problem in the production line is the first and crucial step. It ensures we design a solution which solves the actual problem. Then understanding the pros and cons of the possible solutions brought up in this article, helps to choose the correct approach and apply the correct vision strategy from the various options with AutoVISION.

We saw that the relevant vision solutions are very scalable. This thanks to the high flexibility of AutoVISION software. However, in the same time we must be careful not to overdo things and not to end up with inspecting too much. Inspecting too little is also not effective. Design of a vision solution which is not hitting the target with solving the real problem, leads to bad solution systems which give inconsistent results, too many false failures or too many undetected defects.

Due to the simplicity of design changes with AutoVISION, we can always try different approaches before we decide on one of them. We can also combine different approaches and apply them in one inspection if that is found to be successful.

I hope that with the insights brought in this blog, you will be able to create powerful vision inspection systems for production lines with CIJ printers using Microscan technology. For any questions or application advice, please submit questions in the comments field of this article.  

Category(s): Solutions & Applications Leave a Comment

Recent Posts


Leave a Comment

Comments

Written by on Reply