Portable code reader and code reading method

The portable code reading device addresses the challenge of decoding both simple and difficult codes by using adaptive illumination and parallel core processing, ensuring high-speed and stable decoding through multiple illumination modes and cores.

JP2024113912APending Publication Date: 2024-08-23KEYENCE CORP
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2023019186
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-10
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing code reading technologies face challenges in achieving both high-speed decoding of simple codes and stability in decoding difficult codes, particularly when illumination conditions are inappropriate, leading to failed decoding and standby times in fixed imaging cycles.

Method used

A portable code reading device with an illumination unit capable of switching between multiple illumination modes, an imaging unit, and multiple cores for parallel decoding, where the first core focuses on high-speed decoding of simple codes and the second core ensures stability by frequently switching illumination modes for difficult codes.

Benefits of technology

The device achieves high-speed decoding of simple codes while maintaining stability in decoding difficult codes by reducing standby times and improving the success rate of decoding through parallel processing and adaptive illumination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024113912000001_ABST
    Figure 2024113912000001_ABST
Patent Text Reader

Abstract

To achieve both of high speed in decoding a simple code and stability in decoding a difficult code.SOLUTION: A code image Ic generated by high speed photographing control (first photographing control) for allowing a photographing unit 3 to generate code images while allowing an illumination unit 2 to execute one kind (N1=1) of illumination mode (polarization light illumination mode) among four kinds of illumination modes is decoded (high speed decoding) by a core C1. On the other hand, a code image Ic generated by obfuscating photographing control (second photographing control) for allowing the photographing unit 3 to generate code images while allowing the illumination unit 2 to execute all the four kinds (N2=4) of illumination modes among the four kinds of illumination modes is decoded (obfuscating decoding) by cores C2 to C4.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a technology for generating a code image based on light reflected by a workpiece and decoding the code image to read a code attached to the workpiece. [Background technology]

[0002] There is known a technology for reading a code by decoding a code image generated by capturing an image of the code with a camera. In this case, the time required to decode the code image depends on the type of the code. That is, a code that is easy to decode, such as a code printed on a label, can be decoded in a short time, whereas a code that is difficult to decode, such as a code formed by DPM (Direct Part Marking), takes a long time to decode. In response to this, Patent Document 1 proposes a technology for improving the efficiency of decoding by using a first core and a second core. According to this technology, the timeout for decoding in the first core is set shorter than the imaging period of the code, whereas the timeout for decoding in the second core is set longer than the imaging period of the code. This allows a simple code to be decoded quickly by the first core, while a difficult code can be decoded reliably over a long period of time by the second core. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] US7852519 Summary of the Invention [Problem to be solved by the invention]

[0004] However, even if a long time is spent on decoding, if the conditions for generating the code image are inappropriate, the decoding of the code image will fail. In particular, if the light irradiation on the workpiece is inappropriate, a good code image cannot be generated, and the decoding of the code image will often fail. Furthermore, in an environment where there are more simple codes than difficult codes, if the imaging cycle is fixed as in Patent Document 1, even if the first core can decode the code in a shorter time than the interval between imaging cycles, the first core may be in a standby state until the next imaging cycle.

[0005] SUMMARY OF THE PRESENT INVETION The present invention has been made in consideration of the above problems, and has as its object to achieve both high speed decoding of simple codes and stable decoding of difficult codes. [Means for solving the problem]

[0006] A portable code reading device according to the present invention has an illumination unit capable of switching between and executing in sequence a plurality of illumination modes that irradiate light in different modes onto a workpiece having a code to be read, an imaging unit that receives light irradiated from the illumination unit and reflected by the workpiece to generate a code image, and a first core and a second core that can decode the code image in parallel, and causes the imaging unit to generate a code image while causing the illumination unit to execute one of the plurality of illumination modes, and causes the first core or the second core to decode the generated code image. and a control unit that controls the imaging unit to generate a code image while causing the lighting unit to execute N1 types (N1 is an integer equal to or greater than 1) of lighting modes among the multiple types of lighting modes, and a second imaging control that controls the imaging unit to generate a code image while causing the lighting unit to execute N2 types (N2 is an integer greater than N1) of lighting modes among the multiple types of lighting modes, wherein the first core decodes the code image generated by the first imaging control, and the second core decodes the code image generated by the second imaging control in parallel with the decoding by the first core.

[0007] The code image reading method of the present invention is a code reading method in which an imaging unit receives light reflected from a workpiece and generates a code image while switching between illumination modes executed by an illumination unit capable of executing multiple illumination modes that irradiate light in different modes onto a workpiece having a code to be read, and includes the steps of causing the imaging unit to generate a code image while causing the illumination unit to execute one of the multiple illumination modes, and having a first core or a second core decode the code image, wherein the first core decodes the code image generated by the imaging unit while causing the illumination unit to execute N1 illumination modes (N1 is an integer greater than 1) among the multiple illumination modes, and the second core decodes the code image generated by the imaging unit while causing the illumination unit to execute N2 illumination modes (N2 is an integer greater than N1) among the multiple illumination modes, and the decoding by the second core is performed in parallel with the decoding by the first core.

[0008] In the present invention configured in this way, the first core places emphasis on high speed and switches the illumination mode less (when N1 is 1, the illumination mode is fixed). On the other hand, the second core places emphasis on reliable reading and switches the illumination mode more frequently. As a result, it is possible to achieve both high speed decoding of simple codes and stable decoding of difficult codes.

[0009] A code reading device according to another aspect of the present invention includes an illumination unit that irradiates light onto a workpiece having a code to be read, an imaging unit that receives light irradiated from the illumination unit and reflected by the workpiece to generate a code image, and a control unit that has a first core, a second core, and a third core that are capable of decoding the code images in parallel, and that irradiates light from the illumination unit to cause the imaging unit to generate a code image, and causes the first core, the second core, or the third core to decode the generated code image, wherein the timeout period available for the first core and the second core to use for decoding is shorter than the timeout period available for the third core to use for decoding, and the control unit is configured to irradiate light from the illumination unit to cause the imaging unit to generate a code image to be decoded by the one core when the difference between the time required for one of the first core and the second core to perform decoding becomes less than a predetermined time.

[0010] In the present invention (code reader) configured in this way, a code image for the next decoding to be performed is generated without waiting for the timeout period of the currently executing decoding to elapse. As a result, it is possible to achieve both high speed decoding of simple codes and stable decoding of difficult codes. Effect of the Invention

[0011] The present invention thus configured makes it possible to achieve both high speed decoding of simple codes and stable decoding of difficult codes. [Brief description of the drawings]

[0012] [Figure 1] FIG. 2 is a side view showing a schematic configuration of the code reading device. [Diagram 2] FIG. 2 is a block diagram showing an outline of an electrical configuration of the code reading device shown in FIG. [Diagram 3] 4 is a front view showing a schematic diagram of a diffusion member provided in the head portion and an illumination board provided behind the diffusion member; FIG. [Figure 4]11 is a timing chart showing an example of a sequence executed by a plurality of cores. [Diagram 5] FIG. 2 is a diagram illustrating an example of a bank. [Figure 6] 11 is a flowchart showing an example of tuning. [Figure 7] 10 is a flowchart showing an example of rough brightness adjustment performed in tuning. [Figure 8] 11 is a flowchart showing an example of decoding management. [Figure 9] 13 is a flowchart showing a modified example of decoding management. [Figure 10] 10 is a flowchart showing an example of a decoding control according to a code type. [Figure 11] FIG. 11 is a diagram showing an example of the operations executed in the flowchart of FIG. 10. [Figure 12] FIG. 10 is a diagram illustrating an operation performed in a modified example of decoding control. [Figure 13] 11 is a timing chart showing an example of a sequence executed by a plurality of cores. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] Fig. 1 is a side view showing a schematic configuration of a code reading device, and Fig. 2 is a block diagram showing an outline of an electrical configuration of the code reading device of Fig. 1. Here, a front-rear direction Dfs is appropriately shown in which the side of the workpiece W with respect to the code reading device 1 is designated as the front side Sf and the opposite side of the workpiece W with respect to the code reading device 1 is designated as the rear side Sb in a state in which the code reading device 1 faces the surface Wf of the workpiece W in order to read a code attached to the surface Wf of the workpiece W with the code reading device 1. Note that, although a portable code reading device is taken as an example in this embodiment, the present invention is not limited to a portable type, and a fixed type code reading device may also be used.

[0014] As shown in FIG. 1, the code reading device 1 includes a head portion 11, a grip portion 12, and a grip end portion 13. The grip portion 12 extends in an axial direction Da intersecting the front-rear direction Dfs between the head portion 11 and the grip end portion 13. In other words, the head portion 11 is provided at one end of the grip portion 12, and the grip end portion 13 is provided at the other end (the end opposite to the one end) of the grip portion 12. The head portion 11 has a head body 111, the grip portion 12 has a grip body 121, and the grip end portion 13 has a grip end body 131, and the head body 111, the grip body 121, and the grip end body 131 form a housing 14 that houses each part built into the code reading device 1. A user can carry the code reading device 1 by holding the grip body 121 of the code reading device 1.

[0015] The head body 111 of the head unit 11 has an opening 112 that opens on the front side Sf, and a placement panel 113 is provided at the end of the rear side Sb (in other words, the back side) of the opening 112. When reading a code, the opening 112 faces the surface Wf of the workpiece W, and the placement panel 113 faces the surface Wf of the workpiece W via the opening 112. The head unit 11 also has an illumination unit 2, an imaging unit 3, a distance measurement unit 4, and a display SP shown in FIG. 2. The illumination unit 2, the imaging unit 3, the distance measurement unit 4, and the display SP are stored in the head unit 11. In particular, a part of the illumination unit 2, the imaging unit 3, and the distance measurement unit 4 are provided on the placement panel 113.

[0016] The illumination unit 2 irradiates the surface Wf of the workpiece W with illumination light Li, and the imaging unit 3 captures the reflected light Lr from the surface Wf of the workpiece W with the camera 31A or 31B to generate a code image Ic. The illumination light Li is irradiated from the illumination unit 2 to the surface Wf of the workpiece W through an opening 112, and the reflected light Lr is generated by reflecting the illumination light Li on the surface Wf of the workpiece W, and the reflected light Lr is incident on the camera 31A or 31B of the imaging unit 3 from the surface Wf of the workpiece W through the opening 112.

[0017] The illumination unit 2 has a diffuse illumination unit 27, a direct illumination unit 28, and a polarized illumination unit 29. The diffuse illumination unit 27 has a light source E, and diffuses the light emitted from the light source E before irradiating it onto the surface Wf of the workpiece W. The direct illumination unit 28 has a light source 281, and directly irradiates the light emitted from the light source 281 onto the surface Wf of the workpiece W without diffusing it. The polarized illumination unit 29 has a light source 291, and polarizes the light emitted from the light source 291 before irradiating it onto the surface Wf of the workpiece W. Details of the illumination unit 2 will be described later.

[0018] The imaging unit 3 has two cameras 31A and 31B. Each of the cameras 31A and 31B focuses the reflected light Lr onto a solid-state imaging element by a focusing lens, which is an objective lens facing the surface Wf of the workpiece W. The solid-state imaging element generates a code image Ic by receiving the reflected light Lr focused by the focusing lens. The optical axis Ac of each of the cameras 31A and 31B (i.e., the optical axis Ac of the focusing lens of each of the cameras 31A and 31B) is parallel to the front-rear direction Dfs described above.

[0019] The distance measurement unit 4 measures the distance to the surface Wf of the workpiece W by measuring the time it takes for light irradiated from the distance measurement unit 4 through the opening 112 to be reflected by the surface Wf of the workpiece W and return to the distance measurement unit 4 through the opening 112.

[0020] The display SP displays information to the user and also accepts input operations by the user.

[0021] The grip portion 12 has a trigger switch 122 provided on the front side Sf of the grip body 121. A user can operate the trigger switch 122 with a finger while holding the grip body 121 in his / her hand.

[0022] The code reading device 1 also includes a controller 6 that controls each part of the code reading device 1, and a storage unit 7 that stores data used in the code reading device 1 and data generated by the code reading device 1. The controller 6 and storage unit 7 are housed in a housing 14. The controller 6 is a processor, i.e., a CPU (Central Processing Unit). The storage unit 7 is a ROM (Read Only Memory). These include memory devices such as Internal Memory Only Memory (ROM) and Random Access Memory (RAM).

[0023] The controller 6 causes the lighting unit 2 to perform an illumination operation of irradiating the surface Wf of the workpiece W with illumination light Li, and causes the imaging unit 3 to perform an imaging operation of receiving the reflected light Lr with a solid-state imaging element to generate a code image Ic. In this way, a "code image generation process" is performed by the lighting operation by the lighting unit 2 and the imaging operation by the imaging unit 3. Furthermore, the controller 6 decodes the code image Ic generated by the code image generation process. In this way, code reading is performed by a series of operations such as the code image generation process consisting of the lighting operation by the lighting unit 2 and the imaging operation by the imaging unit 3, and the decoding by the controller 6. For example, when the controller 6 detects an operation of the trigger switch 122 by the user, it performs code reading. The result of the code reading, that is, the decoded result Rd, which is the result of the controller 6 decoding the code image Ic, is stored in the memory unit 7.

[0024] Next, the configuration of the head unit 11, particularly the configuration of the illumination unit 2 provided in the head unit 11, will be described in detail. FIG. 3 is a front view showing a diffusion member provided in the head unit and an illumination board provided behind the diffusion member. FIG. 3 shows a length direction Dl and a width direction Dw. Here, the length direction Dl and the width direction Dw are perpendicular to each other and perpendicular to the front-rear direction Dfs. Also shown are one side Dl1 of the length direction Dl (the side from the grip end portion 13 toward the head unit 11) and the other side Dl2 of the length direction Dl (the opposite side of the one side Dl1), and one side Dw1 of the width direction Dw and the other side Dw2 of the width direction Dw (the opposite side of the one side Dw1).

[0025] The illumination unit 2 has a diffusion member 21 and an illumination board 25 arranged on the rear side Sb of the diffusion member 21 in the front-rear direction Dfs. The diffusion member 21 constitutes a part of the head main body 111 described above. Note that in Fig. 3, the illumination board 25 hidden by the diffusion member 21 in front view from the front side Sf in the front-rear direction Dfs is indicated by a dashed line.

[0026] The diffusion member 21 has an aperture defining portion 211 which is a wall surface surrounding the above-mentioned aperture 112 opened on the front side Sf. The aperture defining portion 211 has a top diffusion plate 212 provided on one side Dl1 of the aperture 112 in the length direction Dl, and a bottom plate 213 provided on the other side Dl2 of the aperture 112. Furthermore, the aperture defining portion 211 has a right diffusion plate 214 provided on one side Dl1 of the aperture 112, and a left diffusion plate 215 provided on the other side Dl2 of the aperture 112 in the width direction Dw. Ends on both sides of the top diffusion plate 212 in the width direction Dw are bent toward the other side Dl2 toward the right diffusion plate 214 and the left diffusion plate 215. In the longitudinal direction Dl, the end of the other side Dl2 of the right diffusion plate 214 is bent toward the other side Dw2 toward the bottom plate 213, and the end of the other side Dl2 of the left diffusion plate 215 is bent toward the one side Dw1 toward the bottom plate 213.

[0027] The top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 diffuse the light passing through them from the rear side Sb to the front side Sf, and emit the light to the front side Sf. Specifically, the back surface (light incident surface) of the rear side Sb of each of the top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 is textured, and the light is diffused by the textured back surface. However, the configuration for imparting the light diffusion function to the top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 is not limited to the textured surface, and the light diffusion function may be imparted by, for example, processing the top diffusion plate 212, the right diffusion plate 214, and the left diffusion plate 215 to a milky white color.

[0028] Each of the plates 212, 213, 214, and 215 defining the opening 112 has a tapered shape inclined with respect to the front-rear direction Dfs so that the area of ​​the opening 112 in a cross section perpendicular to the optical axis Ac of the condenser lens 311A ​​(FIG. 1) of the camera 31A becomes wider toward the front side Sf in the front-rear direction Dfs. In other words, each of the plates 212, 213, 214, and 215 has a tapered shape inclined with respect to the front-rear direction Dfs so as to move away from the optical axis Ac toward the front side Sf in the front-rear direction Dfs (optical axis direction).

[0029] The illumination board 25 is disposed on the rear side Sb of the plates 212, 213, 214, and 215 having such a tapered shape. The illumination board 25 has a board 251 and a plurality of light sources E arranged on a surface of a front side Sf of the board 251. The board 251 has a main board portion 252 extending in the width direction Dw, a right board portion 254 extending from an end of one side Dw1 of the main board portion 252 to the other side Dl2 in the length direction Dl, and a left board portion 255 extending from an end of the other side Dw2 of the main board portion 252 to the other side Dl2 in the length direction Dl.

[0030] The main substrate section 252 is provided with a top light source region Bt provided with a predetermined width in the width direction Dw, and a center light source region Bc provided with a predetermined width in the width direction Dw on the other side Dl2 of the top light source region Bt in the length direction Dl. In the top light source region Bt, a plurality of light sources E are arranged in the width direction Dw at a predetermined pitch (top pitch), and in the center light source region Bc, a plurality of light sources E are arranged in the width direction Dw at a center pitch longer than the top pitch. Due to such a difference in pitch, the number of light sources E arranged in the top light source region Bt is greater than the number of light sources E arranged in the center light source region Bc. In this example, the center pitch is twice the top pitch, but the specific ratio of these pitches is not limited to this.

[0031] An end portion of the other side Dl2 of the right substrate portion 254 is bent toward the other side Dw2 in the width direction Dw. A right light source region Br is provided on the right substrate portion 254 in accordance with the shape of the right substrate portion 254, and a plurality of light sources E are arranged in the right light source region Br. The number of light sources E arranged in the right light source region Br is smaller than the number of light sources E arranged in the top light source region Bt and smaller than the number of light sources E arranged in the center light source region Bc.

[0032] An end portion of the other side Dl2 of the left substrate portion 255 is bent toward one side Dw1 in the width direction Dw. A left light source region Bl is provided on the left substrate portion 255 along the shape of the left substrate portion 255, and a plurality of light sources E are arranged in the left light source region Bl. The number of light sources E arranged in the left light source region Bl is equal to the number of light sources E arranged in the right light source region Br.

[0033] The light source E is, for example, an LED (Light Emitting Diode), and emits light to the front side Sf toward the top diffusion plate 212, the right diffusion plate 214, or the left diffusion plate 215. The light emitted from the light source E and incident on the top diffusion plate 212, the right diffusion plate 214, or the left diffusion plate 215 from the rear side Sb is diffused as it passes through the diffusion plate 212, 214, or 215, and is emitted from the diffusion plate 212, 214, or 215 to the front side Sf.

[0034] The light emitted from the light source E in the top light source region Bt is mainly diffused by the top diffusion plate 212 and then emitted from the top diffusion plate 212 toward the surface Wf of the workpiece W as illumination light Li. The light emitted from the light source E in the center light source region Bc is mainly diffused by the top diffusion plate 212 and then emitted from the top diffusion plate 212 toward the surface Wf of the workpiece W as illumination light Li. The light emitted from the light source E in the right light source region Br is mainly diffused by the right diffusion plate 214 and then emitted from the right diffusion plate 214 toward the surface Wf of the workpiece W as illumination light Li. The light emitted from the light source E in the left light source region Bl is mainly diffused by the left diffusion plate 215 and then emitted from the left diffusion plate 215 toward the surface Wf of the workpiece W as illumination light Li. In this way, the light from the light source E is diffused by the diffusion member 21 as it passes through the diffusion member 21. Furthermore, the diffused light generated by diffusing the light with the diffusing member 21 is irradiated onto the surface Wf of the workpiece W as uniform planar illumination light Li.

[0035] In this way, the top light source region Bt, center light source region Bc, right light source region Br, and left light source region Bl of the diffusion member 21 generate illumination light Li that is irradiated from the diffusion member 21 toward the surface Wf of the workpiece W at angles different from one another. In response to this, the controller 6 that controls the illumination unit 2 can change the lighting region from which light is emitted from the light source E, among the top light source region Bt, center light source region Bc, right light source region Br, and left light source region Bl. In this way, by changing the lighting region, the angle at which the diffused light is incident on the surface Wf of the workpiece W as illumination light Li can be changed.

[0036] In this way, the above-mentioned diffuse illumination unit 27 (FIG. 2) is configured by the diffusion member 21, the reflection member 23, and the illumination board 25. Furthermore, as described above, the illumination unit 2 has a direct illumination unit 28 that directly irradiates light from the light source 281 toward the surface Wf of the workpiece W without diffusing it, and a polarized illumination unit 29 that irradiates polarized light (P waves or S waves) obtained by polarizing light from the light source 291 toward the surface Wf of the workpiece W. As shown in FIG. 3, the direct illumination unit 28 and the polarized illumination unit 29 are arranged on the arrangement panel 113.

[0037] Therefore, the controller 6 can selectively execute a "diffuse lighting mode" in which the workpiece W is irradiated with diffuse lighting generated by turning on the light source E of the diffuse lighting unit 27, a "direct lighting mode" in which the workpiece W is irradiated with direct lighting generated by turning on the light source 281 of the direct lighting unit 28, and a "polarized lighting mode" in which the workpiece W is irradiated with polarized lighting generated by turning on the light source 291 of the polarized lighting unit 29.

[0038] In particular, with regard to the "diffuse lighting mode", a plurality of diffuse lighting modes can be executed in which the combination of lighting areas from which light is emitted from the light source E is different from each other among the top light source area Bt, center light source area Bc, right light source area Br, and left light source area Bl, which irradiate the surface Wf of the workpiece W with diffuse light from different irradiation angles. For example, the plurality of diffuse lighting modes include a "partial diffuse lighting mode" in which partial diffuse lighting generated by emitting light from the light source E only in the top light source area Bt and center light source area Bc among the top light source area Bt, center light source area Bc, right light source area Br, and left light source area Bl is irradiated to the workpiece W, and an "overall diffuse lighting mode" in which overall diffuse lighting (dome lighting) generated by emitting light from all the light sources E in the top light source area Bt, center light source area Bc, right light source area Br, and left light source area Bl is irradiated to the workpiece W, which is included in the plurality of diffuse lighting modes.

[0039] As described above, the imaging unit 3 has two cameras 31A and 31B, which are provided on the arrangement panel 113. Specifically, as shown in FIG. 3, the condenser lenses 311A ​​and 311B (objective lenses) of the cameras 31A and 31B are fitted into the arrangement panel 113. The camera 31A condenses the reflected light Lr from the surface Wf of the workpiece W onto a solid-state imaging element by the condenser lens 311A, and causes the solid-state imaging element to generate a code image Ic. Similarly, the camera 31B condenses the reflected light Lr from the surface Wf of the workpiece W onto a solid-state imaging element by the condenser lens 311B, and causes the solid-state imaging element to generate a code image Ic. The camera 31A is a high-resolution camera, whereas the camera 31B is a standard-resolution camera, and the resolution of the camera 31A is higher than that of the camera 31B. Therefore, the resolution of the code image Ic captured by the camera 31A is higher than the resolution of the code image Ic captured by the camera 31B. For example, when the number of pixels of the image sensors provided in each camera is equal, the resolution of the camera 31A can be made higher than that of the camera 31B by making the field of view of the camera 31A narrower than that of the camera 31B.

[0040] The arrangement panel 113 is also provided with a distance measurement unit 4. The distance measurement unit 4 has a distance sensor 41 which is a TOF (Time of Fight) camera, and the distance sensor 41 has a light-emitting unit 42 which emits light toward the fields of view of the cameras 31A and 31B, and a light-receiving unit 43 which detects light returning from the fields of view of the cameras 31A and 31B, and measures the distance to an object (including the workpiece W) present in the fields of view of the cameras 31A and 31B based on the time from when the light-emitting unit 42 emits light to when the light-receiving unit 43 receives the light.

[0041] As described above, code reading is performed by a series of operations, such as the code image generation process, which is made up of the illumination operation by the illumination unit 2 and the imaging operation by the imaging unit 3, and the decoding by the controller 6. The controller 6 also has multiple cores C0 to C4 (FIG. 4), which are processors capable of performing calculations. Of the multiple cores C0 to C4, the core C0 controls the illumination unit 2 and the imaging unit 3 to cause the illumination unit 2 and the imaging unit 3 to execute the code image generation process for generating the code image Ic. The cores C1 to C4 also decode the code image Ic generated by the code image generation process.

[0042] The cores C1 to C4 can execute decoding in parallel (that is, they can execute parallel processing). The core C1 executes image processing (high-speed decoding) for quickly decoding an easy-to-decode code, and the cores C2 to C4 execute image processing (obscure decoding) for decoding a difficult-to-decode code. The amount of calculation required by the core C1 to execute high-speed decoding is less than the amount of calculation required by each of the cores C2 to C4 to execute obscure decoding, and the time required by the core C1 to execute high-speed decoding is shorter than the time required by each of the cores C2 to C4 to execute obscure decoding. In particular, the obscure decoding executed by the cores C2 to C4 executes image processing using a machine learning model (for example, a deep learning model). This machine learning model has been trained to repair a portion of the code image Ic that is inappropriate for decoding. Therefore, the obscure decoding executes image processing using the machine learning model and executes decoding on the code image Ic that has been subjected to the image processing. On the other hand, the high-speed decoding performed by the core C1 decodes the code image Ic without performing image processing using the machine learning model.

[0043] FIG. 4 is a timing chart showing an example of a sequence executed by a plurality of cores. In the figure, the "Timing" row shows the passage of time in the order of timings T1 to T28. The "Camera" row shows the type of camera used in the imaging operation of the code image generation process, "Standard" shows the camera 31B with standard resolution, and "High" shows the camera 31A with high resolution. The "Core C0" row shows the content of control executed by the core C0 on the illumination unit 2 and the imaging unit 3, "Imaging polarized" shows control of the illumination unit 2 to perform an illumination operation in polarized illumination mode while the imaging unit 3 performs an imaging operation, "Imaging direct" shows control of the illumination unit 2 to perform an illumination operation in direct illumination mode while the imaging unit 3 performs an imaging operation, "Imaging partial diffusion" shows control of the illumination unit 2 to perform an illumination operation in partial diffusion illumination mode while the imaging unit 3 performs an imaging operation, and "Imaging total diffusion" shows control of the illumination unit 2 to perform an illumination operation in total diffusion illumination mode while the imaging unit 3 performs an imaging operation. Furthermore, the rows for "Core C1" to "Core C4" each indicate the type of decoding that the cores C1 to C4 execute.

[0044] At timing T1, core C0 performs a code image generation process using “polarized imaging” with standard resolution camera 31B to generate a code image Ic, and at timings T2 to T3 following timing T1, core C1 performs high-speed decoding on the code image Ic.

[0045] At timing T2, core C0 performs a code image generation process using “polarized imaging” with standard resolution camera 31B to generate a code image Ic, and at timings T3 to T8 following timing T2, core C2 performs obfuscated decoding on the code image Ic.

[0046] At timing T3, core C0 executes a code image generation process using “partial imaging diffusion” with standard resolution camera 31B to generate code image Ic, and at timings T4 to T9 following timing T3, core C3 executes obfuscated decoding on the code image Ic.

[0047] At timing T4, core C0 performs a code image generation process by "direct imaging" using standard resolution camera 31B to generate code image Ic, and at timings T5 to T10 following timing T4, core C3 performs obfuscated decoding on the code image Ic.

[0048] At timing T5, core C0 performs a code image generation process using “polarized imaging” with standard resolution camera 31B to generate a code image Ic, and at timings T6 to T7 following timing T5, core C1 performs high-speed decoding on the code image Ic.

[0049] At timing T8, core C0 performs a code image generation process by "direct imaging" using high-resolution camera 31A to generate a code image Ic, and at timings T9 to T14 following timing T8, core C2 performs obfuscated decoding on the code image Ic.

[0050] At timing T9, core C0 performs a code image generation process using “total diffusion imaging” with standard resolution camera 31B to generate code image Ic, and at timings T10 to T15 following timing T9, core C3 performs obfuscated decoding on the code image Ic.

[0051] At timing T10, core C0 executes a code image generation process using “partial imaging diffusion” with standard resolution camera 31B to generate code image Ic, and at timings T11 to T16 following timing T10, core C4 executes obfuscated decoding on the code image Ic.

[0052] At timing T11, core C0 performs a code image generation process using “polarized imaging” with standard resolution camera 31B to generate a code image Ic, and at timings T12 to T13 following timing T11, core C1 performs high-speed decoding on the code image Ic.

[0053] At timing T14, core C0 performs a code image generation process using “partial imaging diffusion” with standard resolution camera 31B to generate code image Ic, and at timings T15 to T20 following timing T14, core C2 performs obfuscated decoding on the code image Ic.

[0054] At timing T15, core C0 performs a code image generation process using “polarized imaging” with high-resolution camera 31A to generate a code image Ic, and at timings T16 to T21 following timing T15, core C3 performs obfuscated decoding on the code image Ic.

[0055] At timing T16, core C0 executes a code image generation process using “total diffusion imaging” with standard resolution camera 31B to generate code image Ic, and at timings T17 to T22 following timing T16, core C4 executes obfuscated decoding on the code image Ic.

[0056] At timing T17, core C0 performs a code image generation process using “polarized imaging” with standard resolution camera 31B to generate a code image Ic, and at timings T18 to T19 following timing T17, core C1 performs high-speed decoding on the code image Ic.

[0057] At timing T20, core C0 executes a code image generation process using “total diffusion imaging” with standard resolution camera 31B to generate code image Ic, and at timings T21 to T26 following timing T20, core C2 executes obfuscated decoding on the code image Ic.

[0058] At timing T21, core C0 executes a code image generation process by "direct imaging" using standard resolution camera 31B to generate code image Ic, and at timings T22 to T27 following timing T21, core C3 executes obfuscated decoding on the code image Ic.

[0059] At timing T22, core C0 performs a code image generation process using “polarized imaging” with high-resolution camera 31A to generate a code image Ic, and at timings T23 to T28 following timing T22, core C4 performs obfuscated decoding on the code image Ic.

[0060] At timing T23, core C0 performs a code image generation process using “polarized imaging” with standard resolution camera 31B to generate a code image Ic, and at timings T24 to T25 following timing T23, core C1 performs high-speed decoding on the code image Ic.

[0061] 4 ends when any one of the cores C1 to C4 has successfully decoded, that is, successfully read the code. Therefore, not all of the operations shown in FIG. 4 are always executed.

[0062] In the embodiment described above, four types of illumination modes (direct illumination mode, polarized illumination mode, partial diffuse illumination mode, and total diffuse illumination mode) can be implemented to irradiate light in different modes on the workpiece W on which the code to be read is provided. In addition, a code image generation process is executed in which the imaging unit 3 generates a code image while the illumination unit 2 executes one of the multiple illumination modes, and each time the code image generation process is completed, the code image Ic generated in the completed code image generation process is decoded. In particular, a core C1 (first core) and cores C2 to C4 (second cores) are provided and are used as follows:

[0063] The code image Ic generated by the high-speed imaging control (first imaging control) in which the illumination unit 2 executes one (N1=1) illumination mode (polarized illumination mode) of the four illumination modes while executing the code image generation process is decoded by the core C1 (high-speed decoding). On the other hand, the code image Ic generated by the obfuscated imaging control (second imaging control) in which the illumination unit 2 executes all four (N2=4) illumination modes of the four illumination modes while executing the code image generation process is decoded by the cores C2 to C4 (obfuscated decoding). That is, the core C1 decodes the code image Ic generated by executing one illumination mode, and the cores C2 to C4 decode the code image Ic generated by switching between and executing the four illumination modes. In this way, the core C1 places importance on high speed and switches the illumination mode less (here, the illumination mode is fixed). On the other hand, the cores C2 to C4 place importance on reliable reading and switches the illumination mode more. As a result, it is possible to improve the success rate of decoding difficult codes while maintaining high speed in decoding simple codes.

[0064] The illumination unit 2 has diffuse illumination that irradiates the workpiece W with diffused light obtained by diffusing the light emitted from the light source E with the diffusion member 21, and non-diffuse illumination (direct illumination, polarized illumination) that irradiates the workpiece W with the light emitted from the light source E without diffusing the light with the diffusion member 21. The four types of illumination modes executed in the above-mentioned hard-to-read imaging control include an illumination mode that irradiates light with diffuse illumination (diffuse illumination mode) and an illumination mode that irradiates light with non-diffuse illumination (direct illumination mode, polarized illumination mode). In this way, by generating a code image Ic while switching between diffuse illumination and non-diffuse illumination and decoding this code image Ic, a good code image Ic can be generated with appropriate illumination, and the success rate of decoding can be improved. The illumination mode executed in the hard-to-read imaging control (second imaging control) is not limited to switching between diffuse illumination and non-diffuse illumination as exemplified above. That is, in the hard-to-read image capture control, as the lighting considered to be suitable for the hard-to-read code, it is sufficient to include at least one of the lighting modes that irradiate light by, for example, diffuse lighting, polarized lighting, ring lighting, or low-angle lighting. Ring lighting and low-angle lighting are also called dark-field lighting. In this embodiment, for example, a ring lighting (low-angle lighting) that surrounds the opening defining portion 211 is provided near the opening 112 of the head portion 11, and light is irradiated obliquely onto the workpiece W, thereby realizing dark-field lighting. In addition to the diffuse lighting that diffuses light from a light source by a transmissive diffusing member as in this embodiment, diffuse lighting that diffuses light by a reflective diffusing member may also be used.

[0065] As described above, the high-speed imaging control executes a code image generation process multiple times to generate a code image Ic to be decoded by the core C1 (first core). On the other hand, the obfuscated imaging control executes a code image generation process multiple times to generate a code image Ic to be decoded by the core C2 (second core) while switching the illumination mode. At this time, one type of illumination mode executed by the high-speed imaging control irradiates light with non-diffuse illumination (polarized illumination). Then, while the core C2 executes decoding of the code image Ic generated based on the diffuse illumination and decoding of the code image Ic generated based on the non-diffuse illumination, the core C1 executes decoding of the multiple code images Ic generated based on the non-diffuse illumination. For example, during the period (T9-T20) when the core C2 performs the indecipherable decoding of the code image Ic generated based on direct illumination (non-diffuse illumination) at timings T9-T14 and performs the indecipherable decoding of the code image Ic generated based on diffuse illumination at timings T15-T20, the core C1 performs the decoding of the multiple code images Ic generated based on polarized illumination (non-diffuse illumination) (timings T12-T13, T18-T19). In this configuration, the core C1 is caused to decode the code image generated by irradiating light with non-diffuse illumination, while the core C2 is caused to decode each code image generated by irradiating light while switching between non-diffuse illumination and diffuse illumination. As a result, when the code to be read is a simple code, the core C1 for high-speed decoding can decode it at high speed. On the other hand, when the code to be read is an indecipherable code, there is a high possibility that a good code image capable of decoding the indecipherable code will be generated among the multiple code images generated with multiple types of illumination, and as a result, there is a high possibility that the indecipherable code can be decoded. Moreover, while the core C2 decodes the code image Ic generated based on diffuse illumination and the code image Ic generated based on non-diffuse illumination, the core C1 decodes the multiple code images Ic generated based on non-diffuse illumination, which makes it possible to improve the success rate of decoding difficult codes while maintaining high speed decoding of simple codes.

[0066] The diffuse illumination unit 27 of the illumination unit 2 can irradiate the workpiece W with light by diffuse illumination from a plurality of irradiation angles different from each other, and can irradiate light by each of a plurality of diffuse illumination modes (partial diffuse illumination mode, whole diffuse illumination mode) in which the combination of irradiation angles at which light is irradiated is different from each other among the plurality of irradiation angles. Then, while the core C1 (first core) executes decoding of a plurality of code images Ic generated based on non-diffuse illumination (polarized illumination), the core C4 (second core) executes decoding of a plurality of code images Ic generated based on a plurality of diffuse illumination modes and decoding of a code image Ic generated based on non-diffuse illumination. For example, during a period (T2 to T25) in which the core C1 executes decoding of a plurality of code images Ic generated based on polarized illumination, the core C4 executes decoding (T5 to T10) of a code image Ic generated based on direct illumination (non-diffuse illumination) and decoding (T11 to T16, T17 to T22) of a plurality of code images Ic generated based on a plurality of diffuse illumination modes (partial diffuse illumination mode, whole diffuse illumination mode). In this configuration, not only is it possible to switch between non-diffuse and diffuse illumination, but the angle of the diffuse illumination is also switched, making it possible to further improve the success rate of decoding difficult codes.

[0067] Also, while the core C2 (second core) decodes the code image Ic generated based on one of non-diffuse illumination and diffuse illumination, the core C3 (third core) decodes the code image Ic generated based on the other of non-diffuse illumination and diffuse illumination. For example, in parallel with the period (T9 to T14) in which the core C2 decodes the code image Ic generated based on direct illumination (non-diffuse illumination), the core C3 decodes the code image Ic generated based on diffuse illumination (T10 to T15). Or, in parallel with the period (T15 to T20) in which the core C2 decodes the code image Ic generated based on diffuse illumination, the core C3 decodes the code image Ic generated based on polarized illumination (non-diffuse illumination) (T16 to T21). In this configuration, the core C2 can decode the code image Ic generated based on one of non-diffuse illumination and diffuse illumination, and the core C3 can decode the code image Ic generated based on the other of non-diffuse illumination and diffuse illumination in parallel. As a result, it is possible to read difficult codes reliably and quickly.

[0068] Further, the core C2 (second core), the core C3 (third core), and the core C4 (fourth core) decode the code image Ic generated based on different illuminations among non-diffuse illumination (direct illumination or polarized illumination), partial diffuse illumination (first diffuse illumination), and general diffuse illumination (second diffuse illumination). For example, at timings T11 to T14, the core C2 decodes the code image Ic generated by direct illumination, the core C3 decodes the code image Ic generated by general diffuse illumination, and the core C4 decodes the code image Ic generated by partial diffuse illumination. In this configuration, the core C2, the core C3, and the core C4 can decode in parallel the code image Ic generated based on different illuminations among non-diffuse illumination (direct illumination or polarized illumination), partial diffuse illumination, and general diffuse illumination. In other words, the three types of code images Ic generated using different non-diffuse and diffuse illumination as well as different angles of diffuse illumination can be decoded in parallel by cores C2, C3, and C4, respectively. As a result, it becomes possible to read difficult codes reliably and quickly.

[0069] The imaging unit 3 also has a camera 31B (first camera) and a camera 31A (second camera) with a higher resolution than the camera 31B. In a high-speed imaging control (first imaging control) in which a code image generation process for generating a code image Ic to be decoded by the core C1 (first core) is executed multiple times, only the camera 31B is used to generate the code image Ic out of the cameras 31A and 31B. On the other hand, in an obfuscated imaging control (second imaging control) in which a code image generation process for generating a code image Ic to be decoded by the core C2 (second core) is executed multiple times while switching the illumination mode, both the camera 31A and the camera 31B are used to generate the code image Ic by switching the camera used to generate the code image Ic out of the cameras 31A and 31B. In this configuration, for a code with a standard cell size, the camera 31B with a standard resolution (wide field of view) generates the code image Ic, and the code image Ic is decoded. On the other hand, for codes with small cell sizes (relatively difficult to read), the success rate of decoding the code image Ic can be improved by generating the code image Ic using the high-resolution camera 31A. As a result, it is possible to achieve both high speed decoding of simple codes and stable decoding of difficult codes.

[0070] Further, among a plurality of generating conditions in which a combination of one of diffuse lighting and non-diffuse lighting and one of the cameras 31A and 31B is different from one another, the core C2 and the core C3 decode the code image Ic generated based on the different generating conditions in parallel. For example, at timings T10 to T14, the core C2 decodes the code image Ic generated based on the high-resolution camera 31A and direct lighting (non-diffuse lighting) in parallel with the core C3 decodes the code image Ic generated based on the standard-resolution camera 31B and diffuse lighting in parallel. At timings T16 to T20, the core C2 decodes the code image Ic generated based on the standard-resolution camera 31B and diffuse lighting in parallel with the core C3 decodes the code image Ic generated based on the high-resolution camera 31A and polarized lighting (non-diffuse lighting). In this configuration, the core C2 and the core C3 decode the code image Ic generated based on the different generating conditions in parallel. As a result, it is possible to read difficult codes reliably and quickly.

[0071] Further, among a plurality of generation conditions in which a combination of one of partial diffuse illumination (first diffuse illumination), general diffuse illumination (second diffuse illumination) and non-diffuse illumination and one of the cameras 31A and 31B is different from one another, the core C2 (second core), the core C3 (third core) and the core C4 (fourth core) decode the code image Ic generated based on the different generation conditions in parallel. For example, at timings T11 to T14, the core C2 decodes the code image Ic generated based on the high-resolution camera 31A and direct illumination, the core C3 decodes the code image Ic generated based on the standard-resolution camera 31B and general diffuse illumination, and the core C4 decodes the code image Ic generated based on the standard-resolution camera 31B and partial diffuse illumination in parallel. Also, during timings T17 to T20, the core C2 decodes the code image IC generated based on the standard resolution camera 31B and partial diffuse illumination, the core C3 decodes the code image Ic generated based on the high resolution camera 31A and polarized illumination, and the core C4 decodes the code image Ic generated based on the standard resolution camera 31B and total diffuse illumination in parallel. In this configuration, the cores C2, C3, and C4 decode the code images Ic generated based on different generation conditions in parallel. As a result, it becomes possible to read difficult codes reliably and quickly.

[0072] Furthermore, the core C2 executes image processing using a machine learning model that has been trained to repair parts of the code image Ic generated by the imaging unit 3 that are inappropriate for decoding, and executes decoding of the code image Ic that has been subjected to the image processing. On the other hand, the core C1 executes decoding of the code image Ic without executing image processing using the machine learning model. In this configuration, the machine learning model is used only for decoding difficult codes, and is not used for decoding simple codes. This makes it possible to improve the success rate of decoding difficult codes while maintaining the high speed of decoding simple codes.

[0073] The illumination unit 2 also has a diffuse illumination unit 27 that irradiates the workpiece with diffused light obtained by diffusing light emitted from a plurality of light sources E using a diffusion member 21, and the angle at which the diffused light is irradiated onto the workpiece W can be changed by changing the light source E that emits light among the plurality of light sources E (FIGS. 2 and 3). With this configuration, diffuse illumination can be irradiated from an appropriate angle, making it possible to improve the success rate of decoding difficult codes.

[0074] In the above embodiment, the code reading is repeatedly executed while switching the combination of the camera, the illumination, and the decode. That is, one of the high-resolution camera 31A and the standard-resolution camera 31B is switched, one of the polarized illumination, the direct illumination, the partial diffuse illumination, and the total diffuse illumination is switched, and one of the high-speed decoding and the obscure decoding is switched. That is, the controller 6 including the cores C0 to C4 repeatedly executes the code reading while switching the combination of the camera, the illumination, and the decode used in the code reading. At this time, the controller 6 can easily execute the switching of the combination by the control using the bank described next.

[0075] FIG. 5 is a diagram showing an example of a bank. That is, the core C0 can store a plurality of banks B(N) in the storage unit 7 (N=1, 2, 3, ...). The bank B indicates a combination of a camera, an illumination, and a decode to be used in code reading, and each of the plurality of banks B(N) indicates a different combination. For example, the controller 6 can select the bank B(1) to perform code reading according to the combination indicated by the bank B(1), that is, using the standard resolution camera 31B, polarized illumination, and high-speed decode. In this configuration, the bank B, which includes not only the type of illumination (illumination conditions) and the type of camera (imaging conditions), but also the type of decode (decode conditions), can be used separately to perform decoding in parallel by the cores C2 and C3, thereby enabling efficient code reading.

[0076] Incidentally, the illumination conditions under which the illumination unit 2 irradiates the workpiece W with the illumination light Li, the imaging conditions under which the imaging unit 3 images the workpiece W, and the decoding conditions for decoding the code image Ic can be adjusted by tuning as follows. Next, this tuning will be described.

[0077] FIG. 6 is a flow chart showing an example of tuning, and FIG. 7 is a flow chart showing an example of rough brightness adjustment performed in tuning. In step S101, the controller 4 (tuning unit) searches for a code. Specifically, the controller 4 causes the illumination unit 2 to perform an illumination operation while causing the imaging unit 3 to perform an imaging operation to generate a code image Ic. Furthermore, the controller 4 searches for the code by decoding this code image Ic. This search for the code is performed using the illumination conditions, imaging conditions, and decoding conditions set in the controller 4 at that time. That is, in step S101, code reading is performed using the illumination conditions, imaging conditions, and decoding conditions set at that time.

[0078] In step S102, the controller 4 performs a coarse adjustment of the brightness of the illumination light Li emitted by the illumination unit 2 (FIG. 7). As shown in FIG. 7, in step S201, the controller 4 switches the illumination mode by setting an illumination mode in the illumination unit 2 that is different from the illumination mode used in the code search. Then, the controller 4 performs a read test in the switched illumination mode (step S202). This read test is code reading that is performed to adjust the illumination conditions, imaging conditions, or decoding conditions, and the read test performs an illumination operation, an imaging operation, and a decoding operation in sequence, similar to code reading.

[0079] In step S203, the controller 4 determines whether the reading test in step S202 is successful. If the reading test is successful (if "YES" in step S203), the controller 4 executes a reading test at each brightness while gradually changing the brightness of the illumination light Li in each of the illumination modes before and after the switching (step S204). In step S205, the controller 4 determines the illumination mode that has the best reading result from among the illumination modes before and after the switching. For example, as a result of executing a plurality of reading tests for each illumination mode while changing the brightness of the illumination light Li, the illumination mode that has the most successful reading tests is determined as the illumination mode that has the best reading result. In the following step S206, the controller 4 determines the median brightness of each successful reading test among the plurality of reading tests executed for the illumination mode that has the best reading result as the result of the rough brightness adjustment. Then, the rough brightness adjustment in FIG. 7 ends.

[0080] If it is determined in step S203 that the reading test in step S202 has failed (if "NO" in step S203), the controller 4 executes a reading test at each brightness while gradually changing the brightness of the illumination light Li in the previous illumination mode (step S207). In the following step S206, the controller 4 determines the median brightness of each successful reading test among the multiple reading tests executed in the previous illumination mode as the result of the rough brightness adjustment. Then, the rough brightness adjustment in FIG. 7 ends.

[0081] In this way, in the brightness rough adjustment of FIG. 7 (i.e., step S102 of FIG. 6), an appropriate illumination mode and an appropriate brightness in the illumination mode are determined from the illumination modes before and after switching. When this brightness rough adjustment (step S102) is completed, the controller 4 executes brightness fine adjustment (step S103). Specifically, a reading test is executed while changing the brightness of the illumination light Li irradiated in the appropriate illumination mode within a predetermined range centered on the appropriate brightness. For example, multiple reading tests are executed for the same brightness, and the number of successes of the reading test at the brightness is obtained. After the number of successes is obtained for each brightness in this way, the brightness with the highest number of successes is obtained as the optimal brightness.

[0082] In step S104, the controller 4 executes multiple read tests while setting the brightness of the illumination light Li irradiated in one appropriate illumination mode to the optimal brightness obtained in step S103. In step S105, the controller 4 determines whether the success rate of the read tests in the multiple read tests in step S104 is equal to or higher than a predetermined threshold. If the success rate of the read tests is less than the threshold ("NO" in step S105), the controller 4 changes conditions other than the illumination conditions, that is, the imaging conditions or the decoding conditions (step S106), and returns to step S101. On the other hand, if the success rate of the read tests is equal to or higher than the threshold ("YES" in step S105), the controller 4 outputs the illumination conditions, imaging conditions, and decoding conditions set at that time as tuning results (step S107).

[0083] The controller 6 performs the above tuning, for example, in response to a user request. The user can request the controller 6 to perform tuning, for example, by operating the display SP. The controller 6 then stores the result of the tuning, that is, a combination of the illumination condition, the image capture condition, and the decode condition, in the storage unit 7. At this time, the controller 6 generates a new bank B as a custom bank B in the storage unit 7, and stores the tuning result in this custom bank B. Therefore, in the control shown in FIG. 4, the controller 6 can perform code reading using the illumination condition, the image capture condition, and the decode condition set in this custom bank. Also, by performing tuning multiple times, multiple custom banks B can be generated in the storage unit 7.

[0084] That is, in the examples of FIG. 6 and FIG. 7, the controller 6 (tuning execution unit) sets the illumination conditions and imaging conditions to be suitable for decoding. The multiple banks B set in the storage unit 7 include multiple custom banks indicating the illumination conditions and imaging conditions set by tuning by the controller 6. At this time, code reading in which the code image generation process is executed to generate a code image Ic to be decoded by the core C2 and the code reading in which the code image generation process is executed to generate a code image Ic to be decoded by the core C3 and the code reading in which the code image generation process is executed to generate a code image Ic to be decoded by the core C3 can be executed under each condition set in the different custom banks B. In this configuration, when a user handles a special workpiece W, the illumination conditions and imaging conditions can be tuned according to the workpiece W, and reliable code reading is possible.

[0085] As described above, in this embodiment, the code reading device 1 corresponds to an example of a "code reading device" of the present invention, the illumination unit 2 corresponds to an example of an "illumination unit" of the present invention, the imaging unit 3 corresponds to an example of an "imaging unit" of the present invention, the controller 6 corresponds to an example of a "control unit" of the present invention, core C1 corresponds to an example of a "first core" of the present invention, cores C2 to C4 correspond to an example of a "second core" of the present invention, core C3 corresponds to an example of a "third core" of the present invention, and core C4 corresponds to an example of a "fourth core" of the present invention.

[0086] The present invention is not limited to the above embodiment, and various modifications can be made to the above without departing from the spirit of the present invention. For example, the two cameras 31A and 31B of the imaging unit 3 may be configured to be used according to their focal lengths rather than their resolution. In this modification, the condenser lens 311A ​​of the camera 31A and the condenser lens 311B of the camera 31B have different focal lengths, and for example, the focal length of the condenser lens 311A ​​is shorter than the focal length of the condenser lens 311B. In other words, the camera 31A is a close-range camera that captures images at a closer distance than the camera 31B, and conversely, the camera 31B is a long-range camera that captures images at a longer distance than the camera 31A.

[0087] Then, the controller 6 selects one of the cameras 31A and 31B to be used for the imaging operation according to the distance to the workpiece W detected by the distance sensor 41 of the distance measurement unit 4. Specifically, if the distance to the workpiece W is less than the threshold distance, the controller 6 selects the short-distance camera 31A as the camera to be used for the imaging operation, and if the distance to the workpiece W is equal to or greater than the threshold distance, the controller 6 selects the long-distance camera 31B as the camera to be used for the imaging operation. In the code image generation process, the code image Ic is generated by the camera selected in this way. In this configuration, the code image Ic can be captured by a camera having an appropriate focal length, which improves the success rate of decoding the code.

[0088] As described above, the time required for high-speed decoding is different from the time required for obfuscated decoding. In accordance with this difference in the time required for decoding, the timeout period for determining whether the decoding has failed differs between high-speed decoding and obfuscated decoding. In other words, a high-speed timeout period is set for high-speed decoding, and an obfuscated timeout period longer than the high-speed timeout period is set for obfuscated decoding. Moreover, decoding management using such timeout periods can be performed as follows.

[0089] Fig. 8 is a flowchart showing an example of decoding management. The flowchart in Fig. 8 is executed by the controller 6. When the controller 6 starts decoding the code image Ic (step S301), it determines in step S302 whether the timeout period has elapsed since the start of the decoding. If the timeout period has elapsed (if "YES" in step S302), the controller 6 ends the decoding (step S304).

[0090] On the other hand, if the timeout period has not elapsed ("NO" in step S302), the controller 6 checks whether the decoding was successful, i.e., whether the code was successfully read (step S303). If the code was successfully read ("YES" in step S303), the controller 6 ends the decoding (step S304).

[0091] If it is not possible to confirm in step S303 that the code has been successfully read (if "NO" in step S303), the controller 6 checks whether it has been determined that the code image Ic does not contain a code, i.e., whether a determination that there is no code has been made (step S305). If a determination that there is no code has not been made (if "NO" in step S305), the controller 6 returns to step S302. On the other hand, if a determination that there is no code has been made (if "YES" in step S305), the controller 6 ends the decoding (step S304).

[0092] When the decode management of Fig. 8 is executed in the sequence shown in Fig. 4, the following control is executed. That is, in the high-speed imaging control (first imaging control) in which the code image generation process is executed while the illumination unit 2 executes one type of illumination mode (polarized illumination mode), the illumination unit 2 repeatedly executes the one type of illumination mode. Then, when the core C1 (first core) succeeds in decoding the code image Ic ("YES" in step S303), or when the core C1 determines that the decoded code image Ic does not contain a code ("YES" in step S305), the controller 6 newly executes the code image generation process in which the illumination unit 2 irradiates light in one type of illumination mode, and generates the code image Ic to be decoded by the core C1. On the other hand, if the core C2 (second core) succeeds in decoding the code image Ic (if "YES" in step S303), or if the core C2 determines that the decoded code image Ic does not contain a code (if "YES" in step S305), the illumination mode executed by the illumination unit 2 is changed to one of the four illumination modes, and a new code image generation process is executed to generate the code image Ic to be decoded by the core C2. With this configuration, if the decoding is successful or if it is determined that no code is included, reading of a new code can be started immediately.

[0093] Furthermore, if the code image Ic is not successfully decoded even after a timeout period for high speed (first timeout period) has elapsed since the start of decoding of the code image Ic (if "YES" in step S302), the core C1 ends the decoding (step S304). If the code image Ic is not successfully decoded even after a timeout period for hard-to-read (second timeout period) longer than the timeout period for high speed has elapsed since the start of decoding of the code image Ic (if "YES" in step S302), the core C2 ends the decoding (step S304). With this configuration, it is possible to set a short timeout for reading simple codes and a long timeout for reading difficult codes, and it is possible to improve the success rate of decoding difficult codes while maintaining the high speed of decoding simple codes.

[0094] In the above example, the number of cores C1 that perform high-speed decoding is less than the number of cores C2 to C4 that perform obfuscated decoding. However, the number of cores that perform high-speed decoding may be greater than the number of cores that perform obfuscated decoding. For example, high-speed decoding may be performed by cores C1 and C2, and obfuscated decoding may be performed by core C3. In this configuration, code reading for an easy-to-read code can be performed using many cores C1 and C2, and reading of the code can be performed quickly. Furthermore, in order to read an easy-to-read code even more quickly, the following decoding management shown in FIG. 9 may be performed.

[0095] Fig. 9 is a flowchart showing a modified example of the decoding management. The flowchart in Fig. 9 is executed by the controller 6. Also, since the decoding management in Fig. 9 is executed in common by the cores C1 and C2 that perform high-speed decoding, the decoding management for the core C1 will be described here.

[0096] When the controller 6 starts decoding (high-speed decoding) by the core C1 (step S401), in step S402, it checks whether the decoding by the core C1 has been successful. When it is confirmed that the decoding by the core C1 has been successful ("YES" in step S402), the controller 6 ends the decoding (step S406). On the other hand, when it is not confirmed that the decoding by the core C1 has been successful ("NO" in step S402), the controller 6 checks whether the timeout period has elapsed since the start of the decoding (step S403). When it is confirmed that the timeout period has elapsed ("YES" in step S403), the controller 6 ends the decoding (step S406).

[0097] On the other hand, if the timeout period has not elapsed ("NO" in step S403), the controller 6 judges whether the timeout is about to occur (step S404). Specifically, the controller 6 judges whether the difference between the time taken for the decoding being performed by the core C1 and the timeout period set for the core C1 is less than a predetermined time. If the difference is equal to or greater than the predetermined time, the controller 6 judges that the timeout is not about to occur ("NO" in step S404), and returns to step S402.

[0098] On the other hand, if the difference is less than the predetermined time, the controller 6 determines that the timeout is about to occur ("YES" in step S404), executes step S405, and then returns to step S402. In step S405, the controller 6 issues a command to the core C0 to start a code image generation process for generating a code image Ic to be decoded next to the code image Ic currently being decoded by the core C1. Then, upon receiving the command from the controller 6, the core C0 starts the code image generation process.

[0099] That is, in this example, there are provided cores C1 (first core), C2 (second core), and C3 (third core) that can decode the code image Ic in parallel. The timeout period that the cores C1 and C2 can use for decoding is shorter than the timeout period that the core C3 can use for decoding. When the difference between the time taken for one of the cores C1 and C2 to perform the decoding and the timeout period for the one core becomes less than a predetermined time ("YES" in step S404), the controller 6 starts a code image generation process for generating the code image Ic to be decoded by the one core (step S405).

[0100] In other words, the code image generation process for the next decoding scheduled to be executed is started without waiting for the completion of the currently executed decoding, which makes it possible to improve the success rate of decoding difficult codes while maintaining the high speed of decoding simple codes.

[0101] Meanwhile, in a code reading device 1 according to another embodiment different from the above embodiment, as shown in Fig. 13, for example, by prioritizing high-speed reading performance over obscure reading performance, the cores C1 to C3 may be used as cores for high-speed decoding, and the core C4 may be used as a core for obscure decoding, and the timeout period that the cores C1 to C3 can use for decoding may be set shorter than the timeout period that the core C4 can use for decoding. When the difference between the time taken for one of the cores C1 to C3 to perform the decoding and the timeout period for the one core becomes less than a predetermined time (just before the timeout), the controller 6 may start a code image generation process for generating a code image Ic to be decoded by the one core. If there is a core (a core in a standby state) that can immediately perform decoding, the controller 6 may start a code image generation process for generating a code image Ic to be decoded by the one core. This allows the waiting time of each core to be reduced even in an environment where there are more easy codes than difficult codes, while the decoding success rate can be maintained by relatively lengthening the decoding time for the difficult cores, making it possible to achieve both high speed decoding of easy codes and stable decoding of difficult codes. Note that in the above-mentioned other embodiment, the number of cores for high speed decoding may be greater than the number of cores for difficult decoding, without being limited to the above example (for example, cores C1 and C2 may be for high speed decoding, and core C3 may be for difficult decoding). Also, it may be configured to select one of multiple cameras (for example, a camera for standard distance and a camera for long distance) according to the measurement result (distance) of the distance measurement unit 4.

[0102] Furthermore, in the code reading device 1 according to the above-mentioned other embodiment, it is possible to cause the core C1 etc. to execute decoding (in other words, image processing) optimized according to the type of code to be read. For example, the coefficients of a filter used in the image processing for executing the decoding can be optimized according to the type of code, and the coefficients can be included in the decoding conditions and stored in bank B. In particular, optimized filter coefficients can be obtained for each of a plurality of types of codes and stored in bank B. In such a case, it is possible to execute control of decoding according to each of a plurality of code types. Incidentally, for example, a code attached to a label and a code formed by DPM are treated as different types of codes.

[0103] FIG. 10 is a flowchart showing an example of decode control according to a code type, and FIG. 11 is a diagram showing an example of the operation executed in the flowchart of FIG. 10. The flowchart of FIG. 10 is executed by the controller 6. In step S501, the controller 6 determines whether one code type has been selected by the user from among a plurality of code types. The user can select a code type by, for example, operating the display SP. When one code type Ks has been selected ("YES" in step S501), the controller 6 determines that the code image Ic is to be decoded (image processed) according to the one code type Ks in all of the cores C1, C2, and C3. As a result, the cores C1, C2, and C3 execute decodes corresponding to the same code type Ks in parallel with the code image Ic generated in the code image generation process.

[0104] 10 and 11, the controller 6 (control unit) receives from the user a specification of the type of code to be read (step S501). Then, the cores C1, C2, and C3 execute decoding corresponding to the code of one code type Ks received by the controller 6 (step S502). By fixing the code type to one in this way, the imaging frequency for reading the code type is maximized, and the probability that the code can be imaged while it is included in the field of view of the imaging unit 3 is improved.

[0105] In other words, when workpieces W pass in front of the code reading device 1 one after another, some workpieces W cannot be imaged if the period for imaging the workpieces W is long compared to the period for which the workpieces W pass in front of the code reading device 1. Therefore, by maximizing the imaging frequency as described above, it is possible to reliably image the workpieces W.

[0106] In addition, in the flowchart of FIG. 10, when the user has not selected a code type (step S501: NO), it is also possible to execute a decoding control according to the code type as shown in FIG. 12 (step S503). FIG. 12 is a diagram showing an example of an operation executed in a modified example of the decoding control. In this example, a plurality of types of decoding corresponding to each of the plurality of code types Ka, Kb, and Kc are executed. That is, a decoding optimized for the code of the code type Ka, a decoding optimized for the code type Kb, and a decoding optimized for the code type Kc are executed. In addition, each of the cores C1, C2, and C3 executes a plurality of types of decoding corresponding to each of the plurality of code types Ka, Kb, and Kc in parallel in sequence. At this time, the cores C1, C2, and C3 execute a plurality of types of decoding in a different sequence from each other.

[0107] 12, core C1 (first core), core C2 (second core), and core C3 (third core) can decode the multiple common types of codes Ka, Kb, and Kc. Core C1, core C2, and core C3 decode the multiple types of codes Ka, Kb, and Kc in different orders. In this configuration, when there are multiple code types to be read, core C1, core C2, and core C3 can prioritize decoding different code types, thereby improving the probability of successfully reading the codes.

[0108] 4, in the high-speed imaging control in which the code image generation process for generating the code image Ic to be decoded by the core C1 (first core) is executed multiple times, the illumination is fixed to polarized illumination. However, the illumination used in the high-speed imaging control is not limited to polarized illumination, and may be other types of illumination. Also, the type of illumination used in the high-speed imaging control does not need to be one type, and may be two or more types. [Industrial Applicability]

[0109] This invention is applicable to any technology that generates a code image based on light reflected by a workpiece and decodes this code image to read a code attached to a workpiece. [Explanation of symbols]

[0110] 1...Code reader 2. Lighting section 3. Imaging unit C1…Core C2…Core C3…Core C4…Core

Claims

1. an illumination unit capable of switching between a plurality of illumination modes in sequence, the illumination modes being different from one another and irradiating a workpiece having a code to be read; an imaging unit that receives light irradiated from the illumination unit and reflected by the workpiece and generates a code image; a control unit including a first core and a second core capable of decoding a code image in parallel, the control unit causing the illumination unit to execute one of the plurality of illumination modes while causing the imaging unit to generate a code image, and causing the first core or the second core to decode the generated code image; Equipped with the control unit executes a first imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N1 types of illumination modes (N1 is an integer equal to or greater than 1) among the plurality of types of illumination modes, and a second imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N2 types of illumination modes (N2 is an integer greater than N1) among the plurality of types of illumination modes, The first core executes decoding of a code image generated by the first imaging control, the second core executes decoding of the code image generated under the second imaging control in parallel with the decoding by the first core; A code reading device comprising:

2. The N2 types of illumination modes executed in the second imaging control include at least one of an illumination mode in which light is irradiated by diffuse illumination, polarized illumination, ring illumination, or low-angle illumination.

2. The code reader according to claim 1.

3. The N2 types of illumination modes further include an illumination mode in which light is irradiated by non-diffuse illumination, and the illumination mode is also included in the N1 types of illumination modes executed in the first imaging control.

3. The code reader according to claim 2.

4. The illumination unit includes a diffuse illumination unit that irradiates the workpiece with diffused light obtained by diffusing light emitted from a light source using a diffusing member, and a non-diffuse illumination unit that irradiates the workpiece with light emitted from the light source without diffusing the light using the diffusing member, The N2 types of illumination modes executed in the second imaging control include an illumination mode in which light is irradiated by the diffuse illumination and an illumination mode in which light is irradiated by the non-diffuse illumination.

2. The code reader according to claim 1.

5. The N1 types of illumination modes executed in the first imaging control irradiate light by the non-diffuse illumination, the first core performs decoding of a plurality of code images generated based on the non-diffuse illumination while the second core performs decoding of a code image generated based on the diffuse illumination and a code image generated based on the non-diffuse illumination; 5. A code reading device according to claim 4.

6. The illumination unit can irradiate the workpiece with light by the diffuse illumination from a plurality of irradiation angles different from each other, and can irradiate light by each of a plurality of diffuse illumination modes having different combinations of irradiation angles at which light is irradiated among the plurality of irradiation angles; the plurality of illumination modes includes the plurality of diffuse illumination modes; While the first core performs decoding of a plurality of code images generated based on the non-diffuse illumination, the second core performs decoding of a plurality of code images generated based on the plurality of diffuse illumination modes, respectively.

5. A code reading device according to claim 4.

7. the control unit further includes a third core capable of decoding a code image in parallel with the first core and the second core, and executes a third imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N3 types of illumination modes (N3 is an integer greater than N1) among the plurality of types of illumination modes; The third core executes decoding of a code image generated by the third imaging control, the N3 types of illumination modes executed in the third imaging control include at least one of the illumination modes in which light is irradiated by the diffuse illumination, the polarized illumination, the ring illumination, or the low-angle illumination, While the second core decodes a code image generated based on a first illumination selected from the diffuse illumination, the polarized illumination, the ring illumination, and the low-angle illumination, the third core decodes a code image generated based on a second illumination selected from the diffuse illumination, the polarized illumination, the ring illumination, and the low-angle illumination, the second ...

3. The code reader according to claim 2.

8. The illumination unit can irradiate the workpiece with light by the diffuse illumination from a plurality of irradiation angles different from each other, and can irradiate light with each of first diffuse illumination and second diffuse illumination having different combinations of irradiation angles at which light is irradiated from among the plurality of irradiation angles; the plurality of types of illumination modes include an illumination mode in which light is irradiated by the first diffuse illumination and an illumination mode in which light is irradiated by the second diffuse illumination, the control unit further has a third core capable of decoding a code image in parallel with the first core and the second core, and a fourth core capable of decoding a code image in parallel with the first core, the second core, and the third core, and executes a third imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N3 types of illumination modes (N3 is an integer greater than N1) among the plurality of types of illumination modes, and executes a fourth imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N4 types of illumination modes (N4 is an integer greater than N1) among the plurality of types of illumination modes, The third core executes decoding of a code image generated by the third imaging control, The fourth core executes decoding of a code image generated by the fourth imaging control, the second core, the third core, and the fourth core execute decoding of code images generated based on different illuminations among the non-diffuse illumination, the first diffuse illumination, and the second diffuse illumination; 5. A code reading device according to claim 4.

9. the imaging unit includes a first camera and a second camera having a higher resolution than the first camera; Each of the first camera and the second camera is capable of receiving light reflected by the work and generating a code image, In the first imaging control, only the first camera out of the first camera and the second camera is used to generate a code image, In the second imaging control, the camera to be used for generating a code image is switched between the first camera and the second camera, so that both the first camera and the second camera are used for generating a code image.

2. The code reader according to claim 1.

10. The illumination unit includes a diffuse illumination unit that irradiates the workpiece with diffused light obtained by diffusing light emitted from a light source using a diffusing member, and a non-diffuse illumination unit that irradiates the workpiece with light emitted from the light source without diffusing the light using the diffusing member, the imaging unit includes a first camera and a second camera having a higher resolution than the first camera; Each of the first camera and the second camera is capable of receiving light reflected by the work and generating a code image, the control unit further includes a third core capable of decoding a code image in parallel with the first core and the second core, and executes a third imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N3 types of illumination modes (N3 is an integer greater than N1) among the plurality of types of illumination modes; The third core executes decoding of a code image generated by the third imaging control, Among a plurality of generation conditions in which a combination of one of the diffuse lighting and the non-diffuse lighting and one of the first camera and the second camera is different from one another, the second core and the third core execute in parallel the decoding of the code image generated based on the generation conditions different from one another.

2. The code reader according to claim 1.

11. The illumination unit has diffuse illumination that irradiates the workpiece with diffused light obtained by diffusing light emitted from a light source using a diffusion member, and non-diffuse illumination that irradiates the workpiece with light emitted from the light source without diffusing it using the diffusion member, and is capable of irradiating light onto the workpiece using the diffuse illumination from a plurality of irradiation angles that are different from each other, and is capable of irradiating light using first diffuse illumination and second diffuse illumination that have different combinations of irradiation angles at which light is irradiated from among the plurality of irradiation angles, the imaging unit includes a first camera and a second camera having a higher resolution than the first camera; Each of the first camera and the second camera is capable of receiving light reflected by the work and generating a code image, the control unit further has a third core capable of decoding a code image in parallel with the first core and the second core, and a fourth core capable of decoding a code image in parallel with the first core, the second core, and the third core, and executes a third imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N3 types of illumination modes (N3 is an integer greater than N1) among the plurality of types of illumination modes, and executes a fourth imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N4 types of illumination modes (N4 is an integer greater than N1) among the plurality of types of illumination modes, The third core executes decoding of a code image generated by the third imaging control, The fourth core executes decoding of a code image generated by the fourth imaging control, Among a plurality of generation conditions in which a combination of one of the first diffuse illumination, the second diffuse illumination, and the non-diffuse illumination and one of the first camera and the second camera is different from one another, the second core, the third core, and the fourth core execute in parallel the decoding of the code image generated based on the generation conditions different from one another.

2. The code reader according to claim 1.

12. The second core executes image processing using a machine learning model that has been trained to repair a portion of the code image generated by the imaging unit that is inappropriate for decoding, and executes decoding of the code image that has been subjected to the image processing; The code reading device according to claim 1 , wherein the first core decodes the code image without executing image processing using the machine learning model.

13. a storage unit that stores a plurality of banks each indicating a combination of an illumination condition for the illumination unit to irradiate light, an imaging condition for the imaging unit to generate a code image, and a decoding condition for the control unit to perform decoding; the plurality of banks include combinations in which at least one of the illumination condition, the imaging condition, and the decoding condition is different from one another; the control unit further includes a third core capable of decoding a code image in parallel with the first core and the second core, and executes a third imaging control for causing the imaging unit to generate a code image while causing the illumination unit to execute N3 types of illumination modes (N3 is an integer greater than N1) among the plurality of types of illumination modes; The third core executes decoding of a code image generated by the third imaging control, a process of executing the second imaging control and decoding by the second core and a process of executing the third imaging control and decoding by the third core are executed by using different banks.

2. The code reader according to claim 1.

14. a tuning execution unit that sets the illumination conditions and the imaging conditions to be conditions suitable for decoding, the plurality of banks include a plurality of custom banks indicating the illumination conditions and the imaging conditions set in the tuning execution unit, a process of executing the second imaging control and decoding by the second core and a process of executing the third imaging control and decoding by the third core are executed by using different custom banks.

14. A code reading device according to claim 13.

15. A code reading method in which an illumination unit is capable of executing a plurality of illumination modes that irradiate a workpiece having a code to be read with light in different modes, and an imaging unit receives light reflected from the workpiece and generates a code image, the method comprising: causing the illumination unit to execute one of the plurality of illumination modes while causing the imaging unit to generate a code image; causing the first core or the second core to decode the code image; Equipped with the first core decodes a code image generated by the imaging unit while causing the illumination unit to execute N1 types of illumination modes (N1 is an integer equal to or greater than 1) among the plurality of types of illumination modes; the second core decodes a code image generated by the imaging unit while causing the illumination unit to execute N2 types of illumination modes (N2 is an integer greater than N1) among the plurality of types of illumination modes; The decoding by the second core is performed in parallel with the decoding by the first core. A code reading method comprising the steps of:

Citation Information

Patent Citations

  • handheld symbol reader lighting diffuser

    JP2008524709A

  • Optical information reader

    JP2016033787A

  • Optical information reading device and optical information reading method

    JP2020177312A

  • Optical reader

    JP2021149588A

  • Optical information reader

    JP2022135893A