Decoding method and decoding system for realizing self-induction triggering
By using template matching technology in a self-induced triggered decoding system, the barcode images are accurately matched, which solves the problem of the existing technology being susceptible to environmental interference and accidentally triggered, and achieves a more efficient and stable decoding process.
Patent Information
- Application Number
- CN202411883488.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
AI Technical Summary
The existing self-induced triggering decoding technology is easily disturbed by the surrounding environment, resulting in false triggering.
By obtaining the position information of the ROI area in the barcode image, template matching of the barcode image is performed, and decoding is triggered only when the match is successful, reducing the image operation area and improving decoding efficiency and stability.
Shorten the decoding time, improve the decoding efficiency, reduce the possibility of false triggering, and make the decoding more stable.
Smart Images

Figure CN119830936A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of barcode recognition, and in particular to a decoding method and a decoding system for realizing self-induction triggering. Background Art
[0002] In the scenario of barcode entry on the production line, it is inconvenient for the operator to press buttons to trigger decoding. The decoding needs to be automatically triggered after the material barcode is placed under the camera. When no material barcode is placed, decoding is not triggered, that is, the self-sensing trigger mode.
[0003] Generally, the implementation of self-sensing triggering is based on changes in image brightness or infrared sensors, but these triggering methods are easily affected by the surrounding environment, such as changes in ambient light, and are prone to false triggering. Summary of the invention
[0004] In view of the problem in the prior art that self-sensing triggered decoding is easily disturbed by the surrounding environment and may be falsely triggered, the present invention provides a decoding method and a decoding system for realizing self-sensing triggering.
[0005] A decoding method for realizing self-induction triggering of the present invention comprises the following steps: Get the location information of the ROI area in the barcode image; Get the barcode image; Use the training template to perform template matching on the ROI area corresponding to the barcode image; Decode the matched image.
[0006] Preferably, the step of "using the training template to perform template matching on the ROI area corresponding to the barcode image" includes the following steps: Get the training threshold; When the number of training times is less than the training threshold, the ROI area corresponding to the barcode image is decoded according to the position information of the ROI area in the barcode image. When the decoding is successful, feature training is performed on the decoded barcode image area to generate a training template, and the number of training times is increased by 1. When the number of training times is not less than the training threshold, the training template is used to perform template matching on the ROI area corresponding to the barcode image.
[0007] Furthermore, the initial value of the number of training times is 0.
[0008] Furthermore, the step of "when the number of training times is not less than the training threshold, using the training template to perform template matching on the ROI area corresponding to the barcode image" includes the following steps: The training template is used to obtain the similarity evaluation values of all matching areas in the ROI area corresponding to the barcode image; The image of the matching area with the highest similarity evaluation value is taken as the matching image Furthermore, the step of "when the number of training times is not less than the training threshold, using the training template to perform template matching on the ROI area corresponding to the barcode image" includes the following steps: Get the similarity evaluation threshold; The similarity evaluation values of the matching areas in the ROI area corresponding to the barcode image are obtained in sequence using the training template; Each similarity evaluation value is compared with a similarity evaluation threshold. If the similarity evaluation value is greater than the similarity evaluation threshold, the image corresponding to the matching area is a matching image.
[0009] Another aspect of the present invention is a decoding system for realizing self-induction triggering, including an input module, an image acquisition module, a template matching module and a decoding module, wherein the input module is used to obtain the position information of the ROI area in the barcode image; the image acquisition module is used to obtain the barcode image; the template matching module is used to perform template matching on the ROI area corresponding to the barcode image using a training template; and the decoding module is used to decode the matched image.
[0010] Preferably, the input module is also used to obtain a training threshold; the decoding system also includes a control module, which is used to control the decoding module to decode the ROI area corresponding to the barcode image according to the position information of the ROI area in the barcode image when the number of training times is less than the training threshold, and when the decoding is successful, control the template matching module to perform feature training on the successfully decoded barcode image area to generate a training template, and at the same time increase the number of training times by 1; the control module is also used to control the template matching module to perform template matching on the ROI area corresponding to the barcode image using the training template when the number of training times is not less than the training threshold.
[0011] Furthermore, the initial value of the number of training times is 0.
[0012] Furthermore, the template matching module includes a first similarity evaluation module and a first image selection module. The first similarity evaluation module is used to obtain similarity evaluation values of all matching areas in the ROI area corresponding to the barcode image using the training template, and the first image selection module is used to use the image of the matching area with the highest similarity evaluation value as the matching image.
[0013] Furthermore, the input module is also used to obtain a similarity evaluation threshold; the template matching module includes a second similarity evaluation module and a second image selection module, the second similarity evaluation module is used to use the training template to sequentially obtain the similarity evaluation values of the matching areas within the ROI area corresponding to the barcode image, and the second image selection module is used to compare each similarity evaluation value with the similarity evaluation threshold. If the similarity evaluation value is greater than the similarity evaluation threshold, the image corresponding to the matching area is a matching image.
[0014] Compared with the prior art, the decoding method and decoding system for realizing self-sensing triggering of the present invention obtain the position information of the ROI area and operate the ROI area corresponding to the barcode image, thereby reducing the image area and reducing the time required for operation; by using the training template to perform template matching on the ROI area corresponding to the barcode image, only the matched area image needs to be decoded, which further reduces the image area, greatly shortens the decoding time, improves the decoding efficiency, and triggers decoding only when the template matching is successful, which is not easily disturbed by the surrounding environment and makes the decoding more stable. 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 method for implementing self-induction triggering decoding according to an embodiment of the present invention.
[0017] Figure 2 The figure is a flowchart of a method for implementing self-induction triggering decoding according to another embodiment of the present invention.
[0018] Figure 3 FIG. 4 is a flow chart of step S33 according to an embodiment of the present invention.
[0019] Figure 4 FIG. 4 is a flow chart of step S33 according to another embodiment of the present invention.
[0020] Figure 5 The figure is a schematic diagram of the structure of a decoding system for realizing self-induction triggering according to an embodiment of the present invention.
[0021] Figure 6 The figure is a schematic diagram of the structure of a decoding system for realizing self-induction triggering according to another embodiment of the present invention.
[0022] Figure 7 It is a structural diagram of a decoding system for realizing self-induction triggering according to the third embodiment of the present invention.
[0023] Figure 8 It is a structural diagram of a decoding system for implementing self-induction triggering according to the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0024] 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.
[0025] 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.
[0026] See also Figure 1 A decoding method for realizing self-induction triggering of the present invention comprises the following steps: S1. Obtain the location information of the ROI area in the barcode image; S2. Get the barcode image; S3. Use the training template to perform template matching on the ROI area corresponding to the barcode image; S4. Decode the matched image.
[0027] See also Figure 2 , Figure 2 The figure is a flowchart of a method for implementing self-induction triggering decoding according to another embodiment of the present invention.
[0028] In order to ensure the applicability and accuracy of template matching using the training template, step S3 includes the following steps: S31. Obtaining training threshold; S32. When the number of training times is less than the training threshold, the barcode image corresponding to the ROI area is decoded according to the position information of the ROI area in the barcode image. When the decoding is successful, the decoded barcode image area is feature trained to generate a training template, and the number of training times is increased by 1; S33. When the number of training times is not less than the training threshold, the training template is used to perform template matching on the ROI area corresponding to the barcode image.
[0029] In actual use, the initial value of the number of training times is 0.
[0030] In summary, the decoding method for implementing self-induction triggering in this embodiment includes the following steps: S1. Obtain the location information of the ROI area in the barcode image; S2. Get the barcode image; S31. Obtaining training threshold; S32. When the number of training times is less than the training threshold, the barcode image corresponding to the ROI area is decoded according to the position information of the ROI area in the barcode image. When the decoding is successful, the decoded barcode image area is feature trained to generate a training template, and the number of training times is increased by 1; S33. When the number of training times is not less than the training threshold, the training template is used to perform template matching on the barcode image corresponding to the ROI area; S4. Decode the matched barcode image.
[0031] When using the training template to perform template matching on the ROI area corresponding to the barcode image, there are two situations. In one situation, there is only one barcode in the barcode image. In this case, one barcode image can be matched. In the other situation, there are multiple barcodes in the barcode image. In this case, multiple barcode images can be matched.
[0032] When there is only one barcode in the barcode image, see Figure 3 , step S33 comprises the following steps: S331. Using the training template to obtain the similarity evaluation values of all matching areas in the ROI area corresponding to the barcode image; S332. Take the image of the matching area with the highest similarity evaluation value as the matching image.
[0033] In actual use, if the similarity evaluation values of all matching areas are equal, there is no barcode in the barcode image, that is, the template matching of the ROI area corresponding to the barcode image using the training template fails. At this time, step S332 also needs to determine whether the number of matching areas with the highest similarity evaluation value is 1. If it is 1, the image corresponding to the matching area is the matching image.
[0034] When there are multiple barcodes in the barcode image, see Figure 4 , step S33 comprises the following steps: S331'. Get similarity evaluation threshold; S332 'using the training template to obtain the barcode image corresponding to the matching area in the ROI area similarity evaluation value; S333'. Compare each similarity evaluation value with the similarity evaluation threshold. If the similarity evaluation value is greater than the similarity evaluation threshold, the image corresponding to the matching area is a matching image.
[0035] See also Figure 5 Another aspect of the present invention is a decoding system for realizing self-induction triggering, comprising an input module 10, an image acquisition module 20, a template matching module 30 and a decoding module 40, wherein: The input module 10 is used to obtain the position information of the ROI area in the barcode image; The image acquisition module 20 is used to acquire the barcode image; The template matching module 30 is used to perform template matching on the ROI area corresponding to the barcode image using the training template; The decoding module 40 is used to decode the matched image.
[0036] In the decoding system, the output end of the input module 10 is data-connected to the input end of the template matching module 30 to transmit the position information of the ROI area in the barcode image to the template matching module 30, the output end of the image acquisition module 20 is data-connected to the input end of the template matching module 30 to transmit the barcode image to the template matching module 30, and the output end of the template matching module 30 is data-connected to the input end of the decoding module 40 to transmit the matched image to the decoding module 40.
[0037] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of a decoding system for realizing self-induction triggering according to another embodiment of the present invention. Figure 5 Compared with the embodiment in FIG. 1 , in this embodiment, the input module 10 is also used to obtain a training threshold.
[0038] The decoding system further includes a control module 50, which is used to control the decoding module 40 to decode the ROI area corresponding to the barcode image according to the position information of the ROI area in the barcode image when the training number is less than the training threshold, and when the decoding is successful, control the template matching module 30 to perform feature training on the successfully decoded barcode image area to generate a training template, and increase the training number by 1 at the same time; The control module 50 is also used to control the template matching module 30 to perform template matching on the ROI area corresponding to the barcode image using the training template when the number of training times is not less than the training threshold, so as to ensure the applicability and accuracy of template matching using the training template.
[0039] In actual use, the initial value of the number of training times is 0.
[0040] In this decoding system, except Figure 5 In addition to the structural relationship of the embodiment, the output end of the input module 10 is data-connected with the input end of the control module 50 to transmit the training threshold to the control module 50, the output end of the input module 10 is data-connected with the input end of the decoding module 40 to transmit the position information of the ROI area in the barcode image to the decoding module 40, the output end of the image acquisition module 20 is data-connected with the input end of the decoding module 40 to transmit the barcode image to the decoding module 40, the output end of the decoding module 40 is data-connected with the input end of the template matching module 30 to transmit the barcode image area that is successfully decoded to the template matching module, and the output end of the decoding module 40 is data-connected with the input end of the control module 50 to transmit the decoding success information to the control module 50.
[0041] The output end of the control module 50 is electrically connected to the input end of the template matching module 30 to control the template matching module 30 to perform template matching. The output end of the control module 50 is electrically connected to the input end of the decoding module 40 to control the decoding module 40 to perform decoding.
[0042] The control module 50 determines whether the number of training times is less than the training threshold. If the number of training times is less than the training threshold, the template matching module 30 is in the training stage. The control module 50 controls the decoding module 40 to decode the ROI area corresponding to the barcode image according to the position information of the ROI area in the barcode image, and when the decoding is successful, controls the template matching module 30 to perform feature training on the successfully decoded barcode image area to generate a training template, and increases the number of training times by 1. If the number of training times is not less than the training threshold, the template matching module 30 is in the matching use stage, the decoding system is in the self-sensing trigger mode, the control module 50 controls the template matching module 30 to use the training template to perform template matching on the ROI area corresponding to the barcode image, and when the template match is successful, decoding is triggered, and the decoding module 40 decodes the received matching image.
[0043] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of a decoding system for realizing self-induction triggering according to a third embodiment of the present invention. Figure 6 Compared with the embodiment in the above description, in the present embodiment, the template matching module 30 includes a first similarity evaluation module 31 and a first image selection module 32. The first similarity evaluation module 31 uses the training template to obtain the similarity evaluation values of all matching areas in the ROI area corresponding to the barcode image. The first image selection module 32 is used to use the image of the matching area with the highest similarity evaluation value as the matching image.
[0044] The decoding system of this embodiment is applicable to the case where there is only one barcode in the barcode image. In actual use, if the similarity evaluation values of all matching areas are equal, there is no barcode in the barcode image, that is, the template matching of the ROI area corresponding to the barcode image using the training template fails. At this time, the first image selection module 32 also needs to determine whether the number of matching areas with the highest similarity evaluation value is 1. If it is 1, the image corresponding to the matching area is the matching image.
[0045] In this decoding system, Figure 6 What is different from the embodiment is that the output end of the input module 10 is data-connected with the input end of the first similarity evaluation module 31 to transmit the position information of the ROI area in the barcode image to the first similarity evaluation module 31, the output end of the image acquisition module 20 is data-connected with the input end of the first similarity evaluation module 31 to transmit the barcode image to the first similarity evaluation module 31, the output end of the first similarity evaluation module 31 is data-connected with the input end of the first image selection module 32 to transmit the similarity evaluation value and the image of the corresponding matching area to the first image selection module 32, and the output end of the first image selection module 32 is data-connected with the input end of the decoding module 40 to transmit the matched image to the decoding module 40.
[0046] See also Figure 8 , Figure 8 FIG. 4 is a schematic diagram of a decoding system for realizing self-induction triggering according to a fourth embodiment of the present invention. Figure 6 Compared with the embodiment in the above description, in the present embodiment, the input module 10 is further used to obtain a similarity evaluation threshold; the template matching module 30 includes a second similarity evaluation module 33 and a second image selection module 34, the second similarity evaluation module 33 is used to use the training template to sequentially obtain the similarity evaluation values of the matching areas in the ROI area corresponding to the barcode image, and the second image selection module 34 is used to compare each similarity evaluation value with the similarity evaluation threshold, if the similarity evaluation value is greater than the similarity evaluation threshold, the image corresponding to the matching area is a matching image.
[0047] The decoding system of this embodiment is applicable to the case where there are multiple barcodes in the barcode image. In actual use, the similarity evaluation threshold has a greater impact on the template matching result. The more similar the barcodes in the acquired barcode image are, the higher the similarity evaluation threshold should be.
[0048] In this decoding system, Figure 6 The difference from the embodiment is that the output end of the input module 10 is data connected to the input end of the second similarity evaluation module 33 to transmit the position information of the ROI area in the barcode image to the second similarity evaluation module 33, the output end of the input module 10 is data connected to the input end of the second image selection module 34 to transmit the similarity evaluation threshold to the second image selection module 34, the output end of the image acquisition module 20 is data connected to the input end of the second similarity evaluation module 33 to transmit the barcode image to the second similarity evaluation module 33, the output end of the second similarity evaluation module 33 is data connected to the input end of the second image selection module 34 to transmit the similarity evaluation value and the image of the corresponding matching area to the second image selection module 34, and the output end of the second image selection module 34 is data connected to the input end of the decoding module 40 to transmit the matched image to the decoding module 40.
[0049] In actual use, the training threshold in the decoding method is to obtain the stored training threshold, rather than repeatedly inputting the training threshold; when the user finds that the material is not decoded when it is placed, it means that the training template is not suitable for the current usage scenario. At this time, the training template can be manually deleted and re-trained.
[0050] The present invention provides a decoding method and a decoding system for realizing self-sensing triggering. By acquiring the position information of the ROI area, the ROI area corresponding to the barcode image is operated, thereby reducing the image area and the time required for the operation. By using a training template to perform template matching on the ROI area corresponding to the barcode image, only the matched area image needs to be decoded, thereby further reducing the image area, greatly shortening the decoding time, and improving the decoding efficiency. Moreover, the decoding is triggered only when the template matching is successful, and it is not easily disturbed by the surrounding environment, and the decoding is more stable.
[0051] 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 for realizing self-induction triggering, characterized in that: The following steps are involved: Get the location information of the ROI area in the barcode image; Get the barcode image; Use the training template to perform template matching on the ROI area corresponding to the barcode image; Decode the matched image.
2. A decoding method for realizing self-induction triggering as claimed in claim 1, characterized in that: The step of "using the training template to perform template matching on the ROI area corresponding to the barcode image" includes the following steps: Get the training threshold; When the number of training times is less than the training threshold, the ROI area corresponding to the barcode image is decoded according to the position information of the ROI area in the barcode image. When the decoding is successful, feature training is performed on the decoded barcode image area to generate a training template, and the number of training times is increased by 1. When the number of training times is not less than the training threshold, the training template is used to perform template matching on the ROI area corresponding to the barcode image.
3. A decoding method for realizing self-induction triggering as claimed in claim 2, characterized in that: The initial value of the training times is 0.
4. A decoding method for realizing self-induction triggering as claimed in claim 2, characterized in that: The step of "when the number of training times is not less than the training threshold, using the training template to perform template matching on the ROI area corresponding to the barcode image" includes the following steps: The training template is used to obtain the similarity evaluation values of all matching areas in the ROI area corresponding to the barcode image; The image of the matching area with the highest similarity evaluation value is taken as the matching image.
5. A decoding method for realizing self-induction triggering as claimed in claim 2, characterized in that: The step of "when the number of training times is not less than the training threshold, using the training template to perform template matching on the ROI area corresponding to the barcode image" includes the following steps: Get similarity evaluation threshold; The similarity evaluation values of the matching areas in the ROI area corresponding to the barcode image are obtained in sequence using the training template; Each similarity evaluation value is compared with a similarity evaluation threshold. If the similarity evaluation value is greater than the similarity evaluation threshold, the image corresponding to the matching area is a matching image.
6. A decoding system for realizing self-induction triggering, characterized in that: include: An input module is used to obtain the position information of the ROI area in the barcode image; An image acquisition module, used for acquiring a barcode image; The template matching module is used to perform template matching on the ROI area corresponding to the barcode image using the training template; The decoding module is used to decode the matched image.
7. A decoding system for realizing self-induction triggering as claimed in claim 6, characterized in that: The input module is also used to obtain a training threshold; The decoding system further comprises a control module, which is used to control the decoding module to decode the ROI area corresponding to the barcode image according to the position information of the ROI area in the barcode image when the training number is less than the training threshold, and to control the template matching module to perform feature training on the successfully decoded barcode image area to generate a training template when the decoding is successful, and to increase the training number by 1 at the same time; The control module is also used to control the template matching module to perform template matching on the ROI area corresponding to the barcode image using the training template when the number of training times is not less than the training threshold.
8. A decoding system for realizing self-induction triggering as claimed in claim 7, characterized in that: The initial value of the training times is 0.
9. A decoding system for realizing self-induction triggering as claimed in claim 7, characterized in that: The template matching module includes a first similarity evaluation module and a first image selection module. The first similarity evaluation module is used to obtain similarity evaluation values of all matching areas in the ROI area corresponding to the barcode image using the training template. The first image selection module is used to use the image of the matching area with the highest similarity evaluation value as the matching image.
10. A decoding system for realizing self-induction triggering as claimed in claim 7, characterized in that: The input module is also used to obtain a similarity evaluation threshold; The template matching module includes a second similarity evaluation module and a second image selection module. The second similarity evaluation module is used to use the training template to sequentially obtain the similarity evaluation values of the matching areas within the ROI area corresponding to the barcode image. The second image selection module is used to compare each similarity evaluation value with a similarity evaluation threshold. If the similarity evaluation value is greater than the similarity evaluation threshold, the image corresponding to the matching area is a matching image.