Electronic device, code reading method, and program

By capturing barcodes under varying lighting conditions and comparing decoding results, the system addresses misreading issues in barcode scanners, achieving accurate and efficient barcode reading.

JP2026053035APending Publication Date: 2026-03-25CASIO COMPUTER CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2026-03-25

AI Technical Summary

Technical Problem

Existing barcode reading systems face high misreading possibilities when auxiliary lighting is turned on due to incorrect imaging conditions, especially in varying ambient brightness, leading to inaccurate barcode decoding.

Method used

The system employs an imaging unit that captures barcodes under both illuminated and non-illuminated conditions, comparing decoding results to ensure accuracy by alternating imaging conditions until a match is found, thereby updating and overwriting results until a consistent reading is achieved.

Benefits of technology

This approach enhances barcode reading accuracy and efficiency by ensuring that decoding results from different lighting conditions match, reducing errors and improving overall reading performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026053035000001_ABST
    Figure 2026053035000001_ABST
Patent Text Reader

Abstract

This enables more efficient barcode reading. [Solution] The decoded result "A" of the barcode of image a1, which is captured with auxiliary light illumination, is obtained. Next, the decoded result "B" of the barcode of image b, which is captured without auxiliary light illumination, is obtained. If the decoded result "A" and the decoded result "B" match, the reading result is output. If the decoded results "A" and "B" do not match, the decoded result "C" of the barcode of image a2, which is captured again with auxiliary light illumination, is obtained and overwritten as the decoded result "A". If the decoded result "A (=C)" of the barcode read again matches the decoded result "B", the reading result is output. If both do not match, imaging under the first imaging condition and the second imaging condition is repeated alternately, and each time the decoded results of both are compared, the reading result is output when they match.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an electronic device, a code reading method, and a program.

Background Art

[0002] There is known a code reading device that turns on and off auxiliary lighting according to the ambient brightness, images a barcode or a two-dimensional code (hereinafter collectively referred to as a barcode), and decodes the barcode in the captured image (see, for example, Patent Document 1).

Prior Art Documents

Patent Documents

[0003]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0004] However, when it is determined that a barcode cannot be read in imaging with the auxiliary lighting turned off because the surrounding environment is dark, the technique is to turn on the auxiliary lighting and perform imaging. Even if the auxiliary lighting is turned on, the barcode that is read is not necessarily correct, and there is a problem that the possibility of misreading the barcode becomes high.

[0005] Therefore, an object of the present invention is to read a barcode more accurately.

Means for Solving the Problems

[0006] The electronic device according to this invention is characterized by comprising: an imaging unit that captures an image of an optically readable code; a light source for irradiating the code with light; a setting unit that sets imaging conditions including a first imaging condition in which the code is irradiated with light by the light source and a second imaging condition in which the code is not irradiated with light by the light source; an acquisition unit that acquires a first reading result of the code in an image captured by the imaging unit under the first imaging condition and a second reading result of the code in an image captured by the imaging unit under the second imaging condition; and a control unit that, if the first reading result and the second reading result do not match, performs either a first comparison process that causes the image to be re-imaged under the first imaging condition and compares the third reading result of the code in the re-acquired image with the second reading result, or a second comparison process that causes the image to be re-imaged under the second imaging condition and compares the third reading result of the code in the re-acquired image with the first reading result, based on predetermined conditions. [Effects of the Invention]

[0007] This invention allows for more accurate reading of barcodes. [Brief explanation of the drawing]

[0008] [Figure 1] This is an external view showing the configuration of an electronic device (barcode scanner) according to the first embodiment of the present invention. [Figure 2] This is a perspective view showing the usage of the electronic device according to this first embodiment. [Figure 3] This is a block diagram showing the configuration of the electronic device according to the first embodiment. [Figure 4] This is a flowchart illustrating the operation of the electronic device according to this first embodiment. [Figure 5] This is a sequence diagram illustrating the operation of the electronic device according to this first embodiment. [Figure 6] This is a sequence diagram illustrating the operation of an electronic device according to a second embodiment of the present invention. [Figure 7]This is a sequence diagram illustrating the operation of an electronic device according to a third embodiment of the present invention. [Figure 8] This is a sequence diagram illustrating the operation of an electronic device according to the fourth embodiment of the present invention. [Modes for carrying out the invention]

[0009] The electronic device (barcode scanner) in this invention will be described with reference to Figures 1 and 2. The barcode scanner 1 is a portable electronic device used, for example, by logistics companies and other organizations. The barcode scanner 1 has a scanning function that reads barcodes and 2D codes attached to products, shelves, etc. As shown in Figure 1, the barcode scanner 1 includes a display unit 2 and an input unit 3. The display unit 2 consists of an LCD (Liquid Crystal Display) or an organic EL (Electro-Luminescence) display, etc., and displays various information. The input unit 3 is equipped with various keys necessary for inputting and operating information, such as character keys, cursor keys, and function keys.

[0010] Furthermore, as shown in Figure 2, the barcode scanner 1 has a shape that can be grasped by a user with one hand, and a trigger key 31 that accepts a scan trigger input is provided in a position that is easy to operate (push) with the index finger of the hand holding the scanner. In addition, a convex barcode reading unit 4 is provided on the back side of the barcode scanner 1, and by pointing the barcode scanner 1 at the barcode of the product and pressing the trigger key 31, the barcode reading unit 4 can read the product's barcode.

[0011] The barcode reading unit 4 is equipped with an aimer output unit 5, an imaging unit 6, and an auxiliary light output unit (light source) 7. The aimer output unit 5 emits laser light to allow the user to visually confirm that the barcode reading unit 4 is correctly aimed at the barcode. The imaging unit 6 consists of a CMOS sensor or the like, and when the trigger key 31 is pressed, it images and reads the product's barcode. The auxiliary light output unit 7 consists of an LED (Light Emitting Diode) or the like, and illuminates the barcode to be imaged with light.

[0012] As shown in Figure 3, the barcode scanner 1 of the present invention includes, in addition to the display unit 2, input unit 3, and barcode reading unit 4 equipped with an aimer output unit 5, imaging unit 6, and auxiliary light output unit 7, a CPU (Central Processing Unit) 10, ROM (Read Only Memory) 11, RAM (Random Access Memory) 12, wireless communication unit 13, and output unit 14. The CPU 10 controls each part of the barcode scanner 1 according to the system program and application program stored in the ROM 11. In this first embodiment, the CPU 10 controls the operation of the imaging unit 6 and the auxiliary light output unit 7. More specifically, the CPU 10 has a function (setting unit) to set imaging conditions including a first imaging condition in which the barcode is illuminated with auxiliary light by the auxiliary light output unit 7, and a second imaging condition in which the barcode is not illuminated with auxiliary light by the auxiliary light output unit 7. Furthermore, the CPU 10 has a function (acquisition unit) to acquire the decoding result (first reading result) of the barcode in the image captured by the imaging unit 6 under the first imaging condition and the decoding result (second reading result) of the barcode in the image captured by the imaging unit 6 under the second imaging condition. The CPU 10 also has a function to store the first reading result and the second reading result in the RAM 12 (storage unit). Furthermore, if the first reading result with auxiliary light illumination and the second reading result without auxiliary light illumination do not match, the CPU 10 has a function (control unit) to re-capture the image under the first imaging condition, overwrite (update) the first reading result with the decoding result (third reading result) of the barcode in the re-captured image, and compare the updated first reading result (= third reading result) with the decoding result (second reading result) from the previous second imaging condition. Furthermore, the CPU 10 has a function (control unit) that outputs a reading result when the first reading result (or third reading result) and the second reading result match.

[0013] ROM 11 stores system programs and application programs. RAM 12 is volatile memory and is used as a work area to temporarily store various data and programs. The wireless communication unit 13 performs data communication with the communication partner's device using wireless communication methods such as WLAN (Wireless LAN) and WAN (Wide Area Network). The output unit 14 consists of LEDs and a speaker, and controls the LEDs to turn on / off and outputs sound through the speaker according to the control of the CPU 10.

[0014] In this first embodiment, if the decoding result of a barcode captured by the imaging unit 6 with auxiliary light illumination from the auxiliary light output unit 7 matches the decoding result of a barcode captured by the imaging unit 6 without auxiliary light illumination from the auxiliary light output unit 7, the decoding result (reading result) is output. On the other hand, if the two do not match, the system alternates between capturing images with auxiliary light illumination (on) and capturing images without auxiliary light illumination (off), updating (overwriting) the first reading result and the second reading result each time, comparing the decoding results of both, and repeating until the decoding results of both match.

[0015] The CPU 10 performs the barcode reading operation according to the flowchart shown in Figure 4. When the trigger key 31 is pressed (step S10), the CPU 10 lights up the auxiliary light output unit 7 and captures the barcode with the imaging unit 6 with the auxiliary light illuminating (step S12). In other words, the CPU 10 sets the first imaging conditions in response to the press of the trigger key 31 and causes the imaging unit 6 to capture the barcode under the set first imaging conditions. Next, the CPU 10 determines whether the imaging was successful, that is, whether the image was correctly captured by the imaging unit 6 (step S14). Here, determining whether the image was correctly captured means determining whether the captured image has excessive overexposure, underexposure, or blurring (unclearness) of the barcode.

[0016] And when the CPU 10 determines that the imaging of the image has not been successful, that is, when it determines that the image has not been captured correctly (NO in step S14), it returns to step S12, adjusts the imaging conditions, and repeatedly captures the barcode again with the imaging unit 6 with auxiliary light irradiation by the auxiliary light output unit 7 until the imaging is successful (exposure adjustment x in FIG. 5). The imaging conditions include the aperture, shutter speed, gain, etc. in the imaging unit 6.

[0017] Generally, in the first (the first) imaging, since environmental conditions such as the ambient brightness and the distance to the barcode are unknown, the exposure (brightness) of the captured image often does not match, and images with overexposure, underexposure, and blurring (unclarity) of the barcode are often captured. Therefore, based on the exposure of the first image, the exposure (aperture, shutter speed, gain, etc.) is adjusted and finely adjusted for the second, third, fourth,... images, and a plurality of images are captured. Finally, an image with overexposure, underexposure, and blurring (unclarity) of the barcode below a predetermined threshold is obtained. When the CPU 10 determines that the imaging has been successful, that is, when it determines that the image has been captured correctly (YES in step S14), as shown in FIG. 5, it decodes the barcode of the captured image a1 and stores it in the RAM 12 as the decoding result "A" (the first reading result) (step S16). Note that since the imaging unit 6 performs barcode reading (imaging) at 60 fps, it takes about 10 to 20 images, that is, about 3 to 6 fps, until the barcode reading is successful.

[0018] Next, the CPU 10 turns off the auxiliary light output unit 7 and captures the barcode by the imaging unit 6 without irradiating the auxiliary light (step S18). In other words, when the imaging of the barcode under the first imaging condition is successful, the CPU 10 sets the second imaging condition and causes the imaging unit 6 to capture the barcode under the set second imaging condition. Next, the CPU 10 determines whether the imaging is successful, that is, whether an image is correctly captured by the imaging unit 6 (step S20). And when the imaging is not successful, that is, when it is determined that the image is not correctly captured (NO in step S20), the CPU 10 returns to step S18, adjusts the imaging conditions, and repeatedly captures the barcode by the imaging unit 6 again without irradiating the auxiliary light by the auxiliary light output unit 7 until the imaging is successful (exposure adjustment y in FIG. 5).

[0019] When the imaging is successful, that is, when it is determined that the captured image is correctly captured (YES in step S20), as shown in FIG. 5, the CPU 10 decodes the barcode of the captured image b and stores it in the RAM 12 as the decoding result "B" (the second reading result) (step S22). As described above, since the imaging unit 6 executes barcode reading (imaging) at 60 fps, even when imaging is performed under the second imaging condition without irradiating the auxiliary light by turning off the auxiliary light output unit 7, it takes about 10 to 20 images, that is, about 3 to 6 fps, until the barcode reading is successful. In other words, the switching between the first imaging condition with auxiliary light irradiation and the second imaging condition without auxiliary light irradiation is switched at a cycle of about 10 to 20 images, that is, about 3 to 6 fps.

[0020] Next, the CPU 10 determines whether the decoding result "A" and the decoding result "B" match (step S24). The fact that the decoding results "A" and "B" of the barcode obtained under different imaging conditions match may be determined as having a high possibility of correctly reading the barcode. Therefore, when the decoding results "A" and "B" match (YES in step S24), the CPU 10 outputs the decoding result "A" or "B" as the reading result (step S34). Specifically, the CPU 10 displays the reading result on the display unit 2.

[0021] On the other hand, if the decoded results "A" and "B" do not match (NO in step S24), the CPU 10 turns on the auxiliary light output unit 7 and captures the barcode with the imaging unit 6 with the auxiliary light illuminating (step S26). Next, the CPU 10 determines whether the imaging was successful, that is, whether the image was correctly captured by the imaging unit 6 (step S28). If the CPU 10 determines that the imaging was not successful, that is, that the image was not correctly captured (NO in step S28), it returns to step S26, adjusts the imaging conditions, and captures the barcode again with the imaging unit 6 with the auxiliary light illuminating from the auxiliary light output unit 7 (first imaging condition), repeating this until the imaging is successful (exposure adjustment z in Figure 5). At this time, the imaging unit 6 adjusts the exposure based on the imaging conditions when imaging was previously performed with the auxiliary light illuminating (step S12), thereby shortening the time required for exposure adjustment z during re-imaging. More specifically, if the imaging conditions in step S12 are not referenced, as mentioned above, the first image often captures an overexposed image, requiring exposure adjustment. However, when adjusting the exposure based on the imaging conditions in step S12, this problem is less likely to occur, thus reducing the time required for exposure adjustment z during re-imaging.

[0022] If the CPU 10 determines that the image capture was successful, that is, that the image was captured correctly (YES in step S28), it decodes the barcode of the read image a2, as shown in Figure 5, and stores the decoded result "C" (third reading result) in RAM 12 as decoded result "A" (step S16). In other words, it overwrites (updates) the previous decoded result "A" with decoded result "C".

[0023] Next, the CPU 10 determines whether the decoded result "A(=C)" of the barcode read again matches the decoded result "B" (step S32). If the decoded results "A(=C)" and "B" match (YES in step S32), the CPU 10 outputs either the decoded result "A(=C)" or "B" as the reading result (step S34). Specifically, the CPU 10 displays the reading result on the display unit 2.

[0024] On the other hand, if the decoded results "A (=C)" and "B" do not match (NO in step S32), the CPU 10 proceeds to step S18 and beyond, turns off the auxiliary light output unit 7, and re-images the barcode with the imaging unit 6 without auxiliary light illumination (step S18). At this time, the imaging unit 6 adjusts the exposure based on the imaging conditions when it was previously captured without auxiliary light illumination (first step S18), thereby shortening the time required for exposure adjustment during re-image. The CPU 10 also stores (overwrites) the decoded result "D" for the barcode of the captured image as decoded result "B" in RAM 12 (step S22), and determines whether the decoded result "A (=C)" and the decoded result "B (=D)" match (step S24). Then, if the decoded result "A (=C)" and the decoded result "B (=D)" match (YES in step S24), the CPU 10 outputs either the decoded result "A (=C)" or "B (=D)" as the read result (step S34).

[0025] On the other hand, if the decoded result "A (=C)" and the decoded result "B (=D)" do not match (NO in step S24), the steps from S26 onwards described above are repeated. That is, if the two do not match, the system alternately updates (overwrites) the decoded result "A" and the decoded result "B" by repeatedly performing on-camera imaging under the first imaging condition with auxiliary light illumination and off-camera imaging under the second imaging condition without auxiliary light illumination. Each time, it is determined whether the two decoded results match, and the reading result is output when they match. In the above process, even if the decoded result "A" with auxiliary light illumination and the decoded result "B" without auxiliary light illumination do not match and the reading process is repeated, an error is displayed and the reading process is terminated when the preset time limit is reached.

[0026] According to the first embodiment described above, a barcode is imaged under a first imaging condition with auxiliary light illumination and a second imaging condition without auxiliary light illumination. The decoded results obtained from the barcodes imaged under the two different imaging conditions are compared, and a reading result is output if both decoded results match. If they do not match, the system alternately updates (overwrites) the decoded result "A" and the decoded result "B" by repeatedly performing on-camera imaging under the first imaging condition with auxiliary light illumination and off-camera imaging under the second imaging condition without auxiliary light illumination, and each time it is determined whether both decoded results match. This allows for more accurate and efficient barcode reading. In other words, since the reading result is output only when both decoded results match, the barcode can be read more accurately. Furthermore, if the decoding result of a barcode captured under the first imaging condition does not match the decoding result of a barcode captured under the second imaging condition, the system will re-capture the barcode under one of the imaging conditions. This allows for more efficient barcode reading compared to the case where the barcode is captured under both the first and second imaging conditions (i.e., when the barcode reading process is performed from the beginning).

[0027] In the first embodiment described above, imaging was performed first with the auxiliary light turned on, and then with the auxiliary light turned off. However, the method is not limited to this; imaging may be performed first with the auxiliary light turned off, and then with the auxiliary light turned on. In this case, if the decoding results of both methods do not match, imaging can be performed again with the auxiliary light turned off.

[0028] A second embodiment of the present invention will be described with reference to Figure 6. In this second embodiment, in addition to a first imaging condition in which the barcode is illuminated with auxiliary light (bright) by the auxiliary light output unit 7, and a second imaging condition in which the barcode is not illuminated with auxiliary light by the auxiliary light output unit 7, there is a third imaging condition in which imaging is performed with auxiliary light (dark) which has a lower light intensity than the auxiliary light (bright) in the first imaging condition. As shown in Figure 6, the CPU 10 first images the barcode with the imaging unit 6 under the first imaging condition in which the barcode is illuminated with auxiliary light (bright) by the auxiliary light output unit 7, decodes the barcode in the captured image a1 and obtains the decoding result "A" (first reading result). Next, the CPU 10 images the barcode with the imaging unit 6 under the third imaging condition in which the barcode is illuminated with auxiliary light (dark) by the auxiliary light output unit 7, decodes the barcode in the captured image c and obtains the decoding result "D" (fourth reading result). Furthermore, the CPU 10 uses the auxiliary light output unit 7 to capture the barcode with the imaging unit 6 under a second imaging condition where the barcode is not illuminated with auxiliary light, and decodes the barcode in the captured image b to obtain the decode result "B" (second reading result). The CPU 10 then determines whether the decode result "A" (first reading result), the decode result "D" (fourth reading result), and the decode result "B" (second reading result) all match, and if they all match, outputs one of the decode result "A" (first reading result), the decode result "D" (fourth reading result), or the decode result "B" (second reading result) as the reading result.

[0029] On the other hand, if the decode result "A" (first reading result), the decode result "D" (fourth reading result), or the decode result "B" (second reading result) do not match, the CPU 10 re-images image a2 under the first imaging condition with auxiliary light (bright) illumination of the barcode by the auxiliary light output unit 7. Then, if the decode result "A (=C; overwritten)" (third reading result), the decode result "D" (fourth reading result), and the decode result "B" (second reading result) obtained by decode the barcode in the re-imaged image a2 all match, the CPU 10 outputs one of the decode result "A (=C)" (third reading result), the decode result "D" (fourth reading result), or the decode result "B" (second reading result) as the reading result.

[0030] On the other hand, if the decoded result "A (=C)" (third reading result), the decoded result "D" (fourth reading result), and the decoded result "B" (second reading result) do not match, the system will sequentially update (overwrite) the decoded results "A", "D", and "B" by repeatedly performing on-camera imaging under the third imaging condition with auxiliary light (dark) illumination, then off-camera imaging under the second imaging condition without auxiliary light illumination, and so on. Each time, it will be determined whether all the decoded results match, and the reading result will be output when they do. In the above process, even if the decoded result "A" with auxiliary light (bright) illumination, the decoded result "D" with auxiliary light (dark) illumination, and the decoded result "B" without auxiliary light illumination do not match and the reading process is repeated, an error will be displayed and the reading process will be terminated once the pre-set time limit is reached.

[0031] According to the second embodiment described above, in addition to the first imaging condition with auxiliary light illumination and the second imaging condition without auxiliary light illumination, a third imaging condition with auxiliary light illumination (dark), which has a relatively lower light intensity compared to the auxiliary light illumination (bright) of the first imaging condition, is added. The decoded results obtained from barcodes captured under these three different imaging conditions are compared, and the reading result is output when all decoded results match. If any of them do not match, the system sequentially updates (overwrites) the decoded results "A", "D", and "B" by sequentially performing imaging with the third imaging condition with auxiliary light (dark), imaging with the second imaging condition without auxiliary light, and so on, and each time it is determined whether all decoded results match. This allows for more accurate and efficient barcode reading.

[0032] A third embodiment of the present invention will be described with reference to the drawings. In this third embodiment, the imaging unit 6 captures the barcode twice to acquire two images in each of two imaging conditions: a first imaging condition in which the barcode is illuminated with auxiliary light (bright) by the auxiliary light output unit 7, and a second imaging condition in which the barcode is not illuminated with auxiliary light by the auxiliary light output unit 7. As shown in Figure 7, the CPU 10 first captures the barcode twice with the imaging unit 6 under the first imaging condition in which the barcode is illuminated with auxiliary light by the auxiliary light output unit 7, decodes the barcode in the first image a1 to obtain the decode result "A1" (first reading result), and decodes the barcode in the second image a2 to obtain the decode result "A2" (first reading result). Next, the CPU 10 uses the auxiliary light output unit 7 to capture the barcode with the imaging unit 6 under a second imaging condition where the barcode is not illuminated with auxiliary light. The CPU 10 decodes the barcode in the first image b1 to obtain the decode result "B1" (second reading result), and decodes the barcode in the second image b2 to obtain the decode result "B2" (second reading result). The CPU 10 then outputs one of the decode results as the reading result if the decode result "A1" (first reading result), the decode result "A2" (first reading result), the decode result "B1" (second reading result), and the decode result "B2" (second reading result) all match.

[0033] On the other hand, if any of the decoded results "A1" (first reading result), "A2" (first reading result), "B1" (second reading result), or "B2" (second reading result) do not match, the CPU 10 re-images images c1 and c2 under the first imaging condition with auxiliary light illumination on the barcode using the auxiliary light output unit 7, and decodes the barcode in the re-imaged images c1 and c2 to obtain the decoded result "A1 (=C1; overwrite)". If the third reading result ("A2(=C2; overwritten)"), the fourth reading result ("A2(=C2; overwritten)"), the second reading result ("B1"), and the second reading result ("B2") all match, then one of the following will be output as the reading result: the third reading result ("A1(=C1)"), the fourth reading result ("A2(=C2)"), the second reading result ("B1"), or the second reading result ("B2").

[0034] On the other hand, if the decoded result "A1 (=C1)" (third reading result), the decoded result "A2 (=C2)" (fourth reading result), the decoded result "B1" (second reading result), and the decoded result "B2" (second reading result) do not match, the system alternates between off-light imaging under the second imaging condition without auxiliary light illumination, and on-light imaging under the first imaging condition with auxiliary light illumination, etc., updating (overwriting) the decoded results "A1", "A2", "B1", and "B2" in sequence. Each time, it is determined whether all the decoded results match, and the reading result is output when they match. In the above process, even if the decoded results "A1" and "A2" with auxiliary light illumination and the decoded results "B1" and "B2" without auxiliary light illumination do not match and the reading process is repeated, an error will be displayed and the reading process will terminate once the pre-set time limit is reached.

[0035] According to the third embodiment described above, the barcode is imaged at least twice under the first imaging condition with auxiliary light illumination, and at least twice under the second imaging condition without auxiliary light illumination. The reading result is output only if the decoding results of all the captured barcodes match. If the decoding results do not match, the system alternates between imaging with the lights off under the second imaging condition without auxiliary light illumination, imaging with the lights on under the first imaging condition with auxiliary light illumination, etc., updating (overwriting) the decoding results "A1", "A2", "B1", and "B2" in order, and determining each time whether the decoding results all match. This allows for more accurate and efficient barcode reading.

[0036] A fourth embodiment of the present invention will be described with reference to the drawings. In this fourth embodiment, similar to the second embodiment described above, in addition to a first imaging condition in which the barcode is illuminated with auxiliary light (bright) by the auxiliary light output unit 7 and a second imaging condition in which the barcode is not illuminated with auxiliary light by the auxiliary light output unit 7, there is a third imaging condition in which imaging is performed with auxiliary light (dark) which has a lower light intensity than the auxiliary light (bright) in the first imaging condition. As shown in Figure 8, the CPU 10 first images the barcode with the imaging unit 6 under the first imaging condition in which the barcode is illuminated with auxiliary light (bright) by the auxiliary light output unit 7, decodes the barcode in the captured image a1 and obtains the decoding result "A" (first reading result). Next, the CPU 10 images the barcode with the imaging unit 6 under the second imaging condition in which the barcode is not illuminated with auxiliary light by the auxiliary light output unit 7, decodes the barcode in the captured image b and obtains the decoding result "B" (second reading result). The CPU 10 then determines whether the decoded result "A" (first reading result) and the decoded result "B" (second reading result) match, and if they match, outputs either the decoded result "A" (first reading result) or the decoded result "B" (second reading result) as the reading result.

[0037] On the other hand, if the decoded result "A" (first reading result) and the decoded result "B" (second reading result) do not match, the CPU 10 uses the auxiliary light output unit 7 to illuminate the barcode with auxiliary light (brightness) and then uses the imaging unit 6 to re-image the barcode, decodes the barcode in the captured image a2, and obtains the decoded result "C" (third reading result). The CPU 10 then determines whether the decoded result "A (=C)" (first reading result = third reading result) and the decoded result "B" (second reading result) match, and if they match, outputs either the decoded result "A (=C)" (first reading result = third reading result) or the decoded result "B" (second reading result) as the reading result.

[0038] On the other hand, if the decoded result "A (=C)" (first reading result = third reading result) and the decoded result "B" (second reading result) do not match, the CPU 10 uses the auxiliary light output unit 7 to illuminate the barcode with auxiliary light (dark) under third imaging conditions, and the imaging unit 6 captures the barcode in the captured image c to obtain the decoded result "D" (fourth reading result). The CPU 10 then determines whether the decoded result "D" (fourth reading result) matches either the decoded result "B" (second reading result) or the decoded result "A (=C)" (first reading result = third reading result). If either matches, the CPU 10 outputs the decoded result "D" as the reading result.

[0039] On the other hand, if the decoded result "D" (fourth reading result) does not match the decoded result "B" (second reading result) or the decoded result "A (=C)" (first reading result), the system will sequentially update (overwrite) the decoded results "A", "D", and "B" by repeatedly performing the second imaging condition (no auxiliary light illumination) with the lights off, the first imaging condition (with auxiliary light illumination) with the lights on, and so on, while determining each time whether the decoded results match. The reading result is output when they match. In the above process, even if the decoded result "A" with auxiliary light illumination, the decoded result "D" with auxiliary light illumination, and the decoded result "B" without auxiliary light illumination do not match and the reading process is repeated, an error will be displayed and the reading process will terminate once the pre-set time limit is reached.

[0040] According to the fourth embodiment described above, in addition to the first imaging condition with auxiliary light illumination and the second imaging condition without auxiliary light illumination, a third imaging condition with auxiliary light illumination (dark) that has a relatively lower light intensity compared to the auxiliary light illumination (bright) of the first imaging condition is added. The decoded result (first reading result) and the decoded result (second reading result) obtained from the images captured under the first and second imaging conditions are compared. If both decoded results match, the reading result is output. If they do not match, the image is re-captured under the first imaging condition, and the decoded result (third reading result) of the re-captured image is compared with the second reading result. If both decoded results match, the reading result is output. In the event of a match, an image is captured under the third imaging condition with auxiliary light illumination (dark) to obtain the decoded result (fourth reading result). The decoded result (fourth reading result) under the third imaging condition is compared with the third reading result or the second reading result. If either matches, the result is output as the reading result. If neither matches, the process is repeated sequentially, starting with the second imaging condition without auxiliary light illumination (light off), then the first imaging condition with auxiliary light illumination (light on), and so on, updating (overwriting) the decoded results "A", "D", and "B" in sequence. Each time, it is determined whether the decoded results match or not, allowing for more accurate and efficient barcode reading.

[0041] In the first to fourth embodiments described above, imaging was performed first under the first imaging condition with auxiliary light irradiation, followed by imaging under the second imaging condition without auxiliary light irradiation. However, the procedure is not limited to this, and imaging may be performed first under the second imaging condition, followed by imaging under the first imaging condition. In this case, if the two do not match, imaging may be performed again under the second imaging condition without auxiliary light irradiation, and the second reading result may be updated (overwritten) with the third reading result to compare the two.

[0042] Furthermore, in the first to fourth embodiments described above, if the decoding result with auxiliary light illumination (first reading result) and the decoding result without auxiliary light illumination (second reading result) do not match, the image is re-captured with auxiliary light illumination, and the decoding result for the barcode in the re-captured image (third reading result; first reading result due to overwriting) is compared with the previous decoding result without auxiliary light illumination (second reading result). However, the system is not limited to this, and the imaging conditions for the image to be re-captured may be selectively determined based on predetermined conditions, such as the length of the exposure adjustment period, the percentage of overexposure and underexposure in the overall captured image, and the degree of blurriness (unclearness) of the barcode, between the first and second imaging conditions. More specifically, a longer exposure adjustment period (the number of frames until the final image is captured) indicates that it took a long time to capture the image correctly. Therefore, it can be inferred that the image was not captured correctly (it was difficult to capture the correct image), meaning that the correct decoding result was not obtained. In such cases, the system may be controlled to re-capture the image using the imaging conditions with the longer exposure adjustment period. Alternatively, the system may detect (quantify) the percentage of the captured image occupied by overexposed areas (overexposure rate), the percentage of underexposed areas (underexposure rate), and the degree of blurriness (inaugness) of the barcode. A higher overexposure rate, underexposure rate, or blurriness (inaugness) indicates a higher probability that the image was not captured correctly, meaning that the correct decoding result was not obtained. In such cases, the system may be controlled to re-capture the image using the imaging conditions with the higher overexposure rate, underexposure rate, or blurriness (inaugness).

[0043] Furthermore, the detailed configuration and operation of each component of the barcode scanner 1 in the first to fourth embodiments described above can be appropriately modified without departing from the spirit of the present invention. Although embodiments of the present invention have been described, the scope of the present invention is not limited to the embodiments described above, but includes the scope of the invention as described in the claims and its equivalents. [Explanation of symbols]

[0044] 1…Barcode scanner (electronic device), 6…Imaging unit, 7…Auxiliary light output unit (light source), 10…CPU (setting unit, acquisition unit, control unit)

Claims

1. An imaging unit that captures an image of an optically readable code, A light source for illuminating the aforementioned code, A setting unit for setting imaging conditions including a first imaging condition in which the code is illuminated by the light source and a second imaging condition in which the code is not illuminated by the light source, An acquisition unit that acquires a first reading result of the code in an image captured by the imaging unit under the first imaging conditions, and a second reading result of the code in an image captured by the imaging unit under the second imaging conditions, If the first reading result and the second reading result do not match, based on predetermined conditions, A first comparison process is performed which involves re-imaging the image under the first imaging conditions and comparing the third reading result of the code in the re-acquired image with the second reading result, or A control unit that performs either of the following: re-imaging an image under the second imaging conditions, or a second comparison process that compares the third reading result of the code in the re-acquired image with the first reading result; An electronic device characterized by having the following features.

2. The control unit, As a predetermined condition, either the first comparison process or the second comparison process is executed according to the order of imaging under the first imaging condition and the second imaging condition. The electronic device according to feature 1.

3. The control unit, If the first reading result and the second reading result match, the reading result is output. The electronic device according to feature 1.

4. The control unit, If the third reading result and the second reading result match, the reading result is output. The electronic device according to feature 1.

5. The control unit, The first reading result and the second reading result are stored in the storage unit, and the third reading result is overwritten on the first reading result. The electronic device according to feature 1.

6. The aforementioned imaging conditions are: This includes a third imaging condition in which the light intensity of the light source is reduced compared to the first imaging condition, The acquisition unit is, An image is acquired under the third imaging conditions, and the fourth reading result of the code is obtained. The control unit, The system determines whether the first reading result, the second reading result, and the fourth reading result all match, and if they all match, it outputs the fourth reading result as the reading result. The electronic device according to feature 1.

7. The aforementioned imaging conditions are: This includes a third imaging condition in which the light intensity of the light source is reduced compared to the first imaging condition, The acquisition unit is, If the third reading result and the second reading result do not match, an image is acquired under the third imaging conditions to obtain the fourth reading result of the code. The control unit, The fourth reading result is compared with the third reading result or the second reading result, and if the fourth reading result matches either one of them, the fourth reading result is output as the reading result. The electronic device according to feature 1.

8. The acquisition unit is, Two reading results are obtained under the first imaging conditions, and two reading results are obtained under the second imaging conditions. The control unit, The reading result is output when all of the two reading results under the first imaging condition and all of the two reading results under the second imaging condition match. The electronic device according to feature 1.

9. A method for reading a code by the control unit of an electronic device, A step of setting imaging conditions including a first imaging condition in which the code is illuminated by a light source and a second imaging condition in which the code is not illuminated by the light source, The imaging unit captures an image of the code under the first imaging conditions and the second imaging conditions, The steps include obtaining a first reading result of the code in an image captured by the imaging unit under the first imaging conditions, and a second reading result of the code in an image captured by the imaging unit under the second imaging conditions, If the first reading result and the second reading result do not match, based on predetermined conditions, A first comparison process is performed which involves re-imaging the image under the first imaging conditions and comparing the third reading result of the code in the re-acquired image with the second reading result, or The steps include: performing either one of the following: re-imaging an image under the second imaging conditions, and performing a second comparison process that compares the third reading result of the code in the re-acquired image with the first reading result; A code reading method characterized by including the following.

10. In the computer of a device equipped with a light source and an imaging unit, A setting function for setting imaging conditions including a first imaging condition in which the code is illuminated by the light source and a second imaging condition in which the code is not illuminated by the light source. The imaging unit performs an imaging function that captures an image of the code under the first imaging condition and the second imaging condition. An acquisition function that acquires a first reading result of the code in an image captured by the imaging unit under the first imaging conditions, and a second reading result of the code in an image captured by the imaging unit under the second imaging conditions. If the first reading result and the second reading result do not match, based on predetermined conditions, A first comparison process is performed which involves re-imaging the image under the first imaging conditions and comparing the third reading result of the code in the re-acquired image with the second reading result, or A comparison function that performs either of the following: re-imaging an image under the second imaging conditions, or a second comparison process that compares the third reading result of the code in the re-acquired image with the first reading result. A program characterized by its ability to achieve this.

Citation Information

Patent Citations

  • Two-dimensional code reading device

    WO2015098046A1