Two-dimensional code printing correction method based on image recognition

By using image recognition technology to segment the original QR code and adjust the ink drop charging algorithm, the problem of continuous QR code distortion is solved, and automatic correction and efficient printing are achieved.

CN118219678BActive Publication Date: 2025-09-26WUHAN XIANTONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410261207.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-07
Publication Date
2025-09-26
Estimated Expiration
2044-03-07

AI Technical Summary

Technical Problem

In the prior art, continuous printing of QR codes causes distortion due to the excessively fast assembly line speed, requiring manual debugging or optimization of the ink droplet charging algorithm, which is labor-intensive, time-consuming, and labor-intensive.

Method used

Through image recognition technology, the original QR code image is divided into N columns of blocks, the actual distortion amount is calculated and the ink drop charging algorithm is adjusted to automatically improve the QR code printing distortion and reduce manual intervention.

Benefits of technology

It can automatically improve the distortion of QR code printing, reduce the workload of staff, and improve work efficiency and convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118219678B_ABST
    Figure CN118219678B_ABST
Patent Text Reader

Abstract

The present invention relates to a two-dimensional code printing correction method based on image recognition. The method first performs a trial print on the first product on an assembly line, processes the trial-printed two-dimensional code in columns, and obtains the actual distortion of each column of blocks by comparing each column of blocks with the original two-dimensional code image; then obtains the expected distortion of each column of blocks, and obtains the advance of the ink drop charging algorithm of each column of blocks based on the expected distortion and the actual distortion; finally, adjusts the charging algorithm based on the advance. When printing the second and subsequent products, the adjusted overall new ink drop charging algorithm is used to perform two-dimensional code printing. This method can effectively improve the distortion of two-dimensional code printing without the need for manual adjustment of the running speed of the assembly line and the ink drop charging algorithm, which can greatly reduce the workload of staff, save time and effort, and is convenient and fast.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of continuous jet printing, and in particular to a two-dimensional code printing correction method based on image recognition. Background Art

[0002] CIJ is the abbreviation of continuous ink jet printing technology, also known as non-contact printing.

[0003] The continuous inkjet system continuously ejects ink from a single nozzle under pressure, which breaks after crystal oscillation to form continuous ink droplets. Some of these continuous ink droplets are charged, and the charged ink droplets are deflected in trajectory by the high-voltage electric field and then ejected, while the uncharged ink droplets flow back in a straight line to the ink droplet collection head and return to the circulating ink path. The charged ink droplets are deflected and ejected onto the surface of the moving object, thereby scanning to form characters or graphics.

[0004] Continuous inkjet printing technology is generally used in the packaging market where high printing speed is required, such as numbering and marking of food, beverages, electronic components, medicines and other packaging.

[0005] Since continuous printing sprays ink column by column, and the object being printed has a lateral movement speed, a complete pattern will eventually be printed on the surface of the object.

[0006] With the gradual popularization of QR codes, QR codes are also printed on the packaging bags of many products so that consumers can obtain product information more conveniently.

[0007] On a printing line, the inkjet nozzles are fixed to the side of the line. If the line runs too fast during printing, the printed QR code will be distorted. Therefore, manual adjustment of the line speed or optimization of the ink droplet charging algorithm are necessary to improve distortion.

[0008] The disadvantage of the above operation method is that multiple manual adjustments are required to obtain the appropriate pipeline operation speed and ink droplet charging algorithm, which is labor-intensive, time-consuming, labor-intensive and inconvenient, and needs to be improved. Summary of the Invention

[0009] Based on the above description, the present invention provides a two-dimensional code printing correction method based on image recognition to solve the problem of automatically improving the distortion of two-dimensional code printing.

[0010] The technical solution of the present invention to solve the above technical problems is as follows:

[0011] A two-dimensional code printing correction method based on image recognition includes the following steps:

[0012] S1. Obtain the original QR code image;

[0013] S2. Perform image recognition on the original QR code image to identify the position range of each identification area on the original QR code image and identify the type of each identification area;

[0014] S3. Calibrate the allowable distortion amount of each marked area according to the type of the marked area;

[0015] S4, dividing the obtained QR code original image into N columns of blocks in a column-by-column manner to obtain standard blocks in each column;

[0016] S5. Print a QR code for the first product on the assembly line, print each block column by column, capture each block by a camera, compare each block printed in real time with the corresponding standard block in the original QR code image, and calculate the actual distortion of each block printed in each column. Then, identify the section located in the identification area within each block printed in each column, i.e., the identification section, and read the allowable distortion of the identification area where each identification section is located. For each block printed in each column, compare the allowable distortion of all corresponding identification areas within the column to determine the minimum allowable distortion within the block. The minimum allowable distortion is used as the expected distortion after correction for the column of blocks. The advance amount of the ink droplet charging algorithm and the distortion variation are matched in advance through experiments. After obtaining the expected distortion for a column of blocks, the distortion variation is calculated based on the actual distortion and the expected distortion. The corresponding advance amount is then retrieved based on the calculated distortion variation. The charging algorithm for the column of blocks is adjusted based on the retrieved advance amount. This step can be repeated to adjust the charging algorithm for all columns of blocks. When the QR code of the first product is printed, the new ink droplet charging algorithm for the entire QR code can be obtained.

[0017] S6. When printing the second and subsequent products in the production line, execute QR code printing using the new ink drop charging algorithm.

[0018] As a preferred solution: the method for calculating the actual distortion of the blocks in step S5 is to establish a plane rectangular coordinate system, select a column of blocks and obtain the standard blocks corresponding to the column of blocks in the original QR code image; place both in the plane rectangular coordinate system, read the horizontal coordinate Xp1 of the lower left corner vertex P1 of the column of blocks, and read the horizontal coordinate Xp0 of the lower left corner vertex P0 of the corresponding standard block; then the actual distortion of the column of blocks J = (Xp1-Xp0) / Xp0.

[0019] As a preferred solution: the method for matching the advance amount and distortion change amount of the ink droplet charging algorithm in step S5 is to conduct experiments at the same operating speed on the assembly line. First, a column of tiles is printed using the default charging algorithm, and the distortion amount of the printed tiles is calculated; then, the ink droplets that need to be charged in the charging algorithm are advanced by one grid, and after moving one grid, another column of tiles is printed, and the distortion amount of the tiles is calculated; then, the ink droplets that need to be charged in the charging algorithm are advanced by one grid again, completing the printing of a column of tiles and the distortion amount calculation, and repeating this process.

[0020] As a preferred solution: Step S2 determines the position range of each identification area in the original two-dimensional code image and identifies the type of each identification area through image recognition and positioning.

[0021] Compared with the existing technology, the technical solution of the present application has the following beneficial technical effects: the method first conducts a trial print on the first product on the assembly line, processes the trial-printed QR code in columns, and obtains the actual distortion of each column of blocks by comparing each column of blocks with the original QR code image; then obtains the expected distortion of each column of blocks, and obtains the advance of the ink drop charging algorithm of each column of blocks based on the expected distortion and the actual distortion; finally, adjusts the charging algorithm based on the advance. When printing the second and subsequent products, the QR code printing is performed using the adjusted overall new ink drop charging algorithm. This method can automatically improve the distortion of QR code printing without the need to manually adjust the running speed of the assembly line and the ink drop charging algorithm, which can greatly reduce the workload of staff, save time and effort, and is convenient and fast. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 Schematic diagram of the marking area on the QR code in this embodiment;

[0023] Figure 2 This is a schematic diagram of column-by-column decomposition of the QR code in this embodiment;

[0024] Figure 3 Schematic diagram of ink droplet charging algorithm adjustment;

[0025] Figure 4 This is a schematic diagram of the distortion of a single column of blocks in a QR code in this embodiment;

[0026] Figure 5 Schematic diagram of distortion calculation. DETAILED DESCRIPTION

[0027] Reference Figure 1 ,A QR code printing correction method based on image recognition.

[0028] The method comprises the following steps:

[0029] S1. Obtain the original QR code image.

[0030] S2. Perform image recognition on the original QR code image to identify each identification area on the original QR code image and recognize the type of each identification area.

[0031] like Figure 1 As shown, the production of QR codes needs to follow certain production rules, so there will be some different types of identification areas on the QR code original image, and the blocks in different identification areas have different meanings; and the positions and coverage ranges of various identification areas are also fixed, so the position range of each identification area in the QR code original image can be determined and the type of each identification area can be identified through image recognition and positioning.

[0032] For example: Figure 1 The H1, H2 and H3 areas are all identification areas in the original QR code image.

[0033] The H1 area is a position detection area (ie, the type of the H1 identification area is a position detection area). The position detection area serves to assist the camera in positioning the QR code when scanning. Figure 1 The H2 area is the version information area, and the version information is the specification of the QR code. Figure 1 The H3 area in the QR code is the format information area, and the format information indicates the error correction level of the QR code.

[0034] S3. Calibrate the allowable distortion amount of each marked area according to the type of the marked area.

[0035] To enable consumers to quickly and accurately scan QR codes on product packaging using cameras, it's crucial to ensure that each marking area on the QR code is printed with a certain level of precision and minimal distortion. For production lines, printing efficiency is paramount. The most effective way to achieve distortion-free printing is to reduce line speed, but this inevitably reduces printing efficiency. Therefore, adjusting the ink droplet charging algorithm can improve print distortion without compromising line efficiency.

[0036] Reference Figure 3 In the figure, Sf represents the default droplet charging algorithm for printing a column of tiles, where hollow circles represent droplets that do not require charging, and solid circles represent droplets that do require charging. For droplets that require charging, the required charge (i.e., the amount of charge they carry) must be calculated so that they can be deflected by the high-voltage electric field and shot to the corresponding landing point. The charging algorithm mainly consists of two parts: one is to determine which droplets in a group of ink droplets need to be charged (the number of droplets ejected by the inkjet nozzle in each group is the same when printing column by column); the other is to calculate the charge of each droplet that needs to be charged.

[0037] In the field of continuous inkjet printing technology, the charging algorithm is an existing technology (also recorded in patent application number 2023116047242), which will not be described here.

[0038] Reference Figure 4 , Figure 4 (a) is a schematic diagram of a column of blocks when printing column by column. Figure 4 (a) is a schematic diagram of the block in this column when it is not distorted (the assembly line transports products to the left at a constant speed); Figure 4 (b) is a schematic diagram of the column of blocks when they are distorted.

[0039] Depend on Figure 4 (b) It can be seen that for a column of tiles, under its default charging algorithm, when the pipeline runs too fast, the printed tiles will be distorted to the right. The faster the running speed, the more severe the distortion.

[0040] In the actual production process, the speed of the assembly line is fixed, so in order to improve the distortion, the ink droplet charging algorithm needs to be adjusted.

[0041] Figure 3 In the figure, Sa is the adjusted charging scheme, in which there are two uncharged ink droplets between two adjacent charged ink droplets, while in the Sf scheme, there are three uncharged ink droplets between two adjacent charged ink droplets.

[0042] Obviously, the Sa scheme advances the timing of ejection of each charged ink droplet. Under this scheme, the degree of distortion of the printed image block to the right is reduced.

[0043] Further, Figure 3 The Sb scheme is also an adjusted charging scheme, in which only one uncharged ink droplet is placed between two adjacent charged ink droplets. Using the Sb scheme results in less distortion in the printed image column.

[0044] In this solution, since the QR code of the first product needs to be printed first, and the charging algorithm needs to be adjusted before the second product is delivered to the ink droplet nozzle on the assembly line, the adjustment time for the charging algorithm is very limited, so it is necessary to ensure the speed of the charging algorithm adjustment.

[0045] In order to ensure the rapid adjustment of the charging algorithm, it is necessary to sacrifice some of the distortion improvement effects in the logo area.

[0046] In fact, a certain degree of distortion in the logo area will not affect the accuracy of QR code scanning and recognition, and the distortion amounts allowed for different types of logo areas may be different.

[0047] Therefore, it is necessary to calibrate the allowable distortion of each identification area according to its type. For example, the allowable distortion of the H1 area (position detection area) is 20%, the allowable distortion of the H2 area (version information area) is 10%, and the allowable distortion of the H3 area (format information area) is 5%.

[0048] S4, reference Figure 2 , the obtained QR code original image is divided into N columns of blocks in a column-by-column manner to obtain standard blocks in each column.

[0049] Reference Figure 4 , Figure 4 (a) is a schematic diagram of the first column of blocks, compared with Figure 1 It can be seen that a section in the first column of blocks is located within the H2 marked area. This section is divided according to the boundary of the marked area. Similarly, all sections in the marked areas of the other columns of blocks can be divided.

[0050] S5. When printing the QR code for the first product on the assembly line, print each block column by column, capture each column of printed blocks using a camera, compare each column of printed blocks in real time with the corresponding standard blocks in the original QR code image, and calculate the actual distortion of each column of printed blocks.

[0051] Reference Figure 5 , the method for calculating the actual distortion of the block in this embodiment is:

[0052] Establish a rectangular coordinate system, select a column of tiles, and obtain the corresponding standard tile in the original QR code image. Place both in the rectangular coordinate system, read the horizontal coordinate Xp1 of the lower left corner vertex P1 of the column of tiles, and read the horizontal coordinate Xp0 of the lower left corner vertex P0 of the corresponding standard tile.

[0053] Then the actual distortion amount of the image block in this column is J=(Xp1-Xp0) / Xp0.

[0054] Then, the segments located in the marked area within each column of the printed image blocks, i.e., the marked segments, are identified, and the allowable distortion of the marked area in which each marked segment is located is read. For each column of the printed image blocks, the allowable distortion of all corresponding marked areas within the column of the printed image blocks is compared to determine the minimum allowable distortion within the column of image blocks. This minimum allowable distortion is used as the expected distortion after correction for the column of image blocks.

[0055] In this embodiment, a large number of experiments are required to match the advance amount of the ink droplet charging algorithm with the distortion change. Specifically, experiments are conducted on the production line at the same operating speed. First, a column of tiles is printed using the default charging algorithm, and the distortion of the printed tiles is calculated. Then, the ink droplets that need to be charged in the charging algorithm are all advanced (i.e., moved left) by one grid. After this shift, another column of tiles is printed, and the distortion of the tiles is calculated. Then, the ink droplets that need to be charged in the charging algorithm are all advanced by one grid, completing the printing and distortion calculation of the column of tiles, and repeating this process.

[0056] The corresponding relationship between the advance amount of the ink droplet charging algorithm and the distortion change amount can be obtained through the above means.

[0057] After obtaining the expected distortion value of a column of image blocks, the distortion change value is calculated based on the actual distortion value and the expected distortion value. The distortion change value is the difference between the actual distortion value and the expected distortion value.

[0058] Then, the corresponding advance amount is retrieved based on the calculated distortion change, and the charging algorithm of the column of image blocks is adjusted based on the retrieved advance amount. Repeating this step can achieve the adjustment of the charging algorithm of all columns of image blocks.

[0059] When the QR code of the first product is printed, the new ink drop charging algorithm for the entire QR code can be obtained.

[0060] S6. When printing the second and subsequent products in the production line, perform QR code printing using the new overall ink droplet charging algorithm.

[0061] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A two-dimensional code printing correction method based on image recognition, characterized in that: The following steps are involved: S1. Obtain the original QR code image; S2. Perform image recognition on the original QR code image to identify the position range of each identification area on the original QR code image and identify the type of each identification area; S3. Calibrate the allowable distortion amount of each marked area according to the type of the marked area; S4, dividing the obtained QR code original image into N columns of blocks in a column-by-column manner to obtain standard blocks in each column; S5. Print a QR code for the first product on the assembly line, print each block column by column, capture each block by a camera, compare each block printed in real time with the corresponding standard block in the original QR code image, and calculate the actual distortion of each block printed in each column. Then, identify the section located in the identification area within each block printed in each column, i.e., the identification section, and read the allowable distortion of the identification area where each identification section is located. For each block printed in each column, compare the allowable distortion of all corresponding identification areas within the column to determine the minimum allowable distortion within the block. The minimum allowable distortion is used as the expected distortion after correction for the column of blocks. The advance amount of the ink droplet charging algorithm and the distortion variation are matched in advance through experiments. After obtaining the expected distortion for a column of blocks, the distortion variation is calculated based on the actual distortion and the expected distortion. The corresponding advance amount is then retrieved based on the calculated distortion variation. The charging algorithm for the column of blocks is adjusted based on the retrieved advance amount. This step can be repeated to adjust the charging algorithm for all columns of blocks. When the QR code of the first product is printed, the new ink droplet charging algorithm for the entire QR code can be obtained. S6. When printing the second and subsequent products in the production line, execute QR code printing using the new ink drop charging algorithm.

2. The two-dimensional code printing and correction method based on image recognition according to claim 1, characterized in that: The method for calculating the actual distortion of the tiles in step S5 is to establish a plane rectangular coordinate system, select a column of tiles and obtain the corresponding standard tiles in the original QR code image; place both in the plane rectangular coordinate system, read the horizontal coordinate Xp1 of the lower left corner vertex P1 of the column of tiles, and read the horizontal coordinate Xp0 of the lower left corner vertex P0 of the corresponding standard tile; then the actual distortion of the column of tiles J = (Xp1-Xp0) / Xp0.

3. The two-dimensional code printing and correction method based on image recognition according to claim 1, characterized in that: The method for matching the advance amount of the ink droplet charging algorithm and the distortion change amount in step S5 is to conduct experiments at the same operating speed on the production line. First, a column of tiles is printed using the default charging algorithm, and the distortion amount of the printed tiles is calculated; Then, the ink droplets that need to be charged in the charging algorithm are advanced by one grid. After moving one grid, a column of blocks is printed and the distortion of the blocks is calculated. Then, the ink droplets that need to be charged in the charging algorithm are advanced by one grid again, and the printing and distortion calculation of a column of blocks are completed, and this process is repeated.

4. The two-dimensional code printing and correction method based on image recognition according to claim 1, characterized in that: Step S2 determines the position range of each identification area in the original two-dimensional code image and identifies the type of each identification area through image recognition and positioning.

Citation Information

Patent Citations

  • Printing apparatus

    CN101361081A

  • Ink jet printing device

    JP2002254656A