Laser printing method, laser printer, and storage medium
By performing grayscale conversion and laser energy compensation on the image to be printed, and calculating the target laser energy value, the contradiction between efficiency and quality in existing laser printing is resolved, achieving a highly efficient and clear image printing effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TAI LI DE SHI DA YIN JI JIANG MEN YOU XIAN GONG SI
- Filing Date
- 2024-12-16
- Publication Date
- 2026-05-01
AI Technical Summary
While ensuring printing efficiency, existing laser printing scanning algorithms often lead to image quality problems, such as poor edge neatness or unevenness, making it difficult to achieve efficient and clear image printing.
By converting the image to grayscale, the initial laser energy value of each pixel is determined, and laser energy compensation is performed based on the laser energy values of adjacent areas. The target laser energy value is then calculated, and finally, printing is performed to simulate the image texture of an art sketch.
It achieves efficient printing while ensuring image clarity and quality, avoiding the edge irregularities or unevenness common in traditional algorithms.
Smart Images

Figure CN119937946B_ABST
Abstract
Description
Laser printing methods, laser printers and storage media Technical Field
[0001] This application relates to the field of printing technology, and in particular to a laser printing method, apparatus and storage medium. Background Technology
[0002] The basic principle of laser printing is to focus a laser beam through optical elements to form a tiny spot. This focused laser beam precisely scans the material along a predetermined path, causing physical or chemical reactions to form a permanent pattern. Common laser printing scanning algorithms include unidirectional scanning, bidirectional scanning, and arc scanning. With unidirectional scanning, the laser beam scans line by line in a fixed direction. However, when switching between lines, the laser output is turned off, resulting in excessively long jump distances and low efficiency. Bidirectional scanning scans back and forth in both directions, making it more efficient than unidirectional scanning. However, the alternating switching of the laser beam at line jumps causes edge uniformity issues. Arc scanning, based on bidirectional scanning, does not turn off the laser output during line jumps, greatly improving efficiency but leading to uneven printing edges. Currently, there is a pressing need for a printing method that can guarantee both high efficiency and clear images. Summary of the Invention
[0003] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0004] This application provides a laser printing method, apparatus, and storage medium that can achieve efficient and clear image laser printing.
[0005] In a first aspect, embodiments of this application provide a laser printing method, the method comprising:
[0006] Convert the image to grayscale to obtain a grayscale image;
[0007] Determine the initial laser energy value for each pixel in the grayscale image;
[0008] For each pixel in the grayscale image, a laser energy compensation value for each pixel in the grayscale image is determined based on the initial laser energy value of each pixel in the adjacent region.
[0009] The target laser energy value of each pixel in the grayscale image is determined based on the laser energy compensation value and the initial laser energy value of each pixel in the grayscale image.
[0010] The image to be printed is printed according to the target laser energy value.
[0011] According to some embodiments of the laser printing method provided in this application, determining the initial laser energy value of each pixel in the grayscale image includes:
[0012] Determine the grayscale energy mapping table based on the preset laser parameters;
[0013] The initial laser energy value of each pixel in the grayscale image is determined based on the grayscale value of each pixel and the grayscale energy mapping table.
[0014] According to some embodiments of the laser printing method provided in this application, determining the laser energy compensation value for each pixel in the grayscale image based on the initial laser energy value of each pixel in the adjacent region includes:
[0015] Traverse each pixel in the grayscale image and determine the first and second adjacent regions of the current pixel.
[0016] Obtain the initial laser energy value of each first adjacent pixel in the first adjacent region, and the initial laser energy value of each second adjacent pixel in the second adjacent region;
[0017] Based on the initial laser energy value of each first adjacent pixel in the first adjacent region, determine the local laser energy compensation value of the current pixel;
[0018] Based on the initial laser energy value of each second adjacent pixel in the second adjacent region, determine the global laser energy compensation value of the current pixel;
[0019] The laser energy compensation value of the current pixel is determined based on the local laser energy compensation value and the global laser energy compensation value of the current pixel.
[0020] According to some embodiments of the laser printing method provided in this application, determining the local laser energy compensation value of the current pixel based on the initial laser energy value of each first adjacent pixel in the first adjacent region includes:
[0021] Multiply the difference between the initial laser energy value of the current pixel and the initial laser energy value of each of the first adjacent pixels by the first compensation weight corresponding to each of the first adjacent pixels to obtain multiple product terms;
[0022] The multiple product terms are added together to obtain the local laser energy compensation value of the current pixel.
[0023] According to some embodiments of the laser printing method provided in this application, the second adjacent region includes a first adjacent sub-region, a second adjacent sub-region, and a third adjacent sub-region. The current pixel is located in the second adjacent sub-region, and the first adjacent sub-region and the third adjacent sub-region are respectively adjacent to the second adjacent sub-region.
[0024] The step of determining the global laser energy compensation value of the current pixel based on the initial laser energy value of each second adjacent pixel in the second adjacent region includes:
[0025] Obtain the first sum of the initial laser energy values of all second adjacent pixels in the first adjacent sub-region;
[0026] Obtain the initial laser energy values of all second adjacent pixels in the second adjacent sub-region, and the second sum of the initial laser energy values of the current pixel;
[0027] Obtain the third sum of the initial laser energy values of all second adjacent pixels in the third adjacent sub-region;
[0028] The global laser energy compensation value of the current pixel is obtained by adding the product of the second sum and the second compensation weight corresponding to the second adjacent sub-region, the product of the difference between the second sum and the first sum and the second compensation weight corresponding to the first adjacent sub-region, and the product of the difference between the second sum and the third sum and the second compensation weight corresponding to the third adjacent sub-region.
[0029] According to some embodiments of the laser printing method provided in this application, after obtaining the global laser energy compensation value of the current pixel, the method further includes:
[0030] The product of the first sum and the attenuation coefficient is used to update the first sum;
[0031] The second sum is updated by multiplying the second sum by the attenuation coefficient;
[0032] The third sum is updated by multiplying the third sum by the attenuation coefficient.
[0033] According to some embodiments of the laser printing method provided in this application, printing the image to be printed according to the target laser energy value includes:
[0034] Identify the bent areas in the image to be printed;
[0035] The frequency conversion information is determined based on the bending area and the target laser energy value;
[0036] Based on the frequency conversion information, the bent area of the image to be printed is printed.
[0037] Secondly, embodiments of this application provide a laser printer, including:
[0038] At least one processor;
[0039] At least one memory for storing at least one program;
[0040] When at least one of the programs is executed by at least one of the processors, the laser printing method as described in the first aspect of the embodiments of this application is implemented.
[0041] Thirdly, embodiments of this application provide a computer-readable storage medium storing a processor-executable computer program, which, when executed by a processor, is used to implement the laser printing method as described in the first aspect of embodiments of this application.
[0042] Fourthly, embodiments of this application provide a computer program product, including a computer program or computer instructions, wherein the computer program or computer instructions are stored in a computer-readable storage medium, a processor of a laser printer reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, causing the laser printer to perform the laser printing method as described in the first aspect of embodiments of this application.
[0043] The embodiments of this application include at least the following beneficial effects:
[0044] In this embodiment, the image to be printed is converted to grayscale to obtain a grayscale image; the initial laser energy value of each pixel in the grayscale image is determined; for each pixel in the grayscale image, a laser energy compensation value is determined based on the initial laser energy values of each pixel in the adjacent regions; the target laser energy value of each pixel in the grayscale image is determined based on the laser energy compensation value and the initial laser energy value; and the image to be printed is printed according to the target laser energy value. By compensating the initial laser energy value of each pixel after grayscale conversion of the image to be printed with the laser energy compensation value, the target laser energy value for printing is determined and printing is performed. This method can simulate the image texture of an artistic sketch during printing, achieving efficient printing while ensuring image quality.
[0045] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description and the accompanying drawings. Attached Figure Description
[0046] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0047] Figure 1 is a schematic diagram of the steps of a laser printing method provided in an embodiment of this application;
[0048] Figure 2 is a schematic diagram of the specific steps of step S120 in the embodiment of this application;
[0049] Figure 3 is a schematic diagram of a grayscale energy mapping table provided in an embodiment of this application;
[0050] Figure 4 is a flowchart of the steps for providing a laser energy compensation value according to an embodiment of this application;
[0051] Figure 5 is a schematic diagram of a first adjacent region provided in an embodiment of this application;
[0052] Figure 6a is a schematic diagram of another first adjacent region provided in an embodiment of this application;
[0053] Figure 6b is a schematic diagram of another first adjacent region provided in an embodiment of this application;
[0054] Figure 7 is a schematic diagram of the steps for determining the global laser energy compensation value of the current pixel according to an embodiment of this application.
[0055] Figure 8 is a schematic diagram of a bending region provided in an embodiment of this application;
[0056] Figure 9 is a schematic diagram of a laser printer provided in an embodiment of this application. Detailed Implementation
[0057] The present application will be further described below with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered as limitations on the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.
[0058] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0060] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0061] Laser printing is a non-contact printing technology with increasingly mature applications in material processing for ID card production. It uses a laser beam to print images or text onto paper or other media. By focusing the laser beam through optical elements to form a tiny spot, the focused and guided laser beam precisely scans the material along a predetermined path, causing physical or chemical reactions. By using a high-energy-density laser beam to directly act on the material surface, physical or chemical changes are induced through thermal effects, thus forming permanent marks or patterns. Common scanning imaging algorithms used in laser printing during etching include unidirectional scanning, dual-phase scanning, and arc scanning algorithms.
[0062] The unidirectional scanning algorithm is a path planning method that specifies how the laser beam moves when printing on a material surface. In this method, the laser beam scans line by line along a fixed, single direction (e.g., from left to right), shuts off the beam after completing a line, and quickly returns to the starting position to begin scanning the next line. While simple and easy to implement, this method has some limitations, especially when dealing with large areas or complex patterns, as the long jump distances between lines lead to low printing efficiency.
[0063] Bidirectional scanning is an improved path planning method that allows the laser beam to scan back and forth in both directions. The laser head can scan not only in one direction (e.g., from left to right) but also continue working during the return journey (from right to left), reducing downtime and thus improving processing efficiency. Because it reduces the number of line jumps and idle time, bidirectional scanning is generally faster than unidirectional scanning, especially when processing large areas or complex patterns. However, in bidirectional scanning, the laser needs to shut off and reposition itself between the end of each line and the beginning of a new line, and then restart to begin a new scan line. This can lead to edge neatness issues in printing.
[0064] The bow-shaped scanning algorithm (also known as snake scanning or zigzag scanning) is a further optimized laser etching path planning method. The laser controlled by the bow-shaped scanning algorithm is based on bidirectional scanning, which allows the laser beam to continue to output the beam when jumping between rows. Therefore, the scanning efficiency of the bow-shaped scanning algorithm is higher than that of bidirectional scanning. However, not turning off the laser beam output when switching etching directions between rows can lead to the problem of uneven etching edges.
[0065] Because the scanning algorithms used in laser printing, while ensuring efficiency, can lead to image quality issues, there is an urgent need to propose a printing method that can guarantee printing efficiency while simultaneously producing clear images.
[0066] Based on this, embodiments of this application provide a laser printing method, apparatus, and storage medium, which can achieve the technical effect of ensuring image printing quality while printing efficiently. The laser printing method provided in the embodiments of this application will be described first below.
[0067] Please refer to Figure 1, which is a schematic diagram of the steps of a laser printing method provided in an embodiment of this application. As shown in Figure 1, the laser printing method provided in this embodiment may include, but is not limited to, steps S110 to S150 when printing.
[0068] Step S110: Convert the image to grayscale to obtain a grayscale image.
[0069] Understandably, in this embodiment, converting the image to grayscale simplifies the image from containing multiple color channels, typically three channels: red (R), green (G), and blue (B), into an image represented by only a single brightness value. A grayscale image uses only one value to represent the brightness or intensity of each pixel, typically between 0 and 255 (for an 8-bit image), where 0 represents black, 255 represents white, and values in between represent different degrees of gray.
[0070] For example, in a feasible embodiment of this application, grayscale conversion of the image to be printed can be performed using the average method. This involves adding the values of the three color channels (RGB) of the image to be printed and then dividing by 3 to obtain the grayscale value. The formula for grayscale conversion using the average method is: Gray = (R + G + B) / 3, where Gray is the grayscale value of the image after conversion. The average method can directly and efficiently perform grayscale conversion on the image to be printed.
[0071] For example, in a feasible embodiment of this application, grayscale conversion of the image to be printed can be performed using a weighted average method, assigning different weights to each color channel. For example, based on the ITU-R BT.601 standard, the weighted average method is used to perform grayscale conversion of the image to be printed, with the formula: Gray = 0.3R + 0.59G + 0.11B. Using the weighted average method for grayscale conversion is suitable for image grayscale conversion processing in most cases.
[0072] In the embodiments of this application, other methods can be used to convert the image to grayscale, and are not limited to the grayscale conversion methods provided in the above embodiments of this application. No specific limitation is made here.
[0073] It should be noted that, in this embodiment, after converting the image to grayscale to obtain a grayscale image, preprocessing is required, including noise reduction and contrast enhancement. For example, in one embodiment, mean filtering is used to smooth the image and remove random noise by taking the average value of pixels in the neighborhood; median filtering is used to replace the original value with the median of the neighborhood for each pixel to remove salt-and-pepper noise; Gaussian filtering is used to effectively remove noise while preserving edge information by summing neighborhood pixels using Gaussian distribution weights; and histogram equalization is used to adjust the brightness distribution of the image to increase contrast and make the image clearer. Image preprocessing improves image quality, providing a better foundation for subsequent analysis and processing.
[0074] By executing step S110, a grayscale image corresponding to the image to be printed is obtained, thereby determining the initial laser energy value of the image pixels in subsequent steps.
[0075] Step S120: Determine the initial laser energy value of each pixel in the grayscale image.
[0076] It should be noted that, in this embodiment, the initial laser energy value for printing each pixel in the grayscale image is determined using a grayscale energy mapping table. Please refer to Figure 2, which is a schematic diagram of the specific steps of step S120 provided in this embodiment. As shown in Figure 2, in this embodiment, determining the initial laser energy value of each pixel in the grayscale image may include, but is not limited to, steps S210 to S220:
[0077] Step S210: Determine the grayscale energy mapping table according to the preset laser parameters.
[0078] In this embodiment, the preset laser parameters are the specific parameters of the printer when performing laser printing, such as laser power, scanning speed and pulse width. The specific parameter settings vary depending on the printing device. In this embodiment, the setting of the preset laser parameters is not specifically limited, and is determined according to the printing device used by the user in actual use.
[0079] By using preset laser parameters, the energy required for laser printing can be obtained for all grayscale values from 0 to 255. A grayscale energy mapping table is obtained accordingly, as shown in Figure 3. In the grayscale energy mapping table provided in this embodiment, the first row of values is the grayscale value from 0 to 255, and the second row of values P_0 to P_255 represents the initial laser energy corresponding to grayscale values from 0 to 200.
[0080] Once the grayscale energy mapping table is obtained, step S220 can be performed to determine the initial laser energy value required for laser printing of each pixel in the grayscale image.
[0081] Step S220: Determine the initial laser energy value of each pixel in the grayscale image based on the grayscale value of each pixel and the grayscale energy mapping table.
[0082] It is understood that, in the embodiments of this application, by comparing the grayscale information of each pixel in the grayscale image with the grayscale energy mapping table, the initial laser energy value required for laser printing of the grayscale information can be determined in the grayscale energy mapping table. Referring to the grayscale energy mapping table shown in Figure 3, in one embodiment of this application, assuming that the grayscale value of one pixel is 2, by referring to the grayscale energy mapping table, the initial laser energy value required for laser printing of this pixel can be determined to be P_2. Similarly, the initial laser energy values required for laser printing of all pixels in the grayscale image can be determined.
[0083] In this embodiment of the application, the initial laser energy required for laser printing of all pixels in the grayscale image is determined in step S120, so as to further determine the laser energy compensation value in the subsequent step S130.
[0084] Step S130: For each pixel in the grayscale image, determine the laser energy compensation value for each pixel in the grayscale image based on the initial laser energy value of each pixel in the adjacent region.
[0085] Please refer to Figure 4, which is a flowchart of the steps for determining a laser energy compensation value according to an embodiment of this application. As shown in Figure 4, in this embodiment of the application, the step of determining the laser energy compensation value for each pixel in the grayscale image based on the initial laser energy value of each pixel in the adjacent region may include, but is not limited to, steps S410 to S450.
[0086] Step S410: Traverse each pixel in the grayscale image and determine the first and second adjacent regions of the current pixel.
[0087] It should be noted that, in the embodiments of this application, the first adjacent region is the region consisting of the current pixel and its adjacent pixels; the pixels in each row of the grayscale image can be grouped into groups of n pixels to obtain multiple pixel regions. The second adjacent region is composed of pixel regions, including the first adjacent sub-region, the second adjacent sub-region, and the third adjacent sub-region. The current pixel is located in the second adjacent sub-region, and the first and third adjacent sub-regions are adjacent to the second adjacent sub-region, respectively. The second adjacent region is the region consisting of the pixel group where the current pixel is located, the pixel group before it, and the pixel group after it.
[0088] For example, in one embodiment of this application, the first adjacent region is composed of the current pixel, the two pixels before and the two pixels after the current pixel, the five pixels corresponding to the row before the current pixel, and the three pixels corresponding to the two rows before the current pixel. The first adjacent pixel is formed by the two pixels before and the two pixels after the current pixel, the five pixels corresponding to the row before the current pixel, and the three pixels corresponding to the two rows before the current pixel, as shown in Figure 5. In the figure, the shaded point is the current pixel, and the other pixels are the first adjacent pixels. If the current pixel is the first pixel in the first row of the grayscale image, then the first adjacent region is the region composed of the current pixel and the two pixels after it; if the current pixel is the first pixel in the second row of the grayscale image, then the first adjacent region is the region composed of the current pixel, the two pixels after it, and the three pixels corresponding to the row above it. Similarly, in the embodiments of this application, if the first adjacent region includes the current pixel, the two pixels before and the two pixels after the current pixel, the five pixels corresponding to the row before the current pixel, and the three pixels corresponding to the two rows before the current pixel, then the first adjacent region is composed of the included parts, which will not be elaborated further here.
[0089] In one embodiment of this application, the pixels in each row of the grayscale image are grouped into multiple pixel regions, with 100 pixels per group. The number of pixels in each group can be other than a fixed number, and is not limited here. The second adjacent region is the region formed by the pixel region where the current pixel is located, the pixel region preceding the current pixel region, and the pixel group following the current pixel region. The pixel region where the current pixel is located is the second adjacent sub-region, and the regions formed by the pixel region preceding the current pixel region and the pixel group following the current pixel region are the first adjacent sub-region and the third adjacent sub-region, respectively.
[0090] Once the first and second adjacent regions are determined, the laser energy compensation value for the current pixel can be determined.
[0091] Step S420: Obtain the initial laser energy value of each first adjacent pixel in the first adjacent region and the initial laser energy value of each second adjacent pixel in the second adjacent region.
[0092] It is understood that the initial laser energy value of the pixel in the embodiments of this application is determined by a grayscale energy mapping table. The specific determination method can be referred to the above description, and will not be repeated here.
[0093] Step S430: Determine the local laser energy compensation value of the current pixel based on the initial laser energy value of each first adjacent pixel in the first adjacent region;
[0094] In this embodiment of the application, the local laser energy compensation value of the current pixel is determined by the first compensation weight and the initial laser energy value of the pixels in the first adjacent region. The local laser energy compensation value can be determined by the following method:
[0095] The difference between the initial laser energy value of the current pixel and the initial laser energy value of each first adjacent pixel is multiplied by the first compensation weight corresponding to each first adjacent pixel to obtain multiple product terms;
[0096] The local laser energy compensation value of the current pixel is obtained by adding the multiple product terms together.
[0097] For example, please refer to Figures 6a and 6b, which are schematic diagrams of the first adjacent region provided in the embodiments of this application. As shown in Figure 6a, the shaded area represents the current pixel, and the initial laser energy value of the current pixel is X. The remaining pixels are the first adjacent pixels, and the initial laser energies of the first adjacent pixels are XB2L1, XB2, XB2R1, XB1L2, XB1L1, XB1, XB1R1, XB1R2, XL2, XL1, XR1, and XR2, respectively. The local laser energy compensation value of the current pixel is determined by the initial laser energy value of the first adjacent pixels. As shown in Figure 6b, the shaded area represents the current pixel, and the remaining pixels are the first adjacent pixels. The first compensation weights of the current pixel are Kxb2l1, Kxb2, Kxb2r1, Kxb1l2, Kxb1l1, Kxb1, Kxb1r1, Kxb1r2, Kxl2, Kxl1, Kxr2, and Kxr1, respectively. Figure 6a corresponds to Figure 6b, where the initial laser energy at each pixel location corresponds to the first compensation weight.
[0098] The difference between the initial laser energy value of the current pixel and the initial laser energy value of each first adjacent pixel is multiplied by the first compensation weight corresponding to each first adjacent pixel to obtain multiple product terms: (X-XL1)*Kxl1, (X-XL2)*Kxl2, (X-XR1)*Kxr1, (X-XR2)*Kxr2, (X-XB1)*Kxb1, (X-XB1L1)*Kxb1l1, (X-XB1L2)*Kxb1l2, (X-XB1R1)*Kxb1r1, (X-XB1R2)*Kxb1r2, (X-XB2)*Kxb2, (X-XB2L1)*Kxb2l1, (X-XB2R1)*Kxb2r1;
[0099] After obtaining multiple product terms, these terms are added together to obtain the local laser energy compensation value for the current pixel, as shown in the following formula:
[0100] Y1=(X-XL1)*Kxl1+(X-XL2)*Kxl2+(X-XR1)*Kxr1+(X-XR2)*Kxr2+(X-XB1)*Kxb1+ (X-XB1L1)*Kxb1l1+(X-XB1L2)*Kxb1l2+(X-XB1R1)*Kxb1r1+(X-XB1R2)*Kxb1r2+
[0101] (X-XB2)*Kxb2+(X-XB2L1)*Kxb2l1+(X-XB2R1)*Kxb2r1……(1)
[0102] Y1 is the local laser energy compensation value of the current pixel.
[0103] In step S430 of this embodiment, a local laser energy compensation value can be obtained for laser energy compensation, which is used to compensate the initial laser energy of the current pixel.
[0104] Step S440: Determine the global laser energy compensation value of the current pixel based on the initial laser energy value of each second adjacent pixel in the second adjacent region.
[0105] It should be noted that, in this embodiment of the application, the second adjacent region includes a first adjacent sub-region, a second adjacent sub-region, and a third adjacent sub-region. The current pixel is located in the second adjacent sub-region, and the first adjacent sub-region and the third adjacent sub-region are adjacent to the second adjacent sub-region, respectively.
[0106] Referring to Figure 7, in this embodiment of the application, the global laser energy compensation value of the current pixel can be determined by steps S710 to S740 based on the initial laser energy value of each second adjacent pixel in the second adjacent region.
[0107] Step S710: Obtain the first sum of the initial laser energy values of all second adjacent pixels in the first adjacent sub-region;
[0108] Step S720: Obtain the initial laser energy value of all second adjacent pixels in the second adjacent sub-region, and the second sum of the initial laser energy value of the current pixel;
[0109] Step S730: Obtain the third sum of the initial laser energy values of all second adjacent pixels in the third adjacent sub-region;
[0110] It is understood that, in the embodiments of this application, the first sum of the initial laser energy values of all second adjacent pixels in the first adjacent sub-region is the sum of the initial laser energy values of all pixels in the first adjacent sub-region; the second sum of the initial laser energy values of all second adjacent pixels in the second adjacent sub-region and the initial laser energy value of the current pixel is the sum of the initial laser energy values of all pixels in the second adjacent sub-region; and the third sum of the initial laser energy values of all second adjacent pixels in the third adjacent sub-region is the sum of the initial laser energy values of all pixels in the third adjacent sub-region.
[0111] Step S740: Add the product of the second sum and the second compensation weight corresponding to the second adjacent sub-region, the product of the difference between the second sum and the first sum and the second compensation weight corresponding to the first adjacent sub-region, and the product of the difference between the second sum and the third sum and the second compensation weight corresponding to the third adjacent sub-region to obtain the global laser energy compensation value of the current pixel.
[0112] In one embodiment of this application, the first sum is LX1, the second sum is LX2, and the third sum is LX3. Assuming a pixel region consists of 100 pixels, and the current pixel is the 150th pixel, the first adjacent sub-region comprises pixels 1 to 100, the second adjacent sub-region comprises pixels 101 to 200, and the third adjacent sub-region comprises pixels 201 to 300. The second compensation weight corresponding to the second adjacent sub-region is Kl1, and the second compensation weight corresponding to the first and third adjacent sub-regions is the same, Kl2. The product of the second sum and the second compensation weight corresponding to the second adjacent sub-region, the product of the difference between the second sum and the first sum and the second compensation weight corresponding to the first adjacent sub-region, and the product of the difference between the second sum and the third sum and the second compensation weight corresponding to the third adjacent sub-region are added together to obtain the global laser energy compensation value for the current pixel. The formula is as follows:
[0113] Y2=LX2*Kl1+(2LX2-LX1-LX3)*Kl2……(2);
[0114] Y2 is the global laser energy compensation value.
[0115] It should be noted that in the embodiments of this application, the second compensation weight corresponding to the first adjacent sub-region and the second compensation weight corresponding to the third adjacent sub-region can be the same, or different second compensation weights can be used. The specific compensation weight setting is set according to the actual situation. When the second compensation weight corresponding to the first adjacent sub-region and the second compensation weight corresponding to the third adjacent sub-region are different, let the second compensation weight corresponding to the first adjacent sub-region be Kl2 and the second compensation weight corresponding to the third adjacent sub-region be Kl3, then Y2=LX2*Kl1+(LX2-LX1)*Kl2+(LX2-LX3)*Kl3.
[0116] It is understood that in the embodiments of this application, when there is no pixel region in front of the second adjacent sub-region or no pixel region behind it, the first sum or the third sum is 0.
[0117] In step S440 of this embodiment, a global laser energy compensation value can be obtained for laser energy compensation, which is used to compensate the initial laser energy of the current pixel.
[0118] It should be noted that, in this embodiment, after obtaining the global laser energy compensation value of the current pixel, it is also necessary to update the first sum, the second sum, and the third sum to determine the global laser energy compensation value for the next row of pixels. In this embodiment, except for the first row in the grayscale image, the first sum, the second sum, and the third sum of the other rows are determined by the updated first sum, the second sum, and the third sum of the corresponding area of the previous row. The determination method is as follows:
[0119] Update the first sum by multiplying the first sum by the attenuation coefficient;
[0120] Update the second sum by multiplying the second sum by the attenuation coefficient;
[0121] The third sum is updated by multiplying the third sum by the attenuation coefficient.
[0122] For example, in one embodiment of this application, the first sum before the update is determined to be LX1(L1), the second sum before the update is LX2(L1), the third sum before the update is LX3(L1), the first sum after the update is LX1(L2), the second sum after the update is LX2(L2), the third sum after the update is LX3(L2), the attenuation coefficient is kl3, and the update formula is as follows:
[0123] LX1(L2)=kl3*LX1(L1)……(3);
[0124] LX2(L2)=kl3*LX2(L1)……(4);
[0125] LX3(L2)=kl3*LX3(L1)……(5);
[0126] By updating the first, second, and third sums, the global laser energy compensation value for the current pixel in the next row is determined to ensure the uniformity of the compensated laser printing energy and avoid the phenomenon of printing too dark or too light after compensation.
[0127] Step S450: Determine the laser energy compensation value of the current pixel based on the local laser energy compensation value and the global laser energy compensation value of the current pixel.
[0128] Through steps S410 to S450, this embodiment of the application can determine a laser energy compensation value to compensate for the initial laser energy value of the current pixel, and compensate the initial laser energy using the laser energy compensation value, and then execute step S140.
[0129] Step S140: Determine the target laser energy value of each pixel in the grayscale image based on the laser energy compensation value and the initial laser energy value of each pixel in the grayscale image.
[0130] In this embodiment, the initial laser energy value is compensated by a laser energy compensation value to obtain a target laser energy value that meets the requirements. The compensation formula is as follows:
[0131] Y = X + Y1 + Y2……(6);
[0132] Y represents the target laser energy value. The laser energy compensation value, determined by the local and global laser energy compensation values, can compensate for the initial laser energy value used in laser printing. The obtained target laser energy value is used to control the laser printing process and ensure the quality of the printed image.
[0133] Step S150: Print the image to be printed according to the target laser energy value.
[0134] In this embodiment, once the target laser energy is determined, it is combined with parameters such as the image motion contour curve, motion frequency, energy power, and laser beam timing in the image to be printed to form a data packet, which is then sent to the printing device. The printing device prints according to the target laser energy of each pixel, thereby simulating the image texture of an art sketch during printing, ensuring both efficient printing and high-quality printed images.
[0135] It should be noted that, in this embodiment of the application, printing the image to be printed according to the target laser energy value includes:
[0136] Identify the bent areas in the image to be printed;
[0137] The frequency conversion information is determined based on the bending area and the target laser energy value;
[0138] Based on the frequency conversion information, print the curved areas of the image to be printed.
[0139] In this embodiment, during laser printing, it is necessary to calculate and adjust the frequency settings of the laser etching optical lens and the laser beam energy output according to the contour curve. Referring to Figure 8, which shows the printing path of laser printing in this embodiment, when the laser etches line AC (solid line), the laser beam and the optical reflector motor are in a high-speed motion state at frequency F1. If the line of the image to be printed has a bend area BC (solid line), if the optical lens motor maintains the original frequency and changes direction at high speed, the lens will cause insufficient turning due to inertia, resulting in asynchronous movement of the laser beam and the lens, which will lead to excessive etching in the bend area. At this time, the laser control module is required to calculate and reduce the driving frequency of the motor to the setting of F2 before the bend area BC, so that the optical lens motor and the laser beam can reach a stable state of synchronous change of direction.
[0140] In one embodiment of this application, by determining the bending area of the image to be printed, frequency conversion information that needs to be converted is determined based on the target laser energy value. The frequency conversion information includes a first frequency conversion point for frequency reduction and a second frequency conversion point for frequency increase. The first frequency conversion point is located at the position where the laser printing is about to enter the bending area, and the second frequency conversion point is located at the position where the laser printing has completed the printing of the bending area. When laser printing is performed, when the optical lens motor reaches the first frequency conversion point, it automatically reduces the frequency to a stable state. After the optical lens motor completes the printing of the bending area, it passes the second frequency conversion point and then increases the frequency back to the original frequency to achieve stable laser printing.
[0141] The embodiments of this application include at least the following beneficial effects:
[0142] In this embodiment, the image to be printed is converted to grayscale to obtain a grayscale image; the initial laser energy value of each pixel in the grayscale image is determined; for each pixel in the grayscale image, a laser energy compensation value is determined based on the initial laser energy values of each pixel in the adjacent regions; the target laser energy value of each pixel in the grayscale image is determined based on the laser energy compensation value and the initial laser energy value; and the image to be printed is printed according to the target laser energy value. By compensating the initial laser energy value of each pixel after grayscale conversion of the image to be printed with the laser energy compensation value, the target laser energy value for printing is determined and printing is performed. This method can simulate the image texture of an artistic sketch during printing, achieving efficient printing while ensuring image quality.
[0143] Referring to Figure 9, this application embodiment also discloses a laser printer, the laser printer 900 comprising:
[0144] At least one processor 901;
[0145] At least one memory 902 is used to store at least one program;
[0146] When at least one program is executed by at least one processor 901, the laser printing method as described in any embodiment of this application is implemented.
[0147] This application also discloses a computer-readable storage medium storing a processor-executable computer program, which, when executed by a processor, is used to implement the laser printing method described above.
[0148] This application also discloses a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. The processor of the laser printer reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the laser printer to perform the laser printing method as described above.
[0149] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.
[0150] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0151] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.
[0152] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0153] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0154] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0155] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0156] The step numbers in the above method embodiments are set only for ease of explanation and do not impose any restrictions on the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
Claims
1. A laser printing method, characterized in that, The method includes: converting the image to be printed to grayscale to obtain a grayscale image; determining a grayscale energy mapping table according to preset laser parameters; determining an initial laser energy value for each pixel in the grayscale image based on the grayscale value of each pixel in the grayscale image and the grayscale energy mapping table; for each pixel in the grayscale image, obtaining the initial laser energy values of pixels in a first adjacent region and obtaining the initial laser energy values of pixels in a second adjacent region; determining a local laser energy compensation value for the current pixel based on the initial laser energy values of pixels in the first adjacent region and determining a global laser energy compensation value for the current pixel based on the initial laser energy values of pixels in the second adjacent region; determining the laser energy compensation value for the current pixel based on the local laser energy compensation value and the global laser energy compensation value; determining a target laser energy value for each pixel in the grayscale image based on the laser energy compensation value and the initial laser energy value; and printing the image to be printed based on the target laser energy value.
2. The method according to claim 1, characterized in that, Determining the local laser energy compensation value of the current pixel based on the initial laser energy value of the pixels in the first adjacent region includes: multiplying the difference between the initial laser energy value of the current pixel and the initial laser energy value of each first adjacent pixel in the first adjacent region by a first compensation weight corresponding to each first adjacent pixel to obtain multiple product terms; and adding the multiple product terms to obtain the local laser energy compensation value of the current pixel.
3. The method according to claim 1, characterized in that, The second adjacent region includes a first adjacent sub-region, a second adjacent sub-region, and a third adjacent sub-region. The current pixel is located in the second adjacent sub-region, and the first adjacent sub-region and the third adjacent sub-region are adjacent to the second adjacent sub-region, respectively. The step of determining the global laser energy compensation value of the current pixel based on the initial laser energy value of the pixels in the second adjacent region includes: obtaining a first sum of the initial laser energy values of all second adjacent pixels in the first adjacent sub-region; obtaining a second sum of the initial laser energy values of all second adjacent pixels in the second adjacent sub-region and the initial laser energy value of the current pixel; obtaining a third sum of the initial laser energy values of all second adjacent pixels in the third adjacent sub-region; and adding the product of the second sum and the second compensation weight corresponding to the second adjacent sub-region, the product of the difference between the second sum and the first sum and the second compensation weight corresponding to the first adjacent sub-region, and the product of the difference between the second sum and the third sum and the second compensation weight corresponding to the third adjacent sub-region to obtain the global laser energy compensation value of the current pixel.
4. The method according to claim 3, characterized in that, After obtaining the global laser energy compensation value of the current pixel, the method further includes: updating the first sum by multiplying the first sum by the attenuation coefficient; updating the second sum by multiplying the second sum by the attenuation coefficient; and updating the third sum by multiplying the third sum by the attenuation coefficient.
5. The method according to claim 1, characterized in that, The step of printing the image to be printed based on the target laser energy value includes: determining a bending region in the image to be printed; determining frequency conversion information based on the bending region and the target laser energy value; and printing the bending region of the image to be printed based on the frequency conversion information.
6. A laser printer, characterized in that, include: At least one processor; At least one memory for storing at least one program; when at least one of the programs is executed by at least one of the processors, the laser printing method as described in any one of claims 1 to 5 is implemented.
7. A computer-readable storage medium, characterized in that, It contains a processor-executable computer program, which, when executed by a processor, is used to implement the laser printing method as described in any one of claims 1 to 5.
8. A computer program product, comprising a computer program or computer instructions, characterized in that, The computer program or the computer instructions are stored in a computer-readable storage medium. The processor of the laser printer reads the computer program or the computer instructions from the computer-readable storage medium and executes the computer program or the computer instructions, causing the laser printer to perform the laser printing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Laser finishing of apparel
CN109641317A
Light equalizing method and device for LCD photocuring 3D printer
CN111941846A