Optical Reader
The optical reading device enhances decoding speed by preprocessing images line by line and utilizing multiple cores to determine code candidates in parallel, addressing the challenge of delayed results in large image processing.
Patent Information
- Application Number
- JP2024017541
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-02-08
- Publication Date
- 2024-12-16
- Estimated Expiration
- 2040-03-19
AI Technical Summary
Existing optical reading devices face challenges in efficiently processing large images of varying sizes and shapes, leading to delayed decoding results due to the time-consuming code search process, especially in logistics environments where objects of diverse dimensions are transported at high speeds.
The optical reading device employs an illumination section, imaging unit, preprocessing circuit, and processor to capture and preprocess images line by line, calculate feature amounts indicating code-likeness, and perform decoding in parallel using multiple cores, allowing for immediate output of decoding results even with large images.
This configuration accelerates the code search process and enables rapid generation and output of decoding results, even with large images, by processing feature values in parallel and determining code candidate regions efficiently.
Smart Images

Figure 0007600449000001 
Figure 0007600449000002 
Figure 0007600449000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an optical reading device that reads information contained in a read image generated by imaging a workpiece. [Background technology]
[0002] Generally, a code reader is configured to use a camera to capture an image of a code such as a barcode or two-dimensional code attached to a workpiece, extract and binarize the code contained in the resulting image using image processing, and then decode the code to read the information (see, for example, Patent Documents 1 and 2).
[0003] The optical reading device of Patent Document 1 is configured to determine an upper limit of the exposure time for reading the code based on the movement speed of the workpiece and the size of the cells that make up the code, and to automatically set the exposure time within the above-mentioned upper limit by acquiring and analyzing multiple images containing the code.
[0004] The optical reading device of Patent Document 2 has a first core that causes an imaging unit to perform imaging processing and transfers the acquired image data to a shared memory, and a second core that reads image data from the shared memory and performs decoding processing based on a decoding processing request from the first core. [Prior art documents] [Patent documents]
[0005] [Patent Document 1] JP 2018-136860 A [Patent Document 2] JP 2012-64178 A Summary of the Invention [Problem to be solved by the invention]
[0006] Incidentally, the reading process in an optical reader such as those disclosed in Patent Documents 1 and 2 generally consists of three processes: a preprocessing process that performs various filter processes and the like, a code search process that scans the entire image after preprocessing to search for an area where a code is likely to exist, and a decoding process that performs decoding using image data of the area identified by the code search process. While the preprocessing process is often implemented using a dedicated circuit or a PLD (Programmable Logic Device), the code search process and the decoding process are difficult to implement using simple image manipulation processes and cannot be implemented using a dedicated circuit or a PLD, and are therefore executed by a processor.
[0007] However, for example, in a distribution center, items (workpieces) of various sizes and shapes are transported at high speed, and there is a demand to increase the size of the scanned image in order to reliably capture the code under such conditions. If the size of the scanned image increases, the code search process takes a lot of time. In other words, since the code search process is a process of extracting and calculating features for evaluating the likelihood of a code while scanning the entire image, if the image size is increased, scanning will take a long time, and as a result, there is a risk of delaying the output of the decoded result.
[0008] The present invention has been made in view of the above-mentioned problems, and an object of the present invention is to speed up the code search process and enable immediate output of the decoded result even if the size of the read image is large. [Means for solving the problem]
[0009] In order to achieve the above object, the present disclosure is directed to a stationary optical reading device that reads a code attached to a workpiece being transported on a line. The optical reading device includes an illumination unit for irradiating light toward an area through which the workpiece passes, an imaging unit for receiving light irradiated from the illumination unit and reflected from the area through which the workpiece passes, generating a read image of the area through which the workpiece passes, and transferring the read image line by line, a preprocessing circuit for performing preprocessing on the image data every time a predetermined number of lines of image data are taken from the imaging unit, and calculating a feature amount indicating a code-likeness for each area in the preprocessed image data based on the luminance value of each pixel in the preprocessed image data, a processor for acquiring the feature amount calculated by the preprocessing circuit, determining a candidate area for a code in the read image based on the acquired feature amount, executing a decoding process for the determined area, and generating a decoding result, and an output unit for outputting the decoding result generated by the processor.
[0010] According to this configuration, when light is irradiated from the illumination unit onto a workpiece being transported on the line, the light reflected by the workpiece is received by the imaging unit, and a read image including the workpiece and the code attached to the workpiece is generated. The generated read image is transferred line by line to a preprocessing circuit. When the preprocessing circuit takes in image data of a predetermined number of lines, it performs preprocessing on the image data and calculates a feature amount indicating the likelihood of each area in the preprocessed image data being a code. The feature amount can be a combination of edge data. The processor determines candidate areas for the code in the read image based on the calculated feature amount, and performs a decode process for the determined area.
[0011] In other words, while reading image data line by line from the imaging unit, it calculates the feature amount indicating the likelihood of a code, determines the candidate code area based on this feature amount, and executes the decoding process for the determined area, so there is no need to wait until scanning of the entire image is completed to perform a code search, and it is possible to read image data from the imaging unit, calculate the feature amount, and determine the candidate code area in parallel. This makes it possible to speed up the output timing of the decoded result even if the size of the read image is large.
[0012] The pre-processing circuit may be, for example, a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC).
[0013] In a second disclosure, the pre-processing circuit calculates features and then generates a feature image to which a brightness value according to the calculated features is assigned, and the processor acquires the feature image generated by the pre-processing circuit and determines candidate areas for the code based on the acquired feature image.
[0014] According to this configuration, the pre-processing circuit generates a feature image in which a brightness value is assigned according to the feature. In the feature image, the brightness values of pixels differ between areas with large feature amounts and areas with small feature amounts, so the processor can identify areas with large feature amounts based on the brightness values of the pixels. This increases the accuracy of determining candidate areas for codes. The feature image can display areas with large feature amounts brighter or darker than areas with small feature amounts, making it possible to create a so-called heat map image.
[0015] In a third disclosure, the pre-processing circuit calculates a first feature indicating a likelihood of the code being a first code and a second feature indicating a likelihood of the code being a second code, and then generates a first feature image to which a brightness value corresponding to the first feature is assigned and a second feature image to which a brightness value corresponding to the second feature is assigned, and the processor determines a candidate area of the first code based on the first feature image generated by the pre-processing circuit, determines a candidate area of the second code based on the second feature image, performs a decoding process on each of the determined areas, and generates a decoding result.
[0016] For example, a single scanned image may contain a first code and a second code. In this case, a first feature image can be generated in which a brightness value according to a first feature indicating the likelihood of the code being the first code is assigned, and a second feature image can be generated in which a brightness value according to a second feature indicating the likelihood of the code being the second code is assigned, and candidate areas for the first code and the second code can be determined based on these feature images.
[0017] In a fourth disclosure, the processor has a plurality of cores each for acquiring the first feature image and the second feature image, and each core executes a decoding process.
[0018] According to this configuration, the decoding processes of the first code and the second code can be executed in parallel, thereby increasing the processing speed.
[0019] In a fifth disclosure, the processor may have a plurality of cores for executing code decoding processing, and each of the plurality of cores may have a first decoding processing unit that acquires the first feature image and a second decoding processing unit that acquires the second feature image. The first decoding processing unit may execute decoding processing of the first feature image. The second decoding processing unit may execute decoding processing of the second feature image.
[0020] In other words, since the device has a first decoding processing unit that acquires a first feature image and a second decoding processing unit that acquires a second feature image, the process of acquiring the first feature image and the process of acquiring the second feature image can be performed in parallel. Also, each of the first decoding processing unit and the second decoding processing unit may be a thread for a decoding process in a core.
[0021] In a fifth disclosure, the first code is a one-dimensional code and the second code is a two-dimensional code.
[0022] According to this configuration, when a one-dimensional code and a two-dimensional code are included in one scanned image, the area including the one-dimensional code and the area including the two-dimensional code can be determined separately.
[0023] In a sixth disclosure, the preprocessing circuit generates edge data by executing edge detection processing on the image data captured from the imaging unit, and then generates the feature image based on the edge data.
[0024] According to this configuration, edge data can be generated by performing edge detection processing on the image data captured from the imaging unit, and a feature image can be generated based on this edge data, making the candidate area of the code clearer. The edge detection processing can be performed using, for example, a Sobel filter. For example, if the rotation angle of the barcode is 0°, an X-direction Sobel image is used, if it is 90°, a Y-direction Sobel image is used, and if there is no premise for the rotation angle of the barcode, a composite image can be generated by adding the X-direction Sobel image and the Y-direction Sobel image together.
[0025] The edge data may include an edge strength image, an edge angle image, etc., and may be an image that has been subjected to a common convolution process or arithmetic process. In addition to the first differential process, the second differential process, etc. may also be used as the edge detection process.
[0026] In the seventh disclosure, after generating the edge data, the pre-processing circuit executes an edge data integration process for integrating edge data of a certain pixel and its neighboring pixels, and then generates the feature image.
[0027] According to this configuration, for example, an area in the edge data where pixels with high brightness values are concentrated can be estimated as a candidate area for a code. By integrating a certain pixel constituting the edge data and its neighboring edge data, an area where pixels with high brightness values are concentrated can be expressed. In other words, it is possible to execute a product-sum operation process or a pixel integration process to generate data that measures the degree of concentration of edge data within a certain area.
[0028] Specifically, a smoothing process that has the effect of adding up pixel values within a specific window size can be used. A reduction process may also be used, which has the advantage that the amount of data in the feature image is reduced, so that the amount of scanning required is reduced.
[0029] In the eighth disclosure, before generating the first feature image to which a brightness value according to the likelihood of it being a one-dimensional code is assigned, the pre-processing circuit executes the edge data integration process by adding the brightness values of pixels having approximately the same edge direction within a certain range and subtracting the pixel values of pixels having different edge directions, thereby obtaining candidate areas for one-dimensional codes with high accuracy.
[0030] In the ninth disclosure, the pre-processing circuit performs the edge data integration process of adding up pixel values of pixels with different edge directions within a certain range before generating the second feature image to which a brightness value according to the likelihood of it being a two-dimensional code is assigned, thereby obtaining candidate areas for the two-dimensional code with high accuracy.
[0031] In a tenth disclosure, the preprocessing circuit can execute at least one of tone conversion processing and filtering processing as the preprocessing. Effect of the Invention
[0032] As described above, according to the present disclosure, each time the preprocessing circuit takes in a predetermined number of lines of image data, it performs preprocessing, calculates features indicating the likelihood of each area in the preprocessed image data being a code, and the processor determines candidate areas for the code based on the features, performs decoding processing on the determined areas, and generates the decoding results. Therefore, even if the size of the read image is large, the code search processing can be accelerated and the decoding results can be output immediately. [Brief description of the drawings]
[0033] [Figure 1] FIG. 1 is a diagram illustrating an optical reader according to an embodiment of the present invention during operation. [Diagram 2] FIG. 2 is a diagram showing an example of a workpiece to which a one-dimensional code and a two-dimensional code are attached. [Diagram 3] FIG. 3 is a block diagram of the optical reading device. [Figure 4] FIG. 4 is a block diagram showing a detailed structure of a processing unit included in the optical reader. [Diagram 5] FIG. 5 is a front view of the optical reader. [Figure 6] FIG. 6 is a view of the optical reader seen from the operation button side. [Figure 7] FIG. 7 is a view of the optical reader as seen from the terminal side. [Figure 8] FIG. 8 is a diagram showing an example of displaying parameter sets. [Figure 9] FIG. 9 is a flowchart showing an example of a process for generating data for chord search when there is one type of chord. [Figure 10A] FIG. 10A is a diagram showing an example of a read image. [Figure 10B] FIG. 10B is a diagram showing an example of a one-dimensional code heat map image. [Figure 10C] FIG. 10C is a diagram showing an example of a two-dimensional code heat map image. [Figure 11]FIG. 11 is a flowchart showing an example of a process for generating data for chord search when there are two types of chords. [Figure 12] FIG. 12 is a timing chart showing an example of a case where a decoding process is executed on a plurality of read images. [Figure 13] FIG. 13 is a conceptual diagram of a case where a plurality of scanned images are processed in parallel by a plurality of threads in a plurality of cores. [Figure 14] FIG. 14 is a conceptual diagram of parallel processing of multiple scanned images using one thread in multiple cores. [Figure 15] FIG. 15 is a flowchart for instructing a core that has completed a decoding process to perform the next decoding process. [Figure 16] FIG. 16 is a diagram showing the state of the queues of the cores that execute the decoding process and the timing of issuing commands to the cores for the decoding process. [Figure 17] FIG. 17 is a flow chart showing the tuning procedure. [Figure 18] FIG. 18 is a timing chart of the fixed interval imaging mode. [Figure 19] FIG. 19 is a timing chart when images are not captured at fixed intervals. [Figure 20] FIG. 20 is a flowchart showing a processing procedure for waiting for an available core. [Figure 21] FIG. 21 is a flow chart showing a processing procedure when a buffer capable of storing image data is provided. [Figure 22] FIG. 22 is a timing chart showing an example of an operation after the decoding process is completed. [Diagram 23] FIG. 23 is a flowchart showing an example of an operation after the decoding process is completed. [Figure 24] FIG. 24 is a timing chart showing a case where a plurality of read images generated by changing the brightness of the illumination unit are decoded by different cores. [Diagram 25]FIG. 25 is a timing chart showing a case where different types of codes contained in a plurality of read images generated by changing the brightness of the illumination unit are decoded by different cores. [Figure 26] FIG. 26 is a flowchart showing the process during operation of the optical reader. [Figure 27] FIG. 27 is a diagram showing an example of a user interface image. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0034] Hereinafter, the embodiments of the present invention will be described in detail with reference to the drawings. Note that the following description of the preferred embodiments is merely illustrative in nature and is not intended to limit the present invention, its applications, or its uses.
[0035] Fig. 1 is a diagram showing a schematic diagram of an optical reader 1 according to an embodiment of the present invention during operation. In this example, a plurality of workpieces W are placed on the upper surface of a transport belt conveyor B and transported in the direction of arrow Y in Fig. 1, and the optical reader 1 according to the embodiment is installed at a position above and away from the workpieces W. The workpieces W may flow not only in the center in the width direction of the upper surface of the transport belt conveyor B, but also on one side and the other side while being offset in the width direction, and the workpieces W do not necessarily always pass through a fixed position.
[0036] The optical reading device 1 can be used, for example, in a logistics distribution center. On a conveyor belt B for transport installed in the logistics distribution center, transported objects (workpieces W) of various sizes and shapes are transported at high speed. The distance between the works W in the transport direction is also set narrow. Furthermore, as shown in FIG. 2, the workpiece W may have multiple codes CD1, CD2 attached thereto, or may have only one code attached thereto.
[0037] In this example, the first code CD1 and the second code CD2 are different in type, the first code CD1 being a one-dimensional code, and the second code CD2 being a two-dimensional code. Typical examples of the first code CD1 are barcodes, such as JAN code, ITF code, and GS1-128. Typical examples of the second code CD2 are QR code (registered trademark), micro QR code, data matrix (Data code), Veri code, Aztec code, PDF417, and Maxi code. The second code CD2 is of stack type and matrix type, but the present invention can be applied to any two-dimensional code. The first code CD1 and the second code CD2 may be attached to the work W by directly printing or engraving, or may be attached by printing on a label or the like and then attaching it to the work W, and the means and method are not important. In addition, the work W may have a plurality of one-dimensional codes or a plurality of two-dimensional codes attached thereto. In the following explanation, it is assumed that the work W has a first code CD1 and a second code CD2 attached thereto, but the present invention is not limited to application to such a code attachment form, and can also be applied to a form in which only one code is attached, or three or more codes are attached.
[0038] As shown in FIG. 1, the optical reading device 1 is a device that optically reads a first code CD1 and a second code CD2 (shown in FIG. 2) attached to a workpiece W, and specifically, is a code reader configured to capture an image of the first code CD1 and the second code CD2 attached to the workpiece W to generate a read image, decode the first code CD1 and the second code CD2 contained in the generated read image, and output the decoded result.
[0039] The optical reader 1 can be configured as a stationary optical reader that is fixed to a bracket or the like (not shown) so as not to move during operation, but may be operated while being held and moved by a robot (not shown) or a user. The first code CD1 and the second code CD2 of the work W in a stationary state may be read by the optical reader 1. During operation, the first code CD1 and the second code CD2 of the work W sequentially transported by the transport belt conveyor B are read. The optical reader 1 of this embodiment is suitable for a situation in which it is desired to read the first code CD1 and the second code CD2 attached to the work W whose position changes, but is not limited thereto, and can also be used when reading the first code CD1 and the second code CD2 attached to the work W whose position does not change.
[0040] 1, the optical reader 1 is connected to a computer 100 and a programmable logic controller (PLC) 101 as external control devices by signal lines 101a, 101a, respectively, but this is not limiting, and communication modules may be built into the optical reader 1, the computer 100, and the PLC 101 to wirelessly connect the optical reader 1 to the computer 100 and the PLC 101. The PLC 101 is a control device for sequentially controlling the conveyor belt B and the optical reader 1, and a general-purpose PLC may be used.
[0041] A general-purpose or dedicated electronic calculator, a portable terminal, or the like can be used as the computer 100. In this example, a so-called personal computer is used, and is equipped with a control unit 40, a storage device 41, a display unit 42, an input unit 43, and a communication unit 44. By making the optical reading device 1 small-sized, it becomes difficult to perform all the settings of the optical reading device 1 using only the display unit 7 and buttons 8, 9, etc. of the optical reading device 1. Therefore, a computer 100 may be prepared separately from the optical reading device 1, and various settings of the optical reading device 1 may be performed by the computer 100, and the setting information may be transferred to the optical reading device 1.
[0042] In addition, since the computer 100 includes the communication unit 44, the computer 100 and the optical reader 1 may be connected to enable two-way communication, so that part of the processing of the optical reader 1 described above may be performed by the computer 100. In this case, part of the computer 100 becomes part of the components of the optical reader 1.
[0043] The control unit 40 is a unit that controls each part of the computer 100 based on a program stored in the storage device 41. The storage device 41 is composed of various memories, a hard disk, an SSD (Solid State Drive), etc. The display unit 42 is composed of, for example, a liquid crystal display, etc. The input unit 43 is composed of a keyboard, a mouse, a touch sensor, etc. The communication unit 44 is a part that communicates with the optical reading device 1. The communication unit 44 may have an I / O unit connected to the optical reading device 1, a serial communication unit such as RS232C, or a network communication unit such as a wireless LAN or a wired LAN.
[0044] The control unit 40 generates user interface images for setting the imaging conditions of the imaging unit 5 of the optical reading device 1 and the image processing conditions in the processing unit 23, as well as user interface images for displaying the decoded results and image data output from the optical reading device 1, and causes the display unit 42 to display them. The display unit 42 may constitute a part of the optical reading device 1. The storage device 41 is a part that stores the decoded results obtained by executing the decoding process by the processing unit 23, the images captured by the imaging unit 5, various setting information, and the like.
[0045] In addition, during operation, the optical reader 1 receives a read start trigger signal that specifies the start timing of reading the first code CD1 and the second code CD2 from the PLC 101 via the signal line 101a. Then, the optical reader 1 performs imaging and decoding of the work W based on this read start trigger signal. Thereafter, the decoded result obtained by the decoding process is transmitted to the PLC 101 via the signal line 101a. In this manner, during operation of the optical reader 1, the input of the read start trigger signal and the output of the decoded result are repeatedly performed between the optical reader 1 and an external control device such as the PLC 101 via the signal line 101a. Note that the input of the read start trigger signal and the output of the decoded result may be performed via the signal line 101a between the optical reader 1 and the PLC 101 as described above, or may be performed via other signal lines not shown. For example, a sensor for detecting that the work W has arrived at a predetermined position may be directly connected to the optical reader 1, and the read start trigger signal may be input from the sensor to the optical reader 1. In addition, the decoded results, images, and various setting information can also be output to a device other than the PLC 101, such as the computer 100.
[0046] [Overall configuration of optical reader 1] As shown in Figs. 5 to 7, the optical reader 1 includes a housing 2 and a front cover 3. As shown in Fig. 5, an illumination unit 4, an imaging unit 5, and an aimer 6 are provided on the front side of the housing 2. The configurations of the illumination unit 4 and the imaging unit 5 will be described later. The aimer 6 is composed of a light-emitting body such as a light-emitting diode (Light Emitting Diode). The aimer 6 is intended to indicate the imaging range of the imaging unit 5 and the guide of the optical axis of the illumination unit 4 by irradiating light forward of the optical reader 1. A user can also set up the optical reader 1 by referring to the light irradiated from the aimer 6.
[0047] As shown in FIG. 6, a display unit 7, a select button 8, an enter button 9, and an indicator 10 are provided on one end surface of the housing 2. The configuration of the display unit 7 will be described later. The select button 8 and the enter button 9 are buttons used for setting the optical reader 1, and are connected to a control unit 20. The control unit 20 is capable of detecting the operation states of the select button 8 and the enter button 9. The select button 8 is a button operated when selecting one of a plurality of options displayed on the display unit 7. The enter button 9 is a button operated when confirming the result selected by the select button 8. The indicator 10 is connected to the control unit 20 and can be composed of a light-emitting body such as a light-emitting diode. The operating state of the optical reader 1 can be notified to the outside by the lighting state of the indicator 10.
[0048] 7, the other end surface of the housing 2 is provided with a power connector 11, a network connector 12, a serial connector 13, and a USB connector 14. A heat sink 15, which serves as a rear case, is provided on the rear surface of the housing 2. A power wiring for supplying power to the optical reader 1 is connected to the power connector 11. The serial connector 13 is a signal line 101a connected to the computer 100 and the PLC 101, and the network connector 12 is an Ethernet connector. Note that the Ethernet standard is just an example, and signal lines of standards other than the Ethernet standard can also be used.
[0049] 3, a control unit 20, a storage device 50, an output unit 60, and the like are provided inside the housing 2. These will be described later.
[0050] In the description of this embodiment, the front and back of the optical reader 1 are defined as above, but this is only for the convenience of description and does not limit the orientation during use of the optical reader 1. That is, as shown in Fig. 1, the optical reader 1 can be installed and used so that its front face faces almost downward, or so that its front face faces upward, or so that its front face faces downward and is inclined, or so that its front face is along a vertical plane.
[0051] [Lighting section 4 configuration] As shown by the dashed line in Fig. 5, the lighting unit 4 is a member for irradiating light toward an area through which the workpiece W transported by the transport belt conveyor B passes. The light emitted from the lighting unit 4 illuminates at least a predetermined range in the transport direction by the transport belt conveyor B. This predetermined range is wider than the dimension in the same direction of the largest workpiece W expected to be transported during operation. The lighting unit 4 illuminates a first code CD1 and a second code CD2 attached to the workpiece W transported by the transport belt conveyor B.
[0052] The illumination section 4 includes a light-emitting body 4a formed of, for example, a light-emitting diode, and the number of light-emitting bodies 4a may be one or more. In this example, multiple light-emitting bodies 4a are included, and the imaging section 5 faces the outside from between the light-emitting bodies 4a. Light from the aimer 6 is irradiated from between the light-emitting bodies 4a. The illumination section 4 is electrically connected to the imaging control section 22 of the control unit 20 and controlled by the control unit 20, so that it can be turned on and off at any timing.
[0053] In this example, the lighting unit 4 and the imaging unit 5 are mounted and integrated in one housing 2, but the lighting unit 4 and the imaging unit 5 may be configured separately. In this case, the lighting unit 4 and the imaging unit 5 can be connected by wire or wirelessly. In addition, the control unit 20 described later may be built into the lighting unit 4 or into the imaging unit 5. The lighting unit 4 mounted in the housing 2 is called the internal lighting, and the lighting unit 4 separate from the housing 2 is called the external lighting. It is also possible to illuminate the workpiece W using both the internal lighting and the external lighting.
[0054] [Configuration of imaging unit 5] 3 is a block diagram showing the configuration of the optical reading device 1. The imaging unit 5 is a member that receives light that is irradiated from the illumination unit 4 and reflected from the area through which the workpiece W passes, and generates a read image of the area through which the workpiece W passes. An area camera with pixels arranged vertically and horizontally (X direction and Y direction) can be used as the imaging unit 5, which makes it possible to read two-dimensional codes and to capture images of one workpiece W multiple times during transport.
[0055] 3, the imaging unit 5 includes an imaging element 5a capable of imaging at least the portion of the workpiece W to which the first code CD1 and the second code CD2 are attached, an optical system 5b having lenses and the like, and an autofocus mechanism (AF mechanism) 5c. Light reflected from at least the portion of the workpiece W to which the first code CD1 and the second code CD2 are attached is incident on the optical system 5b. The imaging element 5a is an image sensor consisting of a light receiving element such as a charge-coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) that converts an image including the first code CD1 and the second code CD2 obtained through the optical system 5b into an electric signal.
[0056] The AF mechanism 5c is a mechanism for adjusting the focus by changing the position and refractive index of the focusing lens among the lenses constituting the optical system 5b. The AF mechanism 5c is connected to the control unit 20 and is controlled by the AF control unit 21 of the control unit 20.
[0057] The imaging element 5a is connected to the imaging control section 22 of the control unit 20. The imaging element 5a is controlled by the imaging control section 22 and is configured to be able to image the area through which the workpiece W passes at a preset fixed time interval or to image the area through which the workpiece W passes at any timing by changing the time interval. The imaging section 5 is configured to be able to perform so-called infinite burst imaging, which continues to generate read images continuously. This makes it possible to capture the codes CD1 and CD2 of the workpiece W moving at high speed into the read image without missing them, and to generate multiple read images by imaging one workpiece W multiple times during transportation. The imaging control section 22 may be built into the imaging section 5.
[0058] The intensity of light received on the light receiving surface of the imaging element 5a is converted into an electric signal by the imaging element 5a, and the electric signal converted by the imaging element 5a is transferred to the processing unit 23 of the control unit 20 as image data constituting a read image. Specifically, the imaging element 5a generates a read image, and then transfers the read image to the processing unit 23 line by line. One line is, for example, one column (or one row) in the vertical or horizontal direction of the imaging element 5a. Transferring the read image line by line means transferring the luminance values of a plurality of pixels constituting one vertical column of the imaging element 5a, or the luminance values of a plurality of pixels constituting one horizontal column of the imaging element 5a, to the processing unit 23, and then transferring the luminance values of a plurality of pixels constituting a column adjacent to the transferred column to the processing unit 23, and this is performed sequentially in the arrangement direction of the columns. Note that, after generating a read image, the imaging element 5a may transfer the entire read image to the processing unit 23 at once, without transferring the image line by line to the processing unit 23. This can be controlled by, for example, the imaging control unit 22.
[0059] [Display unit 7 configuration] The display unit 7 is, for example, an organic EL display or a liquid crystal display. The display unit 7 is connected to the control unit 20 as shown in FIG. 3. The display unit 7 can display, for example, the codes CD1 and CD2 captured by the imaging unit 5, character strings as the decoded results of the codes CD1 and CD2, the read success rate, matching level (read margin), and the like. The read success rate is the average read success rate when a read process is executed multiple times. The matching level is the read margin indicating the ease of reading the codes CD1 and CD2 that have been successfully decoded. This can be obtained from the number of error corrections that have occurred during decoding, and can be expressed, for example, as a numerical value. The fewer the error corrections, the higher the matching level (read margin), and on the other hand, the more the error corrections, the lower the matching level (read margin).
[0060] [Configuration of storage device 50] The storage device 50 is composed of various memories, a hard disk, an SSD, and the like. The storage device 35 is provided with a decoded result storage unit 51, an image data storage unit 52, and a parameter set storage unit 53. The decoded result storage unit 51 is a unit that stores a decoded result that is a result of the decoding process executed by the processing unit 23. The image data storage unit 52 is a unit that stores an image captured by the imaging unit 5. The parameter set storage unit 53 is a unit that stores setting information set by a setting device such as the computer 100, setting information set by the select button 8 and the enter button 9, setting information obtained as a result of the tuning execution unit 24 executing tuning, and the like. The parameter set storage unit 53 can store a plurality of parameter sets including a plurality of parameters that constitute the imaging conditions of the imaging unit 5 (gain, light amount of the illumination unit 4, exposure time, etc.) and the image processing conditions in the processing unit 23 (type of image processing filter, etc.).
[0061] Fig. 8 is a diagram showing an example of displaying a plurality of parameter sets. The control unit 40 of the computer 100 can generate a user interface image 300 as shown in Fig. 8 and display it on the display unit 42 of the computer 100. A plurality of tabs 301, 302, and 303 are provided at the top of the user interface image 300, and it is possible to select any one of the plurality of tabs 301, 302, and 303.
[0062] In this example, the case where the bank tab 302 is selected is shown. One parameter set is called a "bank." In the example shown in Fig. 8, only bank 1 and bank 2 are displayed, but the number of banks can be set arbitrarily.
[0063] Each bank is provided with common setting items such as a "decode timeout value" indicating the timeout period for the decode process, a "black and white inversion" for inverting the black and white of the read image, an "internal illumination" for switching on and off the internal illumination constituted by the illumination unit 4 mounted on the housing 2, an "external illumination" for switching on and off the external illumination constituted by the illumination unit 4 separate from the housing 2, and a "code detail setting" for switching the code type. Each bank is also provided with reading setting items such as an "exposure time" indicating the exposure time by the imaging unit 5, a "gain" indicating the gain of the imaging unit 5, a "contrast adjustment method" indicating the method for adjusting the contrast of the read image, and "first image filter" and "second image filter" for selecting the type and order of the image filters to be applied.
[0064] In this optical reading device 1, the user can select a bank to be used when operating the optical reading device 1 from among a plurality of banks stored in the parameter set storage unit 53. That is, the user can operate the input unit 43 of the computer 100 while viewing a user interface image 300 shown in FIG. 8, and select an arbitrary bank on the user interface image 300. This input unit 43 is a reception unit that receives the user's selection of a first bank (bank 1) and a second bank (bank 2) from among a plurality of banks stored in the storage device 50. Bank 1 is a parameter set for reading a one-dimensional code, and bank 2 is a parameter set for reading a two-dimensional code. The bank selection can be performed, for example, by operating a button or the like (not shown) displayed on the user interface image 300.
[0065] [Configuration of output section 60] The optical reader 1 has an output unit 60. The output unit 60 is a part that outputs the decoded result obtained by the processing unit 23 described later. Specifically, when the decoding process is completed, the processing unit 23 transmits the decoded result to the output unit 60. The output unit 60 can be configured with a communication unit that transmits data related to the decoded result received from the processing unit 23 to, for example, the computer 100 and the PLC 101. The output unit 60 may have an I / O unit connected to the computer 100 and the PLC 101, a serial communication unit such as RS232C, or a network communication unit such as wireless LAN or wired LAN.
[0066] [Configuration of control unit 20] 3 is a unit for controlling each part of the optical reader 1, and can be configured with a CPU, MPU, system LSI, DSP, dedicated hardware, etc. The control unit 20 is equipped with various functions as described later, which may be realized by a logic circuit or by executing software.
[0067] The control unit 20 has an AF control unit 21, an imaging control unit 22, a processing unit 23, a tuning execution unit 24, and a UI management unit 25. The AF control unit 21 is a unit that performs focusing of the optical system 5b by conventionally known contrast AF or phase difference AF. The AF control unit 21 may be included in the imaging unit 5.
[0068] [Configuration of imaging control unit 22] The imaging control section 22 is a section that controls the imaging section 5 as well as the illumination section 4. That is, the imaging control section 22 is composed of units that adjust the gain of the imaging element 5a, control the amount of light of the illumination section 4, and control the exposure time (shutter speed) of the imaging element 5a. The gain, the amount of light of the illumination section 4, the exposure time, etc. are included in the imaging conditions of the imaging section 5.
[0069] [Configuration of processing unit 23] 4, the processing unit 23 includes a pre-processing circuit 30, a memory 31, and a processor 40. Image data for each line transferred from the imaging element 5a is input to the pre-processing circuit 30. The pre-processing circuit 30 is a pre-processor disposed in the stage preceding the processor 40, and can be configured, for example, with a PLD (programmable logic device), examples of which include an FPGA, an ASIC, and the like.
[0070] The pre-processing circuit 30 performs pre-processing on image data every time the image data of a predetermined number of lines is captured from the imaging element 5. The image data of the predetermined number of lines is data that constitutes a portion of an area of one read image, and therefore, pre-processing is performed on different areas of one read image.
[0071] The predetermined number of lines is an arbitrary number of lines equal to or greater than 1, and is the number of lines required to detect the likelihood of a code. Examples of pre-processing include tone conversion processing and various image filter processing. Pre-processing may include only one or more of these processes. In the case of tone conversion processing, it may be processing to lower the tone of the image data captured by the imaging element 5a, and specifically, if the tone of the image data captured by the imaging element 5a is 12 bits, it is processing to make it 8 bits. Pre-processing may include processing to generate a reduced image.
[0072] After performing the preprocessing, the preprocessing circuit 30 performs a process of generating data for chord search. The process of generating data for chord search includes a process of calculating a feature amount indicating chord-likeness for each region in the preprocessed image data based on the luminance value of each pixel in the preprocessed image data. A specific example of the feature amount is, but is not limited to, a combination of edge data. After calculating the feature amount, the preprocessing circuit 30 generates a feature amount image to which a luminance value according to the calculated feature amount is assigned.
[0073] The code search data generation process executed by the preprocessing circuit 30 will be described with reference to FIG. 9. FIG. 9 shows the code search data generation process in the case where the work W is provided with one type of code, and this code may be a one-dimensional code or a two-dimensional code. In step SA1 after the start, the preprocessing circuit 30 reads the image after preprocessing, that is, the preprocessed image. Then, the process proceeds to step SA2, where the preprocessing circuit 30 executes edge detection processing on the preprocessed image to generate edge data. The edge detection processing can be executed using, for example, a Sobel filter. For example, in the case of a one-dimensional code, when the rotation angle of the barcode is 0°, the X-direction Sobel image is used, and when the rotation angle of the barcode is 90°, the Y-direction Sobel image is used. When there is no premise for the rotation angle of the barcode, a composite image may be generated by adding the X-direction Sobel image and the Y-direction Sobel image together.
[0074] In step SA2, an image after the edge detection process, such as an edge strength image, an edge angle image, etc., can be generated, and an image subjected to a common convolution process or arithmetic process may be generated. In addition, not only a first differential process but also a second differential process can be used as the edge detection process.
[0075] In step SA3, the edge data generated in step SA2 is acquired. Then, the process proceeds to step SA4, where edge data integration processing is performed to integrate edge data of a certain pixel and its vicinity. For example, since a code is likely to exist in an area where pixels with high brightness values are gathered in the edge data, the area can be estimated as a candidate area for the code. By integrating edge data of a certain pixel constituting the edge data and edge data existing in its vicinity, an area where pixels with high brightness values are gathered can be expressed. In this example, product-sum processing and pixel integration processing can be performed to generate data that measures the degree of gathering in a certain area of edge data. For example, a smoothing processing that has the effect of adding up pixel values within a specific window size can be used. A reduction processing may also be used, and when a reduction processing is used, the amount of data is reduced, which has the advantage of reducing the amount of scanning.
[0076] Through steps SA2 to SA4, the preprocessing circuit 30 can calculate a feature amount indicating code-likeness for each region in the preprocessed image data, and generate a feature amount image to which a brightness value according to the calculated feature amount is assigned. The feature amount image can be a so-called heat map image, which can be displayed by displaying regions with large feature amounts brighter or darker than regions with small feature amounts, and can be generated based on edge data. In other words, after performing edge detection processing on the image data to generate edge data, an edge data integration processing is performed to integrate edge data of a certain pixel and its neighboring pixels, and then the process proceeds to step SA5, where a heat map image, which is a feature amount image, is generated.
[0077] Fig. 10A is a diagram showing an example of a scanned image 200 generated by capturing an image of the workpiece W shown in Fig. 2 with the imaging unit 5. The scanned image 200 includes a first code CD1 which is a one-dimensional code and a second code CD2 which is a two-dimensional code.
[0078] FIG. 10B is a diagram showing an example of a one-dimensional code heat map image 201 to which a brightness value is assigned according to a feature (first feature) indicating the likelihood of a one-dimensional code. In the one-dimensional code heat map image 201, the brightness value of candidate areas for one-dimensional codes is high, and the brightness value of other areas (areas where no one-dimensional code exists) is low, and in FIG. 10B, white areas indicate candidate areas for one-dimensional codes, and black areas indicate other areas. In FIG. 10B, a two-dimensional code exists in the area surrounded by a white dashed line, but in the above example, the heat map image 201 is generated based on the feature of the likelihood of a one-dimensional code, so that the brightness value of areas of codes other than one-dimensional codes is low. The one-dimensional code heat map image 201 is used by the processor 40 as data for searching for one-dimensional codes.
[0079] In the above example, the heat map image 201 is generated based on the features of the one-dimensional code-likeness, but this is not limited to the above. It is also possible to calculate the features of the two-dimensional code-likeness by the pre-processing circuit 30 and generate the two-dimensional code heat map image 202 (shown in FIG. 10C) based on the features of the two-dimensional code-likeness.
[0080] FIG. 10C is a diagram showing a two-dimensional heat map image 202 to which a brightness value is assigned according to a feature (second feature) indicating the likelihood of a two-dimensional code. In the two-dimensional code heat map image 202, the brightness value of the candidate area for the two-dimensional code is high, and the brightness value of the other areas (areas where no two-dimensional code exists) is low, and in FIG. 10C, the white part indicates the candidate area for the two-dimensional code, and the black part indicates the other areas. In FIG. 10C, a one-dimensional code exists in the area surrounded by a white dashed line, but in this example, the heat map image 202 is generated based on the feature of the likelihood of a two-dimensional code, so that the brightness value of the areas of codes other than the two-dimensional code is low. The two-dimensional code heat map image 202 is used by the processor 40 as data for searching for a two-dimensional code.
[0081] 10B and 10C are shown for explanatory purposes only and are not actually displayed in the heat map images 201 and 202. If there are multiple code candidate regions, the multiple regions will be shown in the heat map image. Also, the heat map images 201 and 202 may or may not be presented to the user.
[0082] FIG. 11 is a flowchart showing a procedure for generating a one-dimensional code heat map image 201 and a two-dimensional code heat map image 202 when both a one-dimensional code and a two-dimensional code are attached to one work WK. Steps SB1 to SB3 are the same as steps SA1 to SA3 in the flowchart shown in FIG. 9. In step SB4, a one-dimensional code edge data integration process is executed. In the one-dimensional code edge data integration process, edges with the same edge direction are integrated by utilizing the shape characteristics of the one-dimensional code. For example, an edge angle image is generated, and edge angles close to each other are added, and edge angles far from each other are subtracted. In addition, a process may be executed in which image data with similar edge directions is added within a certain range of edge data, and image data with different edge directions is subtracted. Thereafter, the process proceeds to step SB6, and a one-dimensional code heat map image 201 (see FIG. 10B) is generated as described in step SA5 of the flowchart in FIG. 9.
[0083] In addition, in step SB5, a two-dimensional code edge data integration process is executed. In the two-dimensional code edge data integration process, the shape characteristics of the two-dimensional code are used to integrate edges with uneven edge directions. For example, an edge angle image is generated and those with similar edge angles are averaged. In addition, a process of adding image data with different edge directions within a certain range of edge data may be executed. Thereafter, the process proceeds to step SB7, and a two-dimensional code heat map image 202 (see FIG. 10C) is generated as described in step SA5 of the flowchart in FIG. 9. In the flowchart in FIG. 11, steps SB4 and SB6 and steps SB5 and SB7 may be performed in parallel, or one may be performed first.
[0084] 4, the processor 40 is a multi-core processor having multiple physical arithmetic processing units (cores), and acquires the feature values calculated by the pre-processing circuit 30, determines a candidate area for the code in the scanned image based on the acquired feature values, executes a decoding process for the determined area, and generates a decoding result. The generated decoding result is output by the output unit 60.
[0085] The feature amount calculated by the pre-processing circuit 30 may be acquired as the feature amount itself, or may be acquired as a feature amount image (heat map images 201, 202 shown in FIGS. 10B and 10C) generated by the pre-processing circuit 30. When acquiring a feature amount image, the processor 40 can determine a candidate region for the code based on the acquired feature amount image.
[0086] That is, the processor 40 determines the candidate area of the first code CD1 based on the one-dimensional code heat map image 201, and determines the candidate area of the second code CD2 based on the two-dimensional code heat map image 202. At this time, the processor 40 determines the areas in the one-dimensional code heat map image 201 and the two-dimensional code heat map image 202 whose brightness values are equal to or greater than a predetermined value as the candidate areas of the first code CD1 and the second code CD2, respectively, so that it is possible to accurately identify areas with large feature amounts. In this case, the processor 40 executes a decoding process for each of the determined areas to generate a decoding result.
[0087] As shown in FIG. 4, in this example, the processor 40 and the memory 31 are connected so as to be able to transmit and receive data. The memory 31 is composed of a high-speed memory such as a DDR RAM. Image data transferred from the imaging element 5a to the pre-processing circuit 30 is stored in the memory 31 via the processor 40. At this time, the processor 40 determines which address in the memory 31 the image data is to be stored in, and stores the image data in the determined address at high speed. Since the image data storage process is performed every time the imaging element 5a captures an image, a plurality of image data are stored in the memory 31. The processor 40 appropriately reads image data from the memory 31, executes a decoding process, and stores the result in the memory 31.
[0088] [Decoding process details] The processor 40 includes nine cores, CR0 to CR8. The core CR0 is a first core that commands the other cores CR1 to CR8 to decode the read image generated by the imaging unit 5. The cores CR1 to CR8 are second cores that acquire the read image commanded by the core CR0 and execute the decode process on the acquired read image. The first core that commands the decode process is the core CR0, but there are eight second cores that execute the decode process, CR1 to CR8. The number of second cores that execute the decode process is not particularly limited as long as it is two or more. When executing the decode process, the commanded read image may be transferred from the memory 31 to the cores CR1 to CR8 and the decode process may be executed on the transferred read image, or the cores CR1 to CR8 may read the commanded read image from the memory 31 and execute the decode process. The core CR0 may execute the decode process.
[0089] The core CR0 commands the cores CR1 to CR8 that are presumably capable of immediately executing a decoding process or capable of executing a decoding process next to the currently executing decoding process to perform the decoding process. The decoding process commands for the cores CR1 to CR8 are usually issued at different times, but since each of the cores CR1 to CR8 executes a decoding process, multiple decoding processes may be executed in parallel. In other words, the cores CR1 to CR8 are configured to be able to simultaneously perform decoding processes on the read images commanded by the core CR0 at different times.
[0090] The decoding process of this example will be described in detail below. Fig. 12 is a timing chart showing an example of the case where the decoding process is performed on a plurality of read images.
[0091] The imaging unit 5 captures images of the workpiece W and sequentially generates read images. In Fig. 12, C1 to C10 indicate the first to tenth read image generation processes, respectively, and as shown in this figure, the imaging unit 5 captures images in burst mode, so that the first read image generation process C1 to the tenth read image generation process C10 are executed consecutively. If the imaging interval is, for example, 30 fps, the time required for one read image generation process is approximately 33 ms.
[0092] 12, D1 to D10 indicate the first to tenth decoding processes, respectively. The time required for each decoding process is, for example, about 50 ms to 100 ms even in the case of high-speed processing, which is significantly longer than the time (about 33 ms) required for the scanning image generation process by the imaging unit 5.
[0093] When the first read image generation process C1 is completed, the core CR0 instructs the core CR1 to decode the read image generated in the first read image generation process C1. When the second read image generation process C2 is completed, the core CR0 instructs the core CR2 to decode the read image generated in the second read image generation process C2, and when the third read image generation process C3 is completed, the core CR0 instructs the core CR3 to decode the read image generated in the third read image generation process C3. In other words, when the core CR1 is instructed to decode but the cores CR2 and 3 are not instructed to decode, the cores CR2 and 3 are presumed to be cores capable of immediately executing the decode process, and in this case, the core CR0 instructs the cores CR2 and 3 to decode. The same applies to the cores CR4 to 8.
[0094] Furthermore, when the ninth read image generation process C9 is completed, the core CR0 instructs the core CR1 to decode the read image generated in the ninth read image generation process C9. Since the cores CR2 to 8 have already been instructed to decode, a certain amount of time has passed since the previous command, and it is presumed that the core CR1 is a core that can immediately execute the decode process. In this case, by instructing the core CR1 to decode, the read image generated in the ninth read image generation process C9 can be decoded. Similarly, the core CR2 is instructed to decode the read image generated in the tenth read image generation process C10. In this way, by instructing the cores CR1 to 8 to decode in order, at least two of the cores CR1 to 8 execute the decode process simultaneously.
[0095] Here, the time from when the read image generation process is completed until the core CR0 stores the read image in the memory 31 and until the cores CR1 to CR8 that have been instructed to read go to read the read image is called the transfer time.
[0096] Furthermore, since the cores CR1 to CR8 can execute the decoding process immediately after the transfer time has elapsed since the read image was generated, there is no relation with the previous and next processes, and there is no need to adjust the timing.
[0097] Furthermore, since the imaging unit 5 can continue infinite burst imaging, it can capture the code even when it is being transported at high speed, and can also record continuous images like a video.
[0098] T1 in Fig. 12 indicates the time from when the previous decoding process is completed until the next decoding process is commanded. The time T1 can be secured to be significantly longer than the time T2 required for the decoding process, in other words, a long upper limit time for the decoding process can be secured, making it possible to decode obscure codes. The upper limit time for the decoding process is the timeout time for the decoding process. If the decoding process becomes too long during operation of the optical reading device 1 and reaches a preset upper limit time, a timeout time is set to abort the decoding process.
[0099] FIG. 13 is a conceptual diagram of a case where a plurality of scanned images (first to third scanned images) are processed in parallel by a plurality of threads (threads 1 and 2) in a plurality of cores CR1 to CR3. As shown in this example, when a one-dimensional code and a two-dimensional code are included in the first scanned image, in the core CR1 that performs the decoding process on the first scanned image, the thread 1 is used to decode the one-dimensional code, and the thread 2 is used to decode the two-dimensional code. Similarly, in the core CR2, the thread 1 is used to decode the one-dimensional code included in the second scanned image, and the thread 2 is used to decode the two-dimensional code included in the second scanned image. In addition, in the core CR3, the thread 1 is used to decode the one-dimensional code included in the third scanned image, and the thread 2 is used to decode the two-dimensional code included in the third scanned image. Even when a plurality of one-dimensional codes or a plurality of two-dimensional codes are attached, it is possible to command different cores to perform the decoding process.
[0100] The number of threads in each of the cores CR1 to 3 is not limited to two, and may be one, or three or more. When only a one-dimensional code or only a two-dimensional code is attached to the workpiece W, each of the cores CR1 to 3 has one thread.
[0101] 14, core CR0 can also instruct core CR1 to execute thread 1 for decoding the one-dimensional code included in the first scanned image, and core CR2 to execute thread 1 for decoding the two-dimensional code included in the first scanned image. Similarly, for the second scanned image, core CR0 instructs core CR3 to execute the one-dimensional code decoding process, and core CR4 to execute the two-dimensional code decoding process.
[0102] 15 is a flowchart for instructing a core that has completed a decoding process to perform the next decoding process, and the core CR0 determines the order of allocation of the decoding processes to the cores CR1 to CR8 in a FIFO (First in First Out) manner. This flowchart starts when the optical reader 1 receives a reading start trigger signal and ends when an operation to stop operation is performed.
[0103] After starting, in step SC1, the imaging unit 5 captures the workpiece W and sequentially generates a plurality of read images. In step SC2, the core CR0 judges whether or not there is free space in the cores CR1 to 8. Free means that the decoding process is not being performed and that the decoding process can be performed immediately. If the result of the judgment in step SC2 is YES and there is a free core among the cores CR1 to 8, the process proceeds to step SC4. In step SC4, the core CR0 commands the free core to perform the decoding process, so that the free core immediately executes the decoding process, and then the process returns to step SC1. On the other hand, if the result of the judgment in step SC2 is NO and there is no free core among the cores CR1 to 8, the process proceeds to step SC3 and waits for a core to become free for a predetermined time, and then proceeds to step SC2. If there is a free core, the process proceeds to step SC4.
[0104] A specific example of a case where allocation of decoding processes is determined by FIFO will be described with reference to Fig. 16. Fig. 16 illustrates a case where cores CR1 to CR3 are provided. The numbers shown in the queue status column are the numbers of available cores, with core CR1 corresponding to "1", core CR2 corresponding to "2", and core CR3 corresponding to "3".
[0105] Initially, the queue status is such that all cores CR1 to CR3 are free, so numbers 1 to 3 are stacked. After that, when core CR1 is instructed to decode the read image of the first read image generation process C1, the queue status changes so that number 1 disappears and numbers 2 and 3 are stacked. Therefore, core CR0 can instruct core CR2 to decode the read image of the second read image generation process C2. Similarly, core CR0 can instruct core CR3 to decode the read image of the third read image generation process C3.
[0106] When the fourth read image generation process C4 is completed, only number 1 remains in the queue, so core CR0 commands core CR1 to decode the read image of the fifth read image generation process C5. In this way, core CR0 determines the availability of cores CR1 to 3 and commands the available core to perform the decoding process, making it easier to achieve high-speed reading at regular intervals compared to simply allocating the decoding processes to cores CR1 to 3 in order.
[0107] [Configuration of Tuning Execution Unit 24] The tuning execution unit 24 shown in FIG. 3 is a unit that changes imaging conditions such as gain, the light amount of the illumination unit 4, exposure time, and image processing conditions in the processing unit 23. The image processing conditions in the processing unit 23 include coefficients of image processing filters (strength of the filter), switching of image processing filters when there are multiple image processing filters, and combinations of different types of image processing filters. Appropriate imaging conditions and image processing conditions vary depending on the influence of external light on the workpiece W during transportation, the color and material of the surface to which the codes CD1 and CD2 are attached, and the like. Therefore, the tuning execution unit 24 searches for more appropriate imaging conditions and image processing conditions, and sets the processing by the AF control unit 21, the imaging control unit 22, and the processing unit 23. Various types of well-known filters can be used as image processing filters.
[0108] Before operating the optical reader 1, the optical reader 1 is set up as a preparation stage for operation. When setting up the optical reader 1, various settings are made by sending various setting commands from the computer 100 connected to the optical reader 1 via the signal line 101a. During this setting, tuning is performed by the tuning execution unit 24. A specific example of tuning will be described with reference to FIG. 17. After tuning starts, in step SD1, the codes CD1 and CD2 attached to the work W are imaged by the imaging unit 5 to generate a read image.
[0109] Then, the process proceeds to step SD2, where the codes CD1, CD2 included in the generated read image are searched for and decoded by the processing unit 23, and the processing unit 23 analyzes the reading margin indicating the ease of reading the codes CD1, CD2 that have been successfully decoded. Thereafter, the process proceeds to step SD3, where the tuning execution unit 24 changes the imaging conditions, sets the suitability of the image processing filter, and sets the strength of the image processing filter to be applied so that the reading margin analyzed by the processing unit 23 is increased.
[0110] In step SD4, the time required for the decoding process is measured. In step SD5, it is determined whether the decoding process time is within the shortest imaging interval decoding time. The shortest imaging interval decoding time is a time (reference time) obtained by multiplying the time taken to generate and transfer a scanned image by the imaging unit 5 by the number of cores CR1 to 8. For example, if A is the time taken to generate a scanned image by the imaging unit 5, B is the time taken for core CR0 to store the generated scanned image in memory 31 and for cores CR1 to CR8 to read it (transfer time), and C is the number of cores CR1 to 8, then the time calculated by the following formula is the shortest imaging interval decoding time.
[0111] Fastest image interval decode time = (A+B) x C If the determination in step SD5 is YES and the decoding processing time measured in step SD4 is within the shortest imaging interval decoding time, the process proceeds to step SD6, where the decoding processing time measured in step SD4 is set as the upper limit time for the decoding processing. That is, when setting up the optical reader 1, the tuning execution unit 24 generates a read image including a code using the imaging unit 5, executes a decoding process on the generated read image using the processing unit 23, measures the time required for the decoding process, and automatically sets the upper limit time for the decoding process based on the measurement result. The upper limit time for the decoding process can also be automatically set to a time shorter than the shortest imaging interval decoding time.
[0112] On the other hand, if the result of the determination in step SD5 is NO, meaning that the decoding time measured in step SD4 exceeds the shortest imaging interval decoding time, the measurement result is set as the upper limit time for the decoding process, and the process proceeds to step SD7, where the fixed interval imaging mode is set. The fixed interval imaging mode will be described later.
[0113] After steps SD6 and SD7, the process proceeds to step SD8, where the setting conditions are stored. The setting conditions can be stored in the form of a bank as shown in FIG.
[0114] 18 is a timing chart of the fixed interval imaging mode. In this figure, the core CR0 is omitted, but the instruction for the decoding process is executed by the core CR0. Also, although an example having the cores CR1 to CR3 is shown, the number of cores is not important.
[0115] The fixed interval imaging mode is a mode that is selected when the above-mentioned tuning results in that burst imaging is not suitable. In the fixed interval imaging mode, the imaging unit 5 captures images intermittently as shown by C1 to C5 in FIG. 18. Therefore, for example, even if the first read image generation process C1 is completed, the second read image generation process C2 is not started immediately, but is started after a predetermined time interval. When the first read image generation process C1 is completed, the core CR0 commands the core CR1 to decode the read image generated in the first read image generation process C1. The second and subsequent read images are also decoded sequentially.
[0116] This fixed interval imaging mode is applied when it is necessary to extend the time for the decoding process for one read image, so the imaging interval becomes wider, but since the interval is fixed to a predetermined time interval, the imaging interval does not change and the workpiece W does not pass by during imaging.
[0117] On the other hand, FIG. 19 is a timing chart when imaging is not performed at fixed intervals. This example also has cores CR1 to CR3. The read images generated in the first to third read image generation processes C1 to C3 are decoded by the cores CR1 to CR3, respectively. However, since the decoding time in the cores CR1 to CR3 is long, even when the fourth read image generation process C4 is completed, there may be no core capable of decoding the read image generated in that process. Therefore, the core CR1 waits for the decoding process of the core CR1 to be completed, and then decodes the read image generated in the fourth read image generation process C4. In this case, a time interval occurs between the completion of the fourth read image generation process C4 and the start of the fifth read image generation process C5.
[0118] In other words, as shown in the flowchart of Figure 20, the optical reading device 1 starts when it receives a reading start trigger signal, and after starting, generates a read image in step SE1, and then determines in step SE2 whether there is an available core.If there is an available core, the process proceeds to step SE3 and commands the available core to perform a decoding process, whereas if there is no available core, the process proceeds to step SE4 to wait for an available core and then commands the available core to perform a decoding process.
[0119] Also, if there is no free space in the core, the image data can be temporarily stored in the buffer. That is, as shown in the flowchart of FIG. 21, the optical reader 1 starts at the timing when it receives a read start trigger signal, and after starting, in step SF1, it generates a read image, and in step SF2, it is determined whether there is free space in the core, and if there is a free core, it proceeds to step SF3 to command the free core to perform a decode process. On the other hand, if there is no free core, it proceeds to step SF4 to determine whether there is free space in the buffer, and if there is free space in the buffer, it proceeds to step SF5 to temporarily store the image data in the buffer. If there is no free space in the buffer, it proceeds to step SF6 to wait for the buffer or the core to become free, and if the buffer becomes free, it stores the image data there, and if the core becomes free, it commands the core to perform a decode process.
[0120] Since the buffer capacity is limited, it is conceivable that there will eventually be a gap between image generation processes. If the gap between image generation processes becomes long, the workpiece W may pass by during that time, so the fixed interval imaging mode is preferable, but in some cases, an operation mode such as that shown in the timing chart of FIG. 19 is also possible.
[0121] Also, when the decoding process of one of the cores that executes the decoding process is completed, all the decoding processes of the other cores can be terminated. Fig. 22 shows a case where the decoding process D4 of the read image generated in the fourth read image generation process C4 is completed in the core CR1, and when this decoding process is completed, the decoding process D5 of the read image generated in the fifth read image generation process C5 that is being executed in the core CR2 is stopped, and the decoding process D6 of the read image generated in the sixth read image generation process C6 is not executed. At the same time as or after the decoding process D5 is stopped, the decoded result by the decoding process D4 is output.
[0122] That is, when multiple cores CR1 to CR3 decode the scanned image, the timing of completing the decoding process is usually different. For example, the decoded result is obtained when the decoding process is completed by core CR1, so there is no point in continuing the decoding process by other cores CR2 and CR3 after that. In such a case, the decoding process of cores CR2 and CR3 can be stopped.
[0123] Specifically, the start timing of the flowchart in FIG. 23 is the timing when the optical reader 1 receives a read start trigger signal. After starting, a read image is generated in step SG1, and then it is determined in step SG2 whether or not there is an available core. If there is an available core, the process proceeds to step SG3 to command the available core to perform a decode process. If there is no available core, the process proceeds to step SG4 to wait a predetermined time for a core to become available, and then returns to the start. In step SG5, it is determined whether the decode process has been completed in any core. If the decode process has not been completed in any core, the process returns to the start, whereas if it has been completed, the process proceeds to step SG6 to end the decode process in all cores. This allows the process to be put into a standby state in preparation for receiving the next read start trigger signal.
[0124] 24 is a timing chart for decoding a plurality of read images generated by changing the brightness of the illumination unit 4. The brightness of the illumination unit 4 is set to "10" in the first, third, and fifth read image generation processes C1, C3, and C5, and the brightness of the illumination unit 4 is set to "20" in the second, fourth, and sixth read image generation processes C2, C4, and C6. The brightness "20" is brighter than "10." In other words, the imaging unit 5 captures the workpiece W under different imaging conditions to generate a first read image (the read image generated in the first, third, and fifth read image generation processes C1, C3, and C5) and a second read image (the read image generated in the second, fourth, and sixth read image generation processes C2, C4, and C6).
[0125] The core CR0 causes the different cores CR1 and CR2 to decode the scanned image generated in the first scanned image generation process C1, which has different imaging conditions, and the scanned image generated in the second scanned image generation process C2. The core CR0 also causes the different cores CR3 and CR1 to decode the scanned image generated in the third scanned image generation process C3, which has different imaging conditions, and the scanned image generated in the fourth scanned image generation process C4.
[0126] FIG. 25 is a timing chart when different cores decode different types of codes (one-dimensional code, two-dimensional code) contained in multiple read images generated by changing the brightness of the illumination unit 4. This example assumes that, for example, a one-dimensional code (CODE128) and a two-dimensional code (QR) are attached to the work W, and the two-dimensional code is farther away than the one-dimensional code. In this case, the brightness of the illumination unit 4 is set to "10", and the first, third, and fifth read image generation processes C1, C3, and C5 are executed as a brightness suitable for imaging a relatively close one-dimensional code. On the other hand, the brightness of the illumination unit 4 is set to "20" as a brightness suitable for imaging a relatively distant two-dimensional code, and the second, fourth, and sixth read image generation processes C2, C4, and C6 are executed. At this time, the first, third, and fifth read image generation processes C1, C3, and C5 may be executed according to the imaging parameters of the bank 1 shown in FIG. 8, and the second, fourth, and sixth read image generation processes C2, C4, and C6 may be executed according to the imaging parameters of the bank 2.
[0127] Core CR0 causes cores CR1 and CR2 to decode the scanned image generated in the first scanned image generation process C1, which has different imaging conditions, and the scanned image generated in the second scanned image generation process C2, respectively, and core CR1 performs one-dimensional code decoding processing, and core CR2 performs two-dimensional code decoding processing. Core CR0 also causes cores CR3 and CR1 to decode the scanned image generated in the third scanned image generation process C3, which has different imaging conditions, and the scanned image generated in the fourth scanned image generation process C4, respectively, and core CR3 performs one-dimensional code decoding processing, and core CR1 performs two-dimensional code decoding processing.
[0128] Similarly to the case where the imaging conditions are different, the imaging unit 5 can also image the workpiece W under different decoding conditions to generate a first read image and a second read image. In this case, the core CR0 can also instruct different cores to decode the first read image and the second read image generated under different decoding conditions.
[0129] [Operation of Optical Reading Device 1] FIG. 26 shows the process when the optical reader 1 is in operation. When the optical reader 1 is in operation, step SH1 is started when a reading start trigger signal is received. In step SH1, the imaging unit 5 images the workpiece W. In step SH2, a read image is generated from the image data obtained by imaging in step SH1 and output to the pre-processing circuit 30. At this time, the image data for each line is input to the pre-processing circuit 30. Note that instead of the image data for each line, the image data for multiple lines or all of the image data constituting one read image may be input to the pre-processing circuit 30.
[0130] In step SH3, the preprocessing circuit 30 performs preprocessing such as tone conversion and various image filter processes on the image data, and in step SH4 generates a preprocessed image. Then, the process proceeds to step SH5, where a feature value indicating chord-likeness is calculated for each region in the preprocessed image data based on the luminance value of each pixel in the preprocessed image data, and a heat map image (data for chord search) shown in Figures 10B and 10C is generated by assigning a luminance value according to the calculated feature value. In this process, edge data is generated, edge data integration process, etc. are executed. After the data for chord search is generated, the process proceeds to step SH6, where the data for chord search is output to the processor 40.
[0131] In step SH7, the processor 40 executes a code search process using the code search data. That is, when the code search data is a heat map image shown in Fig. 10B or 10C, an area with a high brightness value corresponds to a candidate area for a code, so the processor 40 searches for an area with a high brightness value in the heat map image.
[0132] In step SH8, a candidate area for the code is determined. Then, the process proceeds to step SH9, where the core CR0 of the processor 40 commands the cores CR1 to CR8 to perform a decoding process. After the decoding process, in step SH10, the decoding result is acquired and output to the external device.
[0133] [User interface image] 27 is a diagram showing an example of a user interface image 300, and shows a case where a reading tab 301 is selected from among a plurality of tabs 301, 302, and 303. The user interface image 300 is provided with a read image display area 304 that displays a read image captured by the imaging unit 5, and a tuning result display area 305 that displays a tuning result. In the tuning result display area 305, a graph showing, for example, the relationship between readability and brightness is displayed.
[0134] [Effects of the embodiment] As described above, according to this embodiment, while capturing image data line by line from the imaging unit 5, feature amounts indicating the likelihood of a code are calculated, a candidate area for the code is determined based on these feature amounts, and the determined area is decoded, so there is no need to wait until scanning of the entire image is complete when searching for a code, and it is possible to capture image data from the imaging unit 5, calculate feature amounts, and determine candidate areas for the code in parallel. This makes it possible to speed up the output timing of the decoded result even if the size of the read image is large.
[0135] Moreover, the decoding process can be executed simultaneously by multiple cores among the cores CR1 to CR8. In other words, multiple cores can simultaneously decode the scanned images commanded at different times, so that the decoding process of multiple scanned images can be accelerated while ensuring sufficient decoding process time for one scanned image and enabling stable reading. This allows the scanning results to be obtained quickly and can be output immediately after the scanned image is generated.
[0136] The above-described embodiment is merely illustrative in all respects and should not be construed as limiting. Furthermore, all modifications and variations within the scope of the claims are within the scope of the present invention. [Industrial Applicability]
[0137] As described above, the optical reading device according to the present invention can be used when reading codes such as bar codes and two-dimensional codes attached to a workpiece, for example. [Explanation of symbols]
[0138] 1 Optical reading device 4. Lighting section 5. Imaging unit 23 Processing section 24 Tuning Execution Department 30 Pre-processing circuit 40 processors 43 Input section (reception section) 50 Storage device (storage unit) 60 Output section CD1 1st code (1D code) CD2 Second code (2D code) CR0 core (first core) CR1~8 core (second core) W work
Claims
1. An optical reader for reading a code attached to a workpiece, comprising: An illumination unit for irradiating light toward the workpiece; an imaging unit for receiving light irradiated from the illumination unit and reflected from the workpiece, generating a read image of the workpiece, and transmitting the read image line by line; a pre-processing circuit including: a first circuit that calculates a feature amount indicating a code-likeness of each area in the image data based on a luminance value of each pixel in the image data each time the image data of a predetermined number of lines is captured from the imaging unit; and a second circuit that is provided in parallel with the first circuit and transfers the read image transmitted from the imaging unit; a processor that determines a candidate area of the code in the scanned image based on the feature amount calculated by the first circuit, executes a decoding process for the determined area, and generates a decoding result; and an output section for outputting the decoded result generated by the processor.
2. 2. The optical reading device according to claim 1, the first circuit of the pre-processing circuit calculates a first feature amount indicating a likelihood of a first chord and a second feature amount indicating a likelihood of a second chord; The processor determines a candidate area of the first code based on the first feature generated by the first circuit of the preprocessing circuit, determines a candidate area of the second code based on the second feature, executes a decoding process for each of the determined areas, and generates a decoding result.
3. 3. The optical reading device according to claim 2, The processor has a plurality of cores each for acquiring the first feature amount and the second feature amount, and each core executes a decoding process.
4. 3. The optical reading device according to claim 2, An optical reading device in which the calculation of the second feature by the first circuit of the preprocessing circuit and the determination of the candidate area of the first code based on the first feature by the processor are executed in parallel.
5. 3. The optical reading device according to claim 2, The processor has a plurality of cores for executing a code decoding process; each of the plurality of cores includes a first decoding processing unit that acquires the first feature amount and a second decoding processing unit that acquires the second feature amount; the first decoding processing unit executes a decoding process of the first code based on the first feature amount; The second decoding processing unit executes a decoding process of the second code based on the second feature amount.
6. 6. An optical reading device according to claim 2, An optical reader, wherein the first code is a one-dimensional code and the second code is a two-dimensional code.
7. 7. An optical reading device according to claim 1, The first circuit of the pre-processing circuit is an optical reading device that performs edge detection processing on the image data captured from the imaging unit to generate edge data, and then calculates the feature amount based on the edge data.
8. 8. The optical reading device according to claim 7, The first circuit of the pre-processing circuit generates the edge data, then performs an edge data integration process to integrate edge data of a certain pixel and its neighboring edges, and then calculates the feature amount.
9. 9. The optical reading device according to claim 8, The first circuit of the preprocessing circuit is an optical reading device that performs the edge data integration process before calculating a feature amount indicating the likelihood of a one-dimensional code, by adding luminance values of pixels having approximately the same edge direction within a certain range and subtracting pixel values of pixels having different edge directions.
10. 10. The optical reading device according to claim 8, The first circuit of the pre-processing circuit is an optical reading device that performs the edge data integration process by adding up pixel values of pixels with different edge directions within a certain range before calculating a feature amount indicating a two-dimensional code-like nature.
11. 11. An optical reading device according to claim 1, The pre-processing circuit is an optical reading device that executes at least one of tone conversion processing and filtering processing before calculating a feature amount indicating code-likeness.
12. An optical reading device according to any one of claims 1 to 11, The optical reading device is a stationary optical reading device that reads a code attached to a workpiece being transported, or an optical reading device that reads a code attached to a workpiece that is stationary and held by a user.
13. An optical reader for reading a code attached to a workpiece, comprising: An illumination unit for irradiating light toward the workpiece; an imaging unit for receiving light irradiated from the illumination unit and reflected from the workpiece, generating a read image of the workpiece, and transmitting the read image line by line; a pre-processing circuit for calculating, in parallel with the transfer of image data each time image data of a predetermined number of lines is captured from the imaging unit, a feature amount that indicates a code-likeness for each region in the image data based on a luminance value of each pixel in the image data; a processor that determines a candidate area of the code in the scanned image based on the feature amount calculated by the preprocessing circuit, executes a decoding process for the determined area, and generates a decoded result; and an output section for outputting the decoded result generated by the processor.
Citation Information
Patent Citations
Optical information reader
JP2012064178A
Optical information reading device
JP2014059712A
Optical information reader
JP2018136858A
Optical information reader
JP2018136860A
Optical information reader and optical information reading method
JP2019071018A
