Deep-learning-based barcode locating and detection method
By applying a deep learning-based barcode positioning detection method in the field of industrial logistics, using the yolo-fastest model for coarse positioning and target detection, the problems of small proportion of barcode surfaces, random locations and complex backgrounds in high-resolution images are solved, and efficient and accurate barcode positioning and reading are achieved.
Patent Information
- Application Number
- PCT/CN2024/099707
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-20
- Filing Date
- 2024-06-18
- Publication Date
- 2025-03-27
AI Technical Summary
In the field of industrial logistics, barcode surface lists in high-resolution images account for a small proportion, random locations, and complex backgrounds, which leads to the traditional method taking a long time to locate barcodes, which is easy to miss or misjudgment, and is greatly affected by changes in light source and background complexity.
The barcode positioning detection method based on deep learning is adopted to obtain the image to be detected by scaling the original image, and the yolo-fastest model is used for coarse positioning and object detection, the barcode area is extracted, and the target barcode area is determined based on the distance and relative position of the detection frame, and the target barcode is finally extracted from the high-resolution original image.
It improves the accuracy and efficiency of barcode detection, reduces sensitivity to light source changes and background complexity, and realizes real-time and efficient barcode positioning and reading.
Smart Images

Figure CN2024099707_27032025_PF_FP_ABST
Abstract
Description
A barcode positioning detection method based on deep learning Technical Field
[0001] The present application relates to the field of industrial logistics technology, and in particular to a barcode positioning and detection method based on deep learning. Background Art
[0002] A barcode is a graphical identifier that represents information by arranging multiple black and white bars of varying widths according to specific coding rules. Barcodes can indicate information such as the item's name, production date, expiration date, manufacturer, mail origin and destination, date, and book classification number. Consequently, barcodes are widely used in various industries, including retail, finance, publishing, and logistics.
[0003] The rapid development of barcode technology has also placed higher demands on barcode detection. In industrial logistics, captured images often have very high resolution. Barcode labels are affixed to the package surface, occupying a very small portion of the image. Furthermore, the barcode labels are randomly positioned across different images, and the background is complex and varied. Locating barcodes through a full-image search is time-consuming and prone to omissions or misjudgments. Furthermore, images captured in industrial logistics often experience variable light sources and complex backgrounds, making traditional barcode detection and location methods such as morphological methods, Hough line detection, and edge detection ineffective. Technical issues
[0004] In the field of industrial logistics, images captured often have very high resolution. Barcode labels are affixed to the surface of packages, occupying a very small portion of the image. Furthermore, the barcode labels are randomly positioned across different images, and the background is complex and varied. Locating the barcode through an entire image is time-consuming and prone to omissions or misjudgments. Furthermore, images captured in industrial logistics often experience variable light sources and complex backgrounds, making traditional barcode detection and location methods such as morphological methods, Hough line detection, and edge detection ineffective. Technical Solutions
[0005] In response to the above-mentioned problems and technical requirements, this application proposes a barcode positioning detection method based on deep learning. The technical solution of this application is as follows:
[0006] A barcode positioning detection method based on deep learning, the barcode positioning detection method comprising:
[0007] Scaling the acquired original image to obtain an image to be detected, wherein the image resolution of the image to be detected is smaller than that of the original image;
[0008] A coarse positioning model is used to extract a barcode label area image from the image to be detected. The barcode label area image is an image of the area where the barcode label is located. The barcode label is printed with a barcode and its corresponding checkbox. The edges of the barcode are parallel to the edges of the barcode label, and the checkbox corresponding to each barcode is located at a predetermined relative position to the barcode. The coarse positioning model is trained based on the yolo-fastest model.
[0009] The target detection model is used to perform target detection on the barcode surface single-area image. The barcode detection box, the associated detection box of each barcode, the associated detection box of each associated object group, and the check box detection box of each check box in the barcode surface single-area image are extracted. An associated object group includes a barcode and its corresponding check box. The target detection model is trained based on the yolo-fastest model.
[0010] Determine the target barcode area in the barcode face single area image based on the individual barcode detection boxes, associated detection boxes, and check box detection boxes;
[0011] The target barcode is extracted from the original image according to the target barcode area in the barcode surface single area image.
[0012] A further technical solution is to determine the target barcode area in the barcode face single area image according to each barcode detection frame, associated detection frame and check box detection frame, including:
[0013] When at least one associated detection frame and multiple barcode detection frames are detected from a single area image of the barcode surface, the barcode detection frame that matches each associated detection frame is determined based on each barcode detection frame, the associated detection frame and the check box detection frame, and the area where the barcode detection frame that matches each associated detection frame is located is used as the target barcode area.
[0014] A further technical solution is to determine, based on each barcode detection box, associated detection box, and check box detection box, a barcode detection box that matches each associated detection box, including for each associated detection box:
[0015] Calculate the distance between each barcode detection frame and the associated detection frame respectively, and determine the barcode detection frame with the smallest distance to the associated detection frame as the first candidate detection frame, and the barcode detection frame with the second smallest distance to the associated detection frame as the second candidate detection frame;
[0016] When the difference between the distances of two candidate detection frames and the associated detection frame reaches the distance difference threshold, the area where the first candidate detection frame is located is directly used as the target barcode area;
[0017] When the difference between the distances of two candidate detection frames and the associated detection frame does not reach the distance difference threshold, the area where one of the candidate detection frames is located is determined as the target barcode area based on the relative positions of the two candidate detection frames, the associated detection frame, and each checked box detection frame.
[0018] A further technical solution is to determine the area where one of the candidate detection boxes is located as the target barcode area based on the relative positions of the two candidate detection boxes, the associated detection box, and each check box detection box, including:
[0019] The check box corresponding to a barcode is located on one side of the barcode along the horizontal direction of the plane, the first candidate detection box is located on the first side of the associated detection box along the horizontal direction of the plane, and the second candidate detection box is located on the second side of the associated detection box along the horizontal direction of the plane; when a check box detection box exists on the first side of the first candidate detection box along the horizontal direction of the plane, the area where the second candidate detection box is located is used as the target barcode area; otherwise, the area where the first candidate detection box is located is used as the target barcode area;
[0020] Alternatively, a check box corresponding to a barcode is located on the first side of the barcode along the vertical direction on the plane, the first candidate detection box is located on the first side of the associated detection box along the vertical direction on the plane, and the second candidate detection box is located on the second side of the associated detection box along the vertical direction on the plane; when there is a check box detection box on the first side of the first candidate detection box along the vertical direction on the plane, the area where the second candidate detection box is located is used as the target barcode area, otherwise the area where the first candidate detection box is located is used as the target barcode area.
[0021] A further technical solution is that determining the target barcode area based on each barcode detection box, associated detection box and check box detection box also includes:
[0022] When a unique associated detection frame and a unique barcode detection frame are detected from a single area image of a barcode face, the area where the detected barcode detection frame is located is directly used as the target barcode area;
[0023] When no associated detection frame is detected from the barcode face single region image, it is determined that the target barcode does not exist in the original image.
[0024] A further technical solution is to extract the target barcode from the original image according to the target barcode area in the barcode surface single area image, including:
[0025] The target barcode area in the single area image of the barcode surface is coordinate-transformed according to the image mapping relationship, the target barcode area in the original image is determined, and the image in the target barcode area in the original image is read to obtain the target barcode.
[0026] A further technical solution is to extract a single area image of the barcode surface from the collected original image using a coarse positioning model, including:
[0027] Extract the initial single face image from the collected original image using the coarse positioning model;
[0028] When the inclination angle between the edge of the initial face order image and the edge of the image to be detected does not reach the inclination angle threshold, the initial face order image is used as the extracted barcode face order area image;
[0029] When the inclination angle between the edge of the initial face order image and the edge of the image to be detected reaches the inclination angle threshold, the initial face order image is rotated until the edge and the edge of the image to be detected are within the inclination angle threshold, and the rotated initial face order image is used as the extracted barcode face order area image.
[0030] A further technical solution is to extract an initial face image from the image to be detected using a coarse positioning model, including:
[0031] Input the image to be detected into the coarse positioning model to obtain several face detection boxes whose confidence scores reach the score threshold in the image to be detected;
[0032] Non-maximum suppression is used to further filter several retained face order detection frames, and the image within each retained face order detection frame is extracted as an initial face order image.
[0033] A further technical solution is to use non-maximum suppression to further screen the retained face sheet detection frames, including:
[0034] Determine the face order detection box with the highest confidence score;
[0035] Traverse each other face order detection frame in turn, and calculate the overlapping area between the traversed face order detection frame and the face order detection frame with the highest confidence score. When the overlapping area reaches the overlapping area threshold, the traversed face order detection frame will be deleted.
[0036] A further technical solution is to extract a barcode surface single area image from the collected original image using a coarse positioning model, and further include:
[0037] Perform image sharpening processing on the initial single face image;
[0038] Binarizing the initial single face image after image sharpening to obtain a binary single face image;
[0039] After performing dilation and morphological opening operations on the binary single image, the maximum area contour is determined;
[0040] The minimum circumscribed rectangle of the maximum area contour is constructed, and the angle between the minimum circumscribed rectangle and the edge of the image to be detected is used as the inclination angle between the edge of the initial single face image and the edge of the image to be detected. Beneficial effects
[0041] The present application discloses a barcode positioning and detection method based on deep learning. The method first uses the yolo-fastest model to perform coarse positioning extraction on the barcode surface single area image in the image to be detected after reducing the image resolution, and then uses the yolo-fastest model to perform target detection on the check box, barcode and related objects in the barcode surface single area image respectively. Then, the final target barcode area is obtained by integrating the relationship between the various types of target detections, so as to realize the positioning extraction of the target barcode and the subsequent code reading. The method reduces the original image resolution, uses the deep learning model for barcode detection, and then performs full-frame code reading from the high-resolution original image, ensuring real-time performance while improving the accuracy of barcode detection and code reading.
[0042] When extracting a single-area image of a barcode surface, this method determines whether rotation is required based on the inclination angle of the single-area image of the barcode surface relative to the image to be detected. If rotation is required, the image is rotated to be parallel to the edge, thereby increasing the accuracy of subsequent target detection and improving the accuracy of barcode detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] FIG1 is a flow chart of a barcode positioning detection method according to an embodiment of the present application.
[0044] FIG2 is a schematic diagram of image processing in an example of the present application.
[0045] FIG3 is a flow chart of a method for extracting a single-area image of a barcode surface according to an embodiment of the present application.
[0046] FIG4 is a flow chart of a method for determining a target barcode area in one embodiment of the present application. Modes for Carrying Out the Invention
[0047] The specific implementation of this application will be further described below with reference to the accompanying drawings.
[0048] This application discloses a barcode positioning detection method based on deep learning. Please refer to the flowchart shown in Figure 1. The barcode positioning detection method includes:
[0049] Step 1: Scaling the acquired original image to obtain an image to be detected, wherein the image resolution of the image to be detected is smaller than that of the original image.
[0050] The scenarios targeted by this application are mainly in the field of industrial logistics. The original image collected is an image of a package with a barcode label attached to it. Therefore, the original image collected contains the barcode label, but the barcode label often accounts for a relatively small proportion of the original image, as shown in (a) in Figure 2. The barcode label is printed with a barcode and its corresponding checkbox. The edge of the barcode is parallel to the edge of the barcode label, and the checkbox corresponding to each barcode is located at a predetermined relative position of the barcode. The predetermined relative position is pre-set. The current common practice in the industry is to print the checkbox corresponding to each barcode on one side of the short side of the barcode, as shown in the enlarged views of (b), (c), and (d) in Figure 2. Figure 2 uses the example of 8 barcodes and each checkbox printed on the barcode label for explanation.
[0051] Considering that in the field of industrial logistics, the resolution of the original images captured by cameras is generally high, such as a common resolution of 5440*3648. Directly processing the original images is time-consuming and has poor real-time performance. Therefore, to improve the efficiency of positioning detection, please refer to the flowchart for extracting a single-area image of the barcode face shown in Figure 1. This step first scales the acquired original image to obtain the image to be detected. The image resolution of the obtained image to be detected is lower than that of the original image. For example, the original image can be scaled several times. In one example, the original image can be scaled 4 times, processing the 5440*3648 original image into a 1360*912 image to be detected.
[0052] Step 2: Use a coarse positioning model to extract a single area image of the barcode surface from the image to be detected. The coarse positioning model is trained based on the yolo-fastest model.
[0053] This method first uses a pre-trained coarse positioning model to locate the image of the barcode label area, that is, to extract the barcode label area image. During the extraction process, inputting the image to be detected into the coarse positioning model does not necessarily directly obtain a barcode label area image that meets the posture requirements. Instead, the initial label image in the original image is first extracted, including:
[0054] (1) Input the image to be detected into the coarse positioning model to obtain several face detection boxes in the image to be detected whose confidence scores reach the score threshold.
[0055] (2) Non-maximum suppression is used to further filter the retained face order detection frames, and the image within each retained face order detection frame is extracted as an initial face order image. When non-maximum suppression is used to further filter the face order detection frames, the face order detection frame with the highest confidence score is determined, and then the other face order detection frames are traversed in turn, and the overlapping area between the traversed face order detection frame and the face order detection frame with the highest confidence score is calculated. When the overlapping area reaches the overlapping area threshold, the traversed face order detection frame is deleted. After the traversal is completed, the screening is completed.
[0056] Before application, this method also includes the steps of first training a coarse positioning model. This involves collecting the original sample image and then scaling it to obtain a sample image. The face area in the sample image is then annotated to construct a training dataset. The model is then trained based on the yolo-fastest model. The training batch size is set to 64, and the number of subdivisions is set to 16. This means that 64 images are loaded into memory at once, and forward propagation is completed in 16 passes. Backpropagation is performed after each 64 forward passes. A stochastic gradient descent algorithm with momentum is used. The momentum is set to 0.949, the weight decay regularization term is set to 0.0005, the initial learning rate is set to 0.001, and the total number of iterations is 11,200. The learning rate is adjusted to the initial learning rate multiplied by 0.1 when the training batch size reaches 8,960 and 10,080.
[0057] The initial label image extracted by the coarse positioning model after inputting the image to be detected is located at the actual location of the barcode label in the original image. However, the position and posture of the barcode label in the original image are random. When the barcode label is tilted or rotated too much, the barcode printed on the barcode label will also have a large tilt or rotation angle, causing the subsequent barcode detection frame to overlap the area of other barcodes, affecting detection accuracy. Please refer to Figure 2. After scaling the original image (a) in Figure 2 and extracting the initial label image through the coarse positioning model, it is shown in Figure 2 (b). The dotted line represents the detection frame for one barcode, which can be seen to overlap other barcodes, affecting detection accuracy.
[0058] Therefore, after extracting the initial face single image, the tilt angle between the edge of the initial face single image and the edge of the image to be detected is also detected. This includes: performing image sharpening processing on the initial face single image to enhance the edges, binarizing the initial face single image after image sharpening processing to obtain a binary face single image, performing dilation and morphological opening operations on the binary face single image, determining the maximum area contour, constructing the minimum bounding rectangle of the maximum area contour, and using the angle between the minimum bounding rectangle and the edge of the image to be detected as the tilt angle between the edge of the initial face single image and the edge of the image to be detected.
[0059] When the tilt angle between the edge of the initial single image and the edge of the image to be detected does not reach the tilt angle threshold, the initial single image is used as the extracted barcode single area image. When the tilt angle between the edge of the initial single image and the edge of the image to be detected reaches the tilt angle threshold, the initial single image is rotated until the edge and the edge of the image to be detected are within the tilt angle threshold, and the rotated initial single image is used as the extracted barcode single area image. The direction of rotation is not limited. For example, in the example of Figure 2, the extracted initial single image (b) is rotated to obtain the barcode single area image (c) or the barcode single area image (d).
[0060] Therefore, in this step, the edge of the extracted barcode surface single-area image and the edge of the image to be detected are at the tilt angle threshold, and the posture calibration has been completed.
[0061] Step 2: Use the target detection model to perform target detection on the single area image of the barcode surface. The target detection model is trained based on the yolo-fastest model.
[0062] The objects for target detection are barcodes, checkboxes, and associated object groups. An associated object group consists of a barcode and its corresponding checkbox. The barcode detection frame for each barcode, the associated detection frame for each associated object group, and the checkbox detection frame for each checkbox in the barcode face image are extracted. Similar to step 1, this step also includes pre-training the target detection model before using it, which will not be repeated in this embodiment.
[0063] Step 3: Determine the target barcode area in the barcode face image based on the barcode detection boxes, associated detection boxes, and check box detection boxes. This includes the following situations, please refer to the flowchart shown in Figure 4:
[0064] Case 1: at least one associated detection frame and multiple barcode detection frames are detected from a single-region image of a barcode face.
[0065] In this case, a barcode detection frame matching each associated detection frame is determined according to each barcode detection frame, associated detection frame, and check box detection frame, and the area where the barcode detection frame matching each associated detection frame is located is used as the target barcode area.
[0066] The method for determining the barcode detection frame that matches each associated detection frame includes:
[0067] 1. Calculate the distance between each barcode detection frame and the associated detection frame. Select the barcode detection frame with the smallest distance to the associated detection frame as the first candidate detection frame, and the barcode detection frame with the second smallest distance to the associated detection frame as the second candidate detection frame. When calculating the distance between a barcode detection frame and the associated detection frame, calculate the Euclidean distance between the center point of the barcode detection frame and the center point of the associated detection frame.
[0068] 2. When the difference between the two candidate detection frames and the associated detection frame reaches the distance difference threshold, the area containing the first candidate detection frame is directly used as the target barcode area. This distance difference threshold is a custom preset value and is generally set based on the size of the associated detection frame. For example, the distance difference threshold is 1 / 4 of the height of the associated detection frame.
[0069] 3. When the difference between the distances of two candidate detection frames and the associated detection frame does not reach the distance difference threshold, the area where one of the candidate detection frames is located is determined as the target barcode area based on the relative positions of the two candidate detection frames, the associated detection frame, and each checked box detection frame.
[0070] Based on the predetermined relative positional relationship between each barcode and its corresponding checkbox, the image and checkbox in the barcode image will have two relative positional relationships depending on the orientation of the barcode image:
[0071] (1) The check box corresponding to a barcode is located on one side of the barcode along the horizontal direction on the plane, as shown in (c) in Figure 2. In this case, the first candidate detection box is located on the first side of the associated detection box along the horizontal direction on the plane, and the second candidate detection box is located on the second side of the associated detection box along the horizontal direction on the plane. The first side and the second side are the two sides of the associated detection box along the horizontal direction on the plane.
[0072] When there is a check box detection box on the first side of the first candidate detection box along the horizontal direction on the plane, the area where the second candidate detection box is located is used as the target barcode area; otherwise, the area where the first candidate detection box is located is used as the target barcode area.
[0073] For example, if the first candidate detection box is to the left of the checkbox detection box, and the second candidate detection box is to the right of the checkbox detection box, when there is a checkbox detection box to the left of the first candidate detection box, the area where the second candidate detection box is located is used as the target barcode area. If there is no checkbox detection box to the left of the first candidate detection box, the area where the first candidate detection box is located is used as the target barcode area.
[0074] For another example, the first candidate detection box is located to the right of the checkbox detection box, and the second candidate detection box is located to the left of the checkbox detection box. If there is a checkbox detection box to the right of the first candidate detection box, the area containing the second candidate detection box is used as the target barcode area. If there is no checkbox detection box to the right of the first candidate detection box, the area containing the first candidate detection box is used as the target barcode area.
[0075] (2) The check box corresponding to a barcode is located on the first side of the barcode along the vertical direction on the plane, as shown in (d) in Figure 2. The first candidate detection box is located on the first side of the associated detection box along the vertical direction on the plane, and the second candidate detection box is located on the second side of the associated detection box along the vertical direction on the plane. The first side and the second side are the two sides of the associated detection box along the vertical horizontal direction.
[0076] When there is a check mark detection box on the first side of the first candidate detection box along the vertical direction on the plane, the area where the second candidate detection box is located is used as the target barcode area. Otherwise, the area where the first candidate detection box is located is used as the target barcode area. This is similar to the above situation (1), and this embodiment will not be repeated.
[0077] Case 2: When a unique associated detection frame and a unique barcode detection frame are detected from a single area image of the barcode face, the area where the detected barcode detection frame is located is directly used as the target barcode area.
[0078] Case 3: When no associated detection frame is detected from the barcode face single area image, it is determined that the target barcode does not exist in the original image.
[0079] Step 4: Extract the target barcode from the original image based on the target barcode area in the barcode surface single area image. First, perform coordinate transformation on the target barcode area in the barcode surface single area image based on the image mapping relationship to determine the target barcode area in the original image. The image mapping relationship here matches the operation performed in step 1. When the barcode surface single area image is obtained by rotating the initial surface single image, first determine the mapping of the target barcode area in the barcode surface single area image to the target barcode area in the initial surface single image, and then obtain the mapping of the target barcode area in the original image based on the position of the initial surface single image in the original image. When the barcode surface single area image is directly the initial surface single image, directly obtain the mapping of the target barcode area in the original image based on the position of the initial surface single image in the original image.
[0080] The target barcode is then read from the original image within the target barcode area. Because the image to be detected is the result of scaling the original image, significant barcode detail is lost. Therefore, this step uses full-width barcode reading to locate and extract the target barcode directly from the original image. This involves creating an all-zero image of the same size as the original image, with each pixel having a grayscale value of 0. The image within the target barcode area of the original image is then copied to the all-zero image, and the barcode is read using this image.
[0081] The above description is only a preferred embodiment of the present application, and the present application is not limited to the above embodiments. It is understood that other improvements and variations directly derived or imagined by those skilled in the art without departing from the spirit and concept of the present application should be considered to be included in the scope of protection of the present application.
Claims
1. A barcode positioning detection method based on deep learning, characterized in that: The barcode positioning detection method comprises: Scaling the acquired original image to obtain an image to be detected, wherein the image resolution of the image to be detected is smaller than that of the original image; A barcode face sheet area image is extracted from the image to be detected by using a coarse positioning model, wherein the barcode face sheet area image is an image of the area where the barcode face sheet is located, a barcode and a corresponding check box are printed on the barcode face sheet, the edge of the barcode is parallel to the edge of the barcode face sheet, and the check box corresponding to each barcode is located at a predetermined relative position of the barcode; the coarse positioning model is obtained by training based on the yolo-fastest model; Utilizing the target detection model to perform target detection on the barcode surface single-area image, extracting the barcode detection frame of each barcode in the barcode surface single-area image, the associated detection frame of each associated object group, and the check box detection frame of each check box, wherein an associated object group includes a barcode and its corresponding check box; the target detection model is trained based on the yolo-fastest model; Determine the target barcode area in the barcode surface single area image according to each barcode detection box, associated detection box and check box detection box; A target barcode is extracted from the original image according to the target barcode area in the barcode surface single area image.
2. The barcode positioning detection method according to claim 1, characterized in that: Determining the target barcode area in the barcode face single area image according to each barcode detection box, associated detection box and check box detection box includes: When at least one associated detection frame and multiple barcode detection frames are detected from the single-area image of the barcode surface, a barcode detection frame matching each associated detection frame is determined based on each barcode detection frame, associated detection frame and check box detection frame, and the area where the barcode detection frames matching each associated detection frame are located is used as the target barcode area.
3. The barcode positioning detection method according to claim 2, characterized in that: The determining of the barcode detection frame matching each associated detection frame according to each barcode detection frame, associated detection frame and check box detection frame includes for each associated detection frame: Calculate the distance between each barcode detection frame and the associated detection frame respectively, and determine the barcode detection frame with the smallest distance to the associated detection frame as the first candidate detection frame and the barcode detection frame with the second smallest distance to the associated detection frame as the second candidate detection frame; When the difference between the distances of the two candidate detection frames and the associated detection frame reaches a distance difference threshold, the area where the first candidate detection frame is located is directly used as the target barcode area; When the difference in distances between two candidate detection frames and the associated detection frame does not reach the distance difference threshold, the area where one of the candidate detection frames is located is determined as the target barcode area based on the relative positions of the two candidate detection frames, the associated detection frame and each check box detection frame.
4. The barcode positioning detection method according to claim 3, characterized in that: The step of determining, based on the relative positions of the two candidate detection frames and the associated detection frame and each check box detection frame, to use the area where one of the candidate detection frames is located as the target barcode area includes: A check box corresponding to a barcode is located on one side of the barcode along the horizontal direction on the plane, the first candidate detection box is located on the first side of the associated detection box along the horizontal direction on the plane, and the second candidate detection box is located on the second side of the associated detection box along the horizontal direction on the plane; when a check box detection box exists on the first side of the first candidate detection box along the horizontal direction on the plane, the area where the second candidate detection box is located is used as the target barcode area, otherwise the area where the first candidate detection box is located is used as the target barcode area; Alternatively, a check box corresponding to a barcode is located on the first side of the barcode along the vertical direction on the plane, the first candidate detection box is located on the first side of the associated detection box along the vertical direction on the plane, and the second candidate detection box is located on the second side of the associated detection box along the vertical direction on the plane; when there is a check box detection box on the first side of the first candidate detection box along the vertical direction on the plane, the area where the second candidate detection box is located is used as the target barcode area, otherwise the area where the first candidate detection box is located is used as the target barcode area.
5. The barcode positioning detection method according to claim 2, characterized in that: The determining of the target barcode area according to each barcode detection box, the associated detection box and the check box detection box further includes: When a unique associated detection frame and a unique barcode detection frame are detected from the barcode surface single-region image, the region where the detected barcode detection frame is located is directly used as the target barcode region; When no associated detection frame is detected from the barcode surface single-region image, it is determined that no target barcode exists in the original image.
6. The barcode positioning detection method according to claim 1, characterized in that: The step of extracting the target barcode from the original image according to the target barcode area in the barcode surface single area image comprises: The target barcode area in the single-area image of the barcode surface is subjected to coordinate transformation according to the image mapping relationship, the target barcode area in the original image is determined, and the image in the target barcode area in the original image is read to obtain the target barcode.
7. The barcode positioning detection method according to claim 1, characterized in that: The method of extracting a barcode surface single area image from the image to be detected by using a coarse positioning model comprises: Extracting an initial single face image from the image to be detected using the coarse positioning model; When the inclination angle between the edge of the initial face order image and the edge of the image to be detected does not reach the inclination angle threshold, the initial face order image is used as the extracted barcode face order area image; When the inclination angle between the edge of the initial face order image and the edge of the image to be detected reaches the inclination angle threshold, the initial face order image is rotated until the edge and the edge of the image to be detected are within the inclination angle threshold, and the rotated initial face order image is used as the extracted barcode face order area image.
8. The barcode positioning detection method according to claim 7, characterized in that: The extracting the initial single image from the image to be detected by using the coarse positioning model comprises: Inputting the image to be detected into the coarse positioning model to obtain a plurality of face order detection frames whose confidence scores in the image to be detected reach a score threshold; Non-maximum suppression is used to further screen several retained face order detection frames, and the image within each face order detection frame retained after screening is extracted as an initial face order image.
9. The barcode positioning detection method according to claim 8, characterized in that: The further screening of the retained plurality of face sheet detection frames by using non-maximum suppression includes: Determine the face sheet detection frame with the highest confidence score; Traverse the other bill detection frames in turn, and calculate the overlapping area between the traversed bill detection frame and the bill detection frame with the highest confidence score. When the overlapping area reaches the overlapping area threshold, delete the traversed bill detection frame.
10. The barcode positioning detection method according to claim 7, characterized in that: The method of extracting a barcode surface single area image from the collected original image using a coarse positioning model also includes: Performing image sharpening processing on the initial single face image; Binarizing the initial single face image after image sharpening to obtain a binary single face image; After performing dilation operation and morphological opening operation on the binary single image, a maximum area contour is determined; A minimum circumscribed rectangle of the maximum area contour is constructed, and the angle between the minimum circumscribed rectangle and the edge of the image to be detected is used as the inclination angle between the edge of the initial single image and the edge of the image to be detected.
Citation Information
Patent Citations
Two-dimension code extracting method and mobile terminal
CN104281828A
Batch QR code image extraction method and system
CN111597848A
Complex background low-quality two-dimensional bar code detection method based on deep learning
CN111753572A
Answer sheet adopting composite two-dimensional code with selective answering function
CN113469316A
Local vertex detection method and device
CN115238723A
Cited By
Small target detection method and device based on high-resolution fusion feature map
CN121616942A