Laser printing method, laser printer and storage medium
By performing grayscale conversion and laser energy compensation processing on laser printed images, the problem of difficult to balance laser printing efficiency and image quality in the prior art is solved, and efficient and clear image printing effect is achieved.
Patent Information
- Application Number
- CN202411853385.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-16
AI Technical Summary
While ensuring efficiency, existing laser printing technology is difficult to print out clear images, especially when jumping between lines and switching directions, which can easily lead to problems such as neat edges and heavy etching.
By performing grayscale conversion on the image to be printed, the initial laser energy value of each pixel point is determined, and the laser energy compensation value is calculated based on the initial laser energy value of the adjacent area, and the target laser energy value is finally determined for printing.
It achieves efficient printing while ensuring image quality, and can simulate the image texture of art sketches, improving the overall printing effect.
Smart Images

Figure CN119937946A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of printing technology, and in particular to a laser printing method, device and storage medium. Background Art
[0002] The basic principle of laser printing is to focus the laser beam through an optical element to form a light spot with a very small diameter. The focused and guided laser beam accurately scans the processing material along the specified route and undergoes a physical or chemical reaction to form a permanent pattern mark. At present, the common laser printing scanning imaging algorithms include unidirectional scanning algorithm, bidirectional scanning algorithm and bow scanning algorithm. When using the unidirectional scanning algorithm, the laser beam scans and prints line by line along a fixed single direction. However, when jumping between lines during operation, the laser turns off the beam output, and the jump distance between lines is too long, resulting in low efficiency of the unidirectional scanning algorithm; when using the bidirectional scanning algorithm, the laser beam scans back and forth in both the forward and reverse directions, which is more efficient than the unidirectional scanning algorithm, but there is an alternation of the beam switching at the point where the printing direction is switched between lines, resulting in problems with the neatness of the edges; when using the bow scanning algorithm, the laser prints the job based on the premise of bidirectional scanning, but when jumping between lines, the laser will not turn off the beam output, which greatly improves the printing efficiency, but it will cause the problem of heavy printing edges. At present, it is urgent to propose a printing method that can ensure printing efficiency and print clear images at the same time. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The embodiments of the present application provide a laser printing method, device and storage medium, which can achieve efficient and clear image laser printing.
[0005] In a first aspect, an embodiment of the present application provides a laser printing method, the method comprising:
[0006] Perform grayscale conversion on the image to be printed to obtain a grayscale image;
[0007] Determining an initial laser energy value for each pixel in the grayscale image;
[0008] For each pixel in the grayscale image, determining a laser energy compensation value for each pixel in the grayscale image according to the initial laser energy value for each pixel in an adjacent area;
[0009] Determining a target laser energy value for each pixel in the grayscale image according to the laser energy compensation value for each pixel in the grayscale image and the initial laser energy value;
[0010] The image to be printed is printed according to the target laser energy value.
[0011] According to the laser printing method provided by some embodiments of the present application, the determining the initial laser energy value of each pixel in the grayscale image includes:
[0012] Determine a grayscale energy mapping table according to preset laser parameters;
[0013] An initial laser energy value of each pixel in the grayscale image is determined according to the grayscale value of each pixel in the grayscale image and the grayscale energy mapping table.
[0014] According to the laser printing method provided by some embodiments of the present application, for each pixel in the grayscale image, determining the laser energy compensation value of each pixel in the grayscale image according to the initial laser energy value of each pixel in an adjacent area includes:
[0015] Traversing each pixel in the grayscale image to determine a first adjacent region and a second adjacent region of the current pixel;
[0016] Acquire the initial laser energy value of each first adjacent pixel point in the first adjacent area, and the initial laser energy value of each second adjacent pixel point in the second adjacent area;
[0017] Determine a local laser energy compensation value of the current pixel point according to the initial laser energy value of each first adjacent pixel point in the first adjacent area;
[0018] Determine a global laser energy compensation value of the current pixel point according to the initial laser energy value of each second adjacent pixel point in the second adjacent area;
[0019] The laser energy compensation value of the current pixel point is determined according to the local laser energy compensation value and the global laser energy compensation value of the current pixel point.
[0020] According to the laser printing method provided by some embodiments of the present application, determining the local laser energy compensation value of the current pixel point according to the initial laser energy value of each first adjacent pixel point in the first adjacent area includes:
[0021] Multiplying a 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 a first compensation weight corresponding to each of the first adjacent pixels to obtain a plurality of product terms;
[0022] The multiple product terms are added together to obtain the local laser energy compensation value of the current pixel point.
[0023] According to the laser printing method provided by some embodiments of the present application, the second adjacent area includes a first adjacent sub-area, a second adjacent sub-area and a third adjacent sub-area, the current pixel is in the second adjacent sub-area, and the first adjacent sub-area and the third adjacent sub-area are respectively adjacent to the second adjacent sub-area;
[0024] The step of determining the global laser energy compensation value of the current pixel point according to the initial laser energy value of each second adjacent pixel point in the second adjacent area includes:
[0025] Acquire a first sum of the initial laser energy values of all the second adjacent pixel points in the first adjacent sub-region;
[0026] Acquire the second sum of the initial laser energy values of all the second adjacent pixel points in the second adjacent sub-region and the initial laser energy value of the current pixel point;
[0027] Acquire a third sum of the initial laser energy values of all the second adjacent pixel points in the third adjacent sub-region;
[0028] 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 to obtain the global laser energy compensation value of the current pixel point.
[0029] According to the laser printing method provided by some embodiments of the present application, after obtaining the global laser energy compensation value of the current pixel point, the method further includes:
[0030] Update the first sum by multiplying the first sum by the attenuation coefficient;
[0031] Update the second sum 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 the laser printing method provided by some embodiments of the present application, printing the image to be printed according to the target laser energy value includes:
[0034] Determining a bending area in the image to be printed;
[0035] Determining frequency conversion information according to the bending area and the target laser energy value;
[0036] The bending area of the image to be printed is printed according to the frequency conversion information.
[0037] In a second aspect, an embodiment of the present application provides a laser printer, comprising:
[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 embodiment of the present application is implemented.
[0041] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program executable by a processor. When the processor-executable computer program is executed by the processor, it is used to implement the laser printing method as described in the first aspect of the embodiment of the present application.
[0042] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising a computer program or computer instructions, wherein the computer program or the computer instructions are stored in a computer-readable storage medium, a processor of a laser printer reads the computer program or the computer instructions from the computer-readable storage medium, and the processor executes the computer program or the computer instructions, so that the laser printer performs the laser printing method as described in the first aspect of the embodiment of the present application.
[0043] The embodiments of the present application include at least the following beneficial effects:
[0044] In the embodiment of the present application, the image to be printed is gray-scale converted to obtain a gray-scale image; the initial laser energy value of each pixel in the gray-scale image is determined; for each pixel in the gray-scale image, the laser energy compensation value of each pixel in the gray-scale image is determined according to the initial laser energy value of each pixel in the adjacent area; the target laser energy value of each pixel in the gray-scale image is determined according to the laser energy compensation value and the initial laser energy value of each pixel in the gray-scale image; and the image to be printed is printed according to the target laser energy value. The initial laser energy value of each pixel after the gray-scale conversion of the image to be printed is compensated by the laser energy compensation value, the target laser energy value for printing is determined, and printing is performed, so that the image texture of art sketches can be simulated during printing, and efficient printing can be achieved while ensuring the quality of the printed image.
[0045] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0047] Figure 1 A schematic diagram of the steps of a laser printing method provided in an embodiment of the present application;
[0048] Figure 2 For the embodiment of this application Figure 1 Specific step diagram of step S120;
[0049] Figure 3 A schematic diagram of a grayscale energy mapping table provided in an embodiment of the present application;
[0050] Figure 4 A flow chart of the steps of laser energy compensation value provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a first adjacent area provided in an embodiment of the present application;
[0052] Figure 6a A schematic diagram of another first adjacent area provided in an embodiment of the present application;
[0053] Figure 6b A schematic diagram of another first adjacent area provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of the steps for determining the global laser energy compensation value of the current pixel point provided in an embodiment of the present application.
[0055] Figure 8 A schematic diagram of a bending area provided in an embodiment of the present application;
[0056] Fig. 9 A schematic diagram of a laser printer provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0058] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be 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 those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0060] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0061] Laser printing is a non-contact printing technology that is increasingly used in the material processing of card production. It uses a laser beam to print images or texts on paper or other media. The laser beam is focused by an optical element to form a light spot with a very small diameter. The focused and guided laser beam accurately scans the processing material along the specified route and undergoes a physical or chemical reaction. The high-energy-density laser beam directly acts on the material surface, causing physical or chemical changes on the material surface through thermal effects, thereby forming a permanent mark or pattern. When etching in laser printing, common scanning imaging algorithms include unidirectional scanning algorithm, dual-phase scanning algorithm, and arc scanning algorithm.
[0062] The unidirectional scanning algorithm is a path planning method that specifies how the laser beam moves when printing on the surface of the material. In this method, the laser beam scans line by line along a fixed single direction (for example, from left to right), turns off the beam after completing a line, and quickly returns to the starting position to scan the next line. Although this method is simple and easy to implement, it has some limitations, especially when dealing with large areas or complex patterns, the printing efficiency is low due to the long jump distance between lines.
[0063] The bidirectional scanning algorithm is an improved path planning method that allows the laser beam to scan back and forth in both the forward and reverse directions. The laser head can not only scan in one direction (for example, from left to right), but also continue to work during the return process (from right to left), reducing non-working time and thus improving processing efficiency. Due to the reduction in the number of jumps between lines and the idle time, bidirectional scanning is usually faster than unidirectional scanning, especially for processing large areas or complex patterns. In the bidirectional scanning algorithm, between the end of each line and the beginning of a new line, the laser needs to turn off the beam and reposition it, and then turn it on again to start a new scan line, which leads to edge neatness problems in printing.
[0064] The bow scanning algorithm (also called snake scanning or Zigzag scanning) is a further optimized laser etching path planning method. The laser controlled by the bow scanning algorithm is based on bidirectional scanning, which allows the laser beam to not turn off the beam output when jumping between lines. Therefore, the scanning efficiency of the bow scanning algorithm is higher than that of bidirectional scanning. However, if the laser beam output is not turned off when switching the etching direction between lines, it will cause the problem of heavy etching edges.
[0065] Since the scanning algorithm used in the related technology during laser printing can lead to image quality problems while ensuring efficiency, there is an urgent need to propose a printing method that can ensure printing efficiency and print clear images at the same time.
[0066] On this basis, the embodiments of the present application provide a laser printing method, device and storage medium, which can achieve the technical effect of ensuring image printing quality while achieving efficient printing. The laser printing method provided by the embodiments of the present application is first introduced below.
[0067] Please refer to Figure 1 , is a schematic diagram of the steps of a laser printing method provided in an embodiment of the present application, such as Figure 1 As shown, the laser printing method provided in the embodiment of the present application may include but is not limited to steps S110 to S150 when printing.
[0068] Step S110: performing grayscale conversion on the image to be printed to obtain a grayscale image.
[0069] It can be understood that, in the present embodiment, grayscale conversion of the image to be printed is to simplify the image to be printed from information containing multiple color channels, usually red (R), green (G), and blue (B) channels, to an image represented by only one brightness value. A grayscale image is an image in which each pixel uses only one value to represent its brightness or intensity, and this value is usually between 0 and 255 (for 8-bit images), where 0 represents black, 255 represents white, and the values in between represent different degrees of gray.
[0070] For example, in a feasible embodiment of the present application, the grayscale conversion of the image to be printed can be performed using the average method, by 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, Gray is the grayscale value of the converted image, and the average method can directly and efficiently perform grayscale conversion on the image to be printed.
[0071] Exemplarily, in a feasible embodiment of the present application, the grayscale conversion of the image to be printed can be performed using a weighted average method, and different weights are assigned to each color channel. Exemplarily, based on the ITU-R BT.601 standard, the grayscale conversion of the image to be printed is performed using a weighted average method, and the formula is: Gray = 0.3R + 0.59G + 0.11B. The grayscale conversion using the weighted average method is suitable for image grayscale conversion processing in most cases.
[0072] In the embodiments of the present application, other methods may be used to perform grayscale conversion on the image to be printed, which is not limited to the grayscale conversion method provided in the above embodiments of the present application and is not specifically limited here.
[0073] It should be noted that in the embodiment of the present application, after the grayscale conversion of the image to be printed is performed to obtain a grayscale image, it is also necessary to perform preprocessing operations on the obtained grayscale image, including performing preprocessing operations such as denoising and contrast enhancement. Exemplarily, in one embodiment of the present application, a mean filter is used to smooth the image by taking the average value of pixels in the neighborhood to remove random noise; a median filter is used to use the median value in the neighborhood instead of the original value for each pixel position to remove salt and pepper noise; a Gaussian filter is used to sum the neighborhood pixels using Gaussian distribution weights to effectively remove noise while maintaining edge information; and a histogram equalization is used to adjust the brightness distribution of the image to increase contrast and make the image clearer. Image quality is improved through image preprocessing, which provides 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, so that the initial laser energy value of the image pixel is determined in the subsequent step.
[0075] Step S120: determining the initial laser energy value of each pixel in the grayscale image.
[0076] It should be noted that, in the embodiment of the present application, the initial laser energy value for printing each pixel in the grayscale image is determined by using a grayscale energy mapping table. Figure 2 , is a schematic diagram of specific steps of step S120 provided in an embodiment of the present application, such as Figure 2 As shown, in the embodiment of the present application, 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 a grayscale energy mapping table according to preset laser parameters.
[0078] In the embodiment of the present application, the preset laser parameters are specific parameters of a printer performing laser printing, such as laser power, scanning speed, and pulse width, etc. The specific parameter settings are set differently according to different printing devices. In the embodiment of the present application, there is no specific limitation on the setting of the preset laser parameters, and they are determined according to the printing device used by the user in actual use.
[0079] Through the preset laser parameters, the energy required for laser printing corresponding to all grayscale values from 0 to 255 can be obtained, and a grayscale energy mapping table can be obtained through the correspondence, such as Figure 3 As shown, in the grayscale energy mapping table provided in the embodiment of the present application, the first row of values are grayscale values from 0 to 255, and the second row of values P_0 to P_255 represent the initial laser energy corresponding to the grayscale values 0-200.
[0080] After the grayscale energy mapping table is obtained, step S220 may be performed to determine the initial laser energy value required for laser printing of each pixel point in the grayscale image.
[0081] Step S220 , determining an initial laser energy value for each pixel in the grayscale image according to the grayscale value of each pixel in the grayscale image and the grayscale energy mapping table.
[0082] It can be understood that in the embodiment of the present 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. Figure 3 In the grayscale energy mapping table shown in one embodiment of the present application, assuming that the grayscale value of one pixel is 2, by comparing the grayscale energy mapping table, the initial laser energy value P_2 required for laser printing of this pixel can be determined. Similarly, the initial laser energy values required for all pixels in the grayscale image for laser printing can be determined.
[0083] In the embodiment of the present 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 of each pixel in the grayscale image according to the initial laser energy value of each pixel in the adjacent area.
[0085] Please refer to Figure 4 , is a flow chart of the steps of a laser energy compensation value provided in an embodiment of the present application, such as Figure 4As shown, in the embodiment of the present application, for each pixel in the grayscale image, the step of determining the laser energy compensation value according to the initial laser energy value of each pixel in the adjacent area may include but is not limited to steps S410 to S450.
[0086] Step S410: traverse each pixel in the grayscale image to determine the first adjacent area and the second adjacent area of the current pixel.
[0087] It should be noted that, in the embodiment of the present application, the first adjacent area is an area consisting of the current pixel point traversed and its adjacent pixel points; the pixel points of each row in the grayscale image can be grouped into a group of n pixels to obtain multiple pixel areas, and the second adjacent area is composed of pixel areas, including the first adjacent sub-area, the second adjacent sub-area and the third adjacent sub-area. The current pixel point is in the second adjacent sub-area, and the first adjacent sub-area and the third adjacent sub-area are adjacent to the second adjacent sub-area respectively; the second adjacent area is an area consisting of the pixel group where the current pixel point is located and the pixel group before and after the pixel group where the current pixel point is located.
[0088] Exemplarily, in one embodiment of the present application, the first adjacent area is composed of the current pixel, the two pixels before and after the current pixel, the five pixels corresponding to the previous row of the current pixel, and the three pixels corresponding to the previous two rows of the current pixel. The two pixels before and after the current pixel, the five pixels corresponding to the previous row of the current pixel, and the three pixels corresponding to the previous two rows of the current pixel are the first adjacent pixel. Figure 5 As shown, the shaded point in the figure 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, the first adjacent area is the area composed of the current pixel and the two pixels behind it; if the current pixel is the first pixel in the second row of the grayscale image, the first adjacent area is the area composed of the current pixel and the two pixels behind it and the three pixels corresponding to the previous row. Similarly, in an embodiment of the present application, if the pixels adjacent to the position of the current pixel include the first adjacent area as the current pixel, the two pixels before the current pixel and the two pixels after the current pixel, the five pixels corresponding to the previous row of the current pixel, and the three pixels corresponding to the two previous rows of the current pixel, then the included part constitutes the first adjacent area, which will not be elaborated here.
[0089] In one embodiment of the present application, the pixels of each row in the grayscale image are grouped into 100 pixels, and the pixels are divided into multiple pixel regions. The number of pixels to be grouped can be other numbers, which are not specifically limited here. The second adjacent region is the pixel region where the current pixel is located and the region composed of the previous pixel region and the next pixel group of the pixel region where the current pixel is located, wherein the pixel region where the current pixel is located is the second adjacent sub-region, and the regions composed of the previous pixel region and the next pixel group of the pixel region where the current pixel is located are the first adjacent sub-region and the third adjacent sub-region, respectively.
[0090] After the first adjacent area and the second adjacent area are determined, the laser energy compensation value for the current pixel point can be determined.
[0091] Step S420: acquiring an initial laser energy value of each first adjacent pixel point in the first adjacent region and an initial laser energy value of each second adjacent pixel point in the second adjacent region.
[0092] It can be understood that the initial laser energy value of the pixel point in the embodiment of the present 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, determining a local laser energy compensation value of a current pixel point according to the initial laser energy value of each first adjacent pixel point in the first adjacent area;
[0094] In the embodiment of the present 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 pixel in the first adjacent area. The local laser energy compensation value can be determined by the following method:
[0095] Multiplying the difference between the initial laser energy value of the current pixel and the initial laser energy value of each first adjacent pixel by the first compensation weight corresponding to each first adjacent pixel to obtain a plurality of product terms;
[0096] Multiple product terms are added together to obtain the local laser energy compensation value of the current pixel.
[0097] For example, please refer to Figure 6a and Figure 6b , is a schematic diagram of a first adjacent area provided in an embodiment of the present application, such as Figure 6aAs shown, the shadow is the current pixel, 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. The local laser energy compensation value of the current pixel is determined by the initial laser energy value of the first adjacent pixel. Figure 6b As shown, the shadow is the current pixel, and the other 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 and Figure 6b Correspondingly, the initial laser energy at each pixel position corresponds to the first compensation weight.
[0098] Multiply the difference between the initial laser energy value of the current pixel and the initial laser energy value of each first adjacent pixel 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, add the multiple product terms to obtain the local laser energy compensation value of the current pixel point. The formula is as follows:
[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] Where Y1 is the local laser energy compensation value of the current pixel.
[0103] In step S430 of the embodiment of the present application, a local laser energy compensation value for laser energy compensation can be obtained, which is used to compensate the initial laser energy of the current pixel point.
[0104] Step S440: Determine a global laser energy compensation value of the current pixel point according to the initial laser energy value of each second adjacent pixel point in the second adjacent area.
[0105] It should be noted that in the embodiment of the present application, the second adjacent area includes a first adjacent sub-area, a second adjacent sub-area and a third adjacent sub-area, the current pixel is in the second adjacent sub-area, and the first adjacent sub-area and the third adjacent sub-area are respectively adjacent to the second adjacent sub-area.
[0106] Reference Figure 7 In an embodiment of the present application, determining the global laser energy compensation value of the current pixel point can be completed through steps S710 to S740 based on the initial laser energy value of each second adjacent pixel point in the second adjacent area.
[0107] Step S710, obtaining a first sum of initial laser energy values of all second adjacent pixel points in the first adjacent sub-region;
[0108] Step S720, obtaining the initial laser energy values of all second adjacent pixel points in the second adjacent sub-region and the second sum of the initial laser energy value of the current pixel point;
[0109] Step S730, obtaining a third sum of initial laser energy values of all second adjacent pixel points in the third adjacent sub-region;
[0110] It can be understood that in the embodiment of the present application, the first sum of the initial laser energy values of all second adjacent pixel points in the first adjacent sub-region is the sum of the initial laser energy values of all pixel points in the first adjacent sub-region; the first sum of the initial laser energy values of all second adjacent pixel points in the second adjacent sub-region and the second sum of the initial laser energy value of the current pixel point is the sum of the initial laser energy values of all pixel points in the second adjacent sub-region; the third sum of the initial laser energy values of all second adjacent pixel points in the third adjacent sub-region is the sum of the initial laser energy values of all pixel points 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 the present application, the first sum is LX1, the second sum is LX2, and the third sum is LX3. Assume that 100 pixels are used as a pixel area, the current pixel is the 150th pixel, the first adjacent sub-area is the 1st to 100th pixel, the second adjacent sub-area is the 101st to 200th pixel, and the third adjacent sub-area is the 201st to 300th pixel; at this time, the second compensation weight corresponding to the second adjacent sub-area is Kl1, and the second compensation weight corresponding to the first adjacent sub-area is the same as the second compensation weight corresponding to the third adjacent sub-area, which is Kl2. The product of the second sum and the second compensation weight corresponding to the second adjacent sub-area, the product of the difference between the second sum and the first sum and the second compensation weight corresponding to the first adjacent sub-area, 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-area are added to obtain the global laser energy compensation value of the current pixel. The formula is as follows:
[0113] Y2=LX2*Kl1+(2LX2-LX1-LX3)*Kl2……(2);
[0114] Where Y2 is the global laser energy compensation value.
[0115] It should be noted that, in the embodiment of the present 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, using the same second compensation weight, or different second compensation weights. The specific compensation weight setting is set according to actual conditions. When the second compensation weight corresponding to the first adjacent sub-region is different from the second compensation weight corresponding to the third adjacent sub-region, assume that the second compensation weight corresponding to the first adjacent sub-region is Kl2, and the second compensation weight corresponding to the third adjacent sub-region is Kl3, then Y2=LX2*Kl1+(LX2-LX1)*Kl2+(LX2-LX3)*Kl3.
[0116] It can be understood that, in the embodiment of the present application, when there is no pixel region in front of the second adjacent sub-region or there is no pixel region behind it, the first sum or the third sum is 0.
[0117] In step S440 of the embodiment of the present application, a global laser energy compensation value for laser energy compensation can be obtained, which is used to compensate the initial laser energy of the current pixel point.
[0118] It should be noted that, in the embodiment of the present application, after obtaining the global laser energy compensation value of the current pixel, the first sum, the second sum, and the third sum need to be updated as the first sum, the second sum, and the third sum of the global laser energy compensation value for the next row of pixels, and in the embodiment of the present application, except for the first row in the grayscale image, the first sum, the second sum, and the third sum of the remaining rows are determined by the updated first sum, the second sum, and the third sum of the corresponding area of the previous row, and 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] Exemplarily, in one embodiment of the present application, the first sum before updating is determined to be LX1(L1), the second sum before updating is LX2(L1), the third sum before updating is LX3(L1), the first sum after updating is LX1(L2), the second sum after updating is LX2(L2), the third sum after updating 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] The global laser energy compensation value of the current pixel point in the next row is determined by the updated first, second and third sums to ensure uniformity of laser printing energy after compensation and avoid over-darkness or over-lightness during printing after compensation.
[0127] Step S450: Determine the laser energy compensation value of the current pixel point according to the local laser energy compensation value and the global laser energy compensation value of the current pixel point.
[0128] Through steps S410 to S450, the embodiment of the present application can determine a laser energy compensation value for compensating the initial laser energy value of the current pixel point, compensate the initial laser energy by the laser energy compensation value, and execute step S140.
[0129] Step S140 , determining a target laser energy value for each pixel in the grayscale image according to the laser energy compensation value and the initial laser energy value for each pixel in the grayscale image.
[0130] In the embodiment of the present application, the initial laser energy value is compensated by the 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 is the target laser energy value. The laser energy compensation value determined by the local laser energy compensation value and the global laser energy compensation value can compensate for the initial laser energy value for laser printing. The obtained target laser energy value can be used to control laser printing to ensure the quality of the printed image.
[0133] Step S150: printing the image according to the target laser energy value.
[0134] In an embodiment of the present application, after the target laser energy is determined, it is combined with parameters such as the image motion contour curve, motion frequency, energy power, and opening laser beam timing in the image to be printed to produce a data packet, which is sent to a printing device. The printing device then prints according to the target laser energy of each pixel to achieve the image texture of simulating art sketches during printing, thereby ensuring efficient printing while ensuring the quality of the printed image.
[0135] It should be noted that, in the embodiment of the present application, printing the image to be printed according to the target laser energy value includes:
[0136] determining a bend region in the image to be printed;
[0137] Determine frequency conversion information according to the bending area and target laser energy value;
[0138] According to the frequency conversion information, the bending area of the image to be printed is printed.
[0139] In the embodiment of the present application, when performing laser printing, it is necessary to adjust the frequency setting of the laser etching optical lens and the laser beam energy output according to the contour curve calculation; Figure 8 , Figure 8 The figure shows the printing path of laser printing in the embodiment of the present application. In the embodiment of the present application, when the laser etched the line AC (solid line), the laser beam and the optical reflective lens motor were in a high-speed motion state at a frequency of F1. If the line of the image to be printed has a bending area BC (solid line), if the optical lens motor maintains the original frequency and changes direction at a high speed, the lens will cause understeering under the action of inertia, resulting in the laser beam and the movement of the lens being out of sync, thereby causing the problem of heavy etching in the bending area. At this time, the laser control module is required to calculate the printing line before the BC bending area and reduce the motor drive frequency to the setting of F2, 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 the present application, by determining the bending area of the image to be printed, the frequency conversion information that needs to be converted is determined according to the target laser energy value, wherein the frequency conversion information is a first frequency conversion point for reducing the frequency and a second frequency conversion point for increasing the frequency, wherein 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 completes 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 printing of the bending area, it passes through the second frequency conversion point and then increases the frequency to the original frequency, thereby achieving stable laser printing.
[0141] The embodiments of the present application include at least the following beneficial effects:
[0142] In the embodiment of the present application, the image to be printed is gray-scale converted to obtain a gray-scale image; the initial laser energy value of each pixel in the gray-scale image is determined; for each pixel in the gray-scale image, the laser energy compensation value of each pixel in the gray-scale image is determined according to the initial laser energy value of each pixel in the adjacent area; the target laser energy value of each pixel in the gray-scale image is determined according to the laser energy compensation value and the initial laser energy value of each pixel in the gray-scale image; and the image to be printed is printed according to the target laser energy value. The initial laser energy value of each pixel after the gray-scale conversion of the image to be printed is compensated by the laser energy compensation value, the target laser energy value for printing is determined, and printing is performed, so that the image texture of art sketches can be simulated during printing, and efficient printing can be achieved while ensuring the quality of the printed image.
[0143] Reference Fig. 9 The present application also discloses a laser printer, the laser printer 900 comprising:
[0144] at least one processor 901;
[0145] At least one memory 902, 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 the present application is implemented.
[0147] The embodiment of the present application further discloses a computer-readable storage medium, which stores a computer program executable by a processor. When the computer program executable by the processor is executed by the processor, it is used to implement the laser printing method as described above.
[0148] An embodiment of the present application also discloses 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, and 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, so that the laser printer executes the laser printing method as described above.
[0149] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0150] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0151] In the several embodiments provided in the present 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 only a logical function division. There may be other division methods in actual implementation, 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.
[0152] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0153] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0155] 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 application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0156] The step numbers in the above method embodiment are only provided for the convenience of explanation and description, and no limitation is imposed on the order of the steps. The execution order of each step in the embodiment 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 comprises: Perform grayscale conversion on the image to be printed to obtain a grayscale image; Determining an initial laser energy value for each pixel in the grayscale image; For each pixel in the grayscale image, determining a laser energy compensation value for each pixel in the grayscale image according to the initial laser energy value for each pixel in an adjacent area; Determining a target laser energy value for each pixel in the grayscale image according to the laser energy compensation value for each pixel in the grayscale image and the initial laser energy value; The image to be printed is printed according to the target laser energy value.
2. The method according to claim 1, characterized in that: Determining the initial laser energy value of each pixel in the grayscale image includes: Determine a grayscale energy mapping table according to preset laser parameters; An initial laser energy value of each pixel in the grayscale image is determined according to the grayscale value of each pixel in the grayscale image and the grayscale energy mapping table.
3. The method according to claim 1, characterized in that: The step of determining, for each pixel in the grayscale image, a laser energy compensation value for each pixel in the grayscale image according to the initial laser energy value for each pixel in an adjacent area, comprises: Traversing each pixel in the grayscale image to determine a first adjacent region and a second adjacent region of the current pixel; Acquire the initial laser energy value of each first adjacent pixel point in the first adjacent area, and the initial laser energy value of each second adjacent pixel point in the second adjacent area; Determine a local laser energy compensation value of the current pixel point according to the initial laser energy value of each first adjacent pixel point in the first adjacent area; Determine a global laser energy compensation value of the current pixel point according to the initial laser energy value of each second adjacent pixel point in the second adjacent area; The laser energy compensation value of the current pixel point is determined according to the local laser energy compensation value and the global laser energy compensation value of the current pixel point.
4. The method according to claim 3, characterized in that: The determining the local laser energy compensation value of the current pixel point according to the initial laser energy value of each first adjacent pixel point in the first adjacent area includes: Multiplying a 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 a first compensation weight corresponding to each of the first adjacent pixels to obtain a plurality of product terms; The multiple product terms are added together to obtain the local laser energy compensation value of the current pixel point.
5. The method according to claim 3, 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 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 point according to the initial laser energy value of each second adjacent pixel point in the second adjacent area includes: Acquire a first sum of the initial laser energy values of all the second adjacent pixel points in the first adjacent sub-region; Acquire the second sum of the initial laser energy values of all the second adjacent pixel points in the second adjacent sub-region and the initial laser energy value of the current pixel point; Acquire a third sum of the initial laser energy values of all the second adjacent pixel points in the third adjacent sub-region; 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 to obtain the global laser energy compensation value of the current pixel point.
6. The method according to claim 5, characterized in that After obtaining the global laser energy compensation value of the current pixel point, the method further includes: Update the first sum by multiplying the first sum by the attenuation coefficient; Update the second sum by multiplying the second sum by the attenuation coefficient; The third sum is updated by multiplying the third sum by the attenuation coefficient.
7. The method according to claim 1, characterized in that The step of printing the image to be printed according to the target laser energy value comprises: Determining a bending area in the image to be printed; Determining frequency conversion information according to the bending area and the target laser energy value; The bending area of the image to be printed is printed according to the frequency conversion information.
8. 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 according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium, characterized in that: A computer program executable by a processor is stored therein, and when the computer program executable by the processor is executed by the processor, it is used to implement the laser printing method according to any one of claims 1 to 7.
10. 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 the processor executes the computer program or the computer instructions, so that the laser printer executes the laser printing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Laser finishing of apparel
CN109641317A
Light equalizing method and device for LCD photocuring 3D printer
CN111941846A
Laser printing method and device based on image processing, laser printer and computer readable storage medium
CN113362319A
Image printing method and device, terminal and storage medium
CN117008850A
Laser marking machine, laser marking method, laser marking equipment and laser marking system
US20160318310A1
Cited By
Laser printing method, printer and storage medium
CN119987690A