Error diffusion method for full-color 3D printing

By using genetic iterative algorithms to optimize the diffusion factor and binarization threshold in full color 3D printing, the problems of color reproduction in 3D printing are solved, and high-quality color restoration and texture detail performance are achieved.

WO2025140002A1PCT designated stage expired Publication Date: 2025-07-03SUZHOU FLASHFORGE 3D TECHNOLOGY CO LTD +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/140660
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-29
Filing Date
2024-12-19
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

The existing 2D error diffusion algorithm cannot effectively solve the problems of color reproduction in 3D printing, resulting in unsatisfactory full-color 3D printing effect.

Method used

The diffusion factor is selected by using the genetic iterative algorithm, and by calculating the optimal weight value and binarization threshold, combining voxel position, surface voxel, error number, color difference and printing layer position factor, 3D error diffusion is performed to optimize the networking process of printing channel data.

Benefits of technology

The color reduction and texture details of the 3D printed model are improved to ensure uniformity and detailed performance of the color effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024140660_03072025_PF_FP_ABST
    Figure CN2024140660_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention is an error diffusion method for full-color 3D printing, comprising the following steps: selecting corresponding diffusion factors for each of grayscale values or some of grayscale values, and then according to the principle of minimum color difference and by means of a genetic iteration algorithm, calculating an optimal weight value and an optimal binarization threshold corresponding to each of the diffusion factors; and for each voxel point, selecting one channel, comparing the grayscale value of the channel with a corresponding optimal binarization threshold for binarization screening, calculating a diffusion coefficient on the basis of the corresponding diffusion factor and optimal weight value, and then diffusing an error to unprocessed adjacent voxels of the current layer and the next layer of the current voxel. Corresponding diffusion factors are selected on the basis of the characteristics of 3D printing, and optimal diffusion factor weights and diffusion factor thresholds are selected by means of a genetic iteration algorithm, and then 3D error diffusion is carried out on the basis of obtained results; the obtained 3D printed model has high color fidelity and clear texture details.
Need to check novelty before this filing date? Find Prior Art

Description

A full-color 3D printing error diffusion method Technical Field

[0001] The present invention belongs to the field of 3D printing, and in particular relates to a full-color 3D printing error diffusion method. Background Art

[0002] With the advancement of 3D technology, reproducing rich colors in models has become a new trend in 3D printing. Currently, full-color 3D printing primarily utilizes a subtractive color method similar to 2D printing or printing, achieving color reproduction by printing channels for cyan (C), magenta (M), yellow (Y), black (K), or other color channels. However, compared to 2D printing, which operates on a single plane, color reproduction in 3D printing is more complex, requiring color reproduction across the entire surface of the model. Traditional 2D error diffusion methods (such as the Floyd error diffusion algorithm) are not ideal for direct application in 3D printing, as they fail to consider the z-direction for color reproduction. This results in uneven color distribution, accumulation, and poor detail rendering. Therefore, improvements to 2D error diffusion algorithms are needed to extend their application to 3D printing.

[0003] When performing full-color 3D printing, the entire process can be divided into the following steps: 1. Importing a 3D model; 2. Slicing the 3D model to generate 2D voxel data; 3. Coloring the 2D voxel data to generate RGB data; 4. Color-separating the 2D RGB data and converting it into print channel data (e.g., CMYK); 5. Screening the print channel data (e.g., CMYK) to generate print data; 6. Outputting the print data to the printer for printing. The method of screening the print data in step 5 is crucial to the printing quality. Full-color 3D printers currently available use varying screening methods, resulting in suboptimal printing results, with room for improvement in color reproduction and texture detail. Summary of the Invention

[0004] The purpose of the present invention is to provide a full-color 3D printing error diffusion method, which makes the printing effect rich in color and ensures the color restoration and texture details of the 3D model.

[0005] A full-color 3D printing error diffusion method comprises the following steps:

[0006] For each gray value or part of the gray value, the corresponding diffusion factor is selected, and then the optimal weight value and the optimal binarization threshold corresponding to each diffusion factor of the gray value are calculated according to the principle of minimum color difference through the genetic iterative algorithm;

[0007] For each voxel point, one of the channels is selected and the grayscale value of the channel is compared with the corresponding optimal binarization threshold for binarization screening. The diffusion coefficient is calculated according to the corresponding diffusion factor and the optimal weight value, and the error is diffused to the unprocessed adjacent voxels of the current layer and the next layer of the current voxel.

[0008] Furthermore, the diffusion factors include voxel position factor, surface voxel factor, error number factor, color difference factor, and printing layer position factor, wherein the factor value range of all diffusion factors is [0,1].

[0009] Furthermore, the voxel position factor value is selected as follows: the voxel position factor selects 8 points around the current layer where the voxel point is located and 9 points corresponding to the voxel in the next layer. The closer the voxel position factor value is to the voxel point, the larger it is.

[0010] Furthermore, the factor value of the surface voxel factor is selected as follows: when one of the four voxels adjacent to the voxel is empty, the voxel is a surface voxel and its surface distance is 0;

[0011] The non-surface valid voxels adjacent to the surface voxels are internal voxels. Using the surface voxels as seeds, a breadth-first search method is used to obtain an internal voxel with a surface distance of 1. The cycle uses the first interior as the seed and a breadth-first search method to obtain two internal elements with a surface distance of 2. This is repeated until all voxel searches are completed or the maximum surface distance is reached. According to the absolute value of the surface distance difference between the current voxel and the adjacent voxel, the larger the absolute value, the smaller the current layer surface voxel factor value, and the next layer surface voxel factor value is smaller than the current layer surface voxel factor value.

[0012] Furthermore, the error factor value is selected as follows: when a voxel point is diffused multiple times, the more diffusion times are, the smaller the error factor value is.

[0013] Furthermore, the color difference factor value is selected as follows: during diffusion, the smaller the color difference between the adjacent voxel and the current voxel, the larger the diffusion factor is accepted; the larger the color difference between the adjacent voxel and the current voxel, the smaller the diffusion factor is accepted. The color difference factor value = (255-|△Color|) / 255, where △Color is the color difference of each channel.

[0014] Furthermore, the method for selecting the printing layer position factor is as follows: during diffusion, the current layer and the next layer are set to receive different degrees of diffusion, and the printing layer position factor of the current layer is greater than the printing layer position factor of the next layer.

[0015] Furthermore, the binarization threshold selection method is as follows: during the diffusion process, the color needs to be binarized and converted into print head data. Different threshold settings have different effects on different color grayscales. The binarization threshold is set to = 220 + Rnd (-20~20), Rnd is a random value, and the binarization threshold is a random value between 200 and 240.

[0016] Furthermore, the genetic iterative algorithm includes the following steps:

[0017] Initialize all populations and randomly set the weight value of each diffusion factor and the binarization threshold for each grayscale value;

[0018] The 3D error diffusion method is used to calculate the corresponding printing data and the color difference is calculated using the standard color difference formula;

[0019] According to the color difference, the best solution is to keep the color difference smaller.

[0020] Randomly cross-exchange the weights and binarization thresholds of different factors;

[0021] Randomly change one or more weights or binarization thresholds;

[0022] Increase the number of iterations and repeat the above genetic iterative algorithm steps until the set number of iterations is reached to obtain the optimal weight value and the optimal factor binarization threshold corresponding to the grayscale value.

[0023] Repeat the above process for each grayscale value, or repeat the above process after selecting part of the grayscale, and calculate the other grayscale values ​​by linear interpolation or other methods.

[0024] Furthermore, the specific method of 3D error diffusion is as follows:

[0025] Color channel selection: For each voxel point, the color value is CMYK. The color channel data, i.e., the CMYK values, are sorted from largest to smallest and set as follows: when there is only one maximum value for the CMYK value, the channel corresponding to that value is selected; when there are multiple CMYK values ​​with the same maximum value, the channel corresponding to the same maximum value is randomly selected;

[0026] Binarization: Get the optimal binarization threshold value based on the grayscale value of the selected channel, compare the grayscale value of the selected channel with the optimal binarization threshold value, and set the channel to spray the corresponding color when the grayscale value is greater than the optimal binarization threshold value, otherwise set the channel to spray the filling material;

[0027] Error calculation: If the current voxel point is the injection color, the error is the grayscale value of the voxel point in the channel -255, and the error of other channels is the grayscale value of the voxel point in other channels; if the current voxel point is the filling material, the error is the grayscale value of the voxel point in the channel;

[0028] 3D diffusion: the unprocessed adjacent voxels V of the current voxel in the current layer and the next layer i , calculate their diffusion coefficients f respectively i , f i =W i / ∑W i, W i is the sum of the products of each diffusion factor and the corresponding optimal weight. For each unprocessed adjacent voxel V iThe color CMYK superimposed error values ​​are C' = C+△C×f i , M'= M+△M×f i , Y' =Y+△Y×f i , K'= K+△K×f i ,

[0029] Where C' is the grayscale value of channel C after superimposing the error value, C is the current grayscale value of channel C, △C is the error of channel C, M' is the grayscale value of channel M after superimposing the error value, M is the current grayscale value of channel M, △M is the error of channel M, Y' is the grayscale value of channel Y after superimposing the error value, Y is the current grayscale value of channel Y, △Y is the error of channel Y, K' is the grayscale value of channel K after superimposing the error value, K is the current grayscale value of channel K, and △K is the error of channel K;

[0030] Diffusion path: adjacent voxels V i After adding the error value, the color channel of the voxel point is selected and diffused along different diffusion paths. The above operation is repeated until all voxel points are binarized.

[0031] Due to the adoption of the above technical solution, the present invention has the following beneficial effects:

[0032] 1. According to the characteristics of 3D printing, the corresponding diffusion factor is selected. The genetic iterative algorithm selects the optimal diffusion factor weight and diffusion factor threshold. Then, 3D error diffusion is performed based on the obtained results. The resulting 3D printed model has high color reproduction and clear texture details.

[0033] 2. The color effect of 3D printing is affected by factors such as the surface layer color, internal layer color, color difference of adjacent points, printing layer position, color threshold, etc. The setting of the diffusion factor and binarization threshold takes these influences and their importance into consideration, and the genetic iterative algorithm is used to obtain the best solution as much as possible to ensure the best color reproduction effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The present invention will be further described below with reference to the accompanying drawings.

[0035] FIG1 is an example of a monochrome picture in RGB format in Example 1.

[0036] Figure 2 shows the voxel points of the current layer and the next layer.

[0037] Figure 3 shows the result after diffusion of the image shown in Figure 1.

[0038] FIG4 is a multi-color picture in RGB format in Example 2.

[0039] Figure 5 shows the result after diffusion of the image shown in Figure 4.

[0040] FIG6 is a multi-color picture in RGB format in Example 3.

[0041] Figure 7 shows the result after diffusion of the image shown in Figure 5. DETAILED DESCRIPTION

[0042] When performing full-color 3D printing, the entire printing process can be divided into the following steps:

[0043] 1. Import the 3D model.

[0044] 2. Slice the 3D model to obtain 2D voxel data.

[0045] 3.2D voxel data is colored to obtain RGB data.

[0046] 4.2D RGB data is converted into printing channel (such as CMYK) data.

[0047] 5. Screen the printing channel (such as CMYK) data to obtain printing data.

[0048] 6. Output the print data to the printer for printing.

[0049] Steps 1-4 and step 6 are all prior art and will not be described in detail here. The present invention mainly improves step 5, which involves screening the printing channel (e.g., CMYK) data to obtain the printing data. A full-color 3D printing error diffusion method is mainly used, including the following steps:

[0050] 1. Error Diffusion Coefficient Calculation

[0051] 1.1 In 2D error diffusion, there are relatively mature diffusion coefficients, but these coefficients are difficult to apply directly to 3D. In 3D printing, since the color of the model is usually determined by the voxels on the surface, this application diffuses as much as possible to the surface, and adjacent voxels also diffuse as much as possible to voxels with similar colors. To this end, for the grayscale value corresponding to each voxel point, the voxel position factor, surface voxel factor, error frequency factor, color difference factor, printing layer position factor, and binarization threshold are introduced. The calculation method of the above-mentioned factor values ​​is as follows:

[0052] 1.1.1 Voxel position factor value:

[0053] The voxel position factor selects 8 points around the current layer where the voxel point is located and 9 points corresponding to the voxel in the next layer. For example, the factor value can be set as follows:

[0054] Current layer voxel position factor value posFactor0 = .

[0055] Next layer voxel position factor value posFactor 1= .

[0056] The voxel position factor value of the voxel point is defined as 0, and the voxel position factor values ​​of the corresponding points directly in front, behind, left, right, and above are defined as values ​​within 0.9-1, for example, 1; the remaining points in the current layer are defined as values ​​within 0.3-0.7, for example, 0.5; the voxel position factor value of the point in the next layer with a voxel position factor of 1 is defined as values ​​within 0.3-0.7, for example, 0.5; the remaining points are defined as values ​​within 0.1-0.5, for example, 0.2. The closer the voxel point is to the voxel point, the larger the voxel position factor value is.

[0057] The specific value here can be adjusted according to the actual situation. The next layer refers to the next layer in the printing order during the printing process. In fact, since 3D printing is a stacking process, the next layer is located above the current layer from the Z-axis position.

[0058] 1.1.2 Surface voxel factor value

[0059] When one of the four voxels adjacent to the voxel, namely, the front, back, left, and right, is empty, the voxel is a surface voxel, and the surface distance is defined as 0; the non-surface valid voxel adjacent to the surface voxel is an internal voxel, and the surface voxel is used as a seed and a breadth-first search is performed to obtain an internal voxel once, and the surface distance is defined as 1; the internal voxel is used as a seed and a breadth-first search is performed to obtain two internal voxels, and the surface distance is defined as 2; this process is repeated until all voxels are searched or the maximum surface distance is reached. The maximum distance is usually set to 20-30, which is set based on the color transparency according to the empirical value. According to the absolute value of the surface distance difference between the current voxel and the adjacent voxel, diffusion is divided into four types: external-external, internal-external, external-inner, and internal-inner. External-external refers to the diffusion of surface voxels to surface voxels, internal-external refers to the diffusion of internal voxels to surface voxels, external-inner refers to the diffusion of surface voxels to internal voxels, and internal-inner refers to the diffusion of internal voxels to internal voxels. The corresponding difference values ​​are 0, 1, 2, and 3, respectively, and the surface voxel factor values ​​are set as follows:

[0060] The current layer surface voxel factor value DisFactor0={1, 0.5, 0.25, 0.15}.

[0061] The next layer's surface voxel factor value DisFactor1 = {0.8, 0.4, 0.15, 0.05}. For example, when the corresponding difference is 0, the current layer's surface voxel factor is 1, and the next layer's surface voxel factor is 0.8. When the corresponding difference is 1, the current layer's surface voxel factor is 0.5, and the next layer's surface voxel factor is 0.4. The larger the corresponding difference, the greater the surface distance difference, the smaller the current layer's surface voxel factor value, and the smaller the next layer's surface voxel factor value. The specific values ​​here can be adjusted according to actual conditions.

[0062] 1.1.3 Error factor value:

[0063] When a voxel point is diffused multiple times, the error factor decreases with each diffusion. For 1, 2, 3, 4, and 5 diffusions, the corresponding error factor values ​​are {0.3, 0.25, 0.2, 0.15, 0.1}. After 5 diffusions, no more diffusion is performed, and the error factor value is 0. The specific value can be adjusted based on actual conditions.

[0064] 1.1.4 Color Difference Factor Value

[0065] During diffusion, the smaller the color difference between the adjacent voxel and the current voxel, the larger the diffusion factor is. The larger the color difference between the adjacent voxel and the current voxel, the smaller the diffusion factor is. The color difference factor value colorFactor = (255-|△Color|) / 255, where △Color is the color difference of each channel.

[0066] 1.1.5 Print layer position factor value

[0067] During diffusion, the adjacent voxels in the current layer and the adjacent voxels in the next layer are set to different degrees of diffusion. In principle, the current layer diffuses more and the next layer diffuses less. The layer position factor of the current layer is greater than the layer position factor of the next layer. The layer position factor values ​​of the current layer and the next layer, layerFactor[2], can be = { 0.7, 0.5} or { 0.6, 0.2}, etc.

[0068] 1.1.6 Binarization Threshold

[0069] During the diffusion process, the colors need to be binarized and converted into printhead data. Different binarization thresholds have different effects for different color grayscales. The binarization threshold is set to 220 + Rnd (-20 to 20). Rnd is a random value, and the binarization threshold is a random value between 200 and 240.

[0070] 1.2 After determining the factors, the genetic iterative algorithm is used to calculate the optimal weight value and optimal binarization threshold for each factor corresponding to each grayscale value according to the principle of minimum color difference. The values ​​can be listed for future reference, so that the calculation does not need to be repeated next time:

[0071] 1.2.1 Initialize the population and randomly set multiple groups of weights (more than 50 groups) and binarization thresholds for each diffusion factor, ranging from 0 to 500. For example, for grayscale 64, initialize 100 groups of weight populations, as shown in Table 1. Set the position factor weight, surface factor weight, diffusion count weight, color difference factor weight, and print layer factor weight for group 1, respectively. The binarization threshold values ​​are 173, 32, 31, 267, and 210.

[0072] Table 1

[0073]

[0074] 1.2.2 For each set of weights, use the 3D error diffusion method to calculate the corresponding print data and use the standard color difference formula CIE76 / 2000 to calculate the color difference. If the population size is 100, 100 sets of color difference data can be obtained.

[0075] 1.2.3 Sort by color difference and take the weighted groups with the smallest color difference as the new weighted groups, such as the first 50 groups.

[0076] 1.2.4 Perform crossover mutation on the 50 sets of weights obtained in the previous step. Randomly cross over two of them according to the crossover probability, and randomly change one or more weights according to the mutation probability. In this way, 50 new sets of weights can be obtained.

[0077] For example, as shown in Table 2, randomly select Group 1 and Group 18 for crossover:

[0078] Table 2

[0079]

[0080] As shown in Table 3, the weight group after crossover is as follows:

[0081] Table 3

[0082]

[0083] As shown in Table 4, the following results are obtained by mutation:

[0084] Table 4

[0085]

[0086] 1.2.4 Return to 1.2.2 and repeat the loop until the number of iterations exceeds the set value and exit the loop.

[0087] 1.2.5 Obtain the optimal weight set and optimal binarization threshold for the grayscale. Repeat the above process for each grayscale value, or select a portion of the grayscale values ​​and repeat the above process. Calculate the remaining grayscale values ​​using linear interpolation or other methods.

[0088] Setting the number of genetic iterations to 10, the crossover probability to 0.5, and the mutation probability to 0.2, we can obtain the optimal weights and thresholds as shown in Table 5:

[0089] Table 5

[0090]

[0091] 2. 3D Error Diffusion:

[0092] 2.1 Color Channel Selection: For each voxel, the color value is CMYK. When generating print data, since each channel in 3D printing corresponds to a color or filler material (such as transparent ink or support), each voxel can only be ejected by a certain ink channel. Selecting one of these channels for binarization and screening converts the CMYK data into print data corresponding to whether each nozzle ejects. Sort the color channel data (CMYK) values ​​from largest to smallest and set them as follows:

[0093] When the CMYK value has only one maximum value, this channel is selected; if only C in CYMK is greater than the threshold, cyan (C) is sprayed at this voxel point.

[0094] When there are multiple CMYK values ​​with the same maximum value, a corresponding channel that is greater than the set threshold is randomly selected.

[0095] 2.2 Binarization: Get the optimal binarization threshold value based on the grayscale value of the selected channel, compare the grayscale value of the selected channel with the optimal binarization threshold value, and set the corresponding color to be sprayed on the channel if the grayscale value is greater than the optimal binarization threshold value; otherwise, set the filling material to be sprayed;

[0096] 2.3 Error calculation: If the current voxel point is the injection color, the error △Color=color-255, color is the grayscale value of the voxel point in this channel, and the error △Color of other channels=color, color is the grayscale value of the voxel point in other channels. For example, CYMK (245, 200, 120, 20), the channel with the largest grayscale value is C=245, and the grayscale value of the C channel is greater than the binarization threshold of 220, then the current voxel is injected C, the C channel error △C =245-255=-10, the M channel error △M =200, the Y channel error △Y =120, and the K channel error △K =20; if the current voxel point is a filling voxel, the error is the grayscale value of the voxel point in this channel, such as CYMK (100, 130, 120, 20), the channel with the largest grayscale value is M=130, and the grayscale value of the M channel is less than the binarization threshold of 220, then the current voxel is a filling voxel, and its error is △C =100, △M =130, △Y =120, △K =20.

[0097] 2.4 3D Diffusion: Unprocessed adjacent voxels V in the upper and lower layers of the current voxel i , calculate their diffusion coefficients f respectively i , f i =W i / ∑W i, W i is the sum of the products of each diffusion factor and the corresponding optimal weight, W i= posFactor*posFactorW + disFactor*disFactorW + errorFactor*errorFactorW + layerFctor*layerFactorW + colorFactor*colorFactorW,

[0098] posFactor refers to the voxel position factor value, posFactorW refers to the optimal weight of the voxel position factor, disFactor refers to the surface voxel factor value, disFactorW refers to the optimal weight of the surface voxel factor, errorFactor refers to the error number factor value, errorFactorW refers to the optimal weight of the error number factor, layerFctor refers to the printing layer position factor value, layerFactorW refers to the optimal weight of the printing layer position factor, colorFactor refers to the color difference factor value, colorFactorW refers to the optimal weight of the color difference factor.

[0099] For each V i The color CMYK superimposed error values ​​are C = C + △ C × f i , M = M + △ M × f i , Y =Y+△Y×f i , K = K + △ K × f i ;

[0100] 2.5 Diffusion Path: After adding the error value to the adjacent voxels, the color channel of the voxel is selected and diffused along different diffusion paths. This process is repeated until all voxels are binarized. The diffusion path refers to the common scanning paths used in 2D error diffusion, such as zigzag and serpentine patterns. In 3D diffusion, each layer also adopts a different scanning path, such as from left to right and from top to bottom for the first layer, and from right to left and from bottom to top for the second layer. This method avoids common diffusion defects.

[0101] Example 1

[0102] Taking the monochrome image in Figure 1 as an example, its RGB value is (0, 160, 233). After the color separation algorithm is used to convert it, its CYMK value is (112, 16, 21, 200). As shown in Figure 2, the voxel point X (112, 16, 21, 200) is diffused as an example. The numbers 1, 2, and 3 are the neighboring points of the voxel point X in the current layer, and the numbers 4, 5, 6, and 7 are the neighboring points in the next layer. The maximum channel is K = 200. As mentioned above, the optimal weights and optimal binarization thresholds of each factor at a grayscale value of 200 are calculated using the genetic iterative algorithm. The weight values ​​corresponding to K200 are shown in Table 6:

[0103] Table 6

[0104]

[0105] Threshold comparison: Maximum channel 200 > threshold 142, set the value of the current voxel to K, that is, jet black (K).

[0106] Calculate the channel errors: △K = 200-255=-55, △C = 112, △M=16, △Y=21.

[0107] Calculate the diffusion coefficient of the neighboring points, and the search shows that the number of neighboring points is 7.

[0108] The diffusion coefficient is calculated based on the optimal weight and factor value, and the diffusion weight Wi is obtained by multiplying the position factor and weight for each adjacent point.

[0109] Wi = posFactor*posFactorW + disFactor*disFactorW + errFactor*errFactorW + layerFactor*layerFactorW + colorFactor*colorFactorW

[0110] Taking the adjacent point number 1 as an example, its posFactor=1.0, disFactor=0.15, errorFactor=0.1, layerFctor=0.6, colorFactor=0.129,

[0111] W1 = 1.0*311+0.15*60+0.1*99+0.6*92+0.129*100=398

[0112] The calculated weights of the adjacent points in the first layer are W1=398, W2=551, and W3=339.

[0113] The weight values ​​of each adjacent point in the second layer are W4=299, W5=392, W6=234, W7=392

[0114] According to f i =W i / ∑W i The calculated diffusion coefficient values ​​are f1=0.15, f2=0.21, f3=0.13, f4=0.114, f5=0.150, f6=0.09, f7=0.150

[0115] According to the above diffusion coefficient and error value, the error is diffused to the 7 adjacent points of the current layer and the next layer.

[0116] For example, the c-value error of the three voxel points in the first layer is calculated as follows:

[0117] P1c = 112 + 0.15*△C = 129

[0118] P2c = 112 + 0.21*△C = 135

[0119] P3c = 112 + 0.13*△C = 126

[0120] The same operation is performed on each channel of all adjacent points. After adding the error value to the CYMK values ​​of the seven voxels, the color channel of the voxel is selected. Repeat the above operation until all voxels are binarized. The result of diffusing Figure 1 is shown in Figure 3.

[0121] Example 2

[0122] The color image is shown in Figure 4, and the image after diffusion according to the diffusion method is shown in Figure 5.

[0123] Example 3

[0124] The color image is shown in Figure 6, and the image after diffusion according to the diffusion method is shown in Figure 7.

[0125] The above are only specific embodiments of the present invention, but the technical features of the present invention are not limited thereto. Any simple changes, equivalent substitutions, or modifications based on the present invention to solve substantially the same technical problems and achieve substantially the same technical effects are included within the scope of protection of the present invention.

Claims

1. A full-color 3D printing error diffusion method, characterized in that, It includes the following steps: For each grayscale value or a part of grayscale values, select the corresponding diffusion factor, and then through the genetic iteration algorithm, calculate the optimal weight value and the optimal binarization threshold corresponding to each diffusion factor of the grayscale value according to the principle of the minimum color difference; For each voxel, select one of the channels, compare the grayscale value of the channel with the corresponding optimal binarization threshold for binarization screening, calculate the diffusion coefficient according to the corresponding diffusion factor and the optimal weight value, and then diffuse the error to the unprocessed adjacent voxels of the current layer and the next layer of the current voxel.

2. The full-color 3D printing error diffusion method according to claim 1, characterized in that: The diffusion factors include voxel position factor, surface voxel factor, error times factor, color difference factor, printing layer position factor, and the factor value range of all diffusion factors is [0,1].

3. The full-color 3D printing error diffusion method according to claim 2, wherein: The method for selecting the voxel position factor value is as follows: The voxel position factor selects the 8 points around the current layer where the voxel point is located and the 9 points corresponding to the voxel in the next layer. The closer the voxel is to the voxel point, the larger the voxel position factor value.

4. The full-color 3D printing error diffusion method according to claim 2, wherein: The method for selecting the factor value of the surface voxel factor is as follows: When one of the four voxels adjacent to the voxel in the up, down, left, and right directions is empty, the voxel is a surface voxel, and its surface distance is 0; The non-surface effective voxels adjacent to the surface voxels are internal voxels. Taking the surface voxels as seeds and searching in a breadth-first manner, the first internal voxels are obtained, and their surface distance is 1; repeating the cycle with the first internal voxels as seeds and searching in a breadth-first manner to obtain the second internal elements, and their surface distance is 2; repeating like this until all voxels are searched or the maximum surface distance is reached. According to the absolute value of the difference in the surface distance between the current voxel and the adjacent voxels, the larger the absolute value, the smaller the surface voxel factor value of the current layer, and the surface voxel factor value of the next layer is smaller than that of the current layer.

5. The full-color 3D printing error diffusion method according to claim 2, wherein: The method for selecting the error times factor value is as follows: When a voxel point is diffused multiple times, counted by the number of diffusions, the more the number of diffusions, the smaller the error times factor value.

6. The full-color 3D printing error diffusion method according to claim 2, wherein: The method for selecting the color difference factor value is as follows: During diffusion, the smaller the color difference between the adjacent voxel and the current voxel, the larger the factor for accepting diffusion, and the larger the color difference between the adjacent voxel and the current voxel, the smaller the factor for accepting diffusion. The color difference factor value = (255 - |△Color|) / 255, where △Color is the color difference of each channel.

7. The full-color 3D printing error diffusion method according to claim 2, wherein: The method for selecting the printing layer position factor is as follows: During diffusion, it is set that the degrees of accepting diffusion of the current layer and the next layer are different, and the printing layer position factor of the current layer is greater than that of the next layer.

8. The full-color 3D printing error diffusion method according to claim 2, wherein: The method for selecting the binarization threshold is as follows: During the diffusion process, color binarization processing is required to convert it into print head data. Different threshold settings for different color grayscales have different effects. Set the binarization threshold to = 220 + Rnd(-20~20), where Rnd is a random value, and the binarization threshold is a random value between 200 and 240.

9. A full-color 3D printing error diffusion method according to claim 1, characterized in that: The genetic iteration algorithm includes the following steps: Initialize all populations, and randomly set the weight value of each diffusion factor and the binarization threshold for each grayscale value; Use the 3D error diffusion method to calculate the corresponding print data and calculate the color difference using the standard color difference formula; According to the color difference, save the solution with a smaller color difference as the better solution; Randomly cross and swap the weights and binarization thresholds of different factors; Randomly change one or several weights or binarization thresholds; Increase the number of iterations, and repeat the above steps of the genetic iteration algorithm until the set number of iterations is reached to obtain the optimal weight value and the optimal binarization threshold corresponding to the grayscale value.

10. The method for error diffusion in full-color 3D printing according to claim 1, wherein, For each voxel point, the selection of one of the channels is specifically as follows: For each voxel point, the color value is CMYK. Sort the color channel data, that is, the values of CMYK, from largest to smallest. When there is only one maximum value in the CMYK values, select the channel corresponding to this value at this time; when there are multiple identical maximum values in the CMYK values, randomly select one of the channels corresponding to the identical maximum values at this time.

11. A full-color 3D printing error diffusion method according to claim 1, characterized in that The specific process of binarizing and screening the grayscale value of this channel with the corresponding optimal binarization threshold is as follows: Obtain the optimal binarization threshold according to the grayscale value of the selected channel, compare the grayscale value of the selected channel with the optimal binarization threshold. When the grayscale value is greater than the optimal binarization threshold, set the corresponding color to be ejected from this channel, otherwise set the ejection of the filling material.

12. The method for error diffusion in full-color 3D printing according to claim 1, characterized in that The specific calculation of the diffusion coefficient according to the corresponding diffusion factor and the optimal weight value is as follows: For the unprocessed adjacent voxels V of the current voxel in the current layer and the next layer i , calculate their diffusion coefficients f i , f i = W i / ∑W i, W i is the sum of the products of each diffusion factor and the corresponding optimal weight value.

13. The method for error diffusion in full-color 3D printing according to claim 12, characterized in that, The specific process of spreading the error to the unprocessed adjacent voxels of the current layer and the next layer of the current voxel is as follows: If the current voxel point is ejecting color, the error is the grayscale value of this voxel point in this channel - 255, and the errors of other channels are the grayscale values of the voxel point in other channels; If the current voxel is a filling material, the error is the gray value of the voxel in this channel; for each unprocessed adjacent voxel V i The CMYK values of the color are respectively superimposed with the error value, C’ = C+△C×f i , M’= M+△M×f i , Y’ =Y+△Y×f i , K’= K+△K×f i , Where C’ is the gray value of channel C after superimposing the error value, C is the current gray value of channel C, △C is the error of channel C, M’ is the gray value of channel M after superimposing the error value, M is the current gray value of channel M, △M is the error of channel M, Y’ is the gray value of channel Y after superimposing the error value, Y is the current gray value of channel Y, △Y is the error of channel Y, K’ is the gray value of channel K after superimposing the error value, K is the current gray value of channel K, △K is the error of channel K; the unprocessed adjacent voxel V i After adding the error value, perform color channel selection on the voxel point, diffuse it along different diffusion paths, and repeat the above operations until all voxel points are binarized.

14. A full-color 3D printing error diffusion method according to claim 9, characterized in that: The specific method of 3D error diffusion is as follows: Color channel selection: For each voxel point, the color value is CMYK. Sort the color channel data, that is, the values of CMYK, from largest to smallest, and set it as follows: When there is only one maximum value in the CMYK values, select the channel corresponding to this value at this time; When there are multiple identical maximum values in the CMYK values, randomly select one of the channels corresponding to the identical maximum values at this time; Binarization: Obtain the optimal binarization threshold according to the grayscale value of the selected channel, compare the grayscale value of the selected channel with the optimal binarization threshold. When the grayscale value is greater than the optimal binarization threshold, set the corresponding color to be ejected from this channel, otherwise set the ejection of the filling material; Error calculation: If the current voxel point is ejecting color, the error is the grayscale value of this voxel point in this channel - 255, and the errors of other channels are the grayscale values of the voxel point in other channels; If the current voxel point is the filling material, the error is the grayscale value of this voxel point in this channel; 3D Diffusion: Calculate the diffusion coefficient f for the unprocessed adjacent voxels V of the current voxel in the current layer and the next layer i , respectively i , f i =W i / ∑W i, W i is the sum of the products of each diffusion factor and the corresponding optimal weight. For each unprocessed adjacent voxel V i , add the error value to the CMYK colors respectively. C’ = C + △C × f i , M’ = M + △M × f i , Y’ = Y + △Y × f i , K’ = K + △K × f i , Where C’ is the gray value of channel C after superimposing the error value, C is the current gray value of channel C, △C is the error of channel C, M’ is the gray value of channel M after superimposing the error value, M is the current gray value of channel M, △M is the error of channel M, Y’ is the gray value of channel Y after superimposing the error value, Y is the current gray value of channel Y, △Y is the error of channel Y, K’ is the gray value of channel K after superimposing the error value, K is the current gray value of channel K, and △K is the error of channel K; Diffusion path: adjacent voxel V i After adding the error value, the color channel of this voxel point is selected and diffused along different diffusion paths. The above operations are repeated until all voxel points are binarized.

Citation Information

Patent Citations

  • Octree error diffusion based 3D printing color presentation method and device

    CN108381905A

  • Bridge type structure high-precision printing method based on Gaussian process and shape compensation

    CN114434804A

  • Surface color inward diffusion method of color 3D model

    CN115157654A

  • Image processing method, image processor, and image processing system

    JP2006303999A

  • Method and apparatus for determining error diffusion coefficients

    US20050007635A1