Image processing method, printing method, printing-related device and readable storage medium
By performing blurring and contrast stretching of edge pixel points on the layer slice images of the 3D printed model, the problem of obvious layer texture of the pixels of the printing model is solved and the model quality is improved.
Patent Information
- Application Number
- CN202110734089.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-06-30
AI Technical Summary
The existing 3D printing method leads to the obvious pixel texture of the printing model, affecting the model quality.
By acquiring the layer slice image of the model to be printed, blurring and contrast stretching of edge pixel points are performed to generate a new intermediate image to adjust the grayscale value of edge pixel points, control the degree of resin curing, and reduce pixel layer texture.
Effectively reduce the pixel texture of the printing model and improve the model quality.
Smart Images

Figure CN113409222B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of printing technology, and in particular to an image processing method, a printing method, a printing-related device and a readable storage medium. Background Art
[0002] With the development of three-dimensional (3D) printing technology, 3D printing equipment has been widely used, especially photocuring printing equipment. In the process of using photocuring printing equipment for 3D printing, it is necessary to use an ultraviolet light source to expose the layer slice image, and the resin is cured layer by layer according to the exposure conditions to form a printed model. Since the existing printing method is based on direct curing of the layer slice image, the resin at the corresponding position of the edge pixel point of each layer slice image is cured, so the pixel layer texture of the obtained printed model is more obvious. Summary of the invention
[0003] The embodiments of the present invention provide an image processing method, a printing method, a printing-related device and a readable storage medium to solve the problem that the pixel layer patterns of the printed model obtained by the existing printing method are relatively obvious.
[0004] In a first aspect, an embodiment of the present invention provides an image processing method, the method comprising:
[0005] Obtain N layer slice images of the model to be printed, where N is a positive integer;
[0006] Performing blur processing on edge pixel points in the N layer slice images to obtain N first intermediate images;
[0007] Performing contrast stretching processing on the N first intermediate images to obtain N second intermediate images, wherein the to-be-printed model is generated based on the N second intermediate images. Optionally, performing blurring processing on edge pixels in the N layer slice images to obtain the N first intermediate images includes:
[0008] Binarizing the N layer slice images to obtain N binary images;
[0009] Obtain edge pixel points corresponding to each of the N binary images;
[0010] The edge pixels in the N layer slice images are blurred to obtain N first intermediate images.
[0011] Optionally, obtaining edge pixel points corresponding to each of the N binary images includes:
[0012] Obtaining neighborhood pixel values of a first pixel in a binary image to be determined, wherein the binary image to be determined is any one of the N binary images, the first pixel is any pixel in the binary image to be determined, and the neighborhood pixel values are pixel values of each pixel adjacent to the first pixel;
[0013] In the case where the neighborhood pixel values include at least one first pixel value, determining the first pixel point as an edge pixel point corresponding to the binary image to be determined, the first pixel value is used to represent the pixel value corresponding to black. Optionally, blurring the edge pixel points in the N layer slice images to obtain N first intermediate images includes:
[0014] Acquire a fuzzy processing parameter, where the fuzzy processing parameter is determined according to a first input, where the first input is an input operation performed by a user on the fuzzy processing parameter;
[0015] Based on the blur processing parameters, determining a sliding window involved in blur processing, wherein the sliding window is used to determine a set of pixel points involved in blur processing each time in a first layer slice image, wherein the first layer slice image is any layer slice image among the N layer slice images;
[0016] Based on the sliding window, sequentially obtaining target grayscale values corresponding to edge pixels in the first layer of slice image;
[0017] A first intermediate image corresponding to the first layer slice image is determined according to the target grayscale value.
[0018] Optionally, sequentially acquiring target grayscale values corresponding to edge pixels in the first layer of slice image based on the sliding window includes:
[0019] Sliding the sliding window in sequence in the first slice image according to a preset step length, where the preset step length is used to represent the distance that the sliding window moves each time;
[0020] When the pixel point corresponding to the target position of the sliding window is a first edge pixel point, a convolution calculation is performed on the pixel point set corresponding to the current sliding window and a preset convolution kernel to obtain a convolution result, where the preset convolution kernel is an M*M matrix, the value of M is determined according to the blur processing parameter, M is an integer greater than 1, and the first edge pixel point is any edge pixel point in the first layer slice image;
[0021] According to the convolution result, a target grayscale value of the first edge pixel is determined.
[0022] Optionally, before blurring edge pixels in the N layer slice images to obtain N first intermediate images, the method further includes:
[0023] Performing anti-aliasing processing on the N layer slice images;
[0024] The step of performing blurring processing on edge pixels in the N layer slice images to obtain N first intermediate images includes:
[0025] The edge pixels in the N layer slice images after anti-aliasing processing are blurred to obtain N first intermediate images.
[0026] Optionally, performing contrast stretching processing on the N first intermediate images to obtain N second intermediate images includes:
[0027] Acquire a target grayscale level, where the target grayscale level is determined according to a second input, where the second input is an input operation performed by a user on the grayscale level;
[0028] Determining the grayscale value corresponding to the target grayscale level based on a preset mapping relationship, wherein the preset mapping relationship is used to indicate a mapping relationship between the grayscale level and the grayscale value;
[0029] According to the grayscale value corresponding to the target grayscale level, the grayscale value of each pixel in the N first intermediate images is adjusted to obtain N second intermediate images.
[0030] In a second aspect, an embodiment of the present invention further provides a printing method, the printing method comprising:
[0031] Acquire an image to be printed, and print a model according to the image to be printed; wherein the image to be printed is N second intermediate images generated by the image processing method described in the first aspect.
[0032] In a third aspect, an embodiment of the present invention further provides a printing system, the printing system comprising: an image processing apparatus and a printing device;
[0033] The image processing device is used to execute the image processing method described in the first aspect;
[0034] The printing device uses the N second intermediate images output by the image processing device and obtains the model to be printed based on the N second intermediate images.
[0035] In a fourth aspect, an embodiment of the present invention further provides a printing device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method as described in the first aspect.
[0036] In a fifth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the image processing method described in the first aspect are implemented.
[0037] In an embodiment of the present invention, N layer slice images of a model to be printed are obtained, where N is a positive integer; N first intermediate images are obtained by blurring the edge pixels in the N layer slice images; N second intermediate images are obtained by contrast stretching the N first intermediate images, wherein the model to be printed is generated based on the N second intermediate images. In this way, the edge pixels in the N layer slice images of the model to be printed can be blurred and contrast stretched, so that the grayscale values of the edge pixels in the N layer slice images can be adjusted, thereby effectively controlling the curing degree of the resin at the position corresponding to the edge pixel, thereby effectively reducing the pixel layer lines of the model to be printed and improving the quality of the model to be printed. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0039] Figure 1 A flowchart of an image processing method provided by an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of 4 neighborhoods provided in an embodiment of the present invention;
[0041] Figure 3 A flowchart of a printing method provided by an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of the structure of a printing system provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a printing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] 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 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.
[0045] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0046] The present invention provides an image processing method. Figure 1 , Figure 1 Flow chart of the image processing method provided by the embodiment of the present invention. Figure 1 As shown, the method may specifically include the following steps:
[0047] Step 101: Obtain N layer slice images of a model to be printed, where N is a positive integer.
[0048] Specifically, the above-mentioned model to be printed can be any model that needs to be 3D printed, such as daily necessities, architectural models, appliances, etc. The above-mentioned layer slice image refers to an image obtained by processing the graphic file containing the model to be printed through a preset graphic processing tool. In the process of processing through the preset image processing tool, the three-dimensional stereoscopic model needs to be cut into layer slices of preset thickness, and each layer slice corresponds to an image, that is, a layer slice image.
[0049] It should be noted that, since the thickness of each layer slice is very thin, the above layer slice images can be regarded as two-dimensional images. Each model to be printed can include N layer slice images, and N can be any positive integer such as 1, 2, 3, 4, ... For example, assuming that the model to be printed is a cube with a side length of N pixels, it is sliced in the height direction according to the thickness of one pixel, and finally N layer slice images can be obtained. In this way, these N layer slice images are superimposed together to form a cube with a side length of N pixels.
[0050] Step 102: blur edge pixels in N layer slice images to obtain N first intermediate images.
[0051] In this step, edge pixel points in each layer slice image can be obtained respectively, and then the edge pixel points in each layer slice image can be blurred to obtain N first intermediate images. The number of the first intermediate images is the same as the number of the layer slice images. The blurring process here can be linear filtering, such as mean filtering, median filtering and Gaussian filtering, or nonlinear filtering, such as bilateral filtering, which is not specifically limited in this embodiment.
[0052] Step 103: Perform contrast stretching processing on the N first intermediate images to obtain N second intermediate images, wherein the model to be printed is generated based on the N second intermediate images.
[0053] The contrast stretching process is to adjust the grayscale value of each pixel in the N first intermediate images. Specifically, each pixel in the first intermediate image may be increased to the same grayscale value, or each pixel in the first intermediate image may be increased to a different grayscale value, which is not specifically limited in this embodiment. The number of the second intermediate images is the same as the number of the first intermediate images.
[0054] It should be noted that the above-mentioned image processing method can be executed by a printing device, or by an electronic device independent of the printing device, such as a computer, a notebook, a tablet computer, a mobile terminal, etc., and this embodiment does not make any specific limitation.
[0055] After the N second intermediate images are acquired, a model to be printed may be generated based on the N second intermediate images.
[0056] Specifically, if the above image processing method is executed by a printing device, the printing device can directly expose and cure the N second intermediate images to obtain a model to be printed; if the above image processing method is executed by an electronic device, the electronic device can compress the N second intermediate images to generate a slice file of the model to be printed. After the printing device obtains the slice file, it can decompress the slice file and expose and cure the N second intermediate images in the slice file to finally obtain the model to be printed.
[0057] In this embodiment, the edge pixel points in the N layer slice images of the model to be printed can be blurred and contrast stretched, so that the grayscale values of the edge pixel points in the N layer slice images can be adjusted, thereby effectively controlling the degree of curing of the resin at the position corresponding to the edge pixel points, thereby effectively reducing the pixel layer lines of the model to be printed and improving the quality of the model to be printed.
[0058] Furthermore, the above step 102, performing blur processing on edge pixels in the N layer slice images to obtain N first intermediate images, may specifically include the following steps:
[0059] Binarization is performed on N layer slice images to obtain N binary images;
[0060] Obtain edge pixel points corresponding to each binary image in N binary images;
[0061] The edge pixels in the N layer slice images are blurred to obtain N first intermediate images.
[0062] Specifically, the above-mentioned binarization process refers to setting the grayscale value of the pixel on the image to 0 or 255, that is, the process of making the entire image present an obvious black and white effect. For example, when the grayscale value of a certain pixel in the image is less than or equal to the preset threshold, it is represented by a grayscale value of 0; when the grayscale value of a certain pixel in the image is greater than the preset threshold, it is represented by a grayscale value of 255. It should be noted that the preset threshold here can be set according to actual needs, and this embodiment does not make a specific limitation.
[0063] The above binary image is a black and white image, which can highlight the outline of the layer slice image. In the binary image, the white area represents the image area that needs to be printed on the layer slice image, and the black area represents the blank area that does not need to be printed on the layer slice image. Then the pixel points located at the adjacent positions of the white area and the black area are the edge pixels.
[0064] After determining the edge pixel points of the N binary images, the edge pixel points in each layer slice image may be blurred to obtain N first intermediate images. The blurring process here may be performed by linear filtering, such as mean filtering, median filtering, and Gaussian filtering, or by nonlinear filtering, such as bilateral filtering, which is not specifically limited in this embodiment.
[0065] In this embodiment, by binarizing N layer slice images, the edge pixel points corresponding to each binary image are determined, thereby realizing blurring of the edge pixel points in the N layer slice images. Compared with blurring all the pixels in the entire layer slice image, the blurring efficiency can be greatly improved.
[0066] Furthermore, the above step of obtaining edge pixel points corresponding to each of the N binary images may specifically include the following steps:
[0067] Obtaining neighborhood pixel values of a first pixel in a binary image to be determined, where the binary image to be determined is any one of N binary images, the first pixel is any pixel in the binary image to be determined, and the neighborhood pixel values are pixel values of each pixel adjacent to the first pixel;
[0068] In the case where the neighborhood pixel values include at least one first pixel value, the first pixel point is determined to be an edge pixel point corresponding to the binary image to be determined, and the first pixel value is used to represent the pixel value corresponding to black.
[0069] In one embodiment, after acquiring N binary images, the neighborhood pixel values of the first pixel point in the binary image to be judged can be acquired. When the neighborhood pixel values of the first pixel point include at least one first pixel value, the first pixel point is an edge pixel point; when the neighborhood pixel values of the first pixel point do not include the first pixel value, the first pixel point is a non-edge pixel point. The above-mentioned binary image to be judged is any one of the N binary images, and the above-mentioned first pixel point is any pixel point in the binary image to be judged. The above-mentioned neighborhood pixel value refers to the pixel value of the pixel point adjacent to the first pixel point, and the above-mentioned first pixel value refers to the pixel value with a gray value of 0, that is, the first pixel value is a pixel value that displays black. Figure 2 As shown, the pixel values of the four neighboring pixels of the first pixel in the four directions of a, b, c and d can be obtained respectively as the neighborhood pixel values of the first pixel. When the gray value of only one pixel among the pixel values of the four neighboring pixels is 0, it means that there is a blank area in at least one direction of the first pixel, and thus the first pixel can be considered as an edge pixel.
[0070] Of course, as another implementation, the pixel values of the eight neighboring pixels of the first pixel can also be obtained as the neighborhood pixel values of the first pixel to determine whether the first pixel is an edge pixel. This application does not make specific limitations.
[0071] In this embodiment, the layer slice image can be binarized and the neighborhood pixel points of each first pixel point in the layer slice image can be obtained. Then, based on the pixel values of the neighborhood pixel points, it can be determined whether the first pixel point is an edge pixel point, thereby making the detection of edge pixel points in the layer slice image more accurate.
[0072] Furthermore, the above step of blurring edge pixels in the N layer slice images to obtain N first intermediate images includes:
[0073] Obtaining a fuzzy processing parameter, where the fuzzy processing parameter is determined according to a first input, where the first input is an input operation performed by a user on the fuzzy processing parameter;
[0074] Based on the fuzzy processing parameters, a sliding window participating in the fuzzy processing is determined, where the sliding window is used to determine a set of pixel points participating in the fuzzy processing each time in a first layer slice image, where the first layer slice image is any layer slice image among the N layer slice images;
[0075] Based on the sliding window, the target grayscale value corresponding to each edge pixel point in the first layer slice image is obtained in sequence;
[0076] According to the target grayscale value, determine the first intermediate image corresponding to the first layer slice image. Specifically, the above-mentioned blur processing parameter can be understood as the number of layers for blurring the edge pixels in each layer slice image, and the blur processing parameter can be any value such as 2, 3, 4 or 5. It should be noted that the blur processing parameter can be pre-set or determined based on the user's first input, and this application does not make specific restrictions. When the blur processing parameter is determined based on the user's first input, the user can select the blur processing parameter based on the user interface or physical button, and input the first input according to the selection result, so as to realize flexible setting of the blur processing parameter. The first input here includes but is not limited to operations such as sliding and clicking on the user interface, or pressing physical buttons.
[0077] After determining the blur processing parameters, the sliding window involved in the blur processing can be determined based on the blur processing parameters. For example, when the blur processing parameter is 2, the sliding window is a window of 2 pixels * 2 pixels; when the blur processing parameter is 3, the sliding window is a window of 3 pixels * 3 pixels; when the blur processing parameter is 4, the sliding window is a window of 4 pixels * 4 pixels, etc. In this way, when the sliding window slides in the first layer of slice images, the set of pixels involved in the blur processing after each sliding of the sliding window can be determined. Therefore, based on the sliding window, the edge pixels in the first layer of slice images can be blurred in turn to obtain the target grayscale value corresponding to each edge pixel, thereby obtaining the first intermediate image corresponding to the first layer of slice images.
[0078] In this embodiment, the blur processing parameters can be flexibly set. The user can select appropriate blur processing parameters according to the actual conditions of the layer slice image and the printing device to perform blur processing on the edge pixels to increase the flexibility of blur processing.
[0079] Furthermore, the above step of sequentially acquiring the target grayscale value corresponding to each edge pixel point in the first layer slice image based on the sliding window may include the following steps:
[0080] Sliding the sliding window in sequence in the first slice image according to a preset step length, where the preset step length is used to represent the distance the sliding window moves each time;
[0081] When the pixel point corresponding to the target position of the sliding window is the first edge pixel point, the pixel point set corresponding to the current sliding window is convolved with the preset convolution kernel to obtain the convolution result, the preset convolution kernel is an M*M matrix, the value of M is determined according to the blur processing parameter, M is an integer greater than 1, and the first edge pixel point is any edge pixel point in the first layer slice image;
[0082] According to the convolution result, the target grayscale value of the first edge pixel is determined. Specifically, the size of the convolution kernel is proportional to the size of the blur processing parameter. For example, when the blur processing parameter is 2, the size of the convolution kernel is 2*2; when the blur processing parameter is 3, the size of the convolution kernel is 3*3; when the blur processing parameter is 4, the size of the convolution kernel is 4*4, etc.
[0083] When performing blur processing, the sliding window needs to scan each pixel in the first layer of slice image line by line according to the preset step size. When the first edge pixel is located at the target position of the sliding window, each pixel in the sliding window can be convolved with the convolution kernel to obtain the target grayscale value of the first edge pixel. It should be noted that the preset step size here can be any length such as 1 pixel length, 2 pixel lengths, 3 pixel lengths, etc. In order to realize the traversal of all edge pixels, 1 pixel length can be selected as the preset step size. The target position here refers to any fixed position in the sliding window. For example, assuming that the sliding window is a window of 2 pixels * 2 pixels, the position corresponding to any pixel in [0,0], [0,1], [1,0] and [1,1] in the sliding window can be selected as the target position. In order to achieve a better blurring effect, the middle position of the sliding window can be selected as the target position. For example, when the sliding window is a 3-pixel*3-pixel window, the position corresponding to the [1,1] pixel can be selected as the target position of the sliding window. At the same time, in order to be able to traverse each pixel of the entire layer slice image, the pixel values of 0 can be filled on the outer edges of the layer slice image.
[0084] After each sliding of the sliding window, it is necessary to determine whether the pixel corresponding to the target position is an edge pixel. If the pixel corresponding to the target position is an edge pixel, a convolution calculation is performed; if the pixel corresponding to the target position is a non-edge pixel, no convolution calculation is performed and the window is directly slid to the next pixel. This is repeated until all edge pixels on a certain layer of slice image are traversed, and the sliding window is stopped. The first intermediate image is obtained based on the convolution result of each convolution calculation.
[0085] In this embodiment, each pixel point in the sliding window, that is, the first edge pixel point and other pixel points around the first edge pixel, can be involved in the convolution calculation, so that the convolution result obtained includes the gray value characteristics of the first edge pixel point and its neighborhood pixel points, thereby making the blurring effect of the first edge pixel point better.
[0086] Furthermore, in the above step 102, before blurring the edge pixels in the N layer slice images to obtain N first intermediate images, the method further includes:
[0087] Perform anti-aliasing processing on N layer slice images;
[0088] The above step 102, performing blur processing on edge pixels in N layer slice images to obtain N first intermediate images, includes:
[0089] The edge pixels in the N layer slice images after anti-aliasing processing are blurred to obtain N first intermediate images.
[0090] Specifically, the above-mentioned anti-aliasing processing methods include but are not limited to: Super-Sampling Anti-aliasing (SSAA), Multi-Sampling Anti-Aliasing (MSAA), Coverage Sampling Anti-Aliasing (CSAA), Custom Filter Anti-Aliasing (CFAA), Fast Approximate Anti-Aliasing (FXAA), etc.
[0091] When anti-aliasing processing is performed on the N layer slice images, image anti-aliasing processing can be performed according to preset anti-aliasing level parameters, so that the edges of the layer slice images are smoother. The anti-aliasing level here can be pre-set or determined based on the user's input operation, and this application does not make specific limitations. After anti-aliasing processing is performed on the N layer slice images, blurring processing can be performed based on the edge pixels in the N layer slice images after anti-aliasing processing. The specific blurring processing process has been described in detail in the above embodiment and will not be repeated here.
[0092] In this embodiment, the layer slice image may be firstly subjected to anti-aliasing processing to make the edge of the layer slice image smooth, and then subjected to blurring processing on this basis, thereby achieving a better processing effect.
[0093] Furthermore, the above step 103, performing contrast stretching processing on the N first intermediate images to obtain N second intermediate images, includes:
[0094] Acquire a target grayscale level, where the target grayscale level is determined according to a second input, where the second input is an input operation performed by a user on the grayscale level;
[0095] Determine the grayscale value corresponding to the target grayscale level based on a preset mapping relationship, where the preset mapping relationship is used to indicate the mapping relationship between the grayscale level and the grayscale value;
[0096] According to the grayscale value corresponding to the target grayscale level, the grayscale value of each pixel in the N first intermediate images is adjusted to obtain N second intermediate images.
[0097] Specifically, the above-mentioned target grayscale level can be understood as a level parameter for adjusting the grayscale value of the first intermediate image, and the target grayscale level can be any value such as 2, 3, 4 or 5. It should be noted that the target grayscale level can be pre-set or determined based on the user's second input, and this application does not make specific limitations. When the target grayscale level is determined based on the user's second input, the user can select the target grayscale level based on the user interface or physical button, and input the second input operation according to the selection result, so as to realize flexible setting of the target grayscale level. The second input here includes but is not limited to operations such as sliding and clicking on the user interface, or pressing physical buttons.
[0098] The above preset mapping relationship is used to indicate the mapping relationship between different grayscale levels and different grayscale values. For example, assuming that 16 grayscales are needed to represent grayscale values in the range of 0 to 255, the preset mapping relationship can be as shown in the following table:
[0099] Grayscale 0 1 2 3 4 5 6 7 Gray value 15 31 47 63 79 95 111 127 Grayscale 8 9 10 11 12 13 14 15 Gray value 143 159 175 191 207 223 239 255
[0100] Table 1
[0101] In this way, N first intermediate images can be subjected to contrast stretching based on the target grayscale level and the preset mapping relationship to obtain N second intermediate images. For example, assuming that the target grayscale level selected by the user is 2, the grayscale value of each pixel on each first intermediate image can be increased by 47 to obtain N second intermediate images. Since this process is actually also an adjustment of the grayscale value of the pixel, the curing degree of the corresponding pixel can be changed according to the adjustment result of the grayscale value during printing.
[0102] It should be noted that due to the differences between different printing devices, the grayscale distribution energy curves of different printing devices often have individual differences, that is, the grayscale value range of each printing device for resin curing will be different. This requires users to set different target grayscale levels based on the different grayscale distribution energy curves of each printing device, so that each printing device can achieve a better curing effect and reduce the appearance of pixel layer lines.
[0103] In this embodiment, the target grayscale level can be flexibly set by the user. The user can adjust the target grayscale level according to the current curing effect of the printing device to achieve the best printing state of the printing device.
[0104] See also Figure 3 , Figure 3 Flow chart of the printing method provided by the embodiment of the present invention. Figure 3 As shown, the printing method includes:
[0105] Step 301 : Acquire the image to be printed, and print the model according to the image to be printed; wherein the image to be printed is N second intermediate images generated by the above-mentioned image processing method.
[0106] In this embodiment, the printing method is performed by a printing device, and the image processing method is performed by an electronic device independent of the printing device. The electronic device can perform the above steps 101 to 103 to generate N second intermediate images. For the specific implementation process, please refer to Figure 1 The illustrated embodiments will not be described in detail here.
[0107] After the electronic device generates N second intermediate images, the user can manually copy the file containing the N second intermediate images to the printing device, or transmit the file containing the N second intermediate images from the electronic device to the printing device by wired or wireless means, so that the printing device can obtain the image to be printed and print the model according to the image to be printed.
[0108] In this embodiment, by separating the image processing process and the model printing process and implementing them by different devices, the processing pressure of the printing device can be reduced. At the same time, the problem that the printing device cannot print or has a low printing efficiency during the image processing process can be solved.
[0109] In addition, the present application also provides a printing system. Figure 4 , Figure 4 This is a schematic diagram of the structure of the printing system provided in the embodiment of the present application. Figure 4 As shown, the printing system 400 includes: an image processing device 401 and a printing device 402;
[0110] An image processing device 401, configured to execute the above-mentioned image processing method;
[0111] The printing device 402 uses the N second intermediate images output by the image processing device 401 and obtains a model to be printed according to the N second intermediate images.
[0112] In the printing system, the image processing method is performed by the image processing device 401, which can be any electronic device independent of the printing device 402. The user can manually copy the file containing the N second intermediate images to the printing device 402, or transmit the file containing the N second intermediate images from the electronic device to the printing device 402 by wire or wirelessly. In this way, the printing device 402 can obtain the N second intermediate images; and sequentially expose and cure the N second intermediate images to obtain the model to be printed.
[0113] Specifically, the image processing device 401 includes:
[0114] An acquisition module is used to acquire N layer slice images of the model to be printed, where N is a positive integer;
[0115] A first processing module, used for performing blur processing on edge pixels in N layer slice images to obtain N first intermediate images;
[0116] The second processing module is used to perform contrast stretching processing on the N first intermediate images to obtain N second intermediate images, wherein the model to be printed is generated based on the N second intermediate images.
[0117] Optionally, the first processing module includes:
[0118] The first sub-processing module is used to perform binarization processing on the N layer slice images to obtain N binary images;
[0119] The first acquisition submodule is used to acquire edge pixel points corresponding to each binary image in N binary images;
[0120] The second sub-processing module is used to perform blur processing on edge pixels in the N layer slice images to obtain N first intermediate images.
[0121] Optionally, the first acquisition submodule includes:
[0122] A first acquisition unit is used to acquire neighborhood pixel values of a first pixel point in a binary image to be determined, where the binary image to be determined is any one of the N binary images, the first pixel point is any pixel point in the binary image to be determined, and the neighborhood pixel values are pixel values of each pixel point adjacent to the first pixel point;
[0123] The first determination unit is used to determine that a first pixel point is an edge pixel point corresponding to the binary image to be determined when the neighborhood pixel values include at least one first pixel value, and the first pixel value is used to represent the pixel value corresponding to black.
[0124] Optionally, the second sub-processing module includes:
[0125] A second acquisition unit is used to acquire a fuzzy processing parameter, where the fuzzy processing parameter is determined according to a first input, where the first input is an input operation performed by a user on the fuzzy processing parameter;
[0126] A second determining unit is used to determine a sliding window involved in blur processing based on a blur processing parameter, wherein the sliding window is used to determine a set of pixel points involved in blur processing each time in a first layer slice image, wherein the first layer slice image is any layer slice image among the N layer slice images;
[0127] A third acquisition unit is used to sequentially acquire the target grayscale value corresponding to each edge pixel point in the first layer slice image based on the sliding window;
[0128] The third determining unit is used to determine the first intermediate image corresponding to the first layer slice image according to the target gray value.
[0129] Optionally, the third acquisition unit is specifically used for:
[0130] Sliding the sliding window in sequence in the first slice image according to a preset step length, where the preset step length is used to represent the distance the sliding window moves each time;
[0131] When the pixel point corresponding to the target position of the sliding window is the first edge pixel point, the pixel point set corresponding to the current sliding window is convolved with the preset convolution kernel to obtain the convolution result, the preset convolution kernel is an M*M matrix, the value of M is determined according to the blur processing parameter, M is an integer greater than 1, and the first edge pixel point is any edge pixel point in the first layer slice image;
[0132] According to the convolution result, the target grayscale value of the first edge pixel is determined.
[0133] Optionally, the image processing device 401 further includes:
[0134] The third processing module is used to perform anti-aliasing processing on the N layer slice images;
[0135] The first processing module is further used to perform blurring processing on edge pixels in the N layer slice images after anti-aliasing processing to obtain N first intermediate images.
[0136] Optionally, the second processing module includes:
[0137] A second acquisition submodule, used for acquiring a target grayscale level, where the target grayscale level is determined according to a second input, where the second input is an input operation performed by a user on the grayscale level;
[0138] A determination submodule, used to determine the grayscale value corresponding to the target grayscale level based on a preset mapping relationship, where the preset mapping relationship is used to indicate a mapping relationship between the grayscale level and the grayscale value;
[0139] The adjustment submodule adjusts the grayscale value of each pixel in the N first intermediate images according to the grayscale value corresponding to the target grayscale level to obtain N second intermediate images.
[0140] The image processing device 401 can realize the embodiment of the present invention. Figure 1 The various processes of the method embodiment and the same beneficial effects are achieved, and will not be described again here to avoid repetition.
[0141] Specifically, the printing device 402 includes:
[0142] The printing module is used to obtain the image to be printed and print the model according to the image to be printed; wherein the image to be printed is the N second intermediate images generated by the above-mentioned image processing method.
[0143] Specifically, the printing device 402 can implement the embodiment of the present invention. Figure 3 The various processes of the method embodiment and the same beneficial effects are achieved, and will not be described again here to avoid repetition.
[0144] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of the printing device provided in the embodiment of the present application. Figure 5 As shown, the printing device 500 includes a processor 501, a memory 502, and a program or instruction stored in the memory 502 and executable on the processor 501. When the program or instruction is executed by the processor 501, each step of the above-mentioned image processing method is implemented. The printing device 500 can implement the embodiment of the present application. Figure 1 The various processes of the method embodiment and the same beneficial effects are achieved, and will not be described again here to avoid repetition.
[0145] The embodiment of the present invention further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0146] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0148] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. An image processing method, characterized in that: The method comprises: Obtain N layer slice images of the model to be printed, where N is a positive integer; Performing blur processing on edge pixel points in the N layer slice images to obtain N first intermediate images, the blur processing on the edge pixel points in the N layer slice images to obtain N first intermediate images comprising: obtaining blur processing parameters, the blur processing parameters being determined according to a first input, the first input being an input operation performed by a user on the blur processing parameters; determining a sliding window participating in blur processing based on the blur processing parameters, the sliding window being used to determine a set of pixel points participating in blur processing each time in a first layer slice image, the first layer slice image being any layer slice image in the N layer slice images; obtaining target grayscale values corresponding to each edge pixel point in the first layer slice image in sequence based on the sliding window; determining a first intermediate image corresponding to the first layer slice image according to the target grayscale value, the first intermediate image corresponding to the first layer slice image in sequence based on the sliding window The target grayscale value corresponding to the edge pixel point includes: sliding the sliding window in the first layer slice image in sequence according to a preset step length, and the preset step length is used to characterize the distance that the sliding window moves each time; when the pixel point corresponding to the target position of the sliding window is a first edge pixel point, performing convolution calculation on the pixel point set corresponding to the current sliding window according to the blur processing parameter to obtain a convolution result; determining the target grayscale value of the first edge pixel point according to the convolution result; before blurring the edge pixel points in the N layer slice images to obtain N first intermediate images, the method also includes: performing anti-aliasing processing on the N layer slice images; blurring the edge pixel points in the N layer slice images to obtain N first intermediate images, including: blurring the edge pixel points in the N layer slice images after the anti-aliasing processing to obtain N first intermediate images; Contrast stretching processing is performed on the N first intermediate images to obtain N second intermediate images, wherein the model to be printed is generated based on the N second intermediate images.
2. The image processing method according to claim 1, characterized in that: The step of performing blurring processing on edge pixels in the N layer slice images to obtain N first intermediate images includes: Binarizing the N layer slice images to obtain N binary images; Obtain edge pixel points corresponding to each of the N binary images; The edge pixels in the N layer slice images are blurred to obtain N first intermediate images.
3. The image processing method according to claim 2, characterized in that: The obtaining edge pixel points corresponding to each of the N binary images includes: Obtaining neighborhood pixel values of a first pixel in a binary image to be determined, wherein the binary image to be determined is any one of the N binary images, the first pixel is any pixel in the binary image to be determined, and the neighborhood pixel values are pixel values of each pixel adjacent to the first pixel; In the case where the neighborhood pixel values include at least one first pixel value, the first pixel point is determined to be an edge pixel point corresponding to the binary image to be determined, and the first pixel value is used to represent the pixel value corresponding to black.
4. The image processing method according to claim 1, characterized in that: When the pixel point corresponding to the target position of the sliding window is a first edge pixel point, performing convolution calculation on the pixel point set corresponding to the current sliding window according to the blur processing parameter to obtain a convolution result, including: When the pixel point corresponding to the target position of the sliding window is the first edge pixel point, the pixel point set corresponding to the current sliding window is convolved with the preset convolution kernel to obtain a convolution result, where the preset convolution kernel is an M*M matrix, the value of M is determined according to the blur processing parameter, M is an integer greater than 1, and the first edge pixel point is any edge pixel point in the first layer slice image.
5. The image processing method according to claim 1, characterized in that: The step of performing contrast stretching processing on the N first intermediate images to obtain N second intermediate images includes: Acquire a target grayscale level, where the target grayscale level is determined according to a second input, where the second input is an input operation performed by a user on the grayscale level; Determining the grayscale value corresponding to the target grayscale level based on a preset mapping relationship, wherein the preset mapping relationship is used to indicate a mapping relationship between the grayscale level and the grayscale value; According to the grayscale value corresponding to the target grayscale level, the grayscale value of each pixel in the N first intermediate images is adjusted to obtain N second intermediate images.
6. A printing method, characterized in that: The method comprises: Acquire an image to be printed, and print a model according to the image to be printed; wherein the image to be printed is N second intermediate images generated by the image processing method according to any one of claims 1 to 5.
7. A printing system, characterized in that: include: Image processing devices and printing equipment; The image processing device is used to perform the image processing method according to any one of claims 1 to 5; The printing device uses the N second intermediate images output by the image processing device and obtains the model to be printed based on the N second intermediate images.
8. A printing device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the image processing method as described in any one of claims 1 to 5.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
An intelligent 3D printing system and method
CN109242949A
Light equalizing method and device for LCD photocuring 3D printer
CN111941846A
Photocuring 3D printing method, 3D printer, computer device and medium
CN112743851A
