cv_ocr_tech_kcn

8
Information such as lot numbers, product numbers, and dates are printed on production lines in every industry. Consequently, inspections to ensure print quality and to verify content have become increasingly important. Image processing and inspection devices such as KEYENCE's CV-3000 Series meet the needs of consumers who want to implement these types of visual inspections. This guide describes the basic methods of print inspection and some tips in the form of answers to frequently asked questions. By using KEYENCE's latest machine vision system, the CV-3000 Series as an example, this guide provides specific key points which help users to properly implement a vision system for print inspection. MACHINE VISION PRESENCE/ABSENCE OF PRINT PRINT QUALITY CHARACTER VERIFICATION (OCV) CHARACTER RECOGNITION (OCR) Detects a target which lacks print due to a problem or failure of the printer. Detects an illegible character resulting from a problem or failure of the printer. Checks whether printed characters correspond with the originally intended content. Reads printed characters and outputs the information for sorting, verification, or automatic control. Typical applications Verifying expiration date The vision system verifies whether the expiration date on food containers is correct (OCV). Checking product numbers The vision system recognizes the product number printed on an electronic component (OCR). MARKING INSPECTION Types of print inspection Print inspection can be classified as follows. The method and the function to be used may vary depending on the purpose. Typical applications of print inspection 1

Transcript of cv_ocr_tech_kcn

Information such as lot numbers, product numbers, and dates are printed on production lines in every industry. Consequently, inspections to ensure print quality and to verify content have become increasingly important. Image processing and inspection devices such as KEYENCE's CV-3000 Series meet the needs of consumers who want to implement these types of visual inspections. This guide describes the basic methods of print inspection and some tips in the form of answers to frequently asked questions. By using KEYENCE's latest machine vision system, the CV-3000 Series as an example, this guide provides specific key points which help users to properly implement a vision system for print inspection.

MACHINE VISION

PRESENCE/ABSENCE OF PRINT

PRINT QUALITY

CHARACTER VERIFICATION (OCV)

CHARACTER RECOGNITION (OCR)

Detects a target which lacks print due to a problem or failure of the printer.

Detects an illegible character resulting from a problem or failure of the printer.

Checks whether printed characters correspond with the originally intended content.

Reads printed characters and outputs the information for sorting, verification, or automatic control.

Typical applications

Verifying expiration dateThe vision system verifies whether the expiration date on food containers is correct (OCV).

Checking product numbersThe vision system recognizes the product number printed on an electronic component (OCR).

MARKING INSPECTION

Types of print inspection

Print inspection can be classified as follows. The method and the function to be used may vary depending on the purpose.

Typical applications of print inspection1

2

1st Obj.Recog.2nd Obj.Recog.

StabilityVariation

* The inspection time varies depending on the settings.

1500 inspections/minute

Prod.Date Factory

0123456789ABCDEFGH.......XYZ

Camera

Inspection targets

2 0 0 7 . 0 6 . 1 2

2 0 0 7 . 0 6 . 1 2

2 0 0 7 . 0 6 . 1 3

Target 1

Target 2

Target 3

Judgment outputOKOKNG

Data output2 0 0 7 . 0 6 . 1 22 0 0 7 . 0 6 . 1 22 0 0 7 . 0 6 . 1 3

Vision system controller

Character recognition using the internal library

Registered character string = 2007.06.12

Verification of the registered character string

1

2

3

1

2

3

Similarly shaped characters

Character recognition

As shown below, a vision system captures the image of the characters printed on a target with a camera, and then compares them one by one against the characters registered in the internal library (character font groups). When the shape of a character matches most closely with the shape of one of the characters in the library, it is recognized as that character. As a judgment tolerance, the system can evaluate whether all the recognized characters match with the registered string and then output either an OK or a No Good(NG) result. It is also possible to output the recognized character string to an external device as character data.

The following frequently asked questions relate to customer inquiries regarding print/character inspection.

FREQUENTLY ASKED QUESTIONS2

Prod.Date :

Period :

See pages 5 and 6 for detailsThe Print Inspection function of the CV-3000 Series can detect up to two lines of 20 characters in one inspection window. Since two or more inspection windows can be set, it is possible to inspect characters at several different locations.

How many characters can be inspected?Q1.

The time for print inspection varies depending on the settings. The example below shows that the CV-3000 Series can inspect 10 characters and 2 symbols of data at approximately 40 ms intervals (1500 inspections/minute).

How long does the print inspection take?Q2.

With the CV-3000 Series, users can set the "Character type" to limit the characters used as a reference in the library. As a result, alphabetic characters are verified only against the alphabetic section in the library, and numeric characters are verified only against the numeric section. This prevents letters such as B,O, and I from being incorrectly recognized as 8, 0, and 1. As shown below, the stability values also increase compared with the values on the previous page.

Is it possible to differentiate between similar characters?Q3.

3

Correlation values remain high even when print quality decreases.

Sub patterns

ALPHABETICAL FIGURES

1st Obj.

Recog.

2nd Obj.

Recog.

Stability

Variation

The correlationdecreases.

Registered characters (stamp)

Registered characters (inkjet printing)

Characters of poor quality

Characters with one dot missing

1st Obj.Line 1 Result

Recog.

1st Obj.Line 1 Result

Recog.

1st Obj.Line 1 Result

Recog.

1st Obj.Line 1 Result

Recog.

1st Obj.Line 1 Result

Recog.

The CV-3000 Series is equipped with a Character Recognition function which selects the first and second characters based on their most closely correlated values in comparision to the registered characters. If the difference between the correlation values of the first and second characters is large and no other similarly shaped characters have been registered, the result will be stable. The example shows the correlation and stability of the OCR tool when a character string contains similar numbers and letters such as "0" and "O", "8" and "B", "1" and "I". The stability values of zero and the letter “O” is 0 and 1 respectively, which means they are recognized almost as the same shape. There are differences sufficient enough to distinguish between 8 and B, and 1 and I because part of their shapes are clearly different. Please note that the stability of these characters may decrease due to the font used or the print quality.

Is it possible to differentiate between similar characters?Q4.

See page 7 for detailsIn print quality inspection, some users want to allow reading of a specific print quality, but judge that print quality as NG (defective). Setting a threshold is not always as easy as it seems. The CV-3000 Series can detect the difference in print quality from normal characters as a change in the correlation. In other words, when a character shape changes, the correlation decreases. The examples below show the changes in the correlation values when normal characters and the characters printed with defects are inspected. As the examples on the right show, the correlation decreases when characters have spots, voids, or different weights. However, it is difficult to quantify the relationship between the decrease in the correlation and the type of defectiveness of a character. Consequently, the typical way to determine the threshold value of the vision system for this kind of judgment is to use statistical data obtained from several characters.

Can defects in print be recognized accurately?Q5.

See page 7 for details

The answer to question 5 explains how the correlation decreases when the print quality decreases and that setting the lower limit allows users to exclude the poor quality print from being judged as NG. Is it then possible to continue stable character recognition when print quality decreases? The answer is yes. The CV-3000 Series has a Library Registration function that includes sub pattern registration, allowing users to record several different shape patterns for one character. This prevents the correlation from decreasing even when characters appear to be distorted. The example below shows the improved correlation values after poor quality characters are registered as sub patterns in the library.

Can proper recognition of characters be ensured when print quality decreases?

Q6.

4

In the example above, the registered character string is set to "2007.07.12", which is one month from the current date "2007.06.12".

Detected String :

Registered String :

Detected StringProg.timeRecog.

Detected StringProg.timeRecog.

Detected StringProg.timeRecog.

Inspection of an expiration date printed on food containers

Normal grayscale imageCharacter extraction is unstable due to the influence of background colors.

Color shade processing using the CV-3000The contrast between the characters and background is sufficient for stable recognition.

When Auto Extraction is enabled with the CV-3000 Series, the variation in the size of the character does not affect the recognition accuracy as shown below. This is because Auto Extraction allows the system to recognize the character after performing size normalization.

Will a change in character size affect the inspection?Q7.

If the background of the print has patterns or gradations, character extraction may be unstable. In this case, the color shade processing of the CV-3000 Series provides an image in which only characters are emphasized. This allows stable character recognition.

Is there a method to read printed characters without being affected by the background?

Q8.

No, daily adjustment is unnecessary because the CV-3000 Series automatically adjusts the date in the registered character string based on its internal calendar. It it is also possible to offset by a certain period of time from the current date/time. This is useful for inspecting expiration dates based on a specified number of days from the current date.

Is it necessary to adjust date settings on a daily basis? Q9.

5

Character height

Angle of the line

Character width

Character gap

Auto Extraction 1 (projected waveform)

■ A single measurement window can extract up to 2 lines of text, with up to 20 characters on each line. ■ The character string can be located based on its unique projected waveform and the extraction area is automatically adjusted. ■ The extraction is performed directly from the grayscale image so binary processing is unnecessary.

Users can check the extraction status of characters and lines with the displayed waveform during operation.

■ Angle, rotation, and tilt of the line

■ Variations in character height

■ Variations in character gaps

■ Variations in character sizes

When the characters are extracted in the measurement window, the following items can also be detected and adjusted to increase stability.

The success of the OCR depends on the "extraction" process which divides each character string into individual characters. The OCR tool of the CV-3000 Series offers two extraction settings to help stabilize inspection due to the various conditions of the characters.

Flexible character extraction1

Auto / Fixed Extraction settings

TECHNICAL INFORMATION

6

18%

35%

51%

68%

84%

100%

All characters of a registered string can be directly input.

■ Example of library data

The extracted character data is automatically registered to the proper character type in the library.

(Symbols such as a "hyphen" can also be registered simultaneously)

Advanced Auto Extraction (Set Ratio)

■ The text can be extracted by specifying where each character ends via a set ratio percentage.■ Stable extraction is possible even if the character gap is very narrow.■ A single measurement window can extract up to 2 lines of text, with up to 20 characters each line.

Fixed Extraction

■ The character extraction area can be specified to any position in the measurement window.■ The fixed extraction area is specified in the shape of a rotated rectangle. Complicated layouts such as text on an arc can be extracted stably.

By specifying the separation position between each character in terms of percentage, (the length of the whole character string is considered 100%), users can automatically extract character strings that may be difficult to inspect using auto extraction.

By setting the character extraction area as rotated rectangles, text along a ring can be easily detected.

All of the characters extracted from the measurement window can be registered at once. This eliminates the need to register each character individually.

Register all extracted characters simultaneously (Regist All)

Characters are recognized by comparing them to a preset text library. Generating a library based on the actual target conditions helps to stabilize detection.

Library Registration function2

7

Correlation/Stability display

Character Variations

The Library Function of the CV-3000 also supports the ability to register several versions of the same character type as character variations. Up to 200 character patterns can be registered in all, increasing the stability of recognition for various fonts.

■ One character variation registered for each type

❙ Normal status ❙ Out of focus characters

■ Multiple variations registered for "A"

Before After

Actual captured fonts are added to the registration as character variations for A.

The quality of the character detection can be continuously monitored during operation via the correlation and stability values. A lower limit can be set to these values so that any detected characters with values below the limits will be ignored.

Fine Adjustment function (Fine Adj.) ❙ Fine Adjustment ON (standard setting)

This function is used to improve the correlation and stability of characters that change in size. The extraction area for each character is individually adjusted based on height, then compared to the preset library.

The character "A" is recognized, but the "Correlation" shows lower rates for the second character and other subsequent ones due to the different fonts.

"Correlation" shows 99 for all characters despite the different fonts

Correlation: Outputs the similarity of the detected character to those in the preset library data and assigns a value between 0 (min.) and 99 (max.)Stability: Outputs a value that represents the difference between the correlation values of the first and second closest matching characters.

The correlations increase because each extracted area size is fine-adjusted according to the actual character height.

The correlations decreases due to the extracted area size in spite of the different character height.

❙ Fine Adjustment OFF

The Stability Display function is used to determine the repeatability of the OCR detection, and helps users to make quick adjustments as necessary.

Stability Display function3

■ The year can be displayed with either two digits or four digits.

■ The Zero Suppression function is available for the month and day.

The date of the registered character string is automatically adjusted according to the internal calendar.

Example:When the date is 09/09/06 according to the internal calendar

Zero Suppression OFF 09/09/06Zero Suppression ON (the zeros are removed) 9/9/06

Setting the judgment condition with fixed characters

■ Example of the judgment condition

Year (4 digits) MonthFixed character "." DayFixed character "."

Updating date characters that reference the internal calendar can be used in conjunction with fixed characters, such as a factory code, and may be judged all at once.

Time and date of the internal calendar ■ Wrong day ■ Wrong factory mark

Fixed character "CA"

Wrong characters are displayed in red

In this example, the offset of six months is added to the value of the internal calendar.

An offset value can be added to the internal calendar when performing OCR inspection. This is very useful when verifying correct expiration dates.

An allowable error can be set to account for the time difference between the internal CV clock and that of the external marking device. This can prevent erroneous inspections that involve the date or time, especially at the turn of the day.

Offset Allowable Error

In this example, the OCR inspection will ignore any time difference between the internal calendar and the external device within the range of +/-120 seconds. Thus, at the turn of the day (00:00), both dates are acceptable within this range.

Example: 23:58:00 to 23:59:59 The next day can also be marked. 00:00:00 to 00:02:00 The previous day can also be marked.

Note: The OCR Measurement Tool is not primarily intended for inspecting marking quality such as defects or blurs of characters. Other measurement tools such as the "Stain Inspection Tool" or the "Area Tool" should be used together for such an inspection.

The internal calendar is automatically updated and can be referenced when performing date code inspections. This eliminates the need to adjust the date tolerance on a day-to-day basis.

Calendar function4

KA1-0049

Specifications are subject to change without notice.

CALL TOLL FREE

TO CONTACT YOUR LOCAL OFFICE

1 - 8 8 8 - 5 3 9 - 3 6 2 3

Corporate Office 50 Tice Blvd., Woodcliff Lake, NJ 07677 Phone: 201-930-0100 Fax: 201-930-0099 E-mail: [email protected]

■ Regional offices COFLGAIL

DenverTampaAtlantaChicago

ALCACA

BirminghamN.CaliforniaLos Angeles

VAWA

RichmondSeattle

SCTNTNTX

GreenvilleNashvilleKnoxvilleDallas

Fax: 201-930-0099www.keyence.com

KEYENCE CORPORATION OF AMERICA

KEYENCE CANADA INC.

Head Office Phone: 905-696-9970 Fax: 905-696-8340 E-mail: [email protected] Phone: 514-694-4740 Fax: 514-694-3206

KEYENCE MEXICO S.A. DE C.V.

Phone: +52-81-8220-7900 Fax: +52-81-8220-9097 E-mail: [email protected]

INKSKYMA

IndianapolisKansas CityLouisvilleBoston

MIMIMNMO

DetroitGrand RapidsMinneapolisSt. Louis

NJNYNCNC

Woodcliff LakeRochesterCharlotteRaleigh

OHOHORPA

CincinnatiClevelandPortlandPhiladelphia

Copyright (c) 2008 KEYENCE CORPORATION. All rights reserved. CVMarking-KA-L-E 0119-1 600442 Printed in Japan

* 6 0 0 4 4 2 *