Image processing method and device
By segmenting the initial image into multiple sub-images and processing it using multi-threaded modules, the problem of long time and low efficiency when computers process large memory images is solved, and a significant improvement in image processing speed and efficiency are achieved.
Patent Information
- Application Number
- CN202411795084.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Computers take a long time to process large memory images and are inefficient.
The initial image is divided into multiple first sub-images in order from left to right. Each adjacent first sub-image has two columns of image strips. The multi-threaded module is used to simultaneously use the four neighboring image processing method. The first sub-image is processed, the second sub-image and the third sub-image are obtained, and the third sub-image is sequentially spliced into the output image.
Through segmentation and multi-threading, the speed of image processing is greatly accelerated and the image processing efficiency is improved. The obtained output image is exactly the same as the result of not using the multi-threading module processing.
Smart Images

Figure CN119292007B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of image processing, and in particular, to an image processing method and device in the field of laser direct writing technology. Background Art
[0002] refer to Figure 1 In the field of laser direct writing technology, computers are Figure 1 The conventional processing method of the initial image 10 to be exposed (exemplarily represented as 5 rows×15 columns with a total of 75 black or white pixels, represented by black squares or white squares) is to process it row by row from left to right and from top to bottom: first process the 15 pixels of the first row of image strips from left to right, and then process the 15 pixels of the second row of image strips from left to right... until the 75th pixel on the right of the last fifth row is processed.
[0003] As an exemplary image processing method, Figure 1 When each black pixel in the initial image 10 is deleted or retained for processing, the following is used: Figure 2 and Figure 3 The 4-neighborhood image processing method shown is as follows: Figure 2 As shown in FIG. 1 , when black pixel No. 1 needs to be processed, since the adjacent pixel No. 2 above, the adjacent pixel No. 3 on the left, the adjacent pixel No. 4 on the right, and the adjacent pixel No. 5 below are all black pixels, that is, the four adjacent pixels of black pixel No. 1 are all black pixels, so black pixel No. 1 is retained; Figure 3 As shown in the figure, when black pixel No. 1 needs to be processed, since the adjacent pixel No. 2 above it is a black pixel, the adjacent pixel No. 3 on the left is a white pixel, the adjacent pixel No. 4 on the right is a black pixel, and the adjacent pixel No. 5 on the bottom is a black pixel, the condition that the upper, lower, left, and right pixels adjacent to black pixel No. 1 are all black pixels is not met, so black pixel No. 1 needs to be processed into a white pixel. If pixel No. 1 is a white pixel, there is no need to consider whether its adjacent pixels are black pixels.
[0004] according to Figure 2 and Figure 3 The 4-neighborhood image processing method shown in Figure 1 The initial image 10 shown is processed in a conventional manner for each black pixel, and the output image 10C is finally obtained as shown in FIG. Figure 4 shown.
[0005] It should be noted that if Figure 1The more rows and / or columns the initial image 10 has, the more pixels it contains, the larger the memory occupied by the initial image, and the longer time it takes for the computer to process all pixels of the complete initial image in the above conventional processing method, which is inefficient. Summary of the invention
[0006] The embodiment of the present application provides an image processing method, the purpose of which is to solve the problem that it takes a long time and is inefficient when a computer processes a large memory image.
[0007] The solution of the embodiment of the present application is as follows:
[0008] An image processing method, applied in the field of laser direct writing technology, comprising:
[0009] Step 1: Divide the initial image into N first sub-images from left to right, and every two adjacent first sub-images have two common columns of image strips;
[0010] Step 2: using a multi-threaded module to simultaneously process N first sub-images according to a four-neighborhood image processing method to obtain N second sub-images;
[0011] Step 3: using a multi-thread module to process N pieces of the second sub-images simultaneously to obtain N pieces of the third sub-images;
[0012] Step 4: Use a multi-threaded module to sequentially stitch the N third sub-images into an output image.
[0013] Furthermore, in step 2, when the N first sub-images are processed simultaneously, except for the rightmost column of image strips of the leftmost first sub-image and the leftmost column of image strips of the rightmost last first sub-image, the leftmost first column of image strips and the rightmost last column of image strips of any other first sub-image do not need to be processed.
[0014] Furthermore, step 3 is specifically as follows:
[0015] Step 31: Delete the rightmost column of the leftmost first second sub-image to obtain the first third sub-image;
[0016] Step 32: Delete the leftmost first column of image strips and the rightmost last column of image strips of each of the second sub-images from the left to the N-1th second sub-image, to obtain N-2 third sub-images;
[0017] Step 33: Delete the leftmost first column of the last second sub-image on the rightmost side to obtain the Nth third sub-image;
[0018] Among them, step 31, step 32 and step 33 are performed simultaneously without any particular order.
[0019] Furthermore, in step 4, sequential stitching means that the rightmost column of image strips of any third sub-image and the leftmost column of image strips of the third sub-image that follows it are stitched together according to the same row number in the order of the N first sub-images obtained after segmentation of the initial image.
[0020] Furthermore, the number of columns of the N first sub-images is not necessarily the same.
[0021] The present application also discloses an image processing device, which aims to solve the problem that it takes a long time and is inefficient when a computer processes a large memory image. The image processing device includes:
[0022] A segmentation module is used to: segment the initial image into N first sub-images in order from left to right, where every two adjacent first sub-images have two common columns of image strips;
[0023] A first processing module is used to: use a multi-thread module to process N first sub-images according to a 4-neighborhood image processing method simultaneously to obtain N second sub-images;
[0024] A second processing module is used to: use a multi-thread module to process N pieces of the second sub-images simultaneously to obtain N pieces of the third sub-images;
[0025] The splicing module is used to: use the multi-threading module to sequentially splice the N third sub-images into an output image.
[0026] Furthermore, in the first processing module, when N frames of the first sub-images are processed simultaneously, except for the rightmost column of image strips of the leftmost first sub-image, and the leftmost column of image strips of the rightmost last first sub-image, the leftmost first column of image strips and the rightmost last column of image strips of any other first sub-images do not need to be processed.
[0027] Furthermore, the specific processing process of the second processing module is:
[0028] Step 31: Delete the rightmost column of the leftmost first second sub-image to obtain the first third sub-image;
[0029] Step 32: Delete the leftmost first column of image strips and the rightmost last column of image strips of each of the second sub-images from the left to the N-1th second sub-image, to obtain N-2 third sub-images;
[0030] Step 33: Delete the leftmost first column of the last second sub-image on the rightmost side to obtain the Nth third sub-image;
[0031] Among them, step 31, step 32 and step 33 are performed simultaneously without any particular order.
[0032] The embodiment of the present application further discloses a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the aforementioned image processing method are implemented.
[0033] The embodiment of the present application also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the aforementioned image processing method are implemented.
[0034] The image processing method, image processing device, storage medium and computer equipment can achieve the following technical effects: the initial image is divided into several first sub-images, and then the multi-threaded module is used to process the several first sub-images at the same time, and several second sub-images and several third sub-images are obtained successively, and finally the multi-threaded module is used to sequentially splice the several third sub-images into an output image according to the order of the several first sub-images obtained by dividing the initial image. Since the embodiment of the present application utilizes the multi-threaded module to process the several first sub-images obtained by the division respectively and simultaneously, the speed of image processing is greatly accelerated, the efficiency of image processing is improved, and the output image obtained in the end is exactly the same as the result of not using the multi-threaded module for processing. For images with larger memory, that is, the more rows and / or columns of the image, and the more pixels, the faster the image processing speed is, and the more obvious the efficiency improvement is. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a schematic diagram of an initial image 10 to be processed;
[0036] Figure 2 This is one embodiment of the 4-neighborhood image processing method;
[0037] Figure 3 Another embodiment of the 4-neighborhood image processing method;
[0038] Figure 4 The output image 10C is obtained by processing the initial image 10 using the conventional image processing method described in the background art;
[0039] Figure 5 is a step diagram of the image processing method;
[0040] Figure 6 Schematic diagram of dividing the initial image 10 into three first sub-images 10-1, 10-2 and 10-3;
[0041] Figure 7 A schematic diagram of a process of using a multi-thread module to process three first sub-images into three second sub-images and three third sub-images in sequence according to a four-neighborhood image processing method, and then splicing the three third sub-images into an output image 10C;
[0042] Figure 8 Schematic diagram of module connection of an image processing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as limiting the present invention; the terms "first", "second", and "third" are only used to describe the difference, and cannot be understood as indicating or implying relative importance. In addition, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate object, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0045] refer to Figure 5 , the embodiment of the present application discloses an image processing method, including:
[0046] Step 1: Divide the initial image into N first sub-images from left to right, and every two adjacent first sub-images have two common columns of image strips;
[0047] Step 2: using a multi-threaded module to simultaneously process N first sub-images according to a four-neighborhood image processing method to obtain N second sub-images;
[0048] Step 3: using a multi-thread module to process N pieces of the second sub-images simultaneously to obtain N pieces of the third sub-images;
[0049] Step 4: Use a multi-threaded module to sequentially stitch the N third sub-images into an output image.
[0050] Combine the following Figure 6 to Figure 7 Expand the description of the method described in step 1 to step 4.
[0051] Will Figure 6 The 5 rows×15 columns of pixels of the initial image 10 shown are divided into 3 first sub-images (i.e., N is 3 for example) in order from left to right: the first first sub-image 10-1, the second first sub-image 10-2, and the third first sub-image 10-3. The first first sub-image 10-1 is the image strips of 6 columns from the 1st column to the 6th column from the left of the initial image 10; the second first sub-image 10-2 is the image strips of 7 columns from the 5th column to the 11th column from the left of the initial image 10; the third first sub-image 10-3 is the image strips of 6 columns from the 10th column to the 15th column from the left of the initial image 10. Therefore, the number of columns of the image strips of the three first sub-images is not required to be the same. The first first sub-image 10-1 and the second first sub-image 10-2 have the 5th and 6th columns in common. The second first sub-image 10-2 and the third first sub-image 10-3 have the 10th and 11th columns in common. In addition, the first first sub-image 10-1 has 6 columns of image strips, the second first sub-image 10-2 has 7 columns of image strips, and the third first sub-image 10-3 has 7 columns of image strips, which is merely schematic. It can also be that the first first sub-image 10-1 has 5 columns of image strips, the second first sub-image 10-2 has 8 columns of image strips, and the third first sub-image 10-3 has 7 columns of image strips, as long as it satisfies the 4-neighborhood image processing method that every two adjacent first sub-images have two columns of image strips in common. In addition, the three first sub-images have the same number of rows, which are all 5 rows. It should be noted that if Figure 6 The initial image 10 shown is rotated 90° clockwise and then divided in order from top to bottom. Figure 6 The initial image 10 shown is divided from left to right, which is the same image division effect. Figure 6 The 5 rows×15 columns of pixels of the initial image 10 shown are divided in order from left to right and this should not be considered as a limitation on the order of dividing the image.
[0052] It should be noted that the number of columns of the common image strips between each two adjacent first sub-images is 2, which is based on the 4-neighborhood image processing method described in the image processing method as background technology. In other words, the number of columns of the common image strips between each two adjacent first sub-images is 2, which corresponds to the 4-neighborhood image processing method. If it is other image processing principles, the number of columns of the common image strips between each two adjacent first sub-images is not necessarily 2.
[0053] After the number of columns of the image strips of the three first sub-images is determined, the multi-threaded module stored in the computer is used to respectively Figure 2 and Figure 3 The 4-neighborhood image processing method shown in the figure is used to process the three second sub-images. The multi-threaded module can process multiple first sub-images at the same time, thereby speeding up the image processing process. The specific processing process is as follows: Figure 7 , the first sub-image 10-1 is converted into Figure 2 and Figure 3 The 4-neighborhood image processing method shown in the figure is used to process the first second sub-image 10-1A. When processing the first first sub-image 10-1, the rightmost 6th column image strip of the first sub-image 10-1 is retained without processing and is processed as the second column image strip from the left of the second second sub-image 10-2A. In addition, according to the 4-neighborhood image processing method, it can be known that since there are no other pixels outside the 1st row image strip, the 5th row image strip and the 1st column image strip on the left of the first first sub-image 10-1, all the black pixels they contain should be processed according to Figure 3 1 in the image, all should be processed into white pixels. In the process of processing the first first sub-image 10-1, the 5 pixels of the 1st row of image strips are processed from left to right, and then the 5 pixels of the 2nd row of image strips are processed from left to right... until the 5th pixel on the right of the 5th row of image strips is processed (if there are white pixels in the process, they do not need to be processed, such as the white pixels in the 1st row and the 1st column, and the white pixels in the 1st row and the 4th column). The first second sub-image 10-1A continues to be processed by the multi-threaded module: the rightmost 6th column of image strips is deleted, and the first third sub-image 10-1B containing 5 columns of image strips is obtained.
[0054] refer to Figure 7, the multi-thread module processes the second first sub-image 10-2. The second first sub-image 10-2 has two columns of image strips in common with the first first sub-image 10-1: the 5th column of image strips and the 6th column of image strips; and has two columns of image strips in common with the third first sub-image 10-3: the 10th column of image strips and the 11th column of image strips. The 5th column of image strips in the first first sub-image 10-1 is processed in the process of processing the first first sub-image 10-1 into the first second sub-image 10-1A. Therefore, in the second first sub-image 10-2, the 5th column of image strips remains the same as Figure 6 The same as the initial image 10 in the second first sub-image 10-2, no processing is required. Similarly, in the second first sub-image 10-2, the last 11th column of image strips on the rightmost side does not need to be processed, and is instead processed as the second column of image strips from the leftmost side of the third first sub-image 10-3. The sixth column of image strips from the edge of the initial image 10 is processed as the second column of image strips from the leftmost side of the second first sub-image 10-2. Therefore, in the second first sub-image 10-2, the image strips from the sixth column to the tenth column need to be processed. Similarly, when processing the image strips from the 6th column to the 10th column of the second first sub-image 10-2, the pixels are processed one by one in the order from left to right and from top to bottom according to the 4-neighborhood image processing method: the first pixel in the 1st row and the 1st column is processed first, and then the second pixel in the 1st row and the 2nd column is processed, until the pixel in the 10th column of the 1st row is processed, and then the second row is turned to process the 5 pixels in the 2nd row one by one in the order from left to right. The second second sub-image 10-2A obtained after processing is as follows: Figure 7 As shown. Figure 7 It can be seen from the figure that the first image strip on the leftmost column and the last image strip on the rightmost column of the second sub-image 10-2A and Figure 6 The 6th and 10th image strips are exactly the same and have not been processed. The first and last image strips are not processed in order to ensure the correctness of the 4-neighborhood image processing method. The leftmost 1st image strip and the rightmost last image strip of the second second sub-image 10-2A are deleted by the multi-thread module to obtain the second third sub-image 10-2B.
[0055] refer to Figure 7, the multi-thread module processes the third first sub-image 10-3, which is the last first sub-image. The third first sub-image 10-3 has two columns of image strips in common with the second first sub-image 10-2: the 10th column of image strips and the 11th column of image strips. Since the 10th column of image strips has been processed in the process of processing the second first sub-image 10-2 into the second second sub-image 10-2A, the 10th column of image strips (i.e., the leftmost first column of image strips of the third first sub-image 10-3) does not need to be processed twice in the process of processing the third first sub-image 10-3 into the third second sub-image 10-3A, and the image strips are kept and in the following manner: Figure 6 In the process of processing the third first sub-image 10-3 into the third second sub-image 10-3A, the processing of the image strips from the 11th column to the 15th column is still carried out according to the 4-neighborhood image processing method, and the pixels are processed row by row in the order from left to right and from top to bottom. The obtained third second sub-image 10-3A is as shown in FIG. Figure 7 The multi-thread module is used to convert the leftmost image strip of the first column of the third second sub-image 10-3A (i.e. Figure 6 The 10th column image strip in the initial image is deleted to obtain the third sub-image 10-3B.
[0056] Finally, the three third sub-images 10-1B, 10-2B and 10-3B are spliced in sequence using a multi-threaded module to obtain an output image 10C. The sequential splicing mentioned here means splicing the image strip of the 5th column on the right of the first third sub-image 10-1B and the image strip of the 1st column on the left of the second third sub-image 10-2B (equivalent to the image strip of the 6th column in the initial image) in the same row of pixels. The image strip of the 1st column on the right of the second third sub-image 10-2B (equivalent to the image strip of the 10th column in the initial image) and the image strip of the 1st column on the left of the third third sub-image 10-3B (equivalent to the image strip of the 11th column in the initial image) are spliced in the same row of pixels. The stitching of pixels in the same row with pixels in the same row mentioned here means: for example, stitching the first row of pixels of the leftmost 1st column image strip of the second third sub-image 10-2B to the right of the first row of pixels of the rightmost 5th column image strip of the first third sub-image 10-1B; stitching the second row of pixels of the leftmost 1st column image strip of the second third sub-image 10-2B to the right of the second row of pixels of the rightmost 5th column image strip of the first third sub-image 10-1B.
[0057] It can be seen that Figure 7 The output image 10C obtained after being processed by the multi-thread module is completely the same as the output image 10C obtained by processing by the 4-neighborhood image processing method without using the multi-thread module in the background art.
[0058] It should be noted that the multi-thread module processes the three first sub-images at the same time, rather than processing the first first sub-image, the second first sub-image, and the third first sub-image in sequence. It can be understood that the more blocks of the first sub-images that the initial image is divided into (the larger N is), the more obvious the improvement in efficiency reflected by the multi-thread module processing.
[0059] It is understandable that in the embodiment of the present application, the initial image is divided into several first sub-images, and the several first sub-images are processed simultaneously by the multi-threaded module to obtain several second sub-images and several third sub-images in succession, and finally the several third sub-images are spliced to obtain the output image. This processing method speeds up the image processing speed and improves the image processing efficiency, and the output image finally obtained is exactly the same as the result without the multi-threaded module processing. For images with larger memory, that is, the more rows and / or columns of the image, the more pixels, the faster the image processing speed is and the more obvious the efficiency improvement is when this method is used.
[0060] It should be noted that the 4-neighborhood image processing method used in this application is only exemplary. For example, it can also be an 8-neighborhood image processing method, an image corrosion processing method, and an image expansion processing method. The core idea of this application is to divide the initial image with a large memory into several first sub-images, and then use the multi-threaded module to process several first sub-images at the same time, so that the image processing process is greatly accelerated, which is much more efficient than processing the pixels of the initial image with a large memory in a row-by-column order one by one. In this application, the multi-threaded module technology belongs to the prior art and will not be described in detail here.
[0061] refer to Figure 8 , the present application also discloses an image processing device, comprising: a segmentation module, for: segmenting an initial image into N first sub-images in order from left to right, where each two adjacent first sub-images have two common columns of image strips;
[0062] A first processing module is used to: use a multi-thread module to process N first sub-images according to a 4-neighborhood image processing method simultaneously to obtain N second sub-images;
[0063] A second processing module is used to: use a multi-thread module to process N pieces of the second sub-images simultaneously to obtain N pieces of the third sub-images;
[0064] The splicing module is used to: use the multi-threading module to sequentially splice the N third sub-images into an output image.
[0065] In some embodiments, in the first processing module, when N frames of the first sub-images are processed simultaneously, except for the rightmost column of image strips of the leftmost first sub-image, and the leftmost column of image strips of the rightmost last first sub-image, the leftmost first column of image strips and the rightmost last column of image strips of any other first sub-image do not need to be processed.
[0066] In some embodiments, the specific processing process of the second processing module is:
[0067] Step 31: Delete the rightmost column of the leftmost first second sub-image to obtain the first third sub-image;
[0068] Step 32: Delete the leftmost first column of image strips and the rightmost last column of image strips of each of the second sub-images from the left to the N-1th second sub-image, to obtain N-2 third sub-images;
[0069] Step 33: Delete the leftmost first column of the last second sub-image to obtain the Nth third sub-image;
[0070] Among them, step 31, step 32 and step 33 are performed simultaneously without any particular order.
[0071] The respective functions and relationships of the segmentation module, the first processing module, the second processing module and the stitching module in the image processing device have been described in detail when introducing the image processing method, and will not be repeated here.
[0072] The present application also discloses a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned image processing method can be implemented. Storage medium refers to a carrier for storing data. For example, a floppy disk, an optical disk, a DVD, a hard disk, a flash memory, a USB flash disk, a CF card, an SD card, an MMC card, a SM card, a memory stick (Memory Stick), an xD card, etc. Popular storage media are media based on flash memory (Nand flash), such as a USB flash disk, a CF card, an SD card, an SDHC card, an MMC card, a SM card, a memory stick, an XD card, etc.
[0073] The embodiment of the present application also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the aforementioned image processing method when executing the program. The processor includes a kernel, and the kernel retrieves the corresponding program unit from the memory, and one or more kernels may be provided. The memory may include a non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory, such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one storage chip.
[0074] The storage medium and computer device disclosed in the present application can achieve the technical effect of improving the processing efficiency of large memory images.
[0075] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An image processing method, applied to the field of laser direct writing technology, characterized in that: include: Step 1: Divide the initial image into N first sub-images from left to right, and every two adjacent first sub-images have two common columns of image strips; Step 2: using a multi-threaded module to simultaneously process N first sub-images according to a four-neighborhood image processing method to obtain N second sub-images; Step 3: using a multi-thread module to process N pieces of the second sub-images simultaneously to obtain N pieces of the third sub-images; Step 4: using a multi-thread module to sequentially stitch the N third sub-images into an output image; Among them, step 3 is specifically as follows: Step 31: Delete the rightmost column of the leftmost first second sub-image to obtain the first third sub-image; Step 32: Delete the leftmost first column of image strips and the rightmost last column of image strips of each of the second sub-images from the left to the N-1th second sub-image, to obtain N-2 third sub-images; Step 33: Delete the leftmost first column of the last second sub-image on the rightmost side to obtain the Nth third sub-image; Step 31, step 32 and step 33 are performed simultaneously without any particular order; The 4-neighborhood image processing method is as follows: when the upper, lower, left and right four pixels adjacent to the black pixel at the center are all black pixels, the black pixel at the center is retained; when at least one of the upper, lower, left and right four pixels adjacent to the black pixel at the center is a white pixel, the black pixel at the center needs to be processed into a white pixel.
2. The image processing method according to claim 1, characterized in that: In step 2, when N frames of the first sub-images are processed simultaneously, except for the rightmost column of image strips of the leftmost first sub-image and the leftmost column of image strips of the rightmost last first sub-image, the leftmost first column of image strips and the rightmost last column of image strips of any other first sub-images do not need to be processed.
3. The image processing method according to claim 1, characterized in that: In step 4, sequential stitching means: in the order of the N first sub-images obtained after dividing the initial image, the leftmost column of image strips of any third sub-image corresponding one to the N first sub-images and the rightmost column of image strips of the previous third sub-image are spliced according to the number of rows.
4. The image processing method according to claim 1, wherein: The number of columns of the image strips of each first sub-image may not be the same.
5. An image processing device, applied in the field of laser direct writing technology, characterized in that: include: A segmentation module is used to: segment the initial image into N first sub-images in order from left to right, where every two adjacent first sub-images have two common columns of image strips; A first processing module is used to: use a multi-thread module to process N first sub-images according to a 4-neighborhood image processing method simultaneously to obtain N second sub-images; A second processing module is used to: use a multi-thread module to process N pieces of the second sub-images simultaneously to obtain N pieces of the third sub-images; A splicing module, used to: use a multi-thread module to sequentially splice the N third sub-images into an output image; Among them, in the second processing module, the specific steps for: using the multi-thread module to process the N second sub-images simultaneously are: Step 31: Delete the rightmost column of the leftmost first second sub-image to obtain the first third sub-image; Step 32: Delete the leftmost first column of image strips and the rightmost last column of image strips of each of the second sub-images from the left to the N-1th second sub-image, to obtain N-2 third sub-images; Step 33: Delete the leftmost first column of the last second sub-image on the rightmost side to obtain the Nth third sub-image; Step 31, step 32 and step 33 are performed simultaneously without any particular order; The 4-neighborhood image processing method is as follows: when the upper, lower, left and right four pixels adjacent to the black pixel at the center are all black pixels, the black pixel at the center is retained; when at least one of the upper, lower, left and right four pixels adjacent to the black pixel at the center is a white pixel, the black pixel at the center needs to be processed into a white pixel.
6. The image processing device according to claim 5, characterized in that: When N first sub-images are processed simultaneously, except for the rightmost column of image strips of the leftmost first sub-image and the leftmost column of image strips of the rightmost last first sub-image, the leftmost first column of image strips and the rightmost last column of image strips of any other first sub-images do not need to be processed.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 4 are implemented.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the image processing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Multiprocessor-embedded image acquisition and processing method and device
CN102510448A
Data processing method and data processing system of laser direct writing equipment and related equipment
CN116382042A