Vous êtes sur la page 1sur 13

ID CODE HANDBOOK

2-D CODE TECHNICAL GUIDE

INDEX

Chapter 1
1 2 3

An explanation on the use of 2D code readers based on reading principles and structure.

Types of 2D code readers 2D code reading principles The principle of monochrome recognition 3-1 How to capture monochrome 3-2 Differences in appearance based on colour 3-3 Characteristics based on the surface condition and shape of the workpiece 1. Types of reflection 2. 2D codes printed on a casting surface 3. 2D codes printed on a machined and processed surface 4. 2D codes printed on a black resin surface 5. 2D codes printed on a mirrored surface

Types of 2D code readers

2D code readers can be largely divided into two types.

Lighting

Camera

Lens

Camera/Lens

Decoder

Lighting

Single unit type:


This type of 2D code reader is one in which the lighting, camera, lens, and decoder are all housed in a single chassis. Because it is housed in a single chassis, this type can offer a high enclosure rating.

Separate type:
The separate type 2D code reader is one in which the lighting, camera, lens, and decoder all exist as individual devices. Because each part is separate, this type of reader offers reading performance with an extremely high degree of freedom.

2D code reading principles

2D code readers generally extract and decode 2D codes from captured images that have been converted to binary. If the correct code cannot be recognised using the binary-processed image, the code cannot be read.

(1) Light emitted from an LED illuminates the target code and is captured using a CMOS sensor or other such device. (1) (2) The captured image is downloaded and converted to grey-scale. Captured image

Optimal image

Overly bright image

Grey-scale images are also known as "monochrome" or "black and white" images. Because they are displayed with a smooth brightness that uses white, grey, and black, they are classified as distinct from binary images and are thus called so in image processing.

(2) Grey-scale image

(3) The grey image is converted into a binary image.

(3) (4) The image is decoded in accordance with code standards. The code data is then output via RS-232C or Ethernet communication. Binary image

Successful reading & Data acquisition

Failed reading Failed data acquisition

As seen in image (2), the binary image will vary greatly depending on how the image was captured using greyscale. Even if the printing condition is such that it can be recognised by the human eye, depending on the way the light hits the target, the surface condition of the printed workpiece, and camera conditions, the 2D code reader may be unable to correctly recognise the code.

The principle of monochrome recognition

3 -1 How to capture monochrome


Code reading cameras use the following principles to capture contrast (black/white). Parts that appear white can be seen as white because there is a large amount of light entering the camera. Conversely, parts that appear black can be seen as black because there is a small amount of light entering the camera. This difference in the amount of light (large/small) affects the contrast.

Camera

The amount of light reflected from the code is small

The amount of light reflected from the background is large

Code (Black)

Background (White)

3-2 Differences in appearance based on colour


When reading 2D codes, there must be a high contrast between the code and background. The method by which black and white are captured will vary depending on the colour of the lighting, the colour of the code, and the colour of the code's background. When reading 2D codes, colour must be used to properly understand the characteristics of a code. Colour is determined by wavelengths of light. For example, red light has a long wavelength and blue light has a short wavelength. The human eye understands these differences in wavelengths as colour. Objects that appear red have features that only emit red light, and objects that appear blue have features that only emit blue light.
Wavelength: Short Wavelength: Long

Purple

Blue

Aqua

Green

Yellow

Red

Now, apply this understanding to 2D code readers where red lighting is often used. When white, black, red, and blue items are illuminated with red lighting, the reflection will be as follows.

Reflected light when red lighting has been used to illuminate a white or black target

Red lighting

Camera

The property of the colour white is that it reflects all colours. Therefore, light that has been emitted from a red light source will be completely reflected off of white objects.

Transmitted light

Reflected Light

White object

Red lighting

Camera

Conversely, the property of the colour black is that it absorbs all colours. Therefore, once it hits a black object, light that has been emitted from a red light source is almost entirely absorbed.

Transmitted light

Reflected Light

Black object

If captured with a 2D code reader, the code will appear as follows.

Photo

2D code reader image

The background of the code is projected in the image as bright white, while the black of the code is projected as black. Following this principle, 2D code readers have been designed to capture high-contrast images.

Reflected light when red lighting has been used to illuminate a red or blue target

Red lighting

Camera

The property of the colour red is that it only reflects the colour red. Therefore, light that has been emitted from a red light source will be completely reflected off of red objects.

Transmitted light

Reflected Light

Red object

Red lighting

Camera

Conversely, the property of the colour blue is that it absorbs all colours (does not reflect light) except for the colour blue. Therefore, once it hits a blue object, light that has been emitted from a red light source is almost entirely absorbed.

Transmitted light

Reflected Light

Blue object

If captured with a 2D coder reader, the code will appear as follows.

Photo

2D code reader image

Photo

2D code reader image

Because both the white background and the red code reflect red light, there is a low contrast between the background and the code. Conversely, with blue codes, the background reflects red light and the blue code absorbs red light. As mentioned, 2D code readers have been designed to capture an image in which there is high contrast between the background and code. When looking to increase the contrast in applications such as this, it is important to recognise the combination of lighting, the code colour, and the background colour. Colour combinations that are close in wavelength will be low contrast and result in an unstable reading. When reading 2D codes, review the specifications along with the relationship between the colours of the lighting, background, and code to ensure the highest contrast is achieved.

3-3 Characteristics based on the surface condition and shape of the workpiece
Surface conditions and the shapes that codes are printed on are also important factors to consider when reading 2D codes. When printing 2D codes on objects other than labels, the way in which the lighting is reflected will vary depending on the surface condition and shape. Because of this, stable reading cannot be performed unless it is done in a manner that fits the workpiece in question. When determining reading performance, it is necessary to understand the features of the target workpiece.

1. Types of reflection

Reflection can be broadly divided into two types

Entry angle

Reflection angle

Mirrored reflection
This indicates reflection that occurs as it would when light hits a mirror; a reflection in which light coming from one direction is emitted away in another direction. This is also known as specular reflection. In a mirrored reflection, the entry angle and reflection angle become equal and almost no diffuse reflection occurs.

Diffuse reflection
This indicates reflection that occurs when light hits a textured surface and is then reflected in various directions. This is also called a scatter reflection.
Specular reflected light Diffuse reflected light (scatter reflected light)

2. 2D codes printed on a casting surface


Cast objects have projections and depressions on the entirety of their surface. If the printed surface of a workpiece is magnified, even sections that have been marked with cells produce areas that shine brightly and areas that become black due to the influence of projections and depressions. Shading around the cells also occurs in the same way.
[Magnified image]

When checking code reader grey-scale images, it is possible to see small differences in the background by using a normal image. When converting a grey-scale image into a binary image, many black elements are produced around the code, resulting in a 2D code that cannot be read.

[Grey-scale image]

[Binary image]

When the lighting for the code reader is increased, the black elements of the projections and depressions of the cast surface will appear white. Because the cell has been printed by direct marking, though faint, it is clearer than the projections and depressions of the cast surface. When viewing a binary image, stable reading is possible because the code is in a state that allows it to be properly recognised. When printing directly on a cast surface, try to do so in a manner that will allow for a large amount of light to be used.

[Increased lighting image]

[Binary image]

3. 2D codes printed on a machined and processed surface


Thin, streak-like processing flaws are sometimes left on metal surfaces. These processing flaws are called hairlines. They can occur on machined surfaces, processed surfaces, or on rolled metal surfaces. When lighting is illuminated directly onto surfaces that have these fine processing flaws, shading of the light will occur perpendicular to the direction of the processing flaws, resulting in a state where the cells of the 2D code cannot be recognised.

[Magnified image]

If machined and processed surfaces are not polished, the resulting processing flaws will remain. As seen in the image above, when a 2D code is printed on a cylindrical workpiece, processing flaws are left in the cutting direction. As a result, the lighting is extended in the direction of these processing flaws (images below).

There are many instances where 2D codes are printed without regard for the direction of the hairlines. When directly illuminated with ring lighting or other such illumination, the lighting will be reflected in various ways depending on the workpiece, making it impossible to perform stable reading. In order to evenly irradiate the lighting, a diffusion plate is used (Image A). If the object has clear printing, it is possible to intensify the lighting and make the hairlines around the 2D code appear white, creating a state in which only the 2D code stands out (Image B). When printing a 2D code on a surface with hairlines, it is important to print the cells deeply and precisely.

Image A

Image B

10

4. 2D codes printed on a black resin surface


Black resin workpieces are often mixed with glass fibres in order to increase their strength. Because of this, the surface condition of the workpiece will change, causing the colouration of printed 2D codes to vary.

Both codes below are printed on a resin surface with a laser. When capturing images with a 2D code reader, the black resin surface will be highly reflective and produce many white areas due to the influence of glass fibre elements.

Under normal conditions, both codes should appear white, but when looking at a grey-scale image, the code area on the right has been inversed to black. This is because the amount of reflected light for the printed area is smaller than the area around the code. The 2D code reader also has settings to perform reading in black/white inverse, as it is impossible to perform reading with a single setting if this type of condition occurs.

In order to allow the light reflected from the glass fibres to escape, the code reader is mounted in an angled direction. Angling the light makes it possible to reflect only the printed area of the code and allows it to be seen unaltered in white print (black/white inverse).

11

5. 2D codes printed on a mirrored surface


When 2D codes are printed on a wafer or polished surface, the actual reading range is extremely narrow. This is because the light from the code reader, or external illumination source, creates a specular reflection off of the workpiece surface and influences the ability of the reader to properly recognise the 2D code.

Depending on the printing method, 2D codes that have been printed on a mirrored surface will appear to have been coloured black or coloured white. However, with a camera image, the cells will appear in inverse as white no matter what the printing conditions are.

If the code reader is mounted perpendicular to the workpiece, the reading unit will be reflected in the workpiece surface, as shown in the image above. Even if the 2D code is properly recognised, due to the influence of the lighting and the reading unit, the range in which stable reading can be performed will be narrow, resulting in a state where cells become hidden and unreadable.

Mounting the code reader at an angle...

Lets mirror-reflected light escape so that it receives only diffuse reflected light from the cells Results in a state in which the reading unit is not reflected in the code surface.
In order to achieve stable reading, it is best to mount the code reader in an angled direction with respect to the workpiece.

12

Copyright (c) 2011 KEYENCE CORPORATION. All rights reserved.

BL2DTechnical-WW-EN1220-E 1121-1 E 600A34 Printed in Japan


* 6 0 0 A 3 4 *

Vous aimerez peut-être aussi