Decoding method and decoding system based on grid ROI setting

By evenly dividing the barcode image into grid ROI and performing multi-threaded parallel decoding, the problem of time-consuming and error-prone barcode decoding in code reading scenarios on the production line is solved, and efficient and accurate barcode decoding is achieved.

CN119676460APending Publication Date: 2025-03-21SUPERLEAD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411845922.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In the on-production code reading scenario, it is difficult for the prior art to efficiently decode material barcodes distributed regularly, and traditional methods are time-consuming and prone to errors.

Method used

The decoding method based on grid ROI settings is adopted to divide the barcode image into M*N ROIs evenly, and the decoding efficiency is simplified through multi-thread parallel decoding, ROI area drawing is improved.

Benefits of technology

It realizes simplified ROI area drawing, reduces the risk of errors, and effectively saves decoding time and improves decoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676460A_ABST
    Figure CN119676460A_ABST
Patent Text Reader

Abstract

The invention provides a decoding method and a decoding system based on grid ROI setting. The decoding method comprises the following steps: acquiring a row number M and a column number N corresponding to a grid ROI; acquiring a bar code image; uniformly dividing the barcode image into M * N ROIs (Region Of Interest); and performing multi-thread parallel decoding on the image information corresponding to the M * N ROIs. According to the method, the row number M and the column number N corresponding to the grid ROI are obtained, the row number M and the column number N are consistent with the row number and the column number of the materials distributed at regular positions on the production line, the bar code image is uniformly divided into the M * N ROIs, and the bar codes in the M * N ROIs are subjected to multi-thread parallel decoding, so that the ROI region is simple to draw and is not easy to make mistakes, the decoding accuracy is ensured, and the decoding efficiency is improved. And the decoding time is effectively saved, and the decoding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a decoding method and a decoding system based on grid ROI setting. Background Art

[0002] In the barcode reading scenario on the production line, for materials with M*N relatively regular positions in the tray, it is necessary to take a photo of the image to decode all the barcodes at once. There are two traditional methods: 1) Send a complete image to the algorithm for decoding to decode all the barcodes at once, but this decoding is very time-consuming; 2) Draw ROI areas for barcodes in different areas one by one, and send the ROI area image to the decoding library for decoding. This method is very cumbersome and error-prone for drawing dozens or hundreds of codes. Summary of the invention

[0003] In view of the technical problem in the prior art that it is time-consuming and error-prone to decode all barcodes in a barcode reading scenario of materials distributed at regular positions on a production line in one photograph, the present invention provides a decoding method and a decoding system based on network ROI setting.

[0004] A decoding method based on grid ROI setting of the present invention comprises the following steps: Get the number of rows M and columns N corresponding to the grid ROI; Get the barcode image; Divide the barcode image evenly into M*N ROIs; The image information corresponding to M*N ROIs is decoded in parallel using multiple threads.

[0005] Preferably, the step of "obtaining the number of rows M and the number of columns N corresponding to the grid ROI" further includes the following steps: The number of rows M and columns N corresponding to the storage grid ROI.

[0006] Preferably, the step of "evenly dividing the barcode image into M*N ROIs" includes the following steps: Get the starting position and ending position of the barcode area in the barcode image; Divide the barcode area evenly into M*N ROIs.

[0007] Furthermore, after the step of "evenly dividing the barcode area into M*N ROIs", the following steps are also included: The image information in the M*N ROIs is numbered, and the number is used as a part of the corresponding image information.

[0008] Furthermore, before the step of "evenly dividing the barcode area into M*N ROIs", the following steps are also included: Get segmentation correction information; The corrected starting point position and end point position are obtained according to the segmentation correction information, and the barcode area is determined using the corrected starting point position and end point position.

[0009] Another aspect of the present invention is a decoding system based on grid ROI setting, comprising: An input module is used to obtain the number of rows M and columns N corresponding to the grid ROI; Image acquisition module, users acquire barcode images; Image segmentation module, used to evenly divide the barcode image into M*N ROIs; The decoding module is used to perform multi-threaded parallel decoding on the image information corresponding to the M*N ROIs.

[0010] Preferably, the decoding system further comprises a storage module, and the storage module is used to store the number of rows M and the number of columns N corresponding to the grid ROI.

[0011] Preferably, the image segmentation module includes a barcode region submodule and a segmentation submodule, the barcode region submodule is used to obtain the starting position and the ending position of the barcode region in the barcode image, and the segmentation submodule is used to evenly divide the barcode region into M*N ROIs.

[0012] Furthermore, the image segmentation module also includes a numbering submodule, which is used to number the image information in the M*N ROIs and use the numbering as a part of the corresponding image information.

[0013] Furthermore, the decoding system also includes a correction input module, which is used to obtain segmentation correction information; the barcode area submodule is also used to obtain the corrected starting position and end position according to the segmentation correction information, and use the corrected starting position and end position to determine the barcode area.

[0014] Compared with the prior art, a decoding method and a decoding system based on grid ROI setting of the present invention obtain the number of rows M and the number of columns N corresponding to the grid ROI, which are consistent with the number of rows and the number of columns of materials regularly distributed on the production line, and evenly divide the barcode image into M*N ROIs, and perform multi-threaded parallel decoding on the barcodes in the M*N ROIs, which makes the ROI area drawing simple and error-prone, ensures the accuracy of decoding, and effectively saves decoding time and improves decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 The figure is a flowchart of a decoding method based on grid ROI setting according to an embodiment of the present invention.

[0017] Figure 2 The figure is a flowchart of a decoding method based on grid ROI setting according to another embodiment of the present invention.

[0018] Figure 3 The figure is a schematic structural diagram of a decoding system based on grid ROI setting according to an embodiment of the present invention.

[0019] Figure 4 It is a schematic structural diagram of a decoding system based on grid ROI setting according to another embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to provide a further understanding of the purpose, structure, features, and functions of the present invention, the following detailed description is given in conjunction with the embodiments.

[0021] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they cannot be understood as limitations on the present invention.

[0022] See also Figure 1 , a decoding method based on grid ROI setting of the present invention comprises the following steps: S11. Obtain the number of rows M and the number of columns N corresponding to the grid ROI, where the number of rows M and the number of columns N are consistent with the number of rows and the number of columns of materials regularly distributed on the production line; S12. Obtain a barcode image, which includes all barcodes of materials regularly distributed on the production line; S13. Evenly divide the barcode image into M*N ROIs, so that all barcodes of materials regularly distributed on the production line are located in one of the ROIs; S14. Perform multi-threaded parallel decoding on the image information corresponding to the M*N ROIs.

[0023] In actual use, when the materials on the production line are not fully loaded, there may be a situation where there is no barcode in one or some ROIs. At this time, decoding the image in the ROI will have no output, which will not affect the final decoding output result.

[0024] See also Figure 2 , Figure 2The figure is a flowchart of a decoding method based on grid ROI setting according to another embodiment of the present invention.

[0025] To avoid frequent input of row number M and column number N on the same production line, see Figure 2 , after step S11, the following steps are also included: S11'. Store the number of rows M and columns N corresponding to the grid ROI.

[0026] To ensure more accurate segmentation of barcode images, please refer to Figure 2 , step S13 comprises the following steps: S131. Obtain the starting position and the end position of the barcode area in the barcode image, the starting position may be the coordinates of the upper left corner of the barcode area, and the end position may be the coordinates of the lower right corner of the barcode area; S132. Divide the barcode area evenly into M*N ROIs.

[0027] In order to distinguish the image information in different ROIs, please refer to Figure 2 , after step S132, the following steps are also included: S133. Number the image information in the M*N ROIs, and use the number as a part of the corresponding image information.

[0028] In order to adjust and correct the barcode area to make the segmentation of the barcode image more accurate, please refer to Figure 2 , before step S132, the following steps are also included: S131 'get segmentation correction information; S132'. Obtain the corrected starting position and ending position according to the segmentation correction information, and use the corrected starting position and ending position to determine the barcode area.

[0029] In summary, the decoding method based on grid ROI setting in this embodiment includes the following steps: S11. Obtain the number of rows M and the number of columns N corresponding to the grid ROI, where the number of rows M and the number of columns N are consistent with the number of rows and the number of columns of materials regularly distributed on the production line; S11 '. Storage grid ROI corresponding to the number of rows M and columns N; S12. Obtain a barcode image, which includes all barcodes of materials regularly distributed on the production line; S131. Obtain the starting position and the end position of the barcode area in the barcode image, the starting position may be the coordinates of the upper left corner of the barcode area, and the end position may be the coordinates of the lower right corner of the barcode area; S131 'get segmentation correction information; S132 'according to the segmentation correction information to obtain the corrected starting position and end position, and use the corrected starting position and end position to determine the bar code area; S132. Evenly divide the barcode area into M*N ROIs; S133. Number the image information in the M*N ROIs, and use the number as part of the corresponding image information; S14. Perform multi-threaded parallel decoding on the image information corresponding to the M*N ROIs.

[0030] See also Figure 3 Another aspect of the present invention is a decoding system based on grid ROI setting, comprising an input module 10, an image acquisition module 20, an image segmentation module 30 and a decoding module 40, wherein: An input module 10 is used to obtain the number of rows M and the number of columns N corresponding to the grid ROI; An image acquisition module 20, used to acquire a barcode image; An image segmentation module 30 is used to evenly divide the barcode image into M*N ROIs; The decoding module 40 is used to perform multi-threaded parallel decoding on the image information corresponding to the M*N ROIs.

[0031] See also Figure 4 , Figure 4 It is a structural schematic diagram of a decoding system based on grid setting according to another embodiment of the present invention.

[0032] To avoid frequent input of row number M and column number N on the same production line, see Figure 4 The system also includes a storage module 50, which is used to store the number of rows M and the number of columns N corresponding to the grid ROI. The output end of the storage module 50 is data-connected to the input end of the image segmentation module 30 to transmit the number of rows M and the number of columns N corresponding to the storage grid ROI to the image segmentation module 30.

[0033] To ensure more accurate segmentation of barcode images, please refer to Figure 4 The image segmentation module 30 includes a barcode area submodule 31 and a segmentation submodule 32. The barcode area submodule 31 is used to obtain the starting position and the ending position of the barcode area in the barcode image. The starting position can be the coordinate of the upper left corner of the barcode area, and the ending position can be the coordinate of the lower right corner of the barcode area; the segmentation submodule 32 is used to evenly divide the barcode area into M*N ROIs.

[0034] In order to distinguish the image information in different ROIs, please refer to Figure 4The image segmentation module 30 also includes a numbering submodule 33, which is used to number the image information in the M*N ROIs and use the number as a part of the corresponding image information.

[0035] In order to adjust and correct the barcode area to make the segmentation of the barcode image more accurate, please refer to Figure 4 The system also includes a correction input module 60, which is used to obtain segmentation correction information. The barcode area submodule 31 is also used to obtain the corrected starting position and end position according to the segmentation correction information, and use the corrected starting position and end position to determine the barcode area.

[0036] In actual use, the correction input module 60 can be a specific information input module mode, or a touch screen drag offset acquisition mode.

[0037] The present invention discloses a decoding method and a decoding system based on grid ROI setting, by obtaining the number of rows M and the number of columns N corresponding to the grid ROI, the number of rows M and the number of columns N being consistent with the number of rows and the number of columns of materials regularly distributed on the production line, and evenly dividing the barcode image into M*N ROIs, and performing multi-threaded parallel decoding on the barcodes in the M*N ROIs, which not only makes the ROI area drawing simple and error-prone, thereby ensuring the accuracy of decoding, but also effectively saves the decoding time and improves the decoding efficiency.

[0038] The present invention has been described by the above-mentioned relevant embodiments, but the above-mentioned embodiments are only examples for implementing the present invention. In addition, the technical features involved in the different embodiments of the present invention described above can be combined with each other as long as they do not conflict with each other. It must be pointed out that the disclosed embodiments do not limit the scope of the present invention. On the contrary, changes and modifications made without departing from the spirit and scope of the present invention are all within the scope of patent protection of the present invention.

Claims

1. A decoding method based on grid ROI setting, characterized in that: The following steps are involved: Get the number of rows M and columns N corresponding to the grid ROI; Get the barcode image; Divide the barcode image evenly into M*N ROIs; The image information corresponding to M*N ROIs is decoded in parallel using multiple threads.

2. A decoding method based on grid ROI setting as claimed in claim 1, characterized in that: The step of "obtaining the number of rows M and columns N corresponding to the grid ROI" also includes the following steps: The number of rows M and columns N corresponding to the storage grid ROI.

3. A decoding method based on grid ROI setting as claimed in claim 1, characterized in that: The step "evenly divide the barcode image into M*N ROIs" includes the following steps: Get the starting position and ending position of the barcode area in the barcode image; Divide the barcode area evenly into M*N ROIs.

4. A decoding method based on grid ROI setting as claimed in claim 3, characterized in that: The step "evenly divide the barcode area into M*N ROIs" also includes the following steps: The image information in the M*N ROIs is numbered, and the number is used as a part of the corresponding image information.

5. The decoding method based on grid ROI setting as claimed in claim 3, characterized in that: Before the step of "evenly dividing the barcode area into M*N ROIs", the following steps are also included: Get segmentation correction information; The corrected starting point position and end point position are obtained according to the segmentation correction information, and the barcode area is determined using the corrected starting point position and end point position.

6. A decoding system based on grid ROI setting, characterized in that: include: An input module is used to obtain the number of rows M and columns N corresponding to the grid ROI; An image acquisition module, used for acquiring a barcode image; Image segmentation module, used to evenly divide the barcode image into M*N ROIs; The decoding module is used to perform multi-threaded parallel decoding on the image information corresponding to the M*N ROIs.

7. A decoding system based on grid ROI setting as claimed in claim 6, characterized in that: Also includes: The storage module is used to store the number of rows M and the number of columns N corresponding to the grid ROI.

8. The decoding system based on grid ROI setting as claimed in claim 6, characterized in that: The image segmentation module includes a barcode region submodule and a segmentation submodule. The barcode region submodule is used to obtain the starting position and the ending position of the barcode region in the barcode image. The segmentation submodule is used to evenly divide the barcode region into M*N ROIs.

9. A decoding system based on grid ROI setting as claimed in claim 8, characterized in that: The image segmentation module also includes: The numbering submodule is used to number the image information in the M*N ROIs and use the numbering as part of the corresponding image information.

10. The decoding system based on grid ROI setting as claimed in claim 8, characterized in that: Also includes: A correction input module is used to obtain segmentation correction information; The barcode region submodule is further used to obtain the corrected starting position and ending position according to the segmentation correction information, and determine the barcode region using the corrected starting position and ending position.