An image processing method and apparatus
By splitting the laser direct-write image into contour images and sub-images, the resolution of tilted image segments is identified and improved, thus solving the problem of unevenness in tilted line segments and achieving better printing results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-03-24
AI Technical Summary
In laser direct writing technology, the contour edges of the slanted line segments of the image are not smooth, resulting in poor printing quality.
The first dot matrix image is split into a first contour image and a sub-image. Black pixels in the tilted image segment are identified and adjacent blank pixels are selected for resolution enhancement processing to fill them with higher resolution black pixels, so as to form a smooth second contour image.
It improves the smoothness of image printing, reduces jagged edges, and enhances printing quality.
Smart Images

Figure CN120931526B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of laser direct writing technology, and particularly to an image processing method and apparatus. Background Technology
[0002] In the field of laser direct writing, it is typically necessary to transfer a dot matrix image composed of several black pixels onto a photosensitive coating. For example, Figure 1 The image to be exposed. Figure 2 for Figure 1 The first bitmap image, displayed after magnification, consists of several pixels. Figure 2 It can be seen from this that... Figure 1 When magnified, the diagonal lines show some jagged edges (i.e., a large step effect appears between each pair of adjacent black pixels). Figure 1 The lower the resolution (i.e.) Figure 2 The longer the side length of each square, the better. Figure 2 The more pronounced the jagged edges are in the printing process, the more noticeable the jagged edges will be in the final printed product, resulting in an uneven profile on the sloping section and lower printing quality. Summary of the Invention
[0003] This invention provides an image processing method aimed at solving the problem of uneven contour edges of inclined line segments in the image during the imaging process, resulting in poor image printing quality.
[0004] The solution of the present invention is as follows:
[0005] An image processing method, comprising:
[0006] Step 1: Process the first dot matrix image with a resolution of K, which is composed of the first black pixels, into a first contour image and a sub-image located inside the first contour image. Divide the first contour image into several image segments connected in sequence. Each image segment includes at least one tilted image segment.
[0007] Step 2: Find the M first black pixels that constitute each tilted image segment from the first contour image. Select (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels. Process each first blank pixel into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Use all the second blank pixels that the diagonal of the matrix formed by the P*Q second blank pixels passes through with a diagonal that is close to the tilt direction of the tilted image segment as the boundary. Select all the second blank pixels that are close to two adjacent first black pixels and fill them with black respectively to obtain a number of second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. The number of second black pixels and the first contour image form a second contour image.
[0008] Step 3: Combine the second contour image with the sub-image to form a second dot matrix image;
[0009] Where M is a positive integer that varies with the length of the tilted image segment; P and Q are both positive integers greater than 1, and P and Q can be the same or different; the position of the sub-image in the second dot matrix image does not change relative to the first dot matrix image.
[0010] Furthermore, the contour bitmap is obtained by extracting the contour from the first bitmap image.
[0011] Furthermore, the method for extracting the contour can be any one of edge detection, connectivity-based detection, or region segmentation.
[0012] Furthermore, P=10, Q=10, K=2540dpi;
[0013] Furthermore, P=10, Q=5, K=2540dpi.
[0014] This application also discloses an image processing apparatus, including,
[0015] The image segmentation module is used to: process a first dot matrix image with a resolution of K composed of first black pixels into a first contour image and a sub-image located inside the first contour image, and to segment the first contour image into a number of sequentially connected image segments, wherein the number of image segments includes at least one slanted image segment.
[0016] The second contour image acquisition module is used to: find M first black pixels corresponding to each tilted image segment from the first contour image; select (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels; process each first blank pixel into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K; take all second blank pixels passed through by the diagonal of the matrix composed of P*Q second blank pixels that is close to the tilt direction of the tilted image segment as the boundary; select all second blank pixels close to two adjacent first black pixels and fill them with black respectively; obtain several second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K; and form a second contour image with several second black pixels and the first contour image.
[0017] The second dot matrix image acquisition module is used to: combine the second contour image and the sub-image to form a second dot matrix image;
[0018] Where M is a positive integer that varies with the length of the tilted image segment, P is a positive integer greater than 1, and the position of the sub-image in the second dot matrix image does not change relative to the first dot matrix image.
[0019] Furthermore, the contour bitmap is obtained by extracting the contour from the first bitmap image.
[0020] Furthermore, the method for extracting the contour can be any one of edge detection, connectivity-based detection, or region segmentation.
[0021] Furthermore, P=10, Q=10, K=2540dpi;
[0022] Furthermore, P=10, Q=5, K=2540dpi.
[0023] The image processing method and apparatus can achieve the following effects: Firstly, a first dot matrix image is segmented into a first contour image and sub-images located within the first contour image. An inclined image segment of the first contour image is extracted. Several M first black pixels with a resolution of K constituting the inclined image segment are identified. (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels are selected. Each first blank pixel is processed into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Using all second blank pixels along the diagonal of the matrix formed by the P*Q second blank pixels (which shares the same inclination direction as the inclined image segment) as boundaries, all second blank pixels close to two adjacent first black pixels are selected and filled with black, resulting in several second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. All second black pixels are combined with the first contour image to form a second contour image. The second contour image is then stitched with the sub-images to form a second dot matrix image. Because the jagged parts of the slanted line segments in the second contour image are filled with several higher-resolution second black pixels, the slanted image segments of the outer contour of the second dot matrix image are smoother, resulting in a better image printing effect. Attached Figure Description
[0024] The numbers and their corresponding names in the diagram are as follows:
[0025] Figure 1 The image to be exposed;
[0026] Figure 2 for Figure 1 A magnified display of a first dot matrix image 10 composed of several pixels;
[0027] Figure 3 From Figure 1 The line drawing of the first contour image 110 extracted from it;
[0028] Figure 4 for Figure 2The first dot matrix image 10 is split into a first contour image 110 and a sub-image 120 located inside the first contour image 110;
[0029] Figure 5 This refers to the second dot matrix image 20 obtained after image processing in Example 1;
[0030] Figure 6 This is a diagram illustrating the process of combining the second contour image 210 and the sub-image 120 into the second dot matrix image 20 in Example 1.
[0031] Figure 7 for Figure 6 Enlarged view of point A;
[0032] Figure 8 for Figure 6 Enlarged view of point B;
[0033] Figure 9 This is a diagram illustrating the method steps of the present invention;
[0034] Figure 10 This refers to the second dot matrix image 20-1 obtained after image processing in Example 2;
[0035] Figure 11 This is a diagram illustrating the process of combining the second contour image 210-1 and the sub-image 120 into the second dot matrix image 20-1 in Example 2.
[0036] Figure 12 for Figure 11 Enlarged view at point C;
[0037] Figure 13 for Figure 11 Enlarged view at point D;
[0038] Figure 14 This is a block diagram of the image processing apparatus of the present invention. Detailed Implementation
[0039] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. The terms "first," "second," and "third" are used only to describe distinctions and should not be construed as indicating or implying relative importance. Furthermore, unless otherwise explicitly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; a mechanical connection or an electrical connection; a direct connection or an indirect connection through an intermediate object; or a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0041] refer to Figure 9 This application discloses an image processing method applied in the field of laser direct writing technology, including:
[0042] Step 1: Process the first dot matrix image with a resolution of K, which is composed of the first black pixels, into a first contour image and a sub-image located inside the first contour image. Divide the first contour image into several image segments connected in sequence. Each image segment includes at least one tilted image segment.
[0043] Step 2: Find the M first black pixels that constitute each tilted image segment from the first contour image. Select (M-1) first blank pixels with a resolution of K adjacent to the M first pixels. Process each first blank pixel into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Take all the second blank pixels that the diagonal of the matrix formed by the P*Q second blank pixels passes through with the tilt direction of the tilted image segment as the boundary. Select all the second blank pixels that are close to two adjacent first black pixels and fill them with black respectively. This will result in several second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. These several second black pixels and the first contour image form the second contour image.
[0044] Step 3: Combine the second contour image with the sub-image to form the second raster image;
[0045] Where M is a positive integer that varies with the length of the tilted image segment, and P and Q are both positive integers greater than 1; P and Q can be the same or different; the position of the sub-image in the second dot matrix image does not change relative to the first dot matrix image.
[0046] The following is combined Figures 1 to 8 The above steps will be analyzed.
[0047] refer to Figure 1 , Figure 1 The image to be exposed, when magnified, is displayed as a dot matrix as shown below. Figure 2 As shown, Figure 2 for Figure 1 A magnified view of the first bitmap image 10, composed of several pixels. A gray box represents one pixel, and a white box represents a blank pixel; the white and gray boxes are the same size. Figure 1 and Figure 2 The gray area in the image represents the pattern to be exposed using a laser direct-writing device. The size of the gray box represents the pixel size, which is related to the image resolution. For example, if... Figure 2 The resolution is 2540 dpi, or K=2540 dpi, meaning each pixel is 10 micrometers in size, or the side length of each gray square is 10 micrometers. The higher the image resolution, the smaller each pixel is. Figure 2 The shorter the side length of each gray box shown.
[0048] Will Figure 2 The bitmap image shown, consisting of several pixels, is defined as the first bitmap image 10. Figure 2 Reflects Figure 1 When the display is magnified, it can be seen that... Figure 1 Depend on Figure 2 It consists of several gray squares.
[0049] Will Figure 1 Image processing is performed to obtain a first contour image 110 and a sub-image 120 located within the first contour image 110. The line drawing of the first contour image 110 is shown below. Figure 3 As shown, Figure 3 The line drawing shown is a bitmap, using, for example Figure 4 The left side of the diagram indicates that, it should be noted that, Figure 4 The number of pixels is merely an example and does not reflect the true number of pixels. Figure 3 The actual length of each image segment, for example, Figure 4 The length of the top 8 black pixels does not reflect Figure 3 The actual length of the first horizontal image segment 111 in the image. Figure 3The shape of the first contour image 110 is merely exemplary, comprising the following sequentially connected segments: a first horizontal image segment 111, a second inclined image segment 112, a third vertical image segment 113, a fourth inclined image segment 114, a fifth horizontal image segment 115, and a sixth vertical image segment 116. In this application, the first contour image 110 can have various shapes, but it must include at least one inclined image segment. If it is rectangular, it is not discussed in this application, as this patent application only addresses the processing of inclined image segments. Furthermore, if the first contour image contains arc image segments, these arc image segments are split into several inclined image segments for processing.
[0050] Figure 2 The first bitmap image 10 is processed into a first contour image 110 and a sub-image 120 located inside the first contour image. The bitmaps of the first contour image 110 and the sub-image 120 are as follows: Figure 4 As shown. It should be noted that, Figure 4 The raster image of sub-image 120 in the text is merely an example and does not reflect the true nature of the image. Figure 1 The actual pixel distribution of the neutron image 120.
[0051] because Figure 1 The first contour image 110 contains a second tilted image segment 112 and a fourth tilted image segment 114. If Figure 1 If the resolution is low (e.g., an exemplary resolution of 2540 dpi), then after printing with a laser direct-write device, both the second tilted image segment 112 and the fourth tilted image segment 114 will appear jagged. Figure 2 and Figure 4 As shown, this results in poor printing quality. Therefore, image processing is required for the second tilted image segment 112 and the fourth tilted image segment 114 to make the two new tilted image segments (not shown) obtained after processing smoother.
[0052] Therefore, the problems to be solved in this application are: 1. How to separate the first contour image 110 of the dot matrix from the first dot matrix image 10; 2. How to perform image processing on the second tilted image segment 112 and the fourth tilted image segment 114 in the first contour image 110 of the dot matrix so that the two tilted image segments (not shown) obtained after exposure are relatively smooth.
[0053] For the first problem, a common solution is to extract the edge detection method, connectivity-based detection method, or region segmentation method. Figure 1 The first raster image 10 and the first contour image 110 (e.g.) Figure 3(As shown). Edge detection methods, connectivity-based detection methods, and region segmentation methods are all existing technologies, and any one of them can be directly applied to this application to solve the contour extraction problem. For example, contour extraction based on edge detection is based on the core idea of connecting the locations of abrupt changes in pixel intensity (edges) in the image to form a closed contour of the target object. The specific methods can be divided into traditional edge detection combined with post-processing and deep learning methods. Edge detection method: locates edge points by calculating the image gradient or second-order differential, and then forms a contour through a connection strategy, including: (1) gradient operator and edge localization; (2) second-order differential and edge enhancement; (3) morphology and contour closure: starting from the edge point, search for neighboring points counterclockwise in the direction of the 8-neighborhood chain code to form a closed contour. It should be noted that the specific content of edge detection methods, connectivity-based detection methods, and region segmentation methods are all existing technologies, and the relevant content can be retrieved. This application will not elaborate on the specific content, but can directly apply it.
[0054] refer to Figure 1 , Figure 4 and Figure 5 In this application, the contour of the first dot matrix image 10 is determined by using any one of edge detection methods, connectivity-based detection methods, or region segmentation methods. Figure 11 Extracted, as shown Figure 3 The first contour image 110 is shown. As previously mentioned, the first contour image 110 includes the following segments connected in sequence: a first horizontal image segment 111, a second oblique image segment 112, a third vertical image segment 113, a fourth oblique image segment 114, a fifth horizontal image segment 115, and a sixth vertical image segment 116.
[0055] Regarding the second question: how to process the second tilted image segment 112 and the fourth tilted image segment 114 in the first contour image 110 of the dot matrix so that the two tilted image segments obtained after exposure are relatively smooth, the solution will be explained in detail below.
[0056] according to Figure 3 The first contour image 110 in the image determines two tilted image segments: the second tilted image segment 112 and the fourth tilted image segment 114. Figure 3 The raster image corresponding to the first contour image 110 in the image is as follows: Figure 4 The left half of the first contour image 110 is shown as a bitmap; therefore, the bitmaps corresponding to the second tilted image segment 112 and the fourth tilted image segment 114 can also be obtained from... Figure 4 This has been determined. (Reference) Figure 3First, select the second tilted image segment 112 (or you can select the fourth tilted image segment 114 first, the order doesn't matter). Confirm that the first black pixel constituting the second tilted image segment 112 has 5 (i.e., M is 5, which is just an example and does not mean that the actual length of the second tilted image segment 112 is only 5 first black pixels). Its coordinates are shown in [reference needed]. Figure 4 The first contour image 110 is (5,1), (4,2), (3,3), (2,4), and (1,5). Based on these 5 first black pixels, find the 4 adjacent first blank pixels with coordinates (4,1), (3,2), (2,3), and (1,4). Next, each of these 4 first blank pixels needs to be processed into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K, and then filled accordingly.
[0057] The following describes how to... Figure 4 The first blank pixel with coordinates (4,1) is processed into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K, and then filled accordingly.
[0058] For example, K is set to 2540 dpi, that is Figure 2 and Figure 4 The resolution of each first blank pixel or each first black pixel is 2540 dpi (10 micrometers * 10 micrometers). When P is exemplarily set to 10, Q is also exemplarily set to 10. Figure 4 The first blank pixel at coordinates (4,1) is processed into 10*10 second blank pixels with a resolution of 10*2540dpi = 25400dpi (size 1μm*1μm). That is, the resolution of the second blank pixels is 25400dpi in both the horizontal and vertical directions. The diagonal of the matrix composed of 100 1μm*1μm second blank pixels is determined, and this diagonal needs to be aligned with... Figure 3 The second tilted image segment 112 has the same tilt direction. Taking all the second blank pixels passed through by the diagonal as the boundary, select all the second blank pixels of the two adjacent first black pixels with coordinates (5,1) and (4,2) and fill them respectively, resulting in a number of (55 in the case of P=10) second black pixels. The filling result is as follows. Figure 7 As shown, the resolution of the second black pixel is 25400 dpi in both the horizontal and vertical directions.
[0059] Continue describing how to Figure 4The first blank pixel at coordinates (3,2) is processed into 10*10 second blank pixels with a horizontal resolution of 10*2540 dpi and a vertical resolution of 10*2540 dpi, and then filled accordingly. The first blank pixel at coordinates (3,2) and the first blank pixel at coordinates (4,1) have the same resolution, both 2540 dpi. When P and Q are both 10, the first blank pixel at coordinates (3,2) is processed into 10*10 second blank pixels with a resolution of 10*2540 dpi = 25400 dpi (size 1 μm * 1 μm). The diagonal of the matrix composed of 100 1 μm * 1 μm second blank pixels is determined, and this diagonal also needs to be aligned with... Figure 3 The second tilted image segment 112 has the same tilt direction. Taking all the second blank pixels passed through by the diagonal as the boundary, select all the second blank pixels that are close to the two adjacent first black pixels with coordinates (4,2) and (3,3) and fill them respectively, resulting in a number of (55 in total, assuming P and Q are both 10). The filling result is as follows. Figure 7 As shown, the resolution of the second black pixel is 25400 dpi in both the horizontal and vertical directions.
[0060] The remaining two blank pixels with coordinates (2,3) and (1,4) are processed in the same way as the first blank pixel.
[0061] Finally, after filling the four first blank pixels with coordinates (4,1), (3,2), (2,3), and (1,4), the result is as follows: Figure 6 As shown, this means Figure 3 and Figure 4 The second tilted image segment 112 shown is now filled.
[0062] for Figure 3 The processing method for the fourth tilted image segment 114 is largely the same as that for the second tilted image segment 112, but with minor differences, as detailed below: (See reference...) Figure 3 , Figure 4 Select the fourth tilted image segment 114 and confirm that there are 4 first black pixels constituting the fourth tilted image segment 114 (i.e., M is 4 for example), with coordinates (1,13), (2,14), (3,15), and (4,16) respectively. Based on these 4 first black pixels, find the 3 adjacent first blank pixels with coordinates (1,14), (2,15), and (3,16) respectively. Process each of these 3 first blank pixels into 10*10 second blank pixels with a horizontal resolution of 10*2540dpi and a vertical resolution of 10*2540dpi and fill them accordingly.
[0063] refer to Figure 4 First, the first blank pixel at coordinates (1,14) in the first contour image 110 is processed into 10*10 second blank pixels with a horizontal resolution of 10*2540 dpi and a vertical resolution of 10*2540 dpi, as follows: Figure 7 As shown. Determine the diagonal of a matrix consisting of 100 second blank pixels (1 μm x 1 μm). This diagonal needs to be aligned with... Figure 3 The tilt direction of the fourth tilted image segment 114 is similar. Taking all the second blank pixels passed through by the diagonal as the boundary, select all the second blank pixels of the two adjacent first black pixels with coordinates (1,13) and (2,14) and fill them respectively, to obtain a number (55 in total when P is 10) of second black pixels with a resolution of 25400 dpi in both the horizontal and vertical directions. In the same way, process and fill the remaining two first blank pixels with coordinates (2,15) and (3,16) respectively, and finally obtain the filled image as shown. Figure 8 As shown.
[0064] when Figure 4 After the second tilted image segment 112 and the fourth tilted image segment 114 in the first contour image 110 are filled, the first contour image 110 becomes as follows: Figure 9 The second contour image 210 is shown. The second contour image 210 and the sub-image 120 are combined to form the second bitmap image 20. The combination process is as follows: Figure 6 As shown, the final obtained second dot matrix image 20 is as follows: Figure 5 As shown. In the second dot matrix image 20, the position of sub-image 120 relative to the first dot matrix image 10 (e.g., Figure 4 As shown, there was no change.
[0065] Unlike Example 1, P and Q are different in this example. The following describes how to... Figure 4 The first blank pixel with coordinates (4,1) is processed into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K, and then filled accordingly.
[0066] For example, K is set to 2540 dpi, that is Figure 2 and Figure 4 The resolution of each first blank pixel or each first black pixel is 2540 dpi (10 micrometers * 10 micrometers). When P is 10 for example, and Q is 5 for example, then... Figure 4The first blank pixel at coordinates (4,1) is processed into 10*5 second blank pixels with a horizontal resolution of 10*2540dpi = 25400dpi and a vertical resolution of 5*2540dpi = 12700dpi (size 1μm*2μm). That is, the resolution of the second blank pixels is different in the horizontal and vertical directions. The diagonal of the matrix composed of 100 1μm*2μm second blank pixels is determined, and this diagonal needs to be aligned with... Figure 3 The second tilted image segment 112 has the same tilt direction. Taking all the second blank pixels passed through by the diagonal as the boundary, select all the second blank pixels of the two adjacent first black pixels with coordinates (5,1) and (4,2) and fill them respectively, to obtain a number of second black pixels (30 in the case of P=10). The filling result is as follows. Figure 12 As shown, the horizontal resolution of the second black pixel is 10*2540dpi=25400dpi, and the vertical resolution is 5*2540dpi=12700dpi.
[0067] Continue describing how to Figure 4 The first blank pixel at coordinates (3,2) is processed into 10*5 second blank pixels with a horizontal resolution of 10*2540 dpi and a vertical resolution of 5*2540 dpi, and then filled accordingly. The first blank pixel at coordinates (3,2) and the first blank pixel at coordinates (4,1) have the same resolution: 25400 dpi horizontally and 12700 dpi vertically. When P is 10 and Q is 5, the first blank pixel at coordinates (3,2) is processed into 10*5 second blank pixels with a horizontal resolution of 25400 dpi and a vertical resolution of 12700 dpi. The diagonal of the matrix composed of 50 second blank pixels of 1 μm * 2 μm is determined, and this diagonal also needs to be aligned with... Figure 3 The second tilted image segment 112 has the same tilt direction. Taking all the second blank pixels passed through by the diagonal as the boundary, select all the second blank pixels that are close to the two adjacent first black pixels with coordinates (4,2) and (3,3) and fill them respectively, to obtain a number of second black pixels (30 in total, given P=10 and Q=5). The filling result is as follows. Figure 12 As shown, the horizontal resolution of the second black pixel is 10*2540dpi=25400dpi, and the vertical resolution is 5*2540dpi=12700dpi.
[0068] The remaining two blank pixels with coordinates (2,3) and (1,4) are processed in the same way as the first blank pixel.
[0069] Finally, after filling the four first blank pixels with coordinates (4,1), (3,2), (2,3), and (1,4), the result is as follows: Figure 12 As shown, this means Figure 3 and Figure 4 The second tilted image segment 112 shown is now filled.
[0070] for Figure 3 The processing method for the fourth tilted image segment 114 is largely the same as that for the second tilted image segment 112, but with minor differences, as detailed below: (See reference...) Figure 3 , Figure 4 Select the fourth tilted image segment 114 and confirm that there are 4 first black pixels constituting the fourth tilted image segment 114 (i.e., M is 4 for example), with coordinates (1,13), (2,14), (3,15), and (4,16) respectively. Based on these 4 first black pixels, find the 3 adjacent first blank pixels with coordinates (1,14), (2,15), and (3,16) respectively. Process each of these 3 first blank pixels into 10*5 second blank pixels with a horizontal resolution of 25400dpi and a vertical resolution of 12700dpi and fill them accordingly.
[0071] refer to Figure 4 First, the first blank pixel at coordinates (1,14) in the first contour image 110 is processed into 10*5 second blank pixels with a horizontal resolution of 25400 dpi and a vertical resolution of 12700 dpi, as shown below. Figure 13 As shown. Determine the diagonal of a matrix consisting of 50 second blank pixels of 1 micrometer * 2 micrometers. This diagonal needs to be aligned with... Figure 3 The tilt direction of the fourth tilted image segment 114 is similar. Taking all the second blank pixels passed through by the diagonal as the boundary, select all the second blank pixels of the two adjacent first black pixels with coordinates (1,13) and (2,14) and fill them respectively, to obtain a number of (30 in total when P is 10 and Q is 5) second black pixels with a horizontal resolution of 25400 dpi and a vertical resolution of 12700 dpi. In the same way, process and fill the remaining two first blank pixels with coordinates (2,15) and (3,16) respectively, and finally obtain the filled image as shown. Figure 13 As shown.
[0072] when Figure 4 After the second tilted image segment 112 and the fourth tilted image segment 114 in the first contour image 110 are filled, the first contour image 110 becomes as follows: Figure 11The second contour image 210-1 is shown. The second contour image 210 is combined with the sub-image 120 to form the second dot matrix image 20. The combination process is as follows: Figure 11 As shown, the final second dot matrix image 20-1 is as follows. Figure 10 As shown. In the second dot matrix image 20-1, the position of sub-image 120 relative to the first dot matrix image 10 (e.g., Figure 4 As shown, there was no change.
[0073] In both embodiments, the values of P, Q, and K are merely exemplary; P and Q can be the same or different. If P is 5, Q is 4, and K is 2540 dpi, then the first blank pixel will be processed into 5*4 second blank pixels with a horizontal resolution of 5*2540 dpi = 12700 dpi and a vertical resolution of 4*2540 dpi = 10160 dpi. If P is 5, Q is 4, and K is 1270 dpi, then the first blank pixel will be processed into 5*4 second blank pixels with a horizontal resolution of 5*1270 dpi = 6350 dpi and a vertical resolution of 4*1270 dpi = 5080 dpi. Therefore, as long as P and Q are both positive integers greater than 1, the resolution of the resulting second blank pixels will be improved. Thus, in the second bitmap image, the jagged portion of the tilted image segment (i.e., the step formed by two adjacent first black pixels, such as...) Figure 2 (As shown) is filled with several second black pixels of higher resolution (the number depends on the values of P and Q; the larger the values of P and Q, the more pixels there are, and vice versa). It can be understood that the larger the values of P and Q, the higher the resolution of the second black pixels, the smoother the slanted line segments will be, resulting in a smoother outline of the slanted line segments in the second bitmap image, and less noticeable jagged edges after printing.
[0074] The advantages of this image processing method are as follows: The first dot matrix image is segmented into a first contour image and a sub-image located within the first contour image. The tilted image segment of the first contour image is extracted, and several M first black pixels with a resolution of K constituting the tilted image segment are identified. (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels are selected. Each first blank pixel is processed into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Taking all the second blank pixels passed through by the diagonal of the matrix formed by the P*Q second blank pixels with the same tilt direction as the tilted image segment as the boundary, all the second blank pixels close to two adjacent first black pixels are selected and filled with black respectively, resulting in several second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Finally, all the second black pixels and the first contour image form the second contour image. The second contour image and the sub-image are stitched together to form the second dot matrix image. Because the jagged parts of the slanted line segments in the second contour image are filled with several higher-resolution second black pixels, the slanted image segments of the outer contour of the second dot matrix image are smoother, resulting in a better image printing effect.
[0075] refer to Figure 14 , Figure 14 An image processing apparatus is disclosed, comprising:
[0076] The image segmentation module is used to: process a first dot matrix image with a resolution of K composed of first black pixels into a first contour image and a sub-image located inside the first contour image, and to segment the first contour image into a number of sequentially connected image segments, wherein the number of image segments includes at least one slanted image segment.
[0077] The second contour image acquisition module is used to: find the M first black pixels corresponding to each inclined image segment from the first contour image; select (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels; process each first blank pixel into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K; take all the second blank pixels passed through by the diagonal of the matrix composed of P*Q second blank pixels that is close to the inclined direction of the inclined image segment as the boundary; select all the second blank pixels that are close to two adjacent first black pixels and fill them with black respectively; obtain a number of second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K; and form a second contour image with the first contour image.
[0078] The second dot matrix image acquisition module is used to: combine the second contour image and the sub-image to form a second dot matrix image;
[0079] Where M is a positive integer that varies with the length of the tilted image segment, P is a positive integer greater than 1, and the position of the sub-image in the second dot matrix image does not change relative to the first dot matrix image.
[0080] Furthermore, the contour bitmap is obtained by extracting the contour from the first bitmap image.
[0081] Furthermore, the method for extracting the contour can be any one of edge detection, connectivity-based detection, or region segmentation.
[0082] In some embodiments, P=10, Q=10, K=2540dpi;
[0083] In some embodiments, P=10, Q=10, K=2540dpi.
[0084] The functions of the image segmentation module, the second contour image acquisition module, and the second dot matrix image acquisition module in the image processing device have been described in detail in the previous introduction of the image processing method, and will not be repeated here.
[0085] The image processing apparatus disclosed in this application can achieve the following technical effects:
[0086] The first dot matrix image is segmented into a first contour image and a sub-image located within the first contour image. The tilted image segment of the first contour image is extracted, and several M first black pixels with a resolution of K constituting the tilted image segment are identified. (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels are selected. Each first blank pixel is processed into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Using all the second blank pixels passed through by the diagonal of the matrix formed by the P*Q second blank pixels in the same tilt direction as the tilted image segment as the boundary, all the second blank pixels close to two adjacent first black pixels are selected and filled with black respectively, resulting in several second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Finally, all the second black pixels and the first contour image form the second contour image. The second contour image and the sub-image are stitched together to form the second dot matrix image. Because the jagged parts of the slanted line segments in the second contour image are filled with several higher-resolution second black pixels, the slanted image segments of the outer contour of the second dot matrix image are smoother, resulting in a better image printing effect.
[0087] Finally, it should be noted that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An image processing method, characterized in that, include: Step 1: Process the first dot matrix image with a resolution of K, which is composed of the first black pixels, into a first contour image and a sub-image located inside the first contour image. Divide the first contour image into several image segments connected in sequence. The several image segments include at least one tilted image segment. Step 2: Find the M first black pixels that constitute each tilted image segment from the first contour image. Select (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels. Process each first blank pixel into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. Using all the second blank pixels that the diagonal of the matrix formed by the P*Q second blank pixels passes through with a diagonal similar to the tilt direction of the tilted image segment as the boundary, select all the second blank pixels that are close to two adjacent first black pixels and fill them with black respectively to obtain a number of second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K. The number of second black pixels and the first contour image form a second contour image. Step 3: Combine the second contour image with the sub-image to form a second dot matrix image; Where M is a positive integer that varies with the length of the tilted image segment; P and Q are both positive integers greater than 1, and P and Q may be the same or different; the position of the sub-image in the second dot matrix image does not change relative to the first dot matrix image.
2. The image processing method as described in claim 1, characterized in that, The first contour image is obtained by extracting the contour from the first bitmap image.
3. The image processing method as described in claim 2, characterized in that, The contour can be extracted using any of the following methods: edge detection, connectivity-based detection, or region segmentation.
4. The image processing method according to any one of claims 1 to 3, characterized in that, P=10, Q=10, K=2540dpi.
5. The image processing method according to any one of claims 1 to 3, characterized in that... P=10, Q=5, K=2540dpi.
6. An image processing apparatus, characterized in that, include, The image segmentation module is used to: process a first dot matrix image with a resolution of K composed of first black pixels into a first contour image and a sub-image located inside the first contour image; and segment the first contour image into a plurality of sequentially connected image segments, wherein the plurality of image segments includes at least one tilted image segment. The second contour image acquisition module is used to: find M first black pixels corresponding to each inclined image segment from the first contour image; select (M-1) first blank pixels with a resolution of K adjacent to the M first black pixels; process each first blank pixel into P*Q second blank pixels with a horizontal resolution of P*K and a vertical resolution of Q*K; take all the second blank pixels passed through by the diagonal of the matrix composed of P*Q second blank pixels that is close to the inclined direction of the inclined image segment as the boundary; select all the second blank pixels close to two adjacent first black pixels and fill them with black respectively; obtain a number of second black pixels with a horizontal resolution of P*K and a vertical resolution of Q*K; and form a second contour image with the first contour image. The second dot matrix image acquisition module is used to: combine the second contour image and the sub-image to form a second dot matrix image; Where M is a positive integer that varies with the length of the tilted image segment; P and Q are both positive integers greater than 1, and P and Q may be the same or different; the position of the sub-image in the second dot matrix image does not change relative to the first dot matrix image.
7. The image processing apparatus as claimed in claim 6, characterized in that: The first contour image is obtained by extracting the contour from the first dot matrix image.
8. The image processing apparatus as claimed in claim 7, characterized in that, The contour can be extracted using any of the following methods: edge detection, connectivity-based detection, or region segmentation.
9. The image processing apparatus as claimed in claim 6, characterized in that, P=10, Q=10, K=2540dpi.
10. The image processing apparatus as claimed in claim 6, characterized in that, P=10, Q=5, K=2540dpi.
Citation Information
Patent Citations
Image processing method and device and related equipment
CN118732421A
Image processing of reducing jaggy of printing image
JP2010120329A