Thermal print head resistance calibration method, system and storage medium

By printing a calibration image on a thermal printer, using a scanner and a PC for image processing, and calculating the resistance value of the calibrated thermal print head, the problem of grayscale error of the thermal print head affecting image quality is solved, thereby improving image quality.

CN116985538BActive Publication Date: 2025-09-26南阳柯丽尔科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311117052.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-09-26
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

When each heating element on an existing thermal print head prints the same grayscale, there is an actual grayscale error, which affects the image quality.

Method used

The first calibration image and the second calibration image are printed by a thermal printer, scanned by a scanner and sent to a PC for image processing to generate a one-dimensional array. The calibrated thermal print head resistance value is calculated based on the preset resistance value data of the thermal print head and saved in the printer.

Benefits of technology

The actual grayscale error of each heating element of the thermal print head when printing the same grayscale is reduced, thereby improving image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116985538B_ABST
    Figure CN116985538B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system and storage medium for calibrating the resistance value of a thermal print head. The method comprises: based on different preset printing positions of the thermal print head, printing out a first calibration image and a second calibration image by a thermal printer, scanning the images by a scanner and sending the images to a PC; performing image processing and conversion processing on the first calibration image and the second calibration image by the PC to generate a first one-dimensional array and a second one-dimensional array respectively; replacing a reference area of ​​the first one-dimensional array according to the second one-dimensional array, and using the replaced first one-dimensional array as a target one-dimensional array; calculating the calibrated resistance value of the thermal print head according to the preset resistance value data of the thermal print head and the target one-dimensional array, and saving the calculated value in the thermal printer; the above method can reduce the actual grayscale error of the print and improve the image quality when each heating element on the thermal print head prints the same grayscale.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of thermal printing technology, and in particular to a method, system and storage medium for calibrating the resistance of a thermal print head. Background Art

[0002] The thermal print head is composed of a row of heating elements. Theoretically, the resistance of these elements is the same, but in reality, due to process reasons, the resistance value will deviate. The elements of the thermal print head are arranged very densely. After the current passes through the elements, the elements will quickly generate high temperatures. When the coating in the medium encounters these elements, the temperature will also rise in a very short time, and then chemical phenomena will occur, producing color, and finally forming an image.

[0003] Since the heating element on the thermal printer print head has an error with the reference heating element, with an error range of ±15%, each heating element on the existing thermal print head will produce an error in the actual grayscale when printing the same grayscale, affecting the image quality. Summary of the Invention

[0004] The present invention provides a thermal print head resistance calibration method and system, which solves the technical problem that when each heating element on the existing thermal print head prints the same grayscale, the actual grayscale printed has errors, which affects the image quality.

[0005] The present invention provides a method for calibrating the resistance of a thermal print head, which involves a thermal printer, a scanner, and a PC. The method includes:

[0006] Printing a first calibration image and a second calibration image by the thermal printer based on different preset printing positions of a thermal print head in the thermal printer;

[0007] Scanning the first calibration image and the second calibration image by the scanner and sending them to the PC;

[0008] performing image processing on the first calibration image and the second calibration image by the PC to generate a first image and a second image;

[0009] converting the first two-dimensional image data of the first image and the second two-dimensional image data of the second image by the PC to generate a first one-dimensional array and a second one-dimensional array respectively;

[0010] replacing a reference area of ​​the first one-dimensional array according to the second one-dimensional array by the PC, and using the replaced first one-dimensional array as a target one-dimensional array;

[0011] The PC calculates the calibrated thermal print head resistance value according to the preset resistance value data of the thermal print head and the target one-dimensional array, and saves the calibrated thermal print head resistance value in the thermal printer.

[0012] Optionally, the method further includes:

[0013] When the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality, the step of printing the first calibration image and the second calibration image by the thermal printer based on different preset printing positions of the thermal print head in the thermal printer is jumped to execution.

[0014] Optionally, the step of performing image processing on the first calibration image and the second calibration image by the PC to generate the first image and the second image includes:

[0015] Performing interception and scaling operations on the first calibration image and the second calibration image respectively by the PC to generate a first calibration area image and a second calibration area image;

[0016] The first calibration area image and the second calibration area image are converted into images and saved as first and second images in raw format.

[0017] Optionally, the step of respectively performing interception and scaling operations on the first calibration image and the second calibration image by the PC to generate a first calibration area image and a second calibration area image includes:

[0018] intercepting calibration areas in the first calibration image and the second calibration image respectively by the PC;

[0019] The calibration area is scaled according to a preset number of dots of the thermal print head to generate a corresponding first calibration area image and a second calibration area image.

[0020] Optionally, the step of replacing the reference area of ​​the first one-dimensional array according to the second one-dimensional array by the PC and using the replaced first one-dimensional array as the target one-dimensional array includes:

[0021] Determine, by the PC, area data in the second one-dimensional array that has the same position as the reference area in the first one-dimensional array;

[0022] The data of the reference area of ​​the first one-dimensional array is replaced with the area data, and the replaced first one-dimensional array is used as the target one-dimensional array.

[0023] The present invention also provides a thermal print head resistance calibration system, the calibration system comprising a thermal printer, a scanner and a PC;

[0024] The thermal printer is configured to print out a first calibration image and a second calibration image based on different preset printing positions of a thermal print head within the thermal printer;

[0025] The scanner is configured to scan the first calibration image and the second calibration image and send the scanned images to the PC;

[0026] The PC includes:

[0027] an image processing unit, configured to perform image processing on the first calibration image and the second calibration image to generate a first image and a second image;

[0028] a conversion processing unit, configured to convert the first two-dimensional image data of the first image and the second two-dimensional image data of the second image to generate a first one-dimensional array and a second one-dimensional array respectively;

[0029] a replacing unit, configured to replace a reference area of ​​the first one-dimensional array according to the second one-dimensional array, and use the replaced first one-dimensional array as a target one-dimensional array;

[0030] The calibration calculation unit is used to calculate the calibrated thermal print head resistance value according to the preset resistance data of the thermal print head and the target one-dimensional array, and save the calibrated thermal print head resistance value in the thermal printer.

[0031] Optionally, the calibration system further includes:

[0032] The judgment unit is configured to jump to the thermal printer when the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality.

[0033] Optionally, the image processing unit includes:

[0034] an image operation subunit, configured to perform cropping and scaling operations on the first calibration image and the second calibration image, respectively, to generate a first calibration area image and a second calibration area image;

[0035] The format conversion subunit is configured to perform image conversion on the first calibration area image and the second calibration area image, and save the converted images into the first image and the second image in a raw format.

[0036] Optionally, the replacement unit includes:

[0037] a determining subunit, configured to determine, within the second one-dimensional array, area data having the same position as the reference area of ​​the first one-dimensional array;

[0038] The replacing subunit is configured to replace the data of the reference area of ​​the first one-dimensional array with the area data, and use the replaced first one-dimensional array as the target one-dimensional array.

[0039] The present invention also provides a storage medium storing a computer program, wherein the computer program runs any of the above methods when executed by the processor.

[0040] It can be seen from the above technical solutions that the present invention has the following advantages:

[0041] The present application provides a method, system, and storage medium for calibrating the resistance of a thermal print head, wherein the method involves a thermal printer, a scanner, and a PC. Based on different preset printing positions of the thermal print head in the thermal printer, a first calibration image and a second calibration image are printed out by the thermal printer; the first calibration image and the second calibration image are scanned by the scanner and sent to the PC; the first calibration image and the second calibration image are image processed by the PC to generate a first image and a second image; the first two-dimensional image data of the first image and the second two-dimensional image data of the second image are converted and processed by the PC to generate a first one-dimensional array and a second one-dimensional array respectively; the reference area of ​​the first one-dimensional array is replaced by the PC according to the second one-dimensional array, and the replaced first one-dimensional array is used as the target one-dimensional array; the calibrated thermal print head resistance is calculated by the PC according to the preset resistance data of the thermal print head and the target one-dimensional array, and the calibrated thermal print head resistance is saved in the thermal printer. The above method solves the technical problem that each heating element of the existing thermal print head has an error in the actual grayscale printed when printing the same grayscale, which affects the image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 A flowchart of a method for calibrating the resistance of a thermal print head provided in Example 1 of the present invention;

[0044] Figure 2 A flowchart of a method for calibrating the resistance of a thermal print head provided in Example 2 of the present invention;

[0045] Figure 3 This is a schematic diagram of a first calibration image provided in Example 2 of the present invention.

[0046] Figure 4 This is a schematic diagram of a second calibration image provided in Example 2 of the present invention.

[0047] Figure 5 A framework diagram of a thermal print head resistance calibration system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The embodiments of the present invention provide a thermal print head resistance calibration method, system and storage medium for solving the technical problem that each heating element on the existing thermal print head has an error in the actual grayscale printed when printing the same grayscale, thereby affecting the image quality.

[0049] In order to make the purpose, features, and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only 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 making creative work are within the scope of protection of the present invention.

[0050] Thermal printer: A type of printer that uses heat to print. It controls the heating of the thermistor in the print head, which then contacts the photosensitive material or the pigment layer on the thermal paper, thereby producing a chemical reaction to form an image or text. This printing technology is often used in small portable printers and receipt printers, and has the characteristics of fast printing speed, low noise and low cost.

[0051] Scanner: A device that captures images. As an optical, mechanical, and electrical integrated computer peripheral product, the scanner is the third largest computer input device after the mouse and keyboard. It can convert images into digital formats that can be displayed, edited, stored, and output by the computer. It is a very powerful input device.

[0052] PC: Personal computer, which can be a smartphone, tablet, laptop, desktop computer, etc.

[0053] See also Figure 1 , Figure 1 A method for calibrating the resistance of a thermal print head is provided in Example 1 of the present invention.

[0054] The present invention provides a method for calibrating the resistance of a thermal print head, which involves a thermal printer, a scanner, and a PC. The method includes:

[0055] Step 101 : Printing a first calibration image and a second calibration image by a thermal printer based on different preset printing positions of a thermal print head in the thermal printer.

[0056] It should be noted that the calibration image is printed based on the preset resistance data and printing position of the thermal print head.

[0057] Step 102: Scan the first calibration image and the second calibration image using a scanner and send them to a PC.

[0058] Step 103 : performing image processing on the first calibration image and the second calibration image through a PC to generate a first image and a second image.

[0059] Step 104 : Converting the first two-dimensional image data of the first image and the second two-dimensional image data of the second image through a PC to generate a first one-dimensional array and a second one-dimensional array respectively.

[0060] Step 105 : Using the PC to replace the reference area of ​​the first one-dimensional array according to the second one-dimensional array, and using the replaced first one-dimensional array as the target one-dimensional array.

[0061] In step 106 , the PC calculates the calibrated thermal print head resistance value according to the preset resistance data of the thermal print head and the target one-dimensional array, and saves the calibrated thermal print head resistance value in the thermal printer.

[0062] An embodiment of the present application provides a method for calibrating the resistance of a thermal print head, the method comprising: printing out a first calibration image and a second calibration image by a thermal printer based on different preset printing positions of a thermal print head in the thermal printer; scanning the first calibration image and the second calibration image by a scanner and sending them to a PC; performing image processing on the first calibration image and the second calibration image by the PC to generate a first image and a second image; converting and processing the first two-dimensional image data of the first image and the second two-dimensional image data of the second image by the PC to generate a first one-dimensional array and a second one-dimensional array, respectively; replacing the reference area of ​​the first one-dimensional array by the PC according to the second one-dimensional array, and using the replaced first one-dimensional array as the target one-dimensional array; calculating the calibrated resistance of the thermal print head by the PC according to the preset resistance data of the thermal print head and the target one-dimensional array, and saving the calibrated resistance of the thermal print head in the thermal printer.

[0063] The above method uses a thermal printer to print a first calibration image and a second calibration image, scans the calibration image with a scanner, uses a PC to perform image processing and calculates the calibrated thermal print head resistance value in combination with the preset resistance data of the thermal print head, and saves the calibrated thermal print head resistance value to the thermal printer, so that each heating element on the thermal print head prints the same grayscale, reducing the actual grayscale error of the print and improving the image quality.

[0064] See also Figure 2 , Figure 2A method for calibrating the resistance of a thermal print head is provided in Example 2 of the present invention.

[0065] The present invention provides a method for calibrating the resistance of a thermal print head, which involves a thermal printer, a scanner, and a PC. The method includes:

[0066] Step 201 : Printing a first calibration image and a second calibration image by a thermal printer based on different preset printing positions of a thermal print head in the thermal printer.

[0067] It should be noted that the preset printing position specifically includes: a starting position and an ending position of a heating element in a thermal print head, wherein the thermal printer prints a first calibration image based on the starting position of the heating element in the thermal print head, and the thermal printer prints a second calibration image based on the ending position of the heating element in the thermal print head;

[0068] Figure 3 Schematic diagram of the first calibration image. Specifically, the white portion is thermal printing paper 1, the non-white portion is the first calibration image 2, the dark gray portion is the non-calibration area 3, the light gray and black areas are the calibration area 4. The calibration area is the area where the thermal print head prints the image. The leftmost black area of ​​the calibration area is the reference area 5, which is used to find the starting point for the thermal print head to print the image.

[0069] Figure 4 Schematic diagram of the second calibration image. Specifically, the white portion is thermal printing paper 1, the non-white portion is the second calibration image 2, the dark gray portion is the non-calibration area 3, the light gray and black areas are the calibration area 4. The calibration area is the area where the thermal print head prints the image. The rightmost black area of ​​the calibration area is the reference area 5, which is used to find the end point of the thermal print head printing the image.

[0070] In particular, the reference area is a completely black area and cannot be calibrated using an algorithm. Therefore, the first calibration image cannot be calibrated alone. The present invention uses the second calibration image to calibrate the reference area in the first calibration image.

[0071] Step 202: Scan the first calibration image and the second calibration image using a scanner and send them to a PC.

[0072] It should be noted that the scanner, as a peripheral device of the PC, can scan the first calibration image and the second calibration image and send them to the PC for image processing.

[0073] Step 203 : Using a PC, crop and scale the first calibration image and the second calibration image to generate a first calibration area image and a second calibration area image.

[0074] In Example 2 of the present application, a PC uses a capture software tool to capture the calibration areas within the first calibration image and the second calibration image respectively; the calibration areas are scaled according to the preset number of dots of the thermal print head to generate corresponding first calibration area images and second calibration area images;

[0075] It should be noted that, since the number of dots scanned by the scanner needs to be greater than the number of dots of the thermal print head (generally greater than or equal to 2 times), the calibration area image needs to be scaled to an image of the size of the dots of the thermal print head.

[0076] Step 204 : performing image conversion on the first calibration area image and the second calibration area image, and saving them as the first image and the second image in raw format.

[0077] It should be noted that after obtaining the first calibration area image and the second calibration area image, image conversion is still required. The image conversion can be processing such as scaling, filling and cropping. After the first calibration area image and the second calibration area image are converted, they need to be saved in the same raw format as the format of the image printed by the thermal printer to generate the first image and the second image.

[0078] Step 205 : The first two-dimensional image data of the first image and the second two-dimensional image data of the second image are converted by a PC to generate a first one-dimensional array and a second one-dimensional array respectively.

[0079] It should be noted that the thermal print head is a row of heating elements, and the resistance data of the thermal print head is one-dimensional data, while the raw data corresponds to two-dimensional image data. Based on the mean algorithm, the first two-dimensional image data of the first image and the second two-dimensional image data of the second image can be converted and processed to generate a first one-dimensional array and a second one-dimensional array respectively; wherein the mean algorithm can be a simple average method, a weighted average method, a square average method, etc.

[0080] Assume that the number of printed resistance points of the thermal print head is 7104, and its corresponding array is printData

[7104] ; the image data of the intercepted area has 7104*800 points, and its corresponding array is imageArea

[7104]

[800] ; use the mean-type algorithm to convert the two-dimensional array imageArea

[7104]

[800] into a one-dimensional array imageData

[7104] ;

[0081] Among them, taking the simple averaging method as an example, imageData[0] = (imageArea[0][0] + imageArea[0][1] ... + imageArea[0]

[799] ) / 800, and so on, imageData

[7103] = (imageArea

[7103] [0] + imageArea

[7103] [1] + ... + imageArea

[7103]

[799] ) / 800, thereby converting the two-dimensional array imageArea

[7104]

[800] into the one-dimensional array imageData

[7104] .

[0082] Step 206 : Using the PC, replace the reference area of ​​the first one-dimensional array according to the second one-dimensional array, and use the replaced first one-dimensional array as the target one-dimensional array.

[0083] In Example 2 of the present application, the reference area is black and the corresponding grayscale value is 0. In order to avoid the placement deviation of the thermal printing paper when it is placed in the scanner, which causes the image of the reference area to be offset, the present invention uses a PC to determine the area data in the second one-dimensional array that is at the same position as the reference area of ​​the first one-dimensional array, replaces the data of the reference area of ​​the first one-dimensional array with the area data, and uses the replaced first one-dimensional array as the target one-dimensional array; the above steps can replace the data with a grayscale value of 0 in the reference area of ​​the first one-dimensional array with a value of normal printed gray.

[0084] Specifically, the width of the general reference area is set to be greater than or equal to 10 points. Then, in the first one-dimensional array imageData1

[7104] , the first n points of the reference area are replaced by the corresponding points in the second one-dimensional array imageData2

[7104] , where n is the width of the reference area. Further, assuming that the width of the reference area is 10 points, the first 10 data in the first one-dimensional array imageData1

[7104] are replaced by the first 10 data in the second one-dimensional array imageData2

[7104] , and the replaced first one-dimensional array is used as the target one-dimensional array.

[0085] In step 207 , the PC calculates the calibrated thermal print head resistance value according to the preset resistance data of the thermal print head and the target one-dimensional array, and saves the calibrated thermal print head resistance value in the thermal printer.

[0086] It should be noted that the resistance value of the thermal print head after calibration can be calculated using a preset algorithm model according to the preset resistance value data of the thermal print head and the target one-dimensional array.

[0087] In step 208, when the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality, the process jumps to executing the step of printing the first calibration image and the second calibration image by the thermal printer based on different preset printing positions of the thermal print head in the thermal printer.

[0088] It should be noted that there is a deviation in the resistance of the heating element of the thermal print head. After the thermal print head has been printing for a period of time, the deviation in the resistance of some heating elements may be greater than 15% of the error range. Even if the thermal printer prints a calibration image based on the calibrated thermal print head resistance, there will still be vertical stripes. At this time, calibration needs to be continued.

[0089] Embodiment 2 of the present application provides a method for calibrating the resistance value of a thermal print head, the method comprising: printing out a first calibration image and a second calibration image by a thermal printer based on different preset printing positions of a thermal print head in the thermal printer; scanning the first calibration image and the second calibration image by a scanner and sending them to a PC; intercepting and scaling the first calibration image and the second calibration image by the PC to generate a first calibration area image and a second calibration area image; converting the first calibration area image and the second calibration area image and saving them as a first image and a second image in a raw format; and converting a first two-dimensional image data of the first image and a second two-dimensional image of the second image by the PC. The image data is converted and processed to generate a first one-dimensional array and a second one-dimensional array respectively; a reference area of ​​the first one-dimensional array is replaced by a PC according to the second one-dimensional array, and the replaced first one-dimensional array is used as a target one-dimensional array; a calibrated thermal print head resistance value is calculated by the PC according to the preset resistance value data of the thermal print head and the target one-dimensional array, and the calibrated thermal print head resistance value is saved in the thermal printer; when the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality, the step of jumping to execute based on different preset printing positions of the thermal print head in the thermal printer, and printing the first calibration image and the second calibration image by the thermal printer.

[0090] The above method is applicable to printing all heating points in the thermal print head. When each heating element on the thermal print head prints the same grayscale, it can reduce the actual grayscale error of printing and improve image quality.

[0091] See also Figure 5 , Figure 5 A framework diagram of a thermal print head resistance calibration system provided by an embodiment of the present invention.

[0092] The present invention provides a noise-based thermal print head resistance calibration system, comprising: the calibration system including a thermal printer, a scanner, and a PC;

[0093] a thermal printer configured to print out a first calibration image and a second calibration image based on different preset printing positions of a thermal print head within the thermal printer;

[0094] a scanner, configured to scan the first calibration image and the second calibration image and send the scanned images to a PC;

[0095] PC includes:

[0096] an image processing unit, configured to perform image processing on the first calibration image and the second calibration image to generate a first image and a second image;

[0097] a conversion processing unit, configured to convert the first two-dimensional image data of the first image and the second two-dimensional image data of the second image to generate a first one-dimensional array and a second one-dimensional array respectively;

[0098] a replacement unit, configured to replace a reference area of ​​the first one-dimensional array according to the second one-dimensional array, and use the replaced first one-dimensional array as a target one-dimensional array;

[0099] The calibration calculation unit is used to calculate the calibrated thermal print head resistance value according to the preset resistance value data of the thermal print head and the target one-dimensional array, and save the calibrated thermal print head resistance value in the thermal printer.

[0100] The calibration system also includes:

[0101] The judgment unit is used to jump to the thermal printer when the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality.

[0102] The image processing unit includes:

[0103] An image operation subunit, configured to perform cropping and scaling operations on the first calibration image and the second calibration image, respectively, to generate a first calibration area image and a second calibration area image;

[0104] The format conversion subunit is used to perform image conversion on the first calibration area image and the second calibration area image, and save them as the first image and the second image in raw format.

[0105] The replacement unit includes:

[0106] a determining subunit, configured to determine, within the second one-dimensional array, area data having the same position as the reference area of ​​the first one-dimensional array;

[0107] The replacement subunit is used to replace the data of the reference area of ​​the first one-dimensional array with the area data, and use the replaced first one-dimensional array as the target one-dimensional array.

[0108] The image operation subunit is specifically used to intercept the calibration areas in the first calibration image and the second calibration image respectively through the PC; scale the calibration area according to the preset number of dots of the thermal print head to generate corresponding first calibration area images and second calibration area images.

[0109] The present invention further provides a storage medium storing a computer program. When the computer program is executed by the processor, the thermal print head resistance calibration method in the above method embodiment is executed.

[0110] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0112] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0113] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0115] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for calibrating the resistance of a thermal print head, characterized in that: Involving a thermal printer, a scanner and a PC; the method includes: Printing a first calibration image and a second calibration image by the thermal printer based on different preset printing positions of a thermal print head in the thermal printer; Scanning the first calibration image and the second calibration image by the scanner and sending them to the PC; performing image processing on the first calibration image and the second calibration image by the PC to generate a first image and a second image; converting the first two-dimensional image data of the first image and the second two-dimensional image data of the second image by the PC to generate a first one-dimensional array and a second one-dimensional array respectively; replacing a reference area of ​​the first one-dimensional array according to the second one-dimensional array by the PC, and using the replaced first one-dimensional array as a target one-dimensional array; Calculating, by the PC, a calibrated thermal print head resistance value according to the preset resistance data of the thermal print head and the target one-dimensional array, and saving the calibrated thermal print head resistance value in the thermal printer; The step of performing image processing on the first calibration image and the second calibration image by the PC to generate the first image and the second image includes: Performing interception and scaling operations on the first calibration image and the second calibration image respectively by the PC to generate a first calibration area image and a second calibration area image; Performing image conversion on the first calibration area image and the second calibration area image, and saving the images as the first and second images in raw format; The step of performing interception and scaling operations on the first calibration image and the second calibration image respectively by the PC to generate a first calibration area image and a second calibration area image includes: intercepting calibration areas in the first calibration image and the second calibration image respectively by the PC; Scaling the calibration area according to a preset number of dots of the thermal print head to generate a corresponding first calibration area image and a second calibration area image; The step of replacing the reference area of ​​the first one-dimensional array according to the second one-dimensional array by the PC and using the replaced first one-dimensional array as the target one-dimensional array includes: Determine, by the PC, area data in the second one-dimensional array that has the same position as the reference area in the first one-dimensional array; The data of the reference area of ​​the first one-dimensional array is replaced with the area data, and the replaced first one-dimensional array is used as the target one-dimensional array.

2. The calibration method according to claim 1, wherein: The method further comprises: When the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality, the step of printing the first calibration image and the second calibration image by the thermal printer based on different preset printing positions of the thermal print head in the thermal printer is jumped to execution.

3. A thermal print head resistance calibration system, characterized in that: The calibration system includes a thermal printer, a scanner and a PC; The thermal printer is configured to print out a first calibration image and a second calibration image based on different preset printing positions of a thermal print head within the thermal printer; The scanner is configured to scan the first calibration image and the second calibration image and send the scanned images to the PC; The PC includes: an image processing unit, configured to perform image processing on the first calibration image and the second calibration image to generate a first image and a second image; a conversion processing unit, configured to convert the first two-dimensional image data of the first image and the second two-dimensional image data of the second image to generate a first one-dimensional array and a second one-dimensional array respectively; a replacing unit, configured to replace a reference area of ​​the first one-dimensional array according to the second one-dimensional array, and use the replaced first one-dimensional array as a target one-dimensional array; a calibration calculation unit, configured to calculate a calibrated resistance value of the thermal print head according to the preset resistance value data of the thermal print head and the target one-dimensional array, and save the calibrated resistance value of the thermal print head in the thermal printer; The image processing unit includes: an image operation subunit, configured to perform cropping and scaling operations on the first calibration image and the second calibration image, respectively, to generate a first calibration area image and a second calibration area image; a format conversion subunit, configured to perform image conversion on the first calibration area image and the second calibration area image, and save the converted images into the first image and the second image in a raw format; The image operation subunit is specifically configured to intercept calibration areas within the first calibration image and the second calibration image respectively through the PC; scale the calibration areas according to a preset number of dots of the thermal print head to generate corresponding first calibration area images and second calibration area images; The replacement unit comprises: a determining subunit, configured to determine, within the second one-dimensional array, area data having the same position as the reference area of ​​the first one-dimensional array; The replacing subunit is configured to replace the data of the reference area of ​​the first one-dimensional array with the area data, and use the replaced first one-dimensional array as the target one-dimensional array.

4. The calibration system according to claim 3, characterized in that The calibration system further comprises: The judgment unit is used to jump to the step of printing a first calibration image and a second calibration image based on different preset printing positions of the thermal print head in the thermal printer when the calibration image printed by the thermal printer according to the calibrated thermal print head resistance value is of poor quality.

5. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 2 is executed.

Citation Information

Patent Citations

  • Halftone recording method and apparatus

    CN1131095A

  • Constant-current heating control method of thermal printing head and thermal printing head

    CN113815315A