Bar code recognition method, device, apparatus and storage medium

CN115618901BActive Publication Date: 2026-09-15HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211209494.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-09-15
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

[0005]有鉴于此,本申请实施例提供一种条码识别方法、装置、设备及存储介质,旨在解决难以准确的识别条码,导致疑难类型条码的错识率高的技术问题

Benefits of technology

[0064] This application provides a barcode recognition method, apparatus, device, and storage medium. The method involves acquiring a first image of a target barcode captured by a first camera, and multiple second images of the target barcode captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle. The method further involves acquiring the first coordinates of the target barcode in the first image, extracting a first region image corresponding to the first coordinates in the first image, and extracting a second region image corresponding to the first coordinates in multiple third images, wherein the third images are obtained by correcting the second images based on the first image. The method also involves determining a difference estimation result between the first region image and the multiple second region images; decoding the first region image and the multiple second region images based on the difference estimation result; and outputting the recognition result of the target barcode based on the decoding result. Specifically, the method acquires a first image and multiple second images of the target barcode captured from multiple angles, matches the position of the target barcode in the first image and the corrected second images, and therefore extracts a first region image in the first image and a second region image in the third image based on the first coordinates of the target barcode in the first image. By analyzing the differences in data sources between the first and second region images, potentially problematic barcodes are identified in advance, thus reducing the probability of false recognition. When the difference estimation result between the first region image and multiple second region images indicates that the target barcode is a potentially problematic barcode, the target barcode in both the first and multiple second region images is decoded to obtain the recognition result. Compared to existing technologies that struggle to accurately identify barcodes, leading to a high false recognition rate for potentially problematic barcodes, this method accurately identifies potentially problematic barcodes and reduces the false recognition rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115618901B_ABST
    Figure CN115618901B_ABST
Patent Text Reader

Abstract

The application discloses a bar code recognition method, device and equipment and a storage medium. The method comprises the following steps: acquiring a first image obtained by a first camera after the first camera captures a target bar code, and a plurality of second images obtained by a plurality of second cameras after the plurality of second cameras capture the target bar code, the plurality of second cameras and the first camera being arranged at an included angle; acquiring a first coordinate of the target bar code in the first image; extracting a first region image corresponding to the first coordinate in the first image and a second region image corresponding to the first coordinate in a plurality of third images, the third image being obtained by correcting the second image based on the first image; determining a difference estimation result between the first region image and the plurality of second region images; performing decoding processing on the first region image and the plurality of second region images based on the difference estimation result, and outputting a recognition result of the target bar code according to a decoding result. The application can accurately recognize difficult codes and reduce the misrecognition rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of barcode recognition, and more particularly to a barcode recognition method, apparatus, device, and storage medium. Background Technology

[0002] In routine barcode recognition, factors such as barcode wrinkles, distortion, or material reflection can cause the barcode content in the barcode recognition device's image to be distorted or missing. This type of barcode is called a difficult-to-identify barcode.

[0003] For the reasons mentioned above, current decoding algorithms for difficult-to-identify barcode types rely solely on the camera's measurement of the barcode's width ratio for recognition and decoding. However, once a barcode is distorted or its reflective properties are lost, the barcode content still appears similar in shape to other barcode characters. This causes the decoding algorithm to identify incorrect information and output it incorrectly, resulting in misidentification.

[0004] In other words, existing technologies have the technical problem of making it difficult to accurately identify barcodes, resulting in a high misidentification rate for difficult-to-identify barcode types. Summary of the Invention

[0005] In view of this, embodiments of this application provide a barcode recognition method, apparatus, device, and storage medium, aiming to solve the technical problem of high misidentification rate of difficult-to-identify barcodes.

[0006] This application provides a barcode recognition method, the method comprising:

[0007] The system acquires a first image of the target barcode captured by a first camera, and multiple second images of the target barcode captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle.

[0008] Obtain the first coordinate of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image;

[0009] Determine the difference estimation results between the first region image and multiple second region images;

[0010] Based on the difference estimation results, the first region image and multiple second region images are decoded, and the recognition result of the target barcode is output according to the decoding results.

[0011] In one possible implementation of this application, the step of decoding the first region image and a plurality of second region images based on the difference estimation result, and outputting the recognition result of the target barcode according to the decoding result, includes:

[0012] If the difference estimation result indicates that the target barcode is a non-difficult barcode, the first region image is decoded, and the decoding result is output as the recognition result of the target barcode; or

[0013] If the difference estimation result indicates that the target barcode is a difficult code, the first region image and multiple second region images are decoded. When the decoding results are consistent, the decoding result is output as the recognition result of the target barcode.

[0014] In one possible implementation of this application, the third image is obtained by correcting the second image based on the first image, including:

[0015] The imaging plane containing the target barcode is calibrated based on the first camera and multiple second cameras to obtain the correction parameters of the second cameras;

[0016] The second image captured by the second camera is corrected according to the correction parameters to obtain multiple third images, and the position of the target barcode in the first image is matched with its position in the multiple third images.

[0017] In one possible implementation of this application, the step of calibrating the imaging plane containing the target barcode based on the first camera and a plurality of second cameras to obtain the correction parameters of the second cameras includes:

[0018] Acquire a first calibration image captured by the first camera on the calibration board, and a second calibration image captured by a plurality of second cameras on the calibration board;

[0019] Feature point detection is performed on the first calibration image to obtain the first imaging feature point, and feature point detection is performed on multiple second calibration images to obtain multiple second imaging feature points;

[0020] The first imaging feature point is matched with multiple second imaging feature points to obtain a set of matching points;

[0021] The homography matrix corresponding to the second calibration image is solved based on the matching point set to obtain the correction parameters of the second camera.

[0022] In one possible implementation of this application, determining the difference estimation results between the first region image and a plurality of second region images includes:

[0023] Gradient features are extracted from the first region image and multiple second region images respectively to obtain gradient feature maps, and the first Euclidean distance information between the gradient feature maps is determined.

[0024] The first region image and multiple second region images are binarized to obtain binarized images, and the second Euclidean distance information between the binarized images is determined.

[0025] The difference value of the target barcode is calculated based on the first Euclidean distance information, the second Euclidean distance information, and the pixel count of the first image;

[0026] The difference estimation result is determined based on the difference value and the difference threshold.

[0027] In one possible implementation of this application, determining the difference estimation result based on the difference value and the difference threshold includes:

[0028] If the difference value is greater than the difference threshold, then the target barcode is a difficult code;

[0029] If the difference value is less than or equal to the difference threshold, then the target barcode is a non-difficult barcode.

[0030] In one possible implementation of this application, before obtaining the first coordinates of the target barcode in the first image, and extracting the first region image corresponding to the first coordinates in the first image and the second region image corresponding to the first coordinates in a plurality of third images, the following steps are included:

[0031] The first coordinate is expanded to obtain an expanded region, and the target barcode in the expanded region is detected to obtain the second coordinate.

[0032] The step of obtaining the first coordinates of the target barcode in the first image, and extracting the first region image corresponding to the first coordinates in the first image and the second region image corresponding to the first coordinates in multiple third images includes:

[0033] Based on the second coordinates, the first region image in the first image and the second region image in the third image are extracted.

[0034] This application also provides a barcode recognition device, the device comprising:

[0035] The image acquisition module is used to acquire a first image of the target barcode after being captured by a first camera, and multiple second images of the target barcode after being captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle.

[0036] The image correction module is used to obtain the first coordinates of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image;

[0037] A barcode determination module is used to determine the difference estimation results between the first region image and multiple second region images;

[0038] The barcode recognition module is used to decode the first region image and multiple second region images based on the difference estimation results, and output the recognition result of the target barcode according to the decoding results.

[0039] In one possible implementation of this application, the barcode recognition module further includes:

[0040] The difficult-to-determine submodule is used to decode the first region image if the difference estimation result indicates that the target barcode is a non-difficult-to-determine barcode, and output the decoding result as the recognition result of the target barcode; or

[0041] If the difference estimation result indicates that the target barcode is a difficult code, the first region image and multiple second region images are decoded. When the decoding results are consistent, the decoding result is output as the recognition result of the target barcode.

[0042] And / or, the image correction module further includes:

[0043] The calibration submodule is used to calibrate the imaging plane where the target barcode is located based on the first camera and multiple second cameras, and obtain the correction parameters of the second cameras;

[0044] The image correction submodule is used to correct the second image captured by the second camera according to the correction parameters to obtain multiple third images, wherein the position of the target barcode in the first image is matched with its position in the multiple third images.

[0045] And / or, the calibration submodule further includes:

[0046] An image acquisition unit is used to acquire a first calibration image captured by the first camera on the calibration board, and a plurality of second calibration images captured by the second cameras on the calibration board;

[0047] The detection unit is used to perform feature point detection on the first calibration image to obtain first imaging feature points, and to perform feature point detection on the second calibration image to obtain multiple second imaging feature points;

[0048] A matching unit is used to match the first imaging feature point with a plurality of second imaging feature points to obtain a set of matching points;

[0049] The solving unit is used to solve the homography matrix corresponding to the second calibration image based on the matching point set, so as to obtain the correction parameters of the second camera.

[0050] And / or, the barcode determination module further includes:

[0051] The first determining submodule is used to extract gradient features from the first region image and multiple second region images respectively to obtain gradient feature maps, and to determine the first Euclidean distance information between the gradient feature maps.

[0052] The second determining submodule is used to perform binarization processing on the first region image and multiple second region images respectively to obtain binarized images, and determine the second Euclidean distance information between the binarized images;

[0053] The image processing submodule is used to calculate the difference value of the target barcode based on the first Euclidean distance information, the second Euclidean distance information, and the pixel count of the first image.

[0054] The third determining submodule is used to determine the difference estimation result based on the difference value and the difference threshold.

[0055] And / or, the third determining submodule further includes:

[0056] The first determining unit is configured to determine that if the difference value is greater than the difference threshold, the target barcode is a difficult code.

[0057] The second determining unit is configured to determine that if the difference value is less than or equal to the difference threshold, the target barcode is a non-difficult barcode.

[0058] And / or, the barcode determination module further includes:

[0059] The expansion submodule is used to expand the first coordinates to form an expansion area, and to detect the target barcode in the expansion area to obtain the second coordinates.

[0060] And / or, the image correction module further includes:

[0061] The image extraction submodule is used to extract a first region image corresponding to the second coordinate in the first image and a second region image corresponding to the second coordinate in the third image based on the second coordinate.

[0062] This application also provides a barcode recognition device, which is a physical node device. The barcode recognition device includes: a memory, a processor, and a program of the barcode recognition method stored in the memory and executable on the processor. When the program of the barcode recognition method is executed by the processor, it can implement the steps of the barcode recognition method as described above.

[0063] To achieve the above objectives, a computer-readable storage medium is also provided, on which a barcode recognition program is stored, wherein when the barcode recognition program is executed by a processor, it implements the steps of any of the barcode recognition methods described above.

[0064] This application provides a barcode recognition method, apparatus, device, and storage medium. The method involves acquiring a first image of a target barcode captured by a first camera, and multiple second images of the target barcode captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle. The method further involves acquiring the first coordinates of the target barcode in the first image, extracting a first region image corresponding to the first coordinates in the first image, and extracting a second region image corresponding to the first coordinates in multiple third images, wherein the third images are obtained by correcting the second images based on the first image. The method also involves determining a difference estimation result between the first region image and the multiple second region images; decoding the first region image and the multiple second region images based on the difference estimation result; and outputting the recognition result of the target barcode based on the decoding result. Specifically, the method acquires a first image and multiple second images of the target barcode captured from multiple angles, matches the position of the target barcode in the first image and the corrected second images, and therefore extracts a first region image in the first image and a second region image in the third image based on the first coordinates of the target barcode in the first image. By analyzing the differences in data sources between the first and second region images, potentially problematic barcodes are identified in advance, thus reducing the probability of false recognition. When the difference estimation result between the first region image and multiple second region images indicates that the target barcode is a potentially problematic barcode, the target barcode in both the first and multiple second region images is decoded to obtain the recognition result. Compared to existing technologies that struggle to accurately identify barcodes, leading to a high false recognition rate for potentially problematic barcodes, this method accurately identifies potentially problematic barcodes and reduces the false recognition rate. Attached Figure Description

[0065] Figure 1 This is a flowchart illustrating the first embodiment of the barcode recognition method of this application;

[0066] Figure 2 This is a schematic diagram showing the positions of the first camera, the second camera, and the target barcode in this application;

[0067] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application. Detailed Implementation

[0068] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0069] This application provides a barcode recognition method. In one embodiment of this barcode recognition method, it is applied to a barcode recognition device, as shown below. Figure 1 The method includes:

[0070] Step S10: Obtain a first image of the target barcode captured by the first camera, and multiple second images of the target barcode captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle.

[0071] Step S20: Obtain the first coordinates of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image;

[0072] Step S30: Determine the difference estimation results between the first region image and multiple second region images;

[0073] Step S40: Based on the difference estimation result, decode the first region image and multiple second region images, and output the recognition result of the target barcode according to the decoding result.

[0074] This embodiment aims to improve the accuracy of identifying difficult-to-identify barcode types and reduce the probability of misidentification.

[0075] As an example, in this application, a multi-angle camera is used to capture images of the target barcode to be identified, acquiring barcode images from multiple angles. Since the content difference of a non-difficult barcode is small in each image after angle correction with the images from both sides, the content of the barcode in the images is relatively small after multi-angle imaging. However, for a difficult barcode, due to the relative positions of the multi-angle cameras, there are certain differences in the content of the barcode in the resulting images (for example, the compressed bar and space areas due to distortion are different for a barcode with curved surface distortion under different camera angles; and the reflective area of ​​a reflective barcode is also different at different angles). In this application, a first image and multiple second images of the target barcode after multi-angle imaging are obtained, and the position of the target barcode in the first image and the corrected second images are matched (in the case of multiple barcodes within the imaging, the same barcodes in the imaging of different cameras are quickly bound). That is, based on the first coordinate of the target barcode in the first image, a first region image in the first image and a second region image in the third image are extracted. By analyzing the differences in data sources between the first and second region images, difficult-to-identify barcodes are determined in advance, thereby reducing the probability of misidentification. Furthermore, in this application, when the difference estimation result between the first and second region images indicates that the target barcode is a difficult-to-identify barcode, the target barcode in both the first and second region images is decoded to obtain the recognition result, thereby improving the accuracy of identifying difficult-to-identify barcodes.

[0076] As an example, in this application, multiple second cameras are positioned at angles to the first camera to obtain multi-angle barcode images. When performing difference estimation on these multi-angle barcode images, the barcode images captured by the cameras at different angles need to be corrected to achieve positional binding of the target barcodes in each barcode image. That is, based on the first camera, multiple second images captured by the multiple second cameras are corrected to ensure that the positions of the target barcodes in the first image and the multiple second images correspond, thereby achieving the binding of the target barcodes in each barcode image. When multiple target barcodes exist in a barcode image, the same target barcodes in barcode images from different cameras are quickly bound together, avoiding misjudgment caused by performing difference estimation processing between multiple different target barcodes.

[0077] As an example, in this application, the second camera is calibrated based on the first camera to obtain correction parameters. Based on these correction parameters, the second image captured by the second camera can be corrected, so that the target barcode is matched in position in the first image and multiple corrected third images. This enables fast and accurate binding of the same barcode in different cameras, which is convenient for subsequent difference estimation processing. It ensures that the barcode sent to the difference analysis processing is the same barcode, avoiding two different barcodes being sent to the difference analysis, which could lead to misjudgment.

[0078] As an example, in this application, a first calibration image captured by a first camera on a calibration board and second calibration images captured by multiple second cameras on the same calibration board are obtained. Feature point detection is performed on the first calibration image and the multiple second calibration images to obtain first imaging feature points and multiple second imaging feature points. Based on the first imaging feature points and the multiple second imaging feature points, feature point matching is performed on the first calibration image and the multiple second calibration images to obtain a matching point set. The homography matrix is ​​then solved to obtain the correction parameters. By correcting the second barcode image captured by the second camera using the correction coefficients, the position of the target barcode in the first image can be matched with its position in the multiple corrected second images, facilitating subsequent recognition of the target barcode in the second image and improving the recognition accuracy of the target barcode.

[0079] As an example, in this application, based on the first coordinate of the target barcode in the first image, a first region image corresponding to the first coordinate in the first image and a second region image corresponding to the first coordinate in multiple third images are extracted to determine the difference estimation result between the first region image and the second region image. According to the difference estimation result, the data difference between the first region image and the second region image is known. When this difference is greater than a threshold, the target barcode can be determined as a difficult barcode. Therefore, determining the difference estimation result between the first region image and the second region image is particularly important. Through gradient feature extraction and binarization processing, the difference value of the target barcode among multiple barcode images is obtained. Based on the difference value, difficult barcodes can be predicted, improving the efficiency of barcode recognition.

[0080] As an example, in this application, based on the comparison results between the difference value and the difference threshold, the target barcode is determined in advance as a difficult barcode or a non-difficult barcode before recognition, so that different recognition strategies can be applied to different types of target barcodes. This not only reduces the false recognition rate of difficult barcodes, but also improves the efficiency of barcode recognition.

[0081] As an example, in this application, since the target barcode may have missing or damaged information, leading to inaccurate detection, the first coordinate can be expanded before extracting the first region image corresponding to the first coordinate in the first image and the second region images corresponding to the first coordinate in multiple third images. This expands the area where the target barcode is located, ensuring the completeness and comprehensiveness of the target barcode in each image, thereby improving the accuracy of barcode detection. Furthermore, in this application, the position coordinates of the target barcode are detected based on the expanded region to obtain the second coordinate. The second region image corresponding to the second coordinate in the first image and the second region images corresponding to the second coordinate in multiple third images are then extracted based on this second coordinate, further improving the accuracy of barcode detection.

[0082] In this embodiment, the specific application scenario is:

[0083] In routine barcode recognition, factors such as barcode wrinkles, distortion, or material reflection can cause the barcode content in the barcode recognition device's image to be distorted or missing. This type of barcode is called a difficult-to-identify barcode.

[0084] For the reasons mentioned above, current decoding algorithms for difficult-to-identify barcode types rely solely on the camera's measurement of the barcode's width ratio for recognition and decoding. However, once a barcode is distorted or its reflective properties are lost, the barcode content still appears similar in shape to other barcode characters. This causes the decoding algorithm to identify incorrect information and output it incorrectly, resulting in misidentification.

[0085] As an example, the barcode recognition method can be applied to a barcode recognition system, which includes a camera and a barcode recognition device;

[0086] As an example, the barcode recognition device may be built into the first camera or the second camera, or into other mobile terminals, or independently of the camera and other mobile terminals.

[0087] As an example, the target barcode can be a barcode on a courier package, a product barcode on the outer packaging of a product, etc., and there are no specific limitations.

[0088] As an example, the first camera and the second camera can be of various types, such as color camera, black and white camera, standard definition camera, and high definition camera, without any specific limitation.

[0089] As an example, the first and second cameras are mounted downwards, meaning they are facing the direction of transmission or movement of the object with the target barcode attached. When identifying the target barcode, they can detect the content of the barcode on the front or side. Figure 2 As shown.

[0090] As an example, there can be multiple first cameras and multiple second cameras; no specific limitation is made here.

[0091] As an example, the first camera can be installed perpendicular to the imaging plane of the target barcode. The target barcode captured from this angle is clear and unobstructed.

[0092] As an example, the first camera can also be installed in a non-perpendicular position to the imaging plane where the target barcode is located.

[0093] As an example, the second camera can be installed perpendicular to the imaging plane of the target barcode. The target barcode captured from this angle is clear and unobstructed.

[0094] As an example, the first camera and the second camera can be mounted on the same vertical pole (with the same latitude and longitude), or the first camera and the second camera can be mounted on different vertical poles (with different latitude and longitude).

[0095] The specific steps are as follows:

[0096] Step S10: Obtain a first image of the target barcode captured by the first camera, and multiple second images of the target barcode captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle.

[0097] As an example, the first camera is set up so that its shooting angle is perpendicular to the imaging plane where the target barcode is located.

[0098] As an example, the second camera is mounted at any angle above the target barcode. In order to improve the recognition accuracy of the target barcode, the second camera is mounted at a certain angle to the first camera. Thus, a multi-angle image is formed based on the first image captured by the first camera and the second image captured by the second camera. This allows for the acquisition of images of the target barcode at different angles and exposures. By combining the barcode images from multiple angles, barcode analysis and recognition can be performed to improve the accuracy of barcode recognition.

[0099] As an example, there can be multiple second cameras. The number of second cameras is determined based on actual recognition needs and cost references, and no specific limit is made here.

[0100] As an example, such as Figure 2 As shown, if three cameras are used to identify a target barcode, and the imaging plane of the target barcode is set parallel to each other, with the first camera directly above and perpendicular to the imaging plane, and the two second cameras positioned on either side of the first camera at a certain angle, then the first camera captures a frontal image of the target barcode (the first image), and the two second cameras capture images of the left and right sides of the target barcode (the second images). A multi-angle image is then formed based on the first and second images.

[0101] As an example, the angle between the first and second cameras refers to the angle between the lines connecting the second camera and the target barcode, and the lines connecting the first camera and the target barcode. This angle is determined based on the actual recognition requirements and accuracy. It can be understood that if the angle is too large, it means the second camera is closer to the imaging plane of the target barcode. In this case, the target barcode captured by the second camera will be distorted due to reflections, unclear content display, etc., thus reducing the accuracy of barcode recognition based on the second image. Therefore, the angle size is determined based on the actual recognition requirements and accuracy. As an example, the angle between the second camera and the first camera is 30°.

[0102] As an example, acquiring a first image of the target barcode captured by a first camera and at least one second image of the target barcode captured by at least one second camera is triggered by an acquisition instruction. As an example, the acquisition instruction may be triggered in the following scenarios: when an object or workpiece with the target barcode attached passes directly below the first camera; or when an object or workpiece with the target barcode attached passes a sensor below the first camera, etc.

[0103] Step S20: Obtain the first coordinates of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image;

[0104] As an example, if there is an angle between the shooting angles of the second camera and the first camera, and the first camera is perpendicular to the imaging plane of the target barcode, the barcode image captured by the second camera is a non-perpendicular multi-angle image. In this case, it is necessary to correct the second image captured by the second camera in order to bind the target barcode in the first image and the target barcode in the second image, so as to ensure that the target barcode entering the difference estimation step is the same barcode, and avoid two different barcodes being sent into the difference analysis, which would lead to misjudgment.

[0105] As an example, if a first image captured by a first camera contains multiple target barcodes, and a second image captured by a second camera contains multiple target barcodes, then before performing difference estimation processing on the multiple target barcodes, it is necessary to bind the same target barcode. This quick and accurate binding of the same barcodes from different cameras ensures that the barcodes sent to the difference analysis step are the same barcodes, avoiding the submission of two different barcodes to the difference analysis, which could lead to misjudgment.

[0106] As an example, the first image includes a first barcode and a second barcode, and the second image includes a first barcode and a second barcode. In the case of multiple barcodes in the barcode image, the process of quickly binding the same barcode in barcode images from different cameras involves binding the first barcode in the first image to the first barcode in the second image, binding the second barcode in the first image to the second barcode in the second image, and performing difference estimation on the bound first barcodes (or on the bound second barcodes) to avoid misjudgments caused by differences in the barcodes themselves and improve the accuracy of identifying difficult barcodes.

[0107] As an example, a second image captured by a second camera is corrected based on a first image captured by a first camera, and then transformed to obtain a third image. The target barcode in the first image is detected, and its first coordinates in the first image are obtained. Since the second image, after correction, is identical to the first image, these first coordinates are also the position coordinates of the target barcode in the third image. Therefore, based on the first coordinates of the target barcode in the first image, a first region image corresponding to the first coordinate in the first image and a second region image corresponding to the first coordinate in the third image are extracted. The target barcode in both the first and second region images is then identified as a difficult-to-identify code.

[0108] As an example, the third image is obtained by correcting the second image based on the first image, including:

[0109] Step S21: Based on the first camera and multiple second cameras, calibrate the imaging plane where the target barcode is located to obtain the correction parameters of the second camera;

[0110] Step S21: Correct the second image captured by the second camera according to the correction parameters to obtain multiple third images, wherein the position of the target barcode in the first image matches its position in the multiple third images.

[0111] As an example, the imaging plane containing the target barcode is calibrated using a first camera and a second camera. The correction parameters of the second camera are determined, and these parameters are used to correct the second image captured by the second camera, resulting in a third image. Therefore, the position of the target barcode in the first image is matched with its position in multiple corrected third images. This enables fast and accurate binding of the same barcode from different cameras even when multiple barcodes exist within the imaging context. It ensures that the barcode sent for difference estimation is the same barcode, avoiding misjudgment caused by sending two inherently different barcodes for difference estimation.

[0112] As an example, the process of extracting a region image involves obtaining the first coordinates and then subtracting the first region image (ROI) from the first image based on these coordinates.c The second region image (ROI) is extracted from multiple third images based on the first coordinates. r Other methods for extracting the region image based on the first coordinate are also acceptable, and no specific limitation is made here.

[0113] Step S30: Determine the difference estimation results between the first region image and multiple second region images;

[0114] As an example, the region images extracted based on the same first coordinate in the corrected third images and the first image should be consistent. That is, the data of the target barcode in the first region image and the multiple second region images should be consistent or the difference should be within the expected range. In this case, the corresponding target barcode can be determined to be a non-difficult barcode. Therefore, it is necessary to perform difference estimation processing between the first region image and the second region image, and predict the type of the target barcode in advance, such as a difficult barcode or a non-difficult barcode, based on the difference estimation results.

[0115] As an example, determining the difference estimation results between the first region image and multiple second region images includes:

[0116] Step S31: Extract gradient features from the first region image and the multiple second region images respectively to obtain gradient feature maps, and determine the first Euclidean distance information between the gradient feature maps;

[0117] Step S32: Binarize the first region image and the multiple second region images respectively to obtain a binarized image, and determine the second Euclidean distance information between the binarized images;

[0118] Step S33: Calculate the difference value of the target barcode based on the first Euclidean distance information, the second Euclidean distance information, and the pixel count of the first image;

[0119] Step S34: Determine the difference estimation result based on the difference value and the difference threshold.

[0120] As an example, gradient feature extraction is performed on the first region image to obtain a first gradient feature map. Gradient feature extraction is also performed on the second region to obtain a second gradient feature map. The Euclidean distance between the first and second gradient feature maps is calculated to obtain the first Euclidean distance information. The first region image is then binarized to obtain a first binarized image. The second region image is also binarized to obtain a second binarized image. The Euclidean distance between the first and second binarized images is calculated to obtain the second Euclidean distance information. The first and second Euclidean distance information are summed and divided by the ROI of the first camera. cThe difference value of the target barcode is calculated from the number of pixels in the first captured image. This difference value is used to determine whether the target barcode is a difficult code or not.

[0121] As an example, a normal, non-difficult barcode, after being captured by multiple cameras from different angles and then angle-corrected using images from both sides, shows minimal differences in the barcode content across multiple images. A difficult barcode, however, exhibits differences in content across the barcode area in images captured from multiple angles due to the varying relative positions of the cameras and the barcode. Therefore, by utilizing the differences in the data source of the target barcode after imaging, difficult-type barcodes can be identified in advance, reducing the probability of misidentification. As another example, a difference threshold can be pre-set; target barcodes within this threshold are considered non-difficult, while those outside the threshold are considered non-difficult.

[0122] As an example, determining the difference estimation result based on the difference value and the difference threshold includes:

[0123] Step S341: If the difference value is greater than the difference threshold, then the target barcode is a difficult code;

[0124] Step S342: If the difference value is less than or equal to the difference threshold, then the target barcode is a non-difficult barcode.

[0125] As an example, if the difference value is greater than the difference threshold, the target barcode is a difficult code; if the difference value is less than or equal to the difference threshold, the target barcode is a non-difficult code.

[0126] Step S40: Based on the difference estimation result, decode the first region image and multiple second region images, and output the recognition result of the target barcode according to the decoding result.

[0127] As an example, the difference estimation result determines whether the target barcode is a difficult code, and different recognition processing methods are applied to difficult and non-difficult codes. By decoding the target barcode in the first region image and multiple second region images, and verifying the decoding results, different recognition results are output based on the verification results to improve the barcode recognition accuracy.

[0128] As an example, the decoding process of the first region image and multiple second region images based on the difference estimation result, and the output of the recognition result of the target barcode based on the decoding result, includes:

[0129] Step S41: If the difference estimation result indicates that the target barcode is a non-difficult code, the first region image is decoded, and the decoding result is output as the recognition result of the target barcode; or

[0130] If the difference estimation result indicates that the target barcode is a difficult code, the first region image and multiple second region images are decoded. When the decoding results are consistent, the decoding result is output as the recognition result of the target barcode.

[0131] As an example, when the target barcode is a difficult-to-identify code, both the first region image and multiple second region images are decoded to obtain the recognition result. The decoding process uses common techniques and is not specifically limited here. If the decoding result of the first region image is consistent with the decoding result of the second region image, the decoding result is output as the recognition result, thus realizing the recognition of the target barcode.

[0132] As an example, if the result of decoding the first region image is inconsistent with the result of decoding the second region image, then the recognition result will not be output.

[0133] As an example, a warning or alarm signal is issued without outputting the recognition result, and a detection box is marked for the target barcode in the image to facilitate subsequent manual processing of the target barcode.

[0134] As an example, when the target barcode is a non-difficult barcode, barcode recognition is performed directly on the first image captured by the first camera, and the recognition result is output. Alternatively, when the target barcode is a non-difficult barcode, barcode recognition is performed directly on the first region image, and the recognition result is output.

[0135] This application provides a barcode recognition method, apparatus, device, and storage medium. Compared to current methods that struggle to accurately identify barcodes, leading to high misidentification rates for difficult-to-identify barcodes, this application utilizes multi-angle cameras to capture images of the target barcode, obtaining images from multiple angles. Since the content of a non-difficult-to-identify barcode is relatively similar across images captured by multiple cameras and after angle correction with the images from both sides, the content of the barcode in each image is less different. However, for a difficult-to-identify barcode, due to the relative positions of the cameras, the content of the barcode in the resulting images exhibits certain differences (for example, the compressed bar and space areas of a distorted barcode differ depending on the camera angle; similarly, the reflective area of ​​a reflective barcode varies from angle to angle). This application acquires a first image and multiple second images of the target barcode captured from multiple angles, and matches the position of the target barcode in the first image and the corrected second images (in the case of multiple barcodes within the imaging, quickly binding identical barcodes captured by different cameras). Therefore, based on the first coordinate of the target barcode in the first image, a first region image corresponding to the first coordinate in the first image and a second region image corresponding to the first coordinate in the third image are extracted. By analyzing the differences in data sources between the first region image and multiple second region images, difficult-to-identify barcodes are determined in advance, thereby reducing the probability of misidentification. Furthermore, in this application, when the difference estimation result between the first region image and multiple second region images indicates that the target barcode is a difficult-to-identify barcode, the target barcode in both the first region image and multiple second region images is decoded to obtain the recognition result, thereby improving the accuracy of identifying difficult-to-identify barcodes.

[0136] Based on the first embodiment of the barcode recognition method described above, a second embodiment of the barcode recognition method is proposed. The method further includes:

[0137] Step A11: Obtain a first calibration image captured by the first camera on the calibration board, and a second calibration image captured by a plurality of second cameras on the calibration board;

[0138] Step A12: Perform feature point detection on the first calibration image to obtain the first imaging feature point, and perform feature point detection on multiple second calibration images to obtain multiple second imaging feature points;

[0139] Step A13: Match the first imaging feature point with multiple second imaging feature points to obtain a set of matching points;

[0140] Step A14: Solve the homography matrix corresponding to the second calibration image based on the matching point set to obtain the correction parameters of the second camera.

[0141] As an example, multiple second cameras are calibrated based on a first camera. The calibration process is as follows: A calibration board is placed on the imaging plane. The first camera captures an image of the calibration board, obtaining a first calibration image. The second cameras capture an image of the calibration board, obtaining second calibration images. The first calibration image and multiple second calibration images are acquired. Feature point detection is performed on the first calibration image to obtain first imaging feature points. Feature point detection is performed on the second calibration images to obtain second imaging feature points. It should be noted that the first and second imaging feature points refer to the feature points of each calibration image, not the feature points of the calibration board in the calibration images.

[0142] Feature point matching is performed based on the first and second imaging feature points to obtain successfully matched points, forming a set of matched points. This set of matched points is used to solve the homography matrix corresponding to the second calibration image to obtain the correction parameters of the second camera.

[0143] As an example, the correction parameters include rotation matrix parameters, translation matrix parameters, and normal vector parameters, which are used to correct the second image captured by the second camera so that the corrected image is consistent with the image of the calibration reference.

[0144] As an example, if the first camera C C There is one camera, and two cameras, namely C. r C l In terms of setup, the first camera is positioned directly above the calibration plate in the imaging plane, and the second camera C... l Located at the upper left of the calibration board, the second camera C r The second camera C is located at the upper right of the calibration board. r C l Compared to the first camera C C The calibration process is as follows:

[0145] A calibration board is placed on the imaging plane, and a first camera captures an image of the calibration board to obtain a first calibration image. This image is then transmitted through a second camera C. r C l The calibration board is photographed to obtain a second calibration image and a third calibration image. The first, second, and third calibration images are acquired, and feature point detection is performed on the first calibration image to obtain the first imaging feature point. Feature point detection is performed on the second calibration image to obtain the second imaging feature point. Feature point detection is performed on the third calibration image to obtain the third imaging feature point. Then, the second camera C... r The second imaging feature point and the first camera C CFeature point matching is performed on the first imaging feature point to obtain successfully matched points, forming a set of matched points. This set of matched points is used to solve for the homography matrix H corresponding to the second calibration image. r The second camera C is obtained. r The correction parameters. Then, the second camera C... l The third imaging feature point and the first camera C C Feature point matching is performed on the first imaging feature point to obtain successfully matched points, forming a set of matched points. This set of matched points is used to solve for the homography matrix H corresponding to the third calibration image. l The second camera C is obtained. l The correction parameters.

[0146] In this embodiment, the second barcode image captured by the second camera is corrected using a correction coefficient, thereby achieving positional binding of the target barcode in each barcode image. This facilitates the identification of the target barcode in multiple second images and improves the accuracy of target barcode identification.

[0147] Based on the first or second embodiment of the above-described barcode recognition method, a third embodiment of the barcode recognition method is proposed.

[0148] As an example, before obtaining the first coordinates of the target barcode in the first image, and extracting the first region image corresponding to the first coordinates in the first image and the second region image corresponding to the first coordinates in multiple third images, the process includes:

[0149] Step B1: Expand the first coordinates to obtain an expanded area, and detect the target barcode in the expanded area to obtain the second coordinates;

[0150] In this embodiment, since the target barcode may have missing or damaged information, leading to inaccurate detection, before extracting the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in the third image based on the first coordinate of the target barcode in the first image, the first coordinate is expanded to enlarge the area where the target barcode is located, thus obtaining the expanded region. Barcode detection is then performed within the expanded region to obtain a more accurate first coordinate, which is the second coordinate.

[0151] As an example, during the expansion process of the first coordinate, the region corresponding to the first coordinate is expanded based on preset expansion parameters. The expansion parameters are set according to actual needs and are not specifically limited here. As an example, if the expansion parameter is 20%, the expansion process is to expand the horizontal coordinate by 20% of the region's length and the vertical coordinate by 20% of the region's width, forming the expanded region.

[0152] As an example, obtaining the first coordinates of the target barcode in the first image, extracting the first region image corresponding to the first coordinates in the first image and the second region image corresponding to the first coordinates in multiple third images includes:

[0153] Step B2: Based on the second coordinates, extract the first region image corresponding to the second coordinates in the first image and the second region image corresponding to the second coordinates in the third image.

[0154] As an example, a first region image is obtained by extracting a region image from the first image based on the second coordinate, and a second region image is obtained by extracting a region image from the third image based on the second coordinate. This ensures that the target barcode is completely contained in the new first and second region images, avoiding situations such as barcode omission or occlusion that would affect the accuracy of barcode recognition.

[0155] In this embodiment, the first coordinate is expanded to enlarge the area where the target barcode is located, ensuring that the target barcode in each barcode image is complete and comprehensive, thereby improving the accuracy of barcode detection.

[0156] Reference Figure 3 , Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.

[0157] like Figure 3 As shown, the barcode recognition device may include: a processor 1001, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005.

[0158] Optionally, the barcode recognition device may also include a user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, a WiFi module, etc. The user interface may include a display screen and an input submodule such as a keyboard; optional user interfaces may also include standard wired or wireless interfaces. The network interface may include standard wired or wireless interfaces (such as a Wi-Fi interface).

[0159] Those skilled in the art will understand that Figure 3 The structure of the barcode recognition device shown does not constitute a limitation on the barcode recognition device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0160] like Figure 3As shown, the memory 1005, serving as a storage medium, may include an operating system, a network communication module, and a barcode recognition program. The operating system is a program that manages and controls the hardware and software resources of the barcode recognition device, supporting the operation of the barcode recognition program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the barcode recognition system.

[0161] exist Figure 3 In the barcode recognition device shown, the processor 1001 is used to execute the barcode recognition program stored in the memory 1005 to implement the steps of the barcode recognition method described in any of the above claims.

[0162] The specific implementation of the barcode recognition device in this application is basically the same as the embodiments of the barcode recognition method described above, and will not be repeated here.

[0163] This application also provides a barcode recognition device, the device comprising:

[0164] The image acquisition module is used to acquire a first image of the target barcode after being captured by a first camera, and multiple second images of the target barcode after being captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle.

[0165] The image correction module is used to obtain the first coordinates of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image;

[0166] A barcode determination module is used to determine the difference estimation results between the first region image and multiple second region images;

[0167] The barcode recognition module is used to decode the first region image and multiple second region images based on the difference estimation results, and output the recognition result of the target barcode according to the decoding results.

[0168] In one possible implementation of this application, the barcode recognition module further includes:

[0169] The difficult-to-determine submodule is used to decode the first region image if the difference estimation result indicates that the target barcode is a non-difficult-to-determine barcode, and output the decoding result as the recognition result of the target barcode; or

[0170] If the difference estimation result indicates that the target barcode is a difficult code, the first region image and multiple second region images are decoded. When the decoding results are consistent, the decoding result is output as the recognition result of the target barcode.

[0171] And / or, the image correction module further includes:

[0172] The calibration submodule is used to calibrate the imaging plane where the target barcode is located based on the first camera and multiple second cameras, and obtain the correction parameters of the second cameras;

[0173] The image correction submodule is used to correct the second image captured by the second camera according to the correction parameters to obtain multiple third images, wherein the position of the target barcode in the first image is matched with its position in the multiple third images.

[0174] And / or, the calibration submodule includes:

[0175] An image acquisition unit is used to acquire a first calibration image captured by the first camera on the calibration board, and a plurality of second calibration images captured by the second cameras on the calibration board;

[0176] The detection unit is used to perform feature point detection on the first calibration image to obtain a first imaging feature point, and to perform feature point detection on multiple second calibration images to obtain multiple second imaging feature points.

[0177] A matching unit is used to match the first imaging feature point with a plurality of second imaging feature points to obtain a set of matching points;

[0178] The solving unit is used to solve the homography matrix corresponding to the second calibration image based on the matching point set, so as to obtain the correction parameters of the second camera.

[0179] And / or, the barcode determination module further includes:

[0180] The first determining submodule is used to extract gradient features from the first region image and multiple second region images respectively to obtain gradient feature maps, and to determine the first Euclidean distance information between the gradient feature maps.

[0181] The second determining submodule is used to perform binarization processing on the first region image and multiple second region images respectively to obtain binarized images, and determine the second Euclidean distance information between the binarized images;

[0182] The image processing submodule is used to calculate the difference value of the target barcode based on the first Euclidean distance information, the second Euclidean distance information, and the pixel count of the first image.

[0183] The third determining submodule is used to determine the difference estimation result based on the difference value and the difference threshold.

[0184] And / or, the third determining submodule further includes:

[0185] The first determining unit is configured to determine that if the difference value is greater than the difference threshold, the target barcode is a difficult code.

[0186] The second determining unit is configured to determine that if the difference value is less than or equal to the difference threshold, the target barcode is a non-difficult barcode.

[0187] And / or, the barcode determination module further includes:

[0188] The expansion submodule is used to expand the first coordinates to form an expansion area, and to detect the target barcode in the expansion area to obtain the second coordinates.

[0189] And / or, the image correction module further includes:

[0190] The image extraction submodule is used to extract a first region image corresponding to the second coordinate in the first image and a second region image corresponding to the second coordinate in the third image based on the second coordinate.

[0191] The specific implementation of the barcode recognition device in this application is basically the same as the embodiments of the barcode recognition method described above, and will not be repeated here.

[0192] This application provides a computer-readable storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the barcode recognition method described in any of the above claims.

[0193] The specific implementation of the storage medium in this application is basically the same as the embodiments of the barcode recognition method described above, and will not be repeated here.

[0194] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described barcode recognition method.

[0195] The specific implementation of the computer program product in this application is basically the same as the various embodiments of the barcode recognition method described above, and will not be repeated here.

[0196] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0197] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0198] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of a software plus hardware platform, or by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0199] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A barcode recognition method, characterized in that, The method includes: The system acquires a first image of the target barcode captured by a first camera, and multiple second images of the target barcode captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle. Obtain the first coordinate of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image; Determine the difference estimation results between the first region image and multiple second region images; Based on the difference estimation results, the first region image and multiple second region images are decoded, and the recognition result of the target barcode is output according to the decoding results; The step of decoding the first region image and multiple second region images based on the difference estimation result, and outputting the recognition result of the target barcode according to the decoding result, includes: If the difference estimation result indicates that the target barcode is a non-difficult barcode, the first region image is decoded, and the decoding result is output as the recognition result of the target barcode; or If the difference estimation result indicates that the target barcode is a difficult code, the first region image and multiple second region images are decoded. When the decoding results are consistent, the decoding result is output as the recognition result of the target barcode.

2. The barcode recognition method as described in claim 1, characterized in that, The third image is obtained by correcting the second image based on the first image, and includes: The imaging plane containing the target barcode is calibrated based on the first camera and multiple second cameras to obtain the correction parameters of the second cameras; The second image captured by the second camera is corrected according to the correction parameters to obtain multiple third images, and the position of the target barcode in the first image is matched with its position in the multiple third images.

3. The barcode recognition method as described in claim 2, characterized in that, The step of calibrating the imaging plane containing the target barcode based on the first camera and multiple second cameras to obtain the correction parameters of the second cameras includes: Acquire a first calibration image captured by the first camera on the calibration board, and a second calibration image captured by a plurality of second cameras on the calibration board; Feature point detection is performed on the first calibration image to obtain the first imaging feature point, and feature point detection is performed on multiple second calibration images to obtain multiple second imaging feature points; The first imaging feature point is matched with multiple second imaging feature points to obtain a set of matching points; The homography matrix corresponding to the second calibration image is solved based on the matching point set to obtain the correction parameters of the second camera.

4. The barcode recognition method as described in claim 1, characterized in that, The determination of the difference estimation results between the first region image and the plurality of second region images includes: Gradient features are extracted from the first region image and multiple second region images respectively to obtain gradient feature maps, and the first Euclidean distance information between the gradient feature maps is determined. The first region image and multiple second region images are binarized to obtain binarized images, and the second Euclidean distance information between the binarized images is determined. The difference value of the target barcode is calculated based on the first Euclidean distance information, the second Euclidean distance information, and the pixel count of the first image; The difference estimation result is determined based on the difference value and the difference threshold.

5. The barcode recognition method as described in claim 4, characterized in that, Determining the difference estimation result based on the difference value and the difference threshold includes: If the difference value is greater than the difference threshold, then the target barcode is a difficult code; If the difference value is less than or equal to the difference threshold, then the target barcode is a non-difficult barcode.

6. The barcode recognition method as described in claim 1, characterized in that, Before obtaining the first coordinates of the target barcode in the first image, and extracting the first region image corresponding to the first coordinates in the first image and the second region image corresponding to the first coordinates in multiple third images, the process includes: The first coordinate is expanded to obtain an expanded region, and the target barcode in the expanded region is detected to obtain the second coordinate. The step of obtaining the first coordinates of the target barcode in the first image, and extracting the first region image corresponding to the first coordinates in the first image and the second region image corresponding to the first coordinates in multiple third images includes: Based on the second coordinate, extract the first region image corresponding to the second coordinate in the first image and the second region image corresponding to the second coordinate in the third image.

7. A barcode recognition device, characterized in that, The device includes: The image acquisition module is used to acquire a first image of the target barcode after being captured by a first camera, and multiple second images of the target barcode after being captured by multiple second cameras, wherein the installation positions of the multiple second cameras and the first camera are at an angle. The image correction module is used to obtain the first coordinates of the target barcode in the first image, extract the first region image corresponding to the first coordinate in the first image and the second region image corresponding to the first coordinate in multiple third images, wherein the third image is obtained by correcting the second image based on the first image; A barcode determination module is used to determine the difference estimation results between the first region image and multiple second region images; The barcode recognition module is used to decode the first region image and multiple second region images based on the difference estimation results, and output the recognition result of the target barcode according to the decoding results; The barcode recognition module also includes: The difficult-to-determine submodule is used to decode the first region image if the difference estimation result indicates that the target barcode is a non-difficult-to-determine barcode, and output the decoding result as the recognition result of the target barcode; or If the difference estimation result indicates that the target barcode is a difficult code, the first region image and multiple second region images are decoded. When the decoding results are consistent, the decoding result is output as the recognition result of the target barcode.

8. The barcode recognition device as described in claim 7, characterized in that, The image correction module also includes: The calibration submodule is used to calibrate the imaging plane where the target barcode is located based on the first camera and multiple second cameras, and obtain the correction parameters of the second cameras; The image correction submodule is used to correct the second image captured by the second camera according to the correction parameters to obtain multiple third images, wherein the position of the target barcode in the first image is matched with its position in the multiple third images; And / or, the calibration submodule further includes: An image acquisition unit is used to acquire a first calibration image captured by the first camera on the calibration board, and a second calibration image captured by a plurality of second cameras on the calibration board; The detection unit is used to perform feature point detection on the first calibration image to obtain a first imaging feature point, and to perform feature point detection on multiple second calibration images to obtain multiple second imaging feature points. A matching unit is used to match the first imaging feature point with a plurality of second imaging feature points to obtain a set of matching points; The solving unit is used to solve the homography matrix corresponding to the second calibration image based on the matching point set, so as to obtain the correction parameters of the second camera; And / or, the barcode determination module further includes: The first determining submodule is used to extract gradient features from the first region image and multiple second region images respectively to obtain gradient feature maps, and to determine the first Euclidean distance information between the gradient feature maps. The second determining submodule is used to perform binarization processing on the first region image and multiple second region images respectively to obtain binarized images, and determine the second Euclidean distance information between the binarized images; The image processing submodule is used to calculate the difference value of the target barcode based on the first Euclidean distance information, the second Euclidean distance information, and the pixel count of the first image. The third determining submodule is used to determine the difference estimation result based on the difference value and the difference threshold; And / or, the third determining submodule further includes: The first determining unit is configured to determine that if the difference value is greater than the difference threshold, the target barcode is a difficult code. The second determining unit is configured to determine that if the difference value is less than or equal to the difference threshold, the target barcode is a non-difficult barcode. And / or, the barcode determination module further includes: The expansion submodule is used to expand the first coordinates to form an expansion area, and to detect the target barcode in the expansion area to obtain the second coordinates. And / or, the image correction module further includes: The image extraction submodule is used to extract a first region image corresponding to the second coordinate in the first image and a second region image corresponding to the second coordinate in the third image based on the second coordinate.

9. A barcode recognition device, characterized in that, The barcode recognition device includes a memory, a processor, and a barcode recognition program stored in the memory and executable on the processor. When the processor executes the barcode recognition program, it implements the steps of the barcode recognition method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a barcode recognition program, which, when executed by a processor, implements the steps of the barcode recognition method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Detection and segmentation of a two-dimensional code

    AU2008226843A1

  • Omnibearing bar code identification device and method

    CN107145810A