Bar code scanning method and device for scanning equipment, and scanning equipment
By using multiple supplementary lights in the scanning device to activate at different times and employing image fusion technology, the problem of low accuracy in barcode recognition on highly reflective material surfaces has been solved, enabling the generation and recognition of high-quality barcode images.
Patent Information
- Application Number
- CN202511876516.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, when barcode scanning devices are used on highly reflective material surfaces, bright spot interference causes serious image quality problems and affects recognition accuracy.
By controlling the multiple supplementary lights of the scanning device to be turned on in a timed manner, supplementary light barcode images are acquired separately, and image fusion technology is used to synthesize interference-free high-quality barcode images, eliminating invalid pixels with bright spots and retaining clear local information.
It significantly improves the recognition accuracy of scanning equipment in highly reflective scenarios, solves the problem of information loss caused by bright spot occlusion, and improves the recognition success rate and robustness.
Smart Images

Figure CN121787443A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of scanning equipment technology, such as a barcode scanning method and apparatus for scanning equipment, and a scanning device. Background Technology
[0002] With the rapid advancement of industrial automation and the increasing maturity of intelligent identification technologies, barcode recognition technology has gained widespread application. However, in certain application scenarios, because barcodes are printed on highly reflective materials, the captured images are often damaged by bright spots, severely affecting the barcode recognition performance. Current technologies typically employ the addition of polarizers to barcode scanning devices to reduce the size of bright spots in the image, thereby improving recognition performance.
[0003] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art: Simply adding a polarizer to a barcode scanning device to reduce the spot size is insufficient to completely solve the image quality problem caused by reflections, resulting in still low barcode recognition accuracy.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0006] This disclosure provides a barcode scanning method and apparatus for a scanning device, and a scanning device, to improve the barcode recognition accuracy of the scanning device.
[0007] In some embodiments, the scanning device includes a plurality of supplementary lights; the barcode scanning method for the scanning device includes: when the scanning device enters the supplementary light scanning mode, controlling the plurality of supplementary lights to turn on in a time-sharing manner; obtaining supplementary light barcode images when the supplementary lights are turned on in each time-sharing period; and fusing the plurality of supplementary light barcode images to obtain a target barcode image.
[0008] In some embodiments, a barcode scanning apparatus for a scanning device includes a processor and a memory storing program instructions, the processor being configured to execute the aforementioned barcode scanning method for a scanning device when the program instructions are executed.
[0009] In some embodiments, the scanning device includes: a scanning device body including a plurality of supplementary lights; and the aforementioned barcode scanning device for the scanning device, disposed on the scanning device body.
[0010] The barcode scanning method and apparatus, and scanning device provided in this disclosure can achieve the following technical effects: In this disclosed technical solution, when the scanning device enters the supplementary lighting scanning mode, multiple supplementary lights are controlled to turn on at different times, obtaining supplementary barcode images when the supplementary lights are turned on at each time period. Then, the multiple supplementary barcode images are fused to obtain the target barcode image, and barcode recognition is performed on the target barcode image. In this way, by controlling multiple supplementary lights to light up at different times, a series of supplementary barcode images with different bright spot positions under different illumination angles are obtained. Subsequently, image fusion technology is used to synthesize these supplementary barcode images, effectively removing invalid pixels contaminated by bright spots in each image, and retaining all clear local information, thereby stitching together a complete, interference-free, high-quality barcode image. Finally, by providing a complete "perfect" image for such reflective barcodes, the problem of information loss caused by bright spot occlusion is fundamentally solved, significantly improving the recognition accuracy of the scanning device.
[0011] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0012] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein: Figure 1 This is a schematic flowchart of a barcode scanning method for a scanning device provided in an embodiment of this disclosure; Figure 2 This is a flowchart illustrating another barcode scanning method for a scanning device provided in an embodiment of this disclosure; Figure 3 This is a flowchart illustrating another barcode scanning method for a scanning device provided in an embodiment of this disclosure; Figure 4 This is a flowchart illustrating another barcode scanning method for a scanning device provided in an embodiment of this disclosure; Figure 5A This is a schematic diagram of the layout of a supplementary light provided in an embodiment of this disclosure; Figure 5B This is a schematic diagram of the layout of another supplementary light provided in an embodiment of this disclosure; Figure 5C This is a schematic diagram of the layout of another supplementary light provided in an embodiment of this disclosure; Figure 6 This is a schematic diagram illustrating the effect of a supplementary light barcode image and a target barcode image provided in an embodiment of this disclosure; Figure 7 This is a schematic diagram of the structure of a barcode scanning device for a scanning equipment provided in an embodiment of this disclosure; Figure 8 This is a schematic diagram of the structure of a scanning device provided in an embodiment of this disclosure. Detailed Implementation
[0013] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.
[0014] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0015] Unless otherwise stated, the term "multiple" means two or more. In embodiments of this disclosure, the character " / " indicates that the preceding and following objects are in an "OR" relationship. For example, A / B means: A or B. The term "and / or" describes an association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B. The term "correspondence" can refer to an association or binding relationship; A corresponding to B means that there is an association or binding relationship between A and B.
[0016] Barcodes are frequently applied to highly reflective surfaces, such as metals, PCBs, and laminated materials. When scanning devices capture barcode images on highly reflective surfaces, supplementary lighting can easily cause localized light spots in the barcode image, leading to a sharp decline in barcode recognition performance. To address this issue, this application provides a barcode scanning method for a scanning device. When different supplementary lights are used, the reflective positions in the barcode image will shift. Therefore, at least one clean barcode image exists, or a clean barcode image can be obtained through image fusion, thereby improving barcode recognition performance in highly reflective scenarios.
[0017] Combination Figure 1 As shown in the figure, this disclosure provides a barcode scanning method for a scanning device, including the following steps: S101 controls multiple fill lights to turn on in a time-sharing manner when the scanning device enters the fill light scanning mode.
[0018] Optionally, the scanning device can be controlled to enter the supplementary light scanning mode as follows: if the barcode scanning device fails, the barcode scanning device can be controlled to enter the supplementary light scanning mode.
[0019] In practical applications, the standard scanning mode of the scanning device (with all LED fill lights on simultaneously) is first used to align the barcode on the part. Due to strong specular reflection, a large bright spot appears in the center of the acquired barcode image, obscuring part of the barcode information. The decoding algorithm built into the scanning device cannot read the complete information from this contaminated barcode image, and the decoding engine returns a "recognition failure" signal. Upon receiving the "recognition failure" signal, the main control chip of the scanning device automatically triggers and enters the fill light scanning mode.
[0020] In this way, when scanning ordinary barcodes (without high reflectivity) for the vast majority of the time, the scanning device operates in standard mode, with the fastest response speed and lowest power consumption. Only when encountering truly difficult scenarios where recognition is impossible will a more complex and time-consuming multi-frame capture and fusion process be initiated. This "on-demand activation" strategy optimizes resources and avoids performance overkill when handling simple tasks.
[0021] In some other possible implementations, the scanning device is controlled to enter the supplementary light scanning mode as follows: an initial barcode image is obtained when the barcode scanning device is not in the supplementary light scanning mode; if it is determined that the initial barcode image has high reflectivity, the scanning device is controlled to enter the supplementary light scanning mode.
[0022] High reflectivity in the initial barcode image is determined as follows: the overexposed pixel area in the initial barcode image is larger than a preset pixel area, and the overlap rate between the overexposed pixel area and the barcode area is greater than a preset overlap rate. The overlap rate between the overexposed pixel area and the barcode area is the ratio of the overlapping pixel area of the overexposed pixel area to the overexposed pixel area.
[0023] In practical applications, the scanning device first captures an initial barcode image within a very short time after the supplementary light is turned on. Before formal decoding, the scanning device runs a fast reflection detection algorithm. This algorithm analyzes the initial barcode image and detects large areas of overexposed pixels (pure white blocks with a saturation of 255) whose shape and position overlap with the barcode area. This indicates a high risk of recognition failure due to high reflectivity. In this case, the scanning device skips the standard decoding process and immediately enters supplementary light scanning mode without waiting for decoding failure.
[0024] In this way, instead of waiting for recognition failures to occur, problems are proactively anticipated and resolved in advance, saving the time consumed by a complete decoding attempt that is bound to fail, greatly improving the intelligence level of the scanning device and the user experience.
[0025] Optionally, multiple supplementary lights can be controlled to turn on in a time-sharing manner, including: obtaining an initial barcode image when the barcode scanning device has not entered the supplementary light scanning mode; determining scanning environment parameters based on the initial barcode image; and adjusting the lighting parameters of each supplementary light based on the scanning environment parameters; wherein the lighting parameters include exposure time and / or light source brightness.
[0026] The scanning environment parameters include ambient brightness and reflectivity. In practical applications, ambient brightness is determined by calculating the average pixel brightness of the initial barcode image; reflectivity is determined by calculating the proportion of overexposed pixels in the initial barcode image. A higher average pixel brightness indicates a dimmer ambient light, while a lower average pixel brightness indicates a brighter ambient light. A higher proportion of overexposed pixels indicates higher reflectivity, while a lower proportion of overexposed pixels indicates lower reflectivity.
[0027] The lighting parameters of each supplementary light are adjusted according to the scanning environment parameters, including: increasing the light source brightness and extending the exposure time when the ambient brightness is less than the preset ambient brightness and the reflective intensity is less than the preset reflective intensity; and decreasing the light source brightness and shortening the exposure time when the ambient brightness is greater than the preset ambient brightness and the reflective intensity is greater than the preset reflective intensity.
[0028] In some specific implementations, the target light source brightness and target exposure time are calculated according to the following formulas: L target =L default ×(1 k1×S ratio )×(1+k2×(I max I avg )) Among them, L target For the target light source brightness, Ldefault S is the default light source brightness. ratio I is the reflectivity ratio. max I is the brightness reference value. avg k1 is the average image brightness, k2 is the first reflection suppression coefficient, k2 is the first brightness compensation coefficient, and the reflection intensity ratio is the ratio of the number of overexposed pixels to the total number of pixels.
[0029] T target =T default ×(1 k3×S ratio )×(1+k4×(I max I avg )) Among them, T target For the target exposure time, T default S is the default exposure time. ratio I is the reflectivity ratio. max I is the brightness reference value. avg k is the average image brightness, k3 is the second reflection suppression coefficient, and k4 is the second brightness compensation coefficient.
[0030] By suppressing overexposure and enhancing the signal at the very beginning of image acquisition, the quality of subsequent supplementary lighting barcode images is improved, thereby increasing the recognition success rate and applicability of target barcode images.
[0031] In some other possible implementations, the area where multiple fill lights are located is divided into a main area and an auxiliary area according to the fill light capability; the multiple fill lights are controlled to turn on in a time-sharing manner, including: after controlling the fill lights located in the main area to turn on in a time-sharing manner, the fill lights located in the auxiliary area are controlled to turn on in a time-sharing manner.
[0032] Among them, the supplementary lights located in the main areas are in standard positions, undertaking the core lighting task, providing illumination from multiple main and distinct angles to eliminate reflected light spots from different directions. Combined with... Figure 5A , 5B As shown in Figure 5C, the supplementary lights in the main area are symmetrically distributed on the left and right sides of the scanning window, or evenly distributed in a ring. The supplementary lights in the auxiliary area are located in non-standard positions, serving as supplementary illumination to provide light from specific angles and eliminate reflected light spots from those angles. For example, the supplementary lights in the auxiliary area are located at the bottom of the scanning device, or on the lower side at a large angle to the main optical axis.
[0033] S102, obtain the supplementary light barcode image when the supplementary light is turned on in each time period.
[0034] S103, fuses multiple supplementary light barcode images to obtain the target barcode image.
[0035] In some practical applications, six high-power fill lights are set in the main area, with two symmetrically arranged above the camera and on the left and right sides to form a powerful core illumination circle; four medium-power fill lights are set in the auxiliary area, with two placed at the bottom of the camera to solve the shadows or reflections caused by the top light source at the bottom edge of the barcode, and one placed at each of the upper left and lower right diagonal positions to provide diagonal shear illumination and eliminate striped reflections in specific directions.
[0036] After the scanning device enters the supplementary lighting scanning mode, it first controls only the 6 LED supplementary lights in the main area to turn on in shifts (for example, 1 LED lights up in 6 shifts), simultaneously acquiring 6 supplementary lighting barcode images. The scanning device immediately attempts to fuse and decode these 6 supplementary lighting barcode images. If recognition is successful, the entire scanning process ends immediately. If recognition fails in the main area, the 4 LED supplementary lights in the auxiliary area are activated in shifts, acquiring another 4 supplementary lighting barcode images. The device then fuses the 6 supplementary lighting barcode images from the main area and the 4 from the auxiliary area, for a total of 10 supplementary lighting barcode images, to obtain the target barcode image and performs the final decoding.
[0037] In most highly reflective scenarios, using only the main area supplementary lighting is sufficient, avoiding the need to activate all lights each time, significantly reducing system power consumption and drastically shortening the average scanning time. Furthermore, the novel illumination angles provided by the auxiliary areas greatly enhance the final recognition success rate and robustness of the scanning device in various complex scenarios.
[0038] Optionally, fusing multiple supplementary lighting barcode images to obtain a target barcode image includes: determining a first supplementary lighting barcode image and a second supplementary lighting barcode image from the multiple supplementary lighting barcode images; performing template matching on the first supplementary lighting barcode image and the second supplementary lighting barcode image and calculating the matching offset; and performing fusion fine-tuning on the first supplementary lighting barcode image and the second supplementary lighting barcode image according to the matching offset to obtain the target barcode image.
[0039] The calculation of the matching offset (Δx, Δy) of the second supplementary lighting barcode image relative to the first supplementary lighting barcode image includes: selecting a start or end symbol region of a barcode from the first supplementary lighting barcode image as a matching template; sliding the matching template within the search area of the second supplementary lighting barcode image and calculating the similarity between each position and the matching template; the position with the highest similarity is the new position of the matching template in the second supplementary lighting barcode image; where the coordinate difference between the new position and the original position is the calculated matching offset (ΔxL, ΔyL).
[0040] In practical applications, three sets of supplementary lights (left, center, and right) are activated in a time-sharing manner to acquire three supplementary barcode images: ImageL, ImageC, and ImageR. ImageC (with the center light on, typically exhibiting minimal distortion and jitter) is selected as the first supplementary barcode image (reference image), while ImageL and ImageR are used as the second supplementary barcode images (images to be registered). The offsets (Δx, Δy) of ImageL and ImageR relative to ImageC are calculated. Based on these offsets, ImageL and ImageR are resampled at the sub-pixel level to generate two new images precisely aligned to ImageC at the pixel level: ImageL1 and ImageR1. ImageC, ImageL1, and ImageR1 are then fused pixel-wise to obtain the target barcode image.
[0041] For example, calculating the offset (ΔxL, ΔyL) of ImageL relative to ImageC includes: selecting a start or end barcode region from ImageC as a matching template; sliding the matching template within the search area of ImageL and calculating the similarity between each position and the matching template; the position with the highest similarity is the new position of the matching template in ImageL; where the coordinate difference between the new position and the original position is the calculated matching offset (ΔxL, ΔyL). Similarly, the offset (ΔxR, ΔyR) of ImageR relative to ImageC is calculated.
[0042] The first and second supplementary light barcode images are fused and fine-tuned based on the matching offset to obtain the target barcode image. This effectively eliminates the problem of multiple image misalignment caused by hand shaking, barcode curvature, or optical distortion, avoids image blurring and edge ghosting caused by direct fusion, and ensures that the final generated target barcode image has better sharpness and clarity.
[0043] In other possible implementations, multiple illuminated barcode images are fused to obtain a target barcode image, including: separately selecting a first clear barcode region from a first illuminated barcode image and a second clear barcode region from a second illuminated barcode image; and fusing the first clear barcode region and the second clear barcode region based on a reference barcode image among the multiple illuminated barcode images to obtain the target barcode image. The reference barcode image is the barcode image with the best quality among the multiple illuminated barcode images (e.g., the fewest overexposed pixels or the most consecutive clear pixels).
[0044] Based on a reference barcode image from multiple supplementary light barcode images, a first clear barcode region and a second clear barcode region are fused to obtain a target barcode image. This includes replacing the same location in the reference barcode image with the first clear barcode region and the second clear barcode region respectively to obtain the target barcode region.
[0045] In practical applications, three sets of supplementary lights (left, center, and right) are activated in a time-sharing manner to acquire three supplementary barcode images: ImageA, ImageB, and ImageC. Local quality analysis is performed on each supplementary barcode image to identify the highest quality pixels within each local region. Each supplementary barcode image is divided into multiple small blocks (e.g., an 8x8 pixel grid), and a "sharpness score" is calculated for each block. This score can be obtained by calculating the image gradient of that block (e.g., using the Sobel operator). A higher gradient value indicates sharper edges and better quality. Overexposed (pixel value = 255) or underexposed (pixel value = 0) areas receive low scores.
[0046] In some scenarios, for ImageA: the left region has a high sharpness score, but there is a bright spot in the center; therefore, its sharp barcode area is the high-quality left region. For ImageB: the center region has a high sharpness score, but there is a bright spot on the right; therefore, its sharp barcode area is the high-quality center region. For ImageC: the right region has a high sharpness score, but there is a shadow on the left; therefore, its sharp barcode area is the high-quality right region. Since ImageB has the largest continuous sharp area, ImageB is used as the baseline barcode image. The high-quality left region of ImageA is used as the first sharp barcode area, and the high-quality right region of ImageC is used as the second sharp barcode area. Using the first sharp barcode area, the area covered by the bright spot at the same location in the baseline barcode image is replaced; using the second sharp barcode area, the area with poor quality at the same location in the baseline barcode image is replaced, thus obtaining the target barcode area.
[0047] Based on the reference barcode image, the first clear barcode region and the second clear barcode region are fused to obtain the target barcode image. This only requires local block quality assessment and direct pixel replacement, which is fast and consumes low resources.
[0048] The barcode scanning method for scanning devices provided in this disclosure involves controlling multiple supplementary lights to turn on at different times when the scanning device enters supplementary lighting scanning mode. This allows for the acquisition of supplementary barcode images at each time interval. The multiple supplementary barcode images are then fused to obtain the target barcode image, which is then used for barcode recognition. By controlling multiple supplementary lights to illuminate at different times, a series of supplementary barcode images with different bright spot positions under different illumination angles are acquired. Subsequently, image fusion technology is used to synthesize these supplementary barcode images, effectively removing invalid pixels contaminated by bright spots from each image while retaining all clear local information, thereby stitching together a complete, interference-free, high-quality barcode image. Ultimately, by providing a complete image for such reflective barcodes, the problem of information loss caused by bright spot occlusion is fundamentally solved, significantly improving the recognition accuracy of the scanning device.
[0049] Combination Figure 2 As shown, the barcode scanning method for a scanning device includes the following steps: S201, when the scanning device enters the supplementary light scanning mode, controls multiple supplementary lights to turn on in a time-sharing manner.
[0050] S202, obtain the supplementary light barcode image when the supplementary light is turned on in each minute time period.
[0051] S203, determine the first supplementary light barcode image and the second supplementary light barcode image from multiple supplementary light barcode images.
[0052] S204, perform template matching on the first supplementary light barcode image and the second supplementary light barcode image, and calculate the matching offset.
[0053] S205, the first supplementary light barcode image and the second supplementary light barcode image are fused and fine-tuned according to the matching offset to obtain the target barcode image.
[0054] In this embodiment, the first and second supplementary light barcode images are fused and fine-tuned according to the matching offset to ensure that the barcode details of all images are precisely aligned at the pixel level. This makes the fusion no longer a simple image superposition, but a precise information splicing. The final generated target barcode image has sharp edges and no blurring or ghosting, providing the decoder with the highest quality input and directly improving the decoding success rate and reading speed.
[0055] Combination Figure 3 As shown, the barcode scanning method for a scanning device includes the following steps: S301 controls multiple fill lights to turn on in a time-sharing manner when the scanning device enters the fill light scanning mode.
[0056] S302, obtain the supplementary light barcode image when the supplementary light is turned on in each minute time period.
[0057] S303, respectively filter the first clear barcode region in the first supplementary light barcode image and the second clear barcode region in the second supplementary light barcode image.
[0058] S304, based on the reference barcode image among multiple supplementary light barcode images, merge the first clear barcode area and the second clear barcode area to obtain the target barcode image.
[0059] In this embodiment of the disclosure, based on a reference barcode image among multiple supplementary lighting barcode images, the first clear barcode region and the second clear barcode region are fused together. This can completely avoid defective regions in the supplementary lighting barcode image and combine all available high-quality image fragments together. The final target barcode image is visually complete and clear, without any bright spots or smudges, providing the decoder with near-ideal input and fundamentally improving the recognition success rate.
[0060] In some embodiments, the barcode scanning method for the scanning device further includes: after acquiring each supplementary light barcode image, performing time-division decoding on the supplementary light barcode image; and stopping the acquisition of supplementary light barcode images if the time-division decoding is successful.
[0061] In practical applications, the scanning device enters the supplementary lighting scanning mode, controls the first set of supplementary lights (e.g., the left light) to turn on, and obtains the first supplementary barcode image Image1. After obtaining Image1, the scanning device does not wait for all images to be acquired, but immediately calls the decoder to perform time-division decoding on Image1. If Image1 is successfully decoded, the scanning device immediately stops the subsequent supplementary lighting process, and the scan is completed. If Image1 fails to decode, the second set of supplementary lights (e.g., the central light) is turned on to obtain Image2, and time-division decoding is performed again immediately. If Image2 is successfully decoded, the process terminates. If Image3 fails to decode, the third set of lights is turned on to obtain Image3. Images 1, 2, and 3 are then fused to obtain the target barcode image and decoded.
[0062] The step of performing time-division decoding immediately after acquiring each supplementary light barcode image, by setting multiple "decision checkpoints" in the process, enables the scanning device to "stop losses in time". This maximizes speed and reduces power consumption while ensuring recognition success rate, ultimately achieving a double leap in user experience and device performance.
[0063] In some embodiments, the barcode scanning method for a scanning device further includes: after the target barcode image is successfully decoded, determining the target supplementary lighting barcode image with the largest decoding contribution weight among multiple supplementary lighting barcode images, and determining the first environmental parameter and the first lighting parameter corresponding to the target supplementary lighting barcode image; when the barcode scanning device enters the supplementary lighting scanning mode, obtaining the second environmental parameter, and determining the second lighting parameter corresponding to the first lighting parameter based on the matching degree between the second environmental parameter and the first environmental parameter; and performing barcode recognition using the supplementary lighting barcode image under the second lighting parameter.
[0064] In some possible implementations, the decoding contribution weight is determined according to the following formula: W i = α×P i + β×Q i +δ×C i Among them, W i P contributes weights to decoding i Q is the pixel fusion contribution, used to measure the number of pixels from the illuminated barcode image that are adopted during the fusion process. i C is the image quality score used to evaluate the inherent quality of the illuminated barcode image. i α is the regional criticality coefficient, used to evaluate the positional importance of pixels contributing to the illuminated barcode image within the barcode. α, β, and δ are weighting coefficients, and α+β+δ=1.
[0065] In some possible implementations, the regional criticality coefficient is determined according to the following formula: C i = (Σ{x,y} M i (x,y) ×K(x,y)) / (Σ{x,y} K(x,y)) Among them, C i M is the regional criticality coefficient. i (x,y) is the pixel binary mask derived from the illuminated barcode image i, and K(x,y) is the positional criticality weight map. Barcode start / end symbol region: K(x,y) = 1.5, barcode data region: K(x,y) = 1.0, background region: K(x,y) = 0.1.
[0066] After determining the target illuminated barcode image, the first environmental parameters and the first lighting parameters at the time of its capture are saved. The first environmental parameters include the ambient brightness and reflectivity at the time of capturing the target illuminated barcode image, and the first lighting parameters include the fill light number (illumination angle), light source brightness, and exposure time used at the time of capturing the target illuminated barcode image.
[0067] When the scanning device re-enters the supplementary lighting scanning mode, it captures an initial barcode image as before to analyze the current second environmental parameters. The current second environmental parameters are then compared with the historically stored first environmental parameters to calculate their matching degree. If the matching degree between the first and second environmental parameters is greater than or equal to a first preset matching degree threshold, the first lighting parameter is used as the second lighting parameter. If the matching degree is greater than or equal to the second preset matching degree threshold but less than the first preset matching degree, the first lighting parameter is fine-tuned to obtain the second lighting parameter. The second preset matching degree threshold is less than the first preset matching degree threshold, and the matching degree between the first and second environmental parameters is determined by their similarity.
[0068] In this way, the scanning device no longer needs to perform complete, multiple time-division illumination operations each time. In a familiar environment, it can quickly call up the optimal illumination scheme, and has a very high probability of succeeding on the first or second illumination attempt, reducing the scanning time from hundreds of milliseconds to tens of milliseconds.
[0069] Combination Figure 4 As shown, the barcode scanning method for a scanning device includes the following steps: S401 controls multiple fill lights to turn on in a time-sharing manner when the scanning device enters the fill light scanning mode.
[0070] S402, obtain the supplementary light barcode image when the supplementary light is turned on in each minute time period.
[0071] S403 performs time-division decoding on each supplementary light barcode image obtained.
[0072] S404: If time-division decoding is successful, stop acquiring the supplementary light barcode image.
[0073] S405, in the event that time-division decoding fails, fuses multiple supplementary light barcode images to obtain the target barcode image.
[0074] S406, Barcode recognition using target barcode images.
[0075] In this embodiment, during the time-division multiplexing illumination process, the scanning device attempts to decode each illuminated barcode image in real time. Once successful, the subsequent process is immediately terminated, achieving a "fast channel" with millisecond-level response. If all illuminated barcode images fail, a "safety channel" is activated, intelligently fusing all images into a high-quality target image for final recognition. This solution combines the low power consumption and high efficiency of rapid testing with the robustness of fusion processing. It adaptively allocates computing resources, ensuring fast, accurate, and reliable barcode recognition in various high-reflectivity scenarios, significantly improving user experience and device performance.
[0076] Figure 6 This is a schematic diagram illustrating the effect of the supplementary lighting on the barcode image and the target barcode image. It employs methods such as... Figure 5A As shown, when the left fill light A is lit, it captures a fill light barcode image ImageA; when the right fill light B is lit, it captures a fill light barcode image ImageB. By fusing the fill light barcode images ImageA and ImageB, a target barcode image ImageFusion without reflective spots can be obtained, greatly improving the barcode image quality.
[0077] Combination Figure 7 As shown, this disclosure provides a barcode scanning device (e.g., a computer, controller, etc.) 700 for a scanning device, including a processor 70 and a memory 71, and may also include a communication interface 72 and a bus 73. The processor 70, communication interface 72, and memory 71 can communicate with each other via the bus 73. The communication interface 72 can be used for information transmission. The processor 70 can call logical instructions in the memory 71 to execute the barcode scanning method for the scanning device described in the above embodiment.
[0078] Furthermore, the logic instructions in the aforementioned memory 71 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0079] The memory 71, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 70 executes functional applications and data processing by running the program instructions / modules stored in the memory 71, that is, it implements the barcode scanning method for the scanning device in the above method embodiments.
[0080] The memory 71 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 71 may include high-speed random access memory and may also include non-volatile memory.
[0081] The barcode scanning device for scanning equipment provided in this disclosure controls multiple supplementary lights to illuminate at different times, acquiring a series of supplementary barcode images with different bright spot positions under different illumination angles. Subsequently, image fusion technology is used to synthesize these supplementary barcode images, effectively removing invalid pixels contaminated by bright spots in each image and retaining all clear local information, thereby stitching together a complete, interference-free, high-quality barcode image. Finally, by providing a complete "perfect" image for such reflective barcodes, the problem of information loss caused by bright spot occlusion is fundamentally solved, significantly improving the barcode recognition accuracy of the scanning equipment.
[0082] In some embodiments, combined with Figure 8 As shown, the scanning device 800 includes: a scanning device body 80, including a plurality of supplementary lights; and the aforementioned barcode scanning device 700 for the scanning device, disposed on the scanning device body 80.
[0083] Optionally, combined Figure 5A , 5B As shown, multiple supplementary lights are symmetrically arranged on one or more concentric circles, centered on the imaging lens of the scanning device. These lights, distributed on the concentric circles, project light from multiple different but regular angles. During time-division multiplexing, this arrangement most effectively alters the position of the specular reflection spot on the sensor, maximizing the spot displacement effect with the fewest possible lights, thereby providing differentiated supplementary barcode images for image fusion algorithms with higher efficiency.
[0084] Optionally, combined Figure 5C As shown, multiple fill lights are arranged in a grid around the imaging lens. The grid layout provides a higher degree of freedom in lighting. The fill lights can be turned on in rows and columns at different times, and can also be controlled in more complex combinations (such as diagonals or specific rectangular areas). This makes it possible to generate images with extremely different lighting angles, and is particularly suitable for handling extreme scenes such as curved surfaces and wrinkled surfaces that will produce complex deformed light spots.
[0085] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the barcode scanning method described above for a scanning device.
[0086] This disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the barcode scanning method described above for a scanning device.
[0087] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0088] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.
[0089] The foregoing description and accompanying drawings fully illustrate embodiments of the present disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included or substituted for parts and features of other embodiments. The scope of the embodiments of this disclosure includes the entire scope of the claims and all available equivalents of the claims. While the terms “first,” “second,” etc., may be used in this application to describe elements, these elements should not be limited by these terms. These terms are used only to distinguish one element from another. For example, a first element may be called a second element without changing the meaning of the description, and similarly, a second element may be called a first element, provided that all occurrences of “first element” are consistently renamed and all occurrences of “second element” are consistently renamed. First and second elements are both elements, but may not be the same element. Moreover, the terminology used in this application is only for describing embodiments and is not intended to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” are intended to also include the plural forms. Similarly, the term “and / or” as used herein means including one or more of the associated listed any and all possible combinations. Additionally, when used herein, the terms “comprise” and its variations “comprises” and / or “comprising” refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase “comprising an…” does not exclude the presence of additional identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0090] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0091] The methods and products disclosed in the embodiments herein (including but not limited to devices and equipment) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0092] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A barcode scanning method for a scanning device, characterized in that, The scanning device includes multiple supplementary lights; the barcode scanning methods include: When the scanning device enters the supplementary light scanning mode, multiple supplementary lights are controlled to turn on in a time-sharing manner; Obtain the supplementary light barcode image when the supplementary light is turned on in each minute time period; Multiple supplementary lighting barcode images are fused together to obtain the target barcode image.
2. The barcode scanning method according to claim 1, characterized in that, Control the scanning device to enter the supplementary light scanning mode as follows: If the barcode scanning device fails to scan the barcode, control the barcode scanning device to enter the supplementary light scanning mode; or... Obtain the initial barcode image when the barcode scanning device is not in supplementary light scanning mode; If the initial barcode image is found to have high reflectivity, the scanning device is controlled to enter the supplementary light scanning mode.
3. The barcode scanning method according to claim 1, characterized in that, Controlling multiple fill lights to turn on at different times includes: Obtain the initial barcode image when the barcode scanning device is not in supplementary light scanning mode; Determine the scanning environment parameters based on the initial barcode image; The lighting parameters of each fill light are adjusted according to the scanning environment parameters; the lighting parameters include exposure time and / or light source brightness.
4. The barcode scanning method according to claim 1, characterized in that, Divide the area where multiple fill lights are located into primary and secondary areas according to their lighting capabilities; control the multiple fill lights to turn on at different times, including: After controlling the fill lights in the main area to turn on in a timed manner, control the fill lights in the auxiliary areas to turn on in a timed manner as well.
5. The barcode scanning method according to claim 1, characterized in that, Multiple illuminated barcode images are fused to obtain the target barcode image, including: Identify the first and second supplementary light barcode images from multiple supplementary light barcode images; The first and second supplementary light barcode images are template matched, and the matching offset is calculated. The first and second supplementary light barcode images are fused and fine-tuned according to the matching offset to obtain the target barcode image; or, The first clear barcode region in the first supplementary light barcode image and the second clear barcode region in the second supplementary light barcode image are selected respectively. Based on a reference barcode image from multiple supplementary lighting barcode images, the first clear barcode region and the second clear barcode region are fused to obtain the target barcode image.
6. The barcode scanning method according to any one of claims 1 to 5, characterized in that, Also includes: After obtaining each supplementary light barcode image, the supplementary light barcode image is decoded in a time-division manner; If time-division decoding is successful, stop acquiring the supplementary light barcode image.
7. The barcode scanning method according to any one of claims 1 to 5, characterized in that, Also includes: After the target barcode image is successfully decoded, the target supplementary light barcode image with the largest decoding contribution weight among multiple supplementary light barcode images is determined, and the first environmental parameters and the first lighting parameters corresponding to the target supplementary light barcode image are determined. When the barcode scanning device enters the supplementary light scanning mode, it obtains the second environmental parameters and determines the second light parameters corresponding to the first light parameters based on the matching degree between the second environmental parameters and the first environmental parameters. Barcode recognition is performed using the supplementary lighting barcode image under the second lighting parameters.
8. A barcode scanning device for a scanning equipment, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to perform the barcode scanning method for a scanning device as described in any one of claims 1 to 7 when executing the program instructions.
9. A scanning device, characterized in that, include: The scanning device itself includes multiple supplementary lights; The barcode scanning device for a scanning device as described in claim 8 is disposed on the scanning device body.
10. The scanning device according to claim 9, characterized in that, Multiple supplementary lights are symmetrically arranged in one or more concentric circles, centered on the imaging lens of the scanning device; or... Multiple fill lights are arranged in a grid around the imaging lens.