Method for automatically calibrating label printing and terminal device thereof

By comparing the rendered ideal label renderings and the image information of the real printed label, using image processing technology to calculate the mapping matrix and offset parameters, and automatically adjust the printer parameters, solving the problem of manually adjusting the label position and format in the existing technology, realizing the implementation of the problem of realizing the label position and format. Automatic calibration of label printing improves printing accuracy and efficiency.

CN119473173APending Publication Date: 2025-02-18ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410753853.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, users need to manually adjust the label position and format, resulting in complex operations, time-consuming and error-prone, and the accurate alignment of printed content on the label cannot be achieved.

Method used

By comparing the rendered ideal label renderings and the image information of the real printed label, the image processing technology is used to extract the outer edge feature points and content feature points of the label, calculate the mapping matrix, calculate the offset parameters required for the printing content, and automatically adjust the printer parameters. To achieve accurate alignment of label content.

Benefits of technology

Automatic calibration label printing is realized, reducing operational complexity and error rate, improving printing accuracy and efficiency, and reducing user operating costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473173A_ABST
    Figure CN119473173A_ABST
Patent Text Reader

Abstract

The invention provides a method for automatically calibrating label printing and a terminal device thereof. The method comprises the following steps: performing label printing by using a printer to be calibrated; rendering the to-be-printed label to generate an ideal label effect picture; acquiring image information of a real printed label; respectively extracting outer edge feature points of the real printing label and the ideal label effect picture to calculate a mapping matrix, and identifying recognizable feature points in label contents of the real printing label and the ideal label effect picture for matching; offset parameters needing to be set during label printing are calculated according to the mapping matrix; adjusting parameters of the printer to be calibrated according to the offset and the rotation angle obtained through calculation; and reprinting the label to ensure that the printing result is close to an ideal label effect picture. According to the invention, the label printing with an automatic calibration function can be realized, and the printing content can be automatically and accurately aligned on the label, so that the printing efficiency and accuracy are 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 label printing, and in particular to a method for automatically calibrating label printing and a terminal device applying the method. Background Art

[0002] In the field of label printing, ensuring that labels are printed in the center has always been an important and challenging task. Traditional label printing often requires users to manually adjust the position and format of the label to ensure that the printed content is accurately aligned on the label.

[0003] Traditional label printing methods usually rely on users to manually adjust the displacement parameters and format of the label to achieve accurate alignment of the final printed content on the label.

[0004] Therefore, the disadvantages of the prior art are that the user is required to manually adjust the label position and format, which not only increases the complexity of the operation, but is also time-consuming and error-prone, and causes the printed content to be unable to be accurately aligned on the label. Summary of the invention

[0005] In order to overcome the shortcomings of the prior art, the present invention provides a method for automatically calibrating label printing and a terminal device thereof to address the complex, time-consuming and error-prone problems in the prior art caused by the need for users to manually adjust the label position and format. The method can realize label printing with automatic calibration function, and can automatically and accurately align the printed content on the label, thereby improving printing efficiency and accuracy.

[0006] To solve the above problems, the technical solution adopted by the present invention is as follows:

[0007] A method for automatically calibrating label printing comprises the following steps:

[0008] Print labels using the printer settings to be calibrated;

[0009] Render the labels to be printed and generate ideal label renderings;

[0010] Get the image information of the real printed label;

[0011] Extracting outer edge feature points of the real printed label and the ideal label rendering respectively for calculating the mapping matrix, and identifying recognizable label style feature points in the label contents of the real printed label and the ideal label rendering respectively for matching, so as to further verify and correct the mapping matrix;

[0012] According to the mapping matrix, the offset parameters that need to be set when printing the label are calculated to determine the position correspondence between each element in the ideal label effect image and the position on the actual printed label;

[0013] Adjust the parameters of the printer to be calibrated according to the calculated offset and rotation angle;

[0014] Reprint labels to ensure they are close to the ideal label image and to check the calibration.

[0015] According to a method for automatically calibrating label printing provided by the present invention, rendering the label to be printed includes:

[0016] Use the image processing library to load the background layer and the print content layer; the background layer represents the label paper style, and the print content layer contains the content edited by the user;

[0017] Overlay the printed content layer onto the background layer to form a label effect image;

[0018] Applying image processing functions to the label rendering, including color correction, size adjustment, and transparency setting;

[0019] Generates an image of an ideal label that is used to calibrate label printers.

[0020] According to a method for automatically calibrating label printing provided by the present invention, after obtaining image information of a real printed label, preprocessing the image includes:

[0021] Adjust the brightness and contrast of the image;

[0022] Color balance the image;

[0023] Sharpen the image to further enhance the details and clarity in the image;

[0024] Suppress noise on images to improve clarity.

[0025] According to a method for automatically calibrating label printing provided by the present invention, the step of respectively extracting outer edge feature points of a real printed label and an ideal label effect image comprises:

[0026] Through image processing technology, edge detection algorithm and color space transformation method are used to extract the outer edge of the label; at the same time, feature point extraction and description algorithm is used to extract key feature points from the label content;

[0027] Using the feature matching algorithm, the feature points in the ideal label effect image are matched with the feature points in the real printed label, and then the label outer edge mapping matrix is ​​calculated using the matched label edge information, which is recorded as H B , the formula is as follows:

[0028] H B P B-R =P B ,

[0029] Among them, H B is the mapping matrix, P B-R is the label edge coordinate of the actual printed label, P B are the label edge coordinates of the ideal label.

[0030] According to a method for automatically calibrating label printing provided by the present invention, the step of respectively extracting outer edge feature points of a real printed label and an ideal label effect image comprises:

[0031] Use the trained semantic segmentation model to identify and segment the outer edge feature points of the real printed label and the ideal label rendering.

[0032] According to a method for automatically calibrating label printing provided by the present invention, for extracting label content, a key point-based detection network is used to extract feature points from the label content of a real printed label, and the extracted feature points are matched with the feature points in an ideal effect label image to determine the position and shape of the label content in the printed image.

[0033] According to a method for automatically calibrating label printing provided by the present invention, the calculation of the offset parameters that need to be set when printing the label includes:

[0034] Calculate the offset in the up and down and left and right directions, including:

[0035] According to the mapping matrix H B Calculate the coordinates of the feature points of the label content aligned with the outer edge. The formula is as follows:

[0036]

[0037] Among them, H B is the mapping matrix, P C-R The image coordinates of the feature points of the actual printed label content. The image coordinates of the feature points that align with the outer edges of the labels.

[0038] According to a method for automatically calibrating label printing provided by the present invention, after calculating the coordinates of the feature points of the label content aligned with the outer edge, the offsets of all paired feature points are calculated, and the formula is as follows:

[0039]

[0040] Directly calculate the Δ of all matching feature points x and Δ y The average is calculated and the result is the printing offset parameter. You can also apply the random sampling consensus algorithm (RANSAC) to the Δ x and Δ yThen the average is calculated to obtain a more accurate estimate.

[0041] According to a method for automatically calibrating label printing provided by the present invention, after calculating the coordinates of the feature points of the label content aligned with the outer edge, by using The image coordinates and P of the feature points aligned to the outer edge of the label C The image coordinates of the theoretical feature points are directly fitted to calculate the mapping matrix, and the offset parameters are directly extracted from the mapping matrix, including:

[0042] The mapping matrix that only considers scaling and translation is the projection matrix, and the formula is as follows:

[0043]

[0044] The relationship between the projection matrix and each pair of feature points is as follows:

[0045]

[0046] When there are at least 4 pairs of feature points, the projection matrix is ​​solved by using the least squares method. The projection matrix C x and C y This is the required offset parameter.

[0047] A terminal device for automatic calibration label printing, characterized in that the terminal device is applied to the above-mentioned method for automatic calibration label printing, and the terminal device comprises:

[0048] A memory for storing image data and instructions executable by a processor;

[0049] A processor, for processing data, running instructions and performing operations, to provide computing support for the method of automatically calibrating label printing;

[0050] The image acquisition unit is used to take pictures of the label to be calibrated to obtain the original label image for subsequent processing.

[0051] It can be seen that compared with the prior art, the present invention has the following beneficial effects:

[0052] 1. The present invention compares the ideal label effect rendered with the actual label obtained by taking a photo, and calculates the mapping matrix of the label outer frame and label content of the two through image processing technology.

[0053] 2. The present invention calculates the required left-right and up-down displacements of the label printing content according to the mapping matrix, thereby ensuring that the printed content can be accurately aligned to the actual label.

[0054] 3. The present invention automatically configures the calculated offsets into the printing application, so that subsequent printing operations can automatically adjust the position of the printed content according to these offsets.

[0055] Therefore, the technical solution of the present invention has obvious advantages. In the application, the present invention renders an ideal label effect based on the preset label template and the printing content input by the user, showing the ideal position and layout of the printed content on the label. There is no need for the user to manually adjust the label position and format, which reduces the operation complexity and error rate. By accurately calculating the offset, the automatic printed content is accurately aligned on the label, which improves printing accuracy and quality. The automatic alignment function reduces the user's operating cost, while improving printing efficiency and shortening production time.

[0056] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 The present invention is a flowchart of a method for automatically calibrating label printing according to an embodiment of the present invention.

[0058] Figure 2 It is a schematic diagram of a dedicated calibration image in an embodiment of a method for automatic calibration label printing of the present invention.

[0059] Figure 3 Schematic diagram of a dedicated calibration image label editing area in an embodiment of a method for automatic calibration label printing of the present invention

[0060] Figure 4 The present invention is a schematic diagram of a terminal device for automatically calibrating label printing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] See also Figure 1 The present embodiment provides a method for automatically calibrating label printing, comprising the following steps:

[0063] Step S1, using the printer to be calibrated to print labels;

[0064] Step S2, rendering the label to be printed to generate an ideal label effect image;

[0065] Step S3, obtaining image information of the real printed label;

[0066] Step S4, respectively extracting the outer edge feature points of the real printed label and the ideal label rendering for calculating the mapping matrix, and respectively identifying identifiable feature points in the label content of the real printed label and the ideal label rendering for matching, so as to further verify and correct the mapping matrix;

[0067] Step S5, calculating the offset parameters that need to be set when printing the label according to the mapping matrix, so as to determine the position correspondence between each element in the ideal label effect image and the position on the actual printed label;

[0068] Step S6, adjusting the parameters of the printer to be calibrated according to the calculated offset and rotation angle;

[0069] Step S7, reprint the label to ensure that the printing result is close to the ideal label effect image, and check the calibration effect.

[0070] In the above step S1, when using the printer to be calibrated to print a label, use the printer supporting tool or application to connect the printer and use it to print a label. During use, it is necessary to ensure that the settings of the printer match the actual use environment, including the settings of parameters such as paper type and print quality.

[0071] In the above step S2, the label to be printed is rendered, and the image processing function of the processor is used to render the ideal effect image of the label printed in step S1, which specifically includes:

[0072] Use the image processing library to load the background layer and the print content layer; the background layer represents the label paper style, and the print content layer contains the content edited by the user; superimpose the print content layer on the background layer to form a label rendering; apply image processing functions to the label rendering, and the processing process includes color correction, size adjustment, and transparency setting, etc. For example, apply a color correction algorithm to adjust the overall tone, brightness, and contrast of the label, which involves the use of color space conversion (such as from RGB to HSV and then back to RGB), or the use of color lookup tables (LUT) and other technologies; generate an ideal label rendering used to calibrate the label printer. The rendering should contain all the design elements of the label, such as text, graphics, borders, etc., and the characteristics of the printer and the layout of the label on the paper should be taken into consideration during the design.

[0073] In the above step S3, the image information of the real printed label is obtained, for example, by using a camera, or a scanner to photograph or scan the label printed by the printer. Ensure that the quality of the photo or scan is high enough to clearly show the details of the label for subsequent processing and analysis.

[0074] In the above step S3, the image information of the real printed label is preprocessed to improve the accuracy of subsequent calculations, including:

[0075] Adjust the brightness and contrast of the image to make it clearer, highlight the details and edges in the image, and reduce the effects of shadows and blur; by increasing or decreasing the brightness value of the image, the image can be made brighter or darker, thereby improving the visual effect of the image. Image processing software or libraries (such as OpenCV, PIL / Pillow, etc.) can be used to adjust the brightness of the image. By increasing the contrast, the details and edges in the image can be made more prominent, and the effects of shadows and blur can be reduced. Image processing software or libraries can be used to adjust the contrast of the image.

[0076] Perform color balance on the image to eliminate color deviation caused by lighting conditions and shooting equipment; by adjusting the ratio of the three color channels of red, green, and blue (RGB) in the image, the color of the image can be made more realistic and balanced. Common color balance methods include color enhancement and white balance algorithms in the RGB color model.

[0077] Use histogram equalization, gamma transformation, etc. to sharpen the image to further enhance the details and clarity in the image; for example, by redistributing the pixel values ​​of the image, the image histogram is evenly distributed in the entire grayscale range, thereby enhancing the image contrast. By adjusting the image gamma value to change the image brightness distribution, the dark details in the image can be expanded while the bright details can be compressed, thereby improving the visual effect of the image.

[0078] Use Gaussian filtering and other methods to suppress image noise to improve clarity. In addition to Gaussian filtering, there are other denoising algorithms to choose from, such as mean filtering, median filtering, bilateral filtering, wavelet denoising, etc. These algorithms can be selected according to the specific image and noise type.

[0079] In the above step S4, the eigenvalues ​​are extracted to calculate the mapping matrix of the outer edge of the label and the feature points of the label content are extracted and matched: after obtaining the photo of the real printed label, the image of the label is processed using image processing technology to extract its eigenvalues. This includes but is not limited to edge detection, color analysis, shape recognition and other steps for subsequent mapping matrix calculation. Among them, the mapping matrix is ​​a key data structure that describes the correspondence between the ideal label effect image and the real printed label.

[0080] Among them, when extracting the outer edge feature points of the real printed label and the ideal label effect image, it includes:

[0081] First, through image processing technology, edge detection algorithms (such as Canny edge detection or Sobel operator) and color space transformation methods (such as HSV or LAB) are used to extract the outer edge of the label; at the same time, feature point extraction and description algorithms, such as SIFT (Scale Invariant Feature Transform) or SURF (Speeded Up Robust Features), are used to extract key feature points from the label content.

[0082] Next, a feature matching algorithm, such as the nearest neighbor matching (NN) based on feature points or the efficient nonlinear nearest neighbor search algorithm (FLANN), is used to preliminarily screen and match the feature points in the ideal label effect image with the feature points in the real printed label. Then, the random sampling consensus algorithm (RANSAC) is used to optimize the preliminarily screened feature point pairs to eliminate the influence of mismatching and noise. Then, the matched label edge information is used to calculate the label outer edge mapping matrix, which is recorded as H. B , the formula is as follows:

[0083] H B P B-R =P B ,

[0084] Among them, H B is the mapping matrix, P B-R is the label edge coordinate of the actual printed label, P B are the label edge coordinates of the ideal label.

[0085] In this step, in addition to traditional image processing techniques, deep learning methods can also be considered to extract the outer edges of the label and the key features of the content. Deep learning technology has achieved great success in the field of image processing, especially in object detection and feature extraction. For example, convolutional neural networks (CNNs) can be used to learn feature representations directly from images without manually designing feature extraction algorithms.

[0086] In the above step S4, for the extraction of the outer edge of the label, a trained semantic segmentation model, such as a U-Net or a Mask R-CNN, can be used to identify and segment the outer edge feature points of the real printed label and the ideal label effect image. These models can learn the semantic information of different regions in the image and accurately locate the outer contour of the label.

[0087] In the above step S4, for the extraction of label content, a key point-based detection network can be used to extract feature points from the label content of the real printed label, and the extracted feature points are matched with the feature points in the ideal effect label image to determine the position and shape of the label content in the printed image. It can be seen that these feature points will match the feature points in the ideal effect image to determine the position and shape of the label content in the printed image. The feature points extracted by the key point-based detection network can better capture the geometric information of the label content, thereby improving the accuracy and stability of feature matching.

[0088] In the above step S5, the offset parameters that need to be set when printing the label are calculated. Mathematical calculations can be performed based on the mapping matrix obtained in step S4 to determine the position correspondence between each element in the ideal label effect diagram and the position on the actual printed label, which includes:

[0089] Calculate the offset in the up and down and left and right directions, including:

[0090] According to the mapping matrix H B Calculate the coordinates of the feature points of the label content aligned with the outer edge. The formula is as follows:

[0091]

[0092] Among them, H B is the mapping matrix, P C-R The image coordinates of the feature points of the actual printed label content. The image coordinates of the feature points that align with the outer edges of the labels.

[0093] After calculating the coordinates of the feature points of the label content aligned with the outer edge, calculate the offset of all paired feature points. The formula is as follows:

[0094]

[0095] Directly calculate the Δ of all matching feature points x and Δ y The average value is the print offset parameter. The RANSAC algorithm can also be used to calculate the Δ x and Δ y Then the average is calculated to obtain a more accurate estimate.

[0096] After calculating the coordinates of the feature points of the label content aligned with the outer edge, you can also use P C B The image coordinates and P of the feature points aligned to the outer edge of the label C The image coordinates of the theoretical feature points are directly fitted to calculate the mapping matrix, and the offset parameters are directly extracted from the mapping matrix, including:

[0097] The mapping matrix that only considers scaling and translation is the projection matrix, and the formula is as follows:

[0098]

[0099] The relationship between the projection matrix and each pair of feature points is as follows:

[0100]

[0101] When there are at least 4 pairs of feature points, the projection matrix is ​​solved by using the least squares method. The projection matrix C x and C y This is the required offset parameter.

[0102] In the above steps S6 and S7, the parameters of the printer are adjusted according to the calculated offset and rotation angle, and the label is reprinted to ensure that the printing result is as close as possible to the ideal effect image, thereby achieving the purpose of calibration.

[0103] Among them, when printing the labels to be calibrated and rendering the labels to achieve the desired effect, a specially designed calibration label can be used to further improve the accuracy and stability of the calibration, such as Figure 2 These calibration labels have a special design structure to optimize the feature extraction and matching operations required during the calibration process. The label content may contain multiple QR codes that are precisely placed at the edge of the edit print area, such as Figure 3 , the gray line in the figure is the edge position of the printing area. The QR code here can not only mark the editable distance of the current label, but also accurately locate the edge position of the edited printing area through its position information. In addition, the positional relationship information contained in the QR code can also effectively assist the positioning process. At the same time, by utilizing the outer contour of the QR code, multiple feature points can be easily extracted, which is conducive to edge fitting and calculating the accurate range of the label printing content. Compared with ordinary label content, this design can effectively improve the accuracy and robustness of the calibration process, especially compared with the situation where users edit the printed content by themselves, because it ensures a sufficient number of feature points for feature matching operations, thereby enhancing the reliability of calibration.

[0104] Of course, the QR code of the dedicated calibration label content can be set to different content during use according to actual needs to assist the calibration function, such as setting the QR code content to the ideal physical coordinate position of the label corresponding to the center of the QR code.

[0105] Through the above steps, the printer can be effectively calibrated so that it can more accurately print labels that meet the design requirements. This process combines knowledge and technology from multiple fields such as image processing, computer vision and mathematical calculations, and is of great significance for ensuring the quality of label printing.

[0106] In summary, the present invention compares the rendered ideal label effect with the actual label obtained by taking a photo, and calculates the mapping matrix of the outer frame and label content of the two labels through image processing technology. The present invention calculates the offset required for the left and right movement and the up and down movement of the label printing content according to the mapping matrix, ensuring that the printed content can be accurately aligned to the actual label. The present invention automatically configures the calculated offset into the printing application, so that subsequent printing operations can automatically adjust the position of the printed content according to these offsets. Therefore, the technical solution of the present invention has obvious advantages. In the application, the present invention renders an ideal label effect according to the preset label template and the printed content input by the user, showing the ideal position and layout of the printed content on the label, without the need for the user to manually adjust the label position and format, reducing the complexity of operation and the error rate. By accurately calculating the offset, the accurate alignment of the automatic printed content on the label is achieved, and the printing accuracy and quality are improved. The automatic alignment function reduces the user's operating cost, while improving the printing efficiency and shortening the production time.

[0107] A terminal device embodiment for automatically calibrating label printing

[0108] like Figure 4 As shown, a terminal device for automatically calibrating label printing includes:

[0109] A terminal device for automatic calibration label printing, characterized in that the terminal device is applied to the above-mentioned method for automatic calibration label printing, and the terminal device comprises:

[0110] A memory for storing image data and instructions executable by a processor;

[0111] A processor, for processing data, running instructions and performing operations, to provide computing support for the method of automatically calibrating label printing;

[0112] The image acquisition unit is used to take pictures of the label to be calibrated to obtain the original label image for subsequent processing.

[0113] The terminal usually uses a camera, a camera or an intelligent terminal device with a camera function, which can be a portable device with a standard operating system such as a smart phone or a tablet computer.

[0114] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0115] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.

Claims

1. A method for automatically calibrating label printing, characterized in that: The following steps are involved: Print labels using the printer settings to be calibrated; Render the labels to be printed and generate ideal label renderings; Get the image information of the real printed label; Extracting outer edge feature points of the real printed label and the ideal label rendering respectively for calculating the mapping matrix, and identifying identifiable feature points in the label contents of the real printed label and the ideal label rendering respectively for matching, so as to further verify and correct the mapping matrix; According to the mapping matrix, the offset parameters that need to be set when printing the label are calculated to determine the position correspondence between each element in the ideal label effect image and the position on the actual printed label; Adjust the parameters of the printer to be calibrated according to the calculated offset and rotation angle; Reprint labels to ensure they are close to the ideal label image and to check the calibration.

2. The method according to claim 1, characterized in that The rendering of the label to be printed includes: Use the image processing library to load the background layer and the print content layer; the background layer represents the label paper style, and the print content layer contains the content edited by the user; Overlay the printed content layer onto the background layer to form a label effect image; Applying image processing functions to the label rendering, including color correction, size adjustment, and transparency setting; Generates an image of an ideal label that is used to calibrate label printers.

3. The method according to claim 1, characterized in that: After obtaining the image information of the real printed label, the image is preprocessed, including: Adjust the brightness and contrast of the image; Color balance the image; Sharpen the image to further enhance the details and clarity in the image; Suppress noise on images to improve clarity.

4. The method according to claim 1, characterized in that: The step of respectively extracting outer edge feature points of a real printed label and an ideal label effect image comprises: Through image processing technology, edge detection algorithm and color space transformation method are used to extract the outer edge of the label; at the same time, feature point extraction and description algorithm is used to extract key feature points from the label content; Using the feature matching algorithm, the feature points in the ideal label effect image are matched with the feature points in the real printed label, and then the label outer edge mapping matrix is ​​calculated using the matched label edge information, which is recorded as H B , the formula is as follows: H B P B-R =P B , Among them, H B is the mapping matrix, P B-R is the label edge coordinate of the actual printed label, P B are the label edge coordinates of the ideal label.

5. The method according to claim 1, characterized in that: The step of respectively extracting outer edge feature points of a real printed label and an ideal label effect image comprises: Use the trained semantic segmentation model to identify and segment the outer edge feature points of the real printed label and the ideal label rendering.

6. The method according to claim 1, characterized in that: For the extraction of label content, a key point-based detection network is used to extract feature points from the label content of the real printed label, and the extracted feature points are matched with the feature points in the ideal effect label image to determine the position and shape of the label content in the printed image.

7. The method according to claim 1, characterized in that The offset parameters that need to be set when calculating label printing include: Calculate the offset in the up and down and left and right directions, including: According to the mapping matrix H B Calculate the coordinates of the feature points of the label content aligned with the outer edge. The formula is as follows: Among them, H B is the mapping matrix, P C-R The image coordinates of the feature points of the actual printed label content. The image coordinates of the feature points that align with the outer edges of the labels.

8. The method according to claim 7, characterized in that: After calculating the coordinates of the feature points of the label content aligned with the outer edge, calculate the offset of all paired feature points. The formula is as follows: Directly calculate the Δ of all matching feature points x and Δ y Calculate the average value, and the result is the printing offset parameter; or apply the random sampling consistency algorithm to all feature points Δ x and Δ y Then the average is calculated to obtain a more accurate estimate.

9. The method according to claim 7, characterized in that: After calculating the coordinates of the label content feature points aligned with the outer edge, The image coordinates and P of the feature points aligned to the outer edge of the label C The image coordinates of the theoretical feature points are directly fitted to calculate the mapping matrix, and the offset parameters are directly extracted from the mapping matrix, including: The mapping matrix that only considers scaling and translation is the projection matrix, and the formula is as follows: The relationship between the projection matrix and each pair of feature points is as follows: When there are at least 4 pairs of feature points, the projection matrix is ​​solved by using the least squares method. The projection matrix C x and C y This is the required offset parameter.

10. A terminal device for automatically calibrating label printing, characterized in that: The terminal device is applied to a method for automatic calibration label printing as claimed in any one of claims 1 to 9, and the terminal device comprises: A memory for storing image data and instructions executable by a processor; A processor, for processing data, running instructions and performing operations, to provide computing support for the method of automatically calibrating label printing; The image acquisition unit is used to take pictures of the label to be calibrated to obtain the original label image for subsequent processing.