A 3D printing precision control method and system based on image morphological operation

By using image morphology operations and machine learning algorithms to compensate for the inner and outer contour errors of 3D printed slice images, the optical distortion problem in DLP imaging is solved, thus improving the accuracy of 3D printing.

CN116330664BActive Publication Date: 2026-04-24CHINESE SCI CLOUD COMPUTING ACAD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINESE SCI CLOUD COMPUTING ACAD
Filing Date
2023-03-29
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing 3D printing technologies, optical distortion errors in DLP imaging cause errors in the inner and outer contours of sliced ​​images, affecting the printing accuracy between the finished product and the model.

Method used

A method based on image morphology operations is adopted to control the inner and outer contour accuracy of sliced ​​images through kernel matrix. Kernel matrix parameters are generated using machine learning algorithms, and image morphology operations are performed to compensate for contour errors. Printing accuracy is improved through image merging and Gaussian smoothing.

Benefits of technology

It effectively reduces the error between the finished product and the model caused by material shrinkage and projection error during the 3D printing process, and improves the actual printing accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116330664B_ABST
    Figure CN116330664B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of 3D printing, and particularly relates to a 3D printing precision control method and system based on image morphological operation, and specifically comprises the following steps: firstly, obtaining a slice image of a model from 3D printing slice software; then, performing contour extraction on the slice image, and performing image morphological operation on the extracted contour image and a set kernel matrix to obtain a compensated contour image; merging the compensated contour images to obtain a compensated slice image; then, performing image processing; and finally, sending the processed compensated slice image to a 3D printer for printing. The present application adopts image morphological operation to control the precision of the slice image, can effectively process the edge contour pixel points in the slice image, and compensate for the errors of the contour edges in the slice image; meanwhile, the contour extraction is used to compensate for each contour (including the inner and outer contours) in the slice image to different degrees, so as to improve the actual printing precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of 3D printing, specifically designing a 3D printing accuracy control method and system based on image morphology operations. Background Technology

[0002] 3D printing is a new manufacturing method that combines digitalization, artificial intelligence, and the application of new materials. Photopolymer 3D printing technology, due to its advantages such as high-quality prototype surface, fast printing speed, and high dimensional accuracy, is the main method for achieving high-precision molding and is widely used in the production of small-sized, high-precision products. Currently, there are two photopolymerization methods: laser scanning and Digital Light Processing (DLP) imaging. DLP imaging can, in principle, achieve extremely high precision 3D printing down to the micrometer level, and its core display device is a Digital Micromirror Device (DMD).

[0003] The current 3D printing process involves two key steps: model slicing and printing the slices. In real-world 3D printing applications, there will always be some discrepancy between the ideal model slice image and the actual printed slice image. For example, in DLP 3D printing technology, the optical distortion error generated by the DMD (Digital Mask) of the 3D printer during projection, as measured experimentally, is mainly reflected at the edges of the inner and outer contours of the slice image. Furthermore, there are also errors of varying magnitudes for the inner and outer contours of the slice image, resulting in discrepancies between the finished product and the model, thus affecting the actual printing accuracy. Summary of the Invention

[0004] To address the problems existing in the aforementioned background technology, this invention provides a 3D printing accuracy control method based on image morphology operations, specifically including the following steps:

[0005] S1. The three-dimensional model is processed using slicing software to obtain sliced ​​images. The l-th layer sliced ​​image is extracted, and the contour image is obtained based on the sliced ​​image, where l is a natural number greater than or equal to 1.

[0006] S2. Perform image morphology operations on the contour image using a kernel matrix to control the inner diameter contour accuracy and the outer diameter contour accuracy, thereby obtaining a compensated contour image. The inner diameter contour accuracy control is to compensate for the dimensional accuracy of the inner contour of each slice contour image, and the outer diameter contour accuracy control is to compensate for the dimensional accuracy of the outer contour of each slice contour image.

[0007] S3. The compensated contour images are merged through algebraic operations to obtain compensated slice images;

[0008] S4. Perform image processing on the compensated slice image and send the processed compensated slice image to the 3D printer for printing.

[0009] Repeat the above steps until the three-dimensional model is printed.

[0010] Further, S1, which obtains the contour image based on the sliced ​​image, specifically includes the following steps:

[0011] S101. Extract the image contour data of the sliced ​​image, and construct a contour hierarchy tree based on the image contour data;

[0012] S102. Divide the inner and outer contours according to the contour hierarchy tree, and fill the inner and outer contours to obtain a contour image.

[0013] Furthermore, the parameters of the kernel matrix are generated by a machine learning algorithm, the input of which is the printing error features, and the output is the current kernel matrix parameters;

[0014] The relationship between the input and output of the machine learning algorithm is expressed as follows:

[0015]

[0016] l represents the sequence number of the slice image, i represents the sequence number of the contour image contained in the l-th slice image, and j represents the sequence number of the summation traversal; normal_contour l,i It is the outline image of the i-th standard 3D printed slice in the l-th layer slice image; γ∈(0,1] is the discount factor; It is the sum of the discount error characteristics of historical printing; k l,i Let k be the kernel matrix of the i-th contour in the l-th layer. l,i ={K nm anchor(x, y)}, K nm It is a Boolean matrix with elements of 0 or 1, where anchor(x,y) is the anchor point of the kernel matrix, 1≤x≤n, 1≤y≤m; iterations l,i Is with k l,j The number of iterations corresponding to the kernel matrix. l,i ∈Z, where Z represents the set of integers, when iterations l,i When the integer is negative, it represents the erosion operation, iterations l,i When it is a positive integer, it represents the expansion operation, iterations l,i A value of 0 indicates no operation is performed; the number of iterations. l,i=n indicates that the kernel matrix is ​​used to perform abs(n) loop operations, and abs(·) indicates taking the absolute value; layer_error j This represents the printing error of the j-th layer;

[0017] The functional model for calculating the characteristics of printing errors is as follows:

[0018]

[0019] contour_num l The contour_error represents the total number of contours contained in the l-th slice image. l,j The error feature representing the j-th contour in the l-th slice image is calculated using the following function model:

[0020] contour_error l,j =g(normal_contour l,j deform_contour l,j )

[0021] deform_contour l,j It is the outline image of the slice printed by the j-th 3D printer in the l-th slice image.

[0022] Furthermore, the compensation rules for the step contour image are as follows:

[0023] When iterations l,j <0, the image morphological operation of the contour image is represented as:

[0024] normal_contour l,i Θ[k l,j terations l,i ],

[0025] The compensation result for the contour image is as follows:

[0026]

[0027] When iterations l,i >0, the image morphological operation of the contour image is represented as:

[0028]

[0029] The compensation result for the contour image is as follows:

[0030]

[0031] When iterations l,i=0, the contour image is not processed, that is, the compensation result of the contour image is itself.

[0032] Furthermore, the historical printing error features are stored in an error feature database, which is formed by accumulating the error features of each new print.

[0033] Furthermore, the compensated contour image is merged according to the contour merging function merge(·), compensated d_layer l =merge(compensate_contours) l contour_hierarchy_tree l ),

[0034] Where OR stands for "or", meaning either "erosion" or "dilation" is used, compensated_layer l For the compensated slice image of layer l, compensated_contours l The contour_hierarchy_tree is the set of compensated contour images of the l-th slice image. l This is the contour hierarchy tree of the slice image at layer l.

[0035] Furthermore, the specific operation of merge(·) includes the following steps:

[0036] S301. Perform a hierarchical traversal of the contour hierarchy tree of the l-th layer slice image to obtain the hierarchy number of each layer slice image in the contour hierarchy tree.

[0037] S302. Perform image addition on each compensated contour image and merge them into a hierarchical contour image containing multiple contours. Sort the images according to the hierarchical number of the contour hierarchy tree. The contour hierarchy tree contains the hierarchical relationship of all contours, specifically including the index number of the next contour, the previous contour, the embedded contour, and the parent contour.

[0038] S303. Perform image addition and subtraction operations on the hierarchical contour images to merge multiple hierarchical contour images into one, and obtain the compensated slice image.

[0039] Furthermore, the parameters of the kernel matrix include the kernel matrix size, kernel matrix element values, and kernel matrix anchor point positions.

[0040] Furthermore, the machine learning algorithms include, but are not limited to, supervised learning algorithms and reinforcement learning algorithms. The supervised learning algorithm uses a kernel matrix of a deep neural network architecture for optimization training. The input is error feature data, and the output is a kernel matrix. Then, the kernel matrix and kernel matrix labels are used to calculate the loss, and backpropagation is used to train and optimize the parameters of the deep neural network. The reinforcement learning algorithm takes a reward function and error feature data as input and outputs a kernel matrix. The kernel matrix is ​​used to compensate for the morphological operations of the sliced ​​image. The compensated sliced ​​image is input into a 3D printer, and the sliced ​​image is output. The error between the compensated sliced ​​image and the sliced ​​image output is calculated to obtain error feature data, which is then fed into the reward function to give the reward value of the current kernel matrix, and then input to the next time step.

[0041] Furthermore, the image processing method is Gaussian smoothing.

[0042] A 3D printing accuracy control system based on image morphology operations includes:

[0043] The slicing module is used to process the 3D model to obtain sliced ​​images and to obtain contour images based on the sliced ​​images;

[0044] The image processing module is used to perform image morphology operations on the contour image to obtain a compensated contour image, then merge the compensated contour images to obtain a compensated slice image, and then perform image processing on the compensated slice image.

[0045] The 3D printing module is used to print the processed and compensated sliced ​​images.

[0046] A computer-readable storage medium storing a computer program, characterized in that the computer program can be executed by at least one processor to cause the at least one processor to perform the steps of a 3D printing precision control method based on image morphology operations as described above.

[0047] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0048] This invention employs image morphology operations to control the precision of sliced ​​images, effectively processing edge contour pixels and compensating for errors in the contour edges. Simultaneously, by extracting contours from the sliced ​​images and constructing a contour hierarchy tree, different degrees of compensation can be applied to each contour (including inner and outer contours) within the sliced ​​image. In practical simulation experiments and production applications, using this precision control method, compared to no compensation operation, can significantly reduce the errors between the finished product and the model caused by material shrinkage, projection errors, etc., during the 3D printing process, thereby improving the actual printing accuracy.

[0049] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description, claims, and drawings. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 A flowchart illustrating a 3D printing accuracy control method based on image morphology operations according to an embodiment of the present invention is shown.

[0052] Figure 2 A schematic diagram of a 3D printing accuracy control process based on image morphology operations according to an embodiment of the present invention is shown.

[0053] Figure 3 This illustration shows a schematic diagram of kernel matrix optimization training based on a supervised learning method using a deep neural network architecture in an embodiment.

[0054] Figure 4 This illustration shows a schematic diagram of kernel matrix optimization structure based on reinforcement learning method using deep neural network architecture in an embodiment of the present invention;

[0055] Figure 5 An example of erosion and dilation operations in image morphology operations is shown in an embodiment of the present invention. Figure 1 ;

[0056] Figure 6 An example of erosion and dilation operations in image morphology operations is shown in an embodiment of the present invention. Figure 2 ;

[0057] Figure 7 A schematic diagram illustrating the precision control of the inner and outer diameters in an embodiment of the present invention is shown;

[0058] Figure 8 This invention presents a comparison of the effects of different precision control operations on sliced ​​images in an embodiment of the invention.

[0059] Figure 9 This invention presents a comparison of the effects of applying different levels of Gaussian smoothing to the compensated sliced ​​image in an embodiment of the invention.

[0060] Figure 10 A schematic diagram of the system structure of a 3D printing accuracy control method based on image morphology operations is shown. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] like Figure 1-2 As shown, this invention provides a 3D printing accuracy control method based on image morphology operations, specifically including the following steps:

[0063] S1. The three-dimensional model is processed using slicing software to obtain sliced ​​images, and a contour image is obtained based on the sliced ​​images.

[0064] Slicing software is a primary tool for processing 3D models during 3D printing, supporting functions such as rotation, scaling, and support generation. The main function of slicing software is to divide a complete 3D model into multiple layer slices. After precision control, these slices are generated into several binary images, packaged together to form slice image data, and then sent to the 3D printer for recognition and printing. A 3D model is a 3D model of the object to be printed. 3D is a 3D graphics file format used for rapid prototyping technology. A 3D model consists of the definition of multiple triangular facets. The definition of each triangular facet includes the 3D coordinates of each vertex of the triangle and the normal vector of the facet. 3D models can be generated using graphics modeling software or a 3D scanner.

[0065] Furthermore, step S1, which involves acquiring the contour image based on the slice image, specifically includes the following steps:

[0066] S101. Extract image contour data from the sliced ​​image, and construct a contour hierarchy tree based on the image contour data;

[0067] S102. Fill the inner and outer contours according to the contour hierarchy tree to obtain a contour image.

[0068] Specifically, the 3D model of the object to be printed is imported into slicing software. The slicing software cuts the 3D model into several binary images, obtaining slice images. Extracting the image contour data from the slice images involves extracting the boundaries of the object in the 3D printing slice image and depicting them as closed curves in the image. The interior of the contour curves is then completely filled. The extracted curves are closed, and all extracted elements represent the boundaries of the target. Depending on the object in the actual slice image, there may be multiple contour images. A contour hierarchy tree is established among these multiple contour images. Specifically, one slice image is taken sequentially, and a contour extraction algorithm based on binary images is used to extract the contour data into multiple sets of vectors consisting of continuous point sets. Simultaneously, contour structure information is extracted to construct a contour tree. Based on the contour tree, different contours are divided for compensation. Specifically, for each contour image, the pixel values ​​enclosed within the contour are filled with pixel values ​​consistent with the contour curve, resulting in all contour images of the slice image.

[0069] S2. Perform image morphology operations on the contour image using a kernel matrix to control the inner diameter contour accuracy and the outer diameter contour accuracy, thereby obtaining a compensated contour image. The inner diameter contour accuracy control is to compensate for the dimensional accuracy of the closed inner contour of each slice contour image, and the outer diameter contour accuracy control is to compensate for the dimensional accuracy of the outer contour of each slice contour image.

[0070] Specifically, the parameters of the kernel matrix are generated by a machine learning algorithm or set manually. The machine learning algorithm automatically generates the kernel matrix parameters and the number of iterations by learning from the errors in the printed data. The kernel matrix parameters include the kernel matrix size (m×n), the value of each element in the kernel matrix (typically 0 or 1), and the position of the kernel matrix anchor points. The input to the machine learning algorithm is the printing error, i.e., the error between the 3D printer's output and the input; the output is the first parameter of the current kernel matrix, used for precision control. The machine learning algorithm includes, but is not limited to, methods such as supervised learning and reinforcement learning, which fit the relationship between the sliced ​​image and the kernel matrix parameters through supervised learning and reinforcement learning.

[0071] Furthermore, let the 3D printing accuracy compensation model generated by the machine learning algorithm be function f(·), and the model for calculating printing error be function g(·), k i Let be the kernel matrix of the i-th contour. The relationship between the input and output of the machine learning algorithm can be expressed as:

[0072]

[0073] k l,i ={K nm anchor(x,y)}

[0074] Among them, K nm It is a Boolean matrix with elements of 0 or 1, and anchor(x, y) is the anchor point position of the kernel matrix. The anchor point position can be any position on the kernel matrix; 1≤x≤n, 1≤y≤m, where the values ​​of m and n are at most the same as the resolution of the standard slice image, preferably 3, 4 or 5;

[0075] iterations l,i Is with k l,i The number of iterations corresponding to the kernel matrix. l,i ∈Z, where Z represents the set of integers. A negative integer represents the erosion operation, 0 represents no operation, and a positive integer represents the dilation operation. The absolute value of the integer represents the number of iterations. l,i =n indicates that the kernel matrix is ​​used to perform abs(n) loop operations, and abs(·) indicates taking the absolute value.

[0076] l represents the sequence number of the slice image, i represents the sequence number of the contour image contained in the l-th slice image, and j represents the sequence number of the summation traversal.

[0077] normal_contour l,i It is the i-th standard 3D printed slice outline image in the l-th slice image;

[0078] y∈(0,1] is a discount factor, which is set manually to balance the weight of the compensation model on the current printing error and the historical printing error;

[0079] It is the sum of the discount error characteristics of historical printing;

[0080] layer_error j In this context, j represents the index of the summation traversal, and here it represents the printing error of the j-th layer.

[0081] The functional model for calculating the characteristics of printing errors is as follows:

[0082]

[0083] contour_num l This represents the total number of contours contained in the slice image of layer l.

[0084] j represents the index of the summation traversal, contour_error l,j The error feature representing the j-th contour in the l-th slice image is calculated using the following function model:

[0085] contour_error l,j =g(normal_contour l,j deform_contour l,j )

[0086] deform_contour l,j It is the outline image of the slice printed by the j-th 3D printer in the slice image of the l-th layer;

[0087] The above l represents the sequence number of the slice image obtained after slicing the 3D model, and i and j represent the sequence numbers of all contours extracted from the printed image of the l-th slice image. The sequence numbering rule is as follows: in a single slice layer, the numbers are assigned according to the order of traversing the contour hierarchy tree established for the single-layer contour image.

[0088] Specifically, historical printing error features are stored in an error feature database, which is formed by accumulating the error features of each new print. This process of cyclical precision control continuously accumulates the error feature database. By forming this database, historical printing error data can be preserved and used as a dataset for training machine learning algorithms. Simultaneously, during precision control, historical discount errors can be calculated, allowing the precision control algorithm to rely not only on the error data from the previous moment but also on the overall error data to arrive at the optimal precision control strategy.

[0089] Furthermore, such as Figure 3 As shown, in this embodiment of the invention, a kernel matrix employing a deep neural network architecture is optimized and trained using a supervised learning method, where the input is error feature data, namely normal_contour. l,i and The output kernel matrix is ​​then used to perform a loss calculation with the kernel matrix labels. Finally, backpropagation is used to train and optimize the parameters of the deep neural network.

[0090] Furthermore, such as Figure 4 As shown, in this embodiment of the invention, a reinforcement learning method is used to optimize the structure of a kernel matrix employing a deep neural network. The reinforcement learning agent is composed of a deep neural network, and its inputs are a reward function and error feature data, with the output being a kernel matrix. Morphological operations on sliced ​​images are compensated using the kernel matrix. The compensated sliced ​​image is then input into a 3D printer, and the output sliced ​​image is compared with the compensated sliced ​​image to calculate the error feature data, which is then fed into the reward function to provide the reward value for the current kernel matrix. This data is then input into the agent at the next time step, and the process is iterative. The reinforcement learning algorithm maximizes the expected value of the reward function.

[0091] Furthermore, such as Figure 5 and Figure 6 As shown, image morphological operations mainly include erosion and dilation operations, among which... Figure 5 In Figure (a), the process of dilation operation is shown. After inputting the contour image, the edge contour pixels of the contour image are expanded and increased through the dilation operation. Figure 5 In step (b), during the erosion operation, after inputting the contour image, the edge contour pixels of the contour image are eliminated through the erosion operation. In the erosion and dilation operation of image morphology operations in this embodiment of the invention, the contour data of the extracted contour image is obtained from the slice image and filled by the internal data of the contour image (such as...). Figure 6 As shown in (a), erosion or dilation operations are performed. In one embodiment of the invention, an "eight-connected" kernel matrix (such as...) is used. Figure 6 As shown in (b), where "P" represents the set kernel matrix anchor point, the "eight-connected" kernel matrix displays the "eight-connected" erosion result and the "eight-connected" expansion result obtained through erosion. The "eight-connected" kernel matrix is ​​similar to a rectangle; when using rectangular structuring elements for erosion operations, the contour edges will shrink inward. In another embodiment of the invention, a "four-connected" kernel matrix (such as...) is used. Figure 6 As shown in (c), the results of "four-connected" erosion and "four-connected" dilation are illustrated. The "four-connected" kernel matrix is ​​typically used to connect adjacent contour regions, forming a unified whole. During erosion, the edges of the contours can be reduced along a cross-shaped direction, thus connecting adjacent contour regions. The results of "four-connected" erosion or dilation are not the same as those of "eight-connected" erosion or dilation. Therefore, different precision control results can be achieved by using different kernel matrix forms, and these results are related to actual printing requirements.

[0092] Specifically,

[0093] The corrosion calculation formula is:

[0094] The expansion formula is:

[0095] Where A is the contour image matrix to be compensated, and B represents the kernel matrix.

[0096] For image morphology operations on a single contour image, the [k] can be determined based on the function model f(·). l,i ,iterations l,i The value of ] is used for precision control, which involves compensating for the inner and outer contours of the contour image. This is specifically done through image morphology operations, and the compensation rules are as follows:

[0097] • when items l,i <0, the image morphological operation of the contour image is represented as:

[0098] normal_contour l,i Θ[k l,i ,iterations l,i ],

[0099] The compensation result for the contour image is as follows:

[0100]

[0101] • When iterations l,i >0, the image morphological operation of the contour image is represented as:

[0102]

[0103] The compensation result for the contour image is as follows:

[0104]

[0105] • When iterations l,i The contour image is not processed; that is, the compensation result for the contour image is itself.

[0106] Based on the above compensation rules, the kernel matrix can be used to perform image morphology operations on the current contour image, thereby achieving the purpose of precision control by performing image morphology operations on the 3D printed slice contour image based on historical printing errors.

[0107] Furthermore, such as Figure 7 The diagram illustrates the specific inner and outer diameter accuracy control in this embodiment of the invention. Inner diameter contour accuracy control compensates for the dimensional accuracy of the closed inner contour (such as the contour of a gear's inner hole) on each slice of the model; outer diameter compensation compensates for the dimensional accuracy of the outer contour on each slice of the model. Here, A represents the inner diameter compensation value, and B represents the outer diameter compensation value. When A is positive (compensating for model shrinkage), the inner diameter decreases, and the model solid increases. When A is negative (compensating for model expansion), the inner diameter increases, and the model solid decreases. When B is positive (compensating for model shrinkage), the outer diameter increases, and the model solid increases. When B is negative (compensating for model expansion), the outer diameter decreases, and the model solid decreases.

[0108] like Figure 8 As shown, this illustrates a comparison of the effects of different precision control operations on sliced ​​images in embodiments of the present invention, wherein... Figure 8 Image (a) is the original image. Figure 8Images (b) and (c) are schematic diagrams of the inner contour dilation and erosion by 5 pixels, respectively. Figure 8 Images (d) and (e) are schematic diagrams illustrating the expansion and erosion of the outer contour by 5 pixels, respectively. During printing, the deformation of the inner and outer contours differs, thus requiring different degrees of compensation. Furthermore, during printing, a slice image may contain one or multiple models; therefore, this invention compensates not only for the outer contour of each model but also for the internal contours of each model.

[0109] S3. Merge the compensated contour images to obtain a compensated slice image. It is important to emphasize that all contour images must be processed before proceeding to step S3. If not, return to step S101 and process again until all contour images are processed. Merging all processed contour images into a single slice image uses algebraic operations, primarily addition and subtraction. The result of addition is the sum of the pixel values ​​of corresponding pixels in the contour images, and the result of subtraction is the difference in pixel values ​​between corresponding pixels in the contour images.

[0110] Furthermore, the compensated contour image is merged according to the contour merging function merge(·):

[0111] compensate d_laayer l =merge(compebsate_contours) l contour_hierarchy_tree l )

[0112]

[0113] The OR operator above represents "or," meaning it uses either "erosion" or "dilation" operations. compensated_layer l For the compensated slice image of layer l, compensated_contours l The contour_hierarchy_tree is the set of compensated contour images of the l-th slice image. l This is the contour hierarchy tree of the slice image at layer l.

[0114] Furthermore, the specific operations of merge(·) include the following steps:

[0115] S301. Perform a hierarchical traversal of the contour hierarchy tree of the l-th layer slice image to obtain the hierarchy number of each layer slice image in the contour hierarchy tree.

[0116] S302. Perform image addition on each contour image and merge them into a single hierarchical contour image containing multiple contours, and sort them according to the hierarchical number of the contour hierarchy tree.

[0117] S303. Starting from the root contour image of the contour hierarchy tree, perform image addition and subtraction operations on the hierarchical contour images to merge multiple hierarchical contour images into one, and obtain the compensated slice image.

[0118] S4. Perform image processing on the compensated slice image and send the processed compensated slice image to the 3D printer for printing.

[0119] The image processing can employ Gaussian smoothing, which involves applying a certain degree of Gaussian smoothing to the compensated slice image after precision control using image morphology operations. Gaussian smoothing is based on a Gaussian filtering algorithm and supports various levels of smoothness, while also allowing for the setting of blur pixel values ​​as needed. The processed compensated slice image is then sent to the 3D printer, which recognizes the image and prints the corresponding 3D object model. This process is repeated until printing is complete.

[0120] like Figure 9 As shown in the figure, this embodiment of the invention illustrates the effect of applying different levels of Gaussian smoothing to a slice image. The left image shows a slice image with 1 pixel of blurring, while the right image shows a slice image with 3 pixels of blurring. Since "burrs" are easily generated at the edges of the slice image after precision control, Gaussian smoothing is needed to further compensate for this. Its purpose is to make the surface of the object to be printed smoother. As can be seen from the figure, when 1 pixel is processed, the model has higher precision; when 3 pixels are processed, the model surface is smoother. The specific settings can be adjusted according to the user's actual needs. Pixel-level precision control is achieved by setting kernel matrices of different sizes.

[0121] In this invention, a standard 3D model is input, and the outline of the sliced ​​image of the 3D model is processed by image morphology based on historical printing error characteristics. The newly printed error characteristics are then added to the error characteristic database. This process of cyclical precision control continues until printing is completed, and the error characteristic database is continuously accumulated, which can provide a good foundation for precision control of subsequent model printing.

[0122] like Figure 10 As shown, the present invention also provides a system for a 3D printing accuracy control method based on image morphology operations, comprising:

[0123] The slicing module is used to process the 3D model to obtain sliced ​​images and to obtain contour images based on the sliced ​​images;

[0124] The image processing module is used to perform image morphology operations on the contour image to obtain a compensated contour image, then merge the compensated contour images to obtain a compensated slice image, and then perform image processing on the compensated slice image.

[0125] The 3D printing module is used to print the processed and compensated sliced ​​images.

[0126] The present invention also provides a computer-readable storage medium storing a computer program that can be executed by at least one processor to perform the steps of a 3D printing precision control method based on image morphology operations as described above.

[0127] The computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0128] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0129] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (AN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.

Claims

1. A 3D printing accuracy control method based on image morphological operations, characterized in that, Specifically, the following steps are included: S1. The three-dimensional model is processed using slicing software to obtain sliced ​​images. The l-th layer sliced ​​image is extracted, and the contour image is obtained based on the sliced ​​image, where l is a natural number greater than or equal to 1. S2. Perform image morphology operations on the contour image using a kernel matrix to control the inner diameter contour accuracy and the outer diameter contour accuracy, resulting in a compensated contour image. The inner diameter contour accuracy control compensates for the dimensional accuracy of the closed inner contour of each slice contour image, and the outer diameter contour accuracy control compensates for the dimensional accuracy of the outer contour of each slice contour image. The parameters of the kernel matrix include the kernel matrix size, kernel matrix element values, and kernel matrix anchor point positions. S3. The compensated contour images are merged through algebraic operations to obtain compensated slice images; S4. Perform image processing on the compensated slice image and send the processed compensated slice image to the 3D printer for printing. Repeat the above steps until the three-dimensional model is printed. The parameters of the kernel matrix are generated by a machine learning algorithm, which takes printing error features as input and outputs the current kernel matrix parameters. The relationship between the input and output of the machine learning algorithm is expressed as follows: l represents the sequence number of the slice image, i represents the sequence number of the contour image contained in the l-th slice image, and j represents the sequence number of the summation traversal; normal_contour lj It is the outline image of the i-th standard 3D printed slice in the l-th layer slice image; γ∈(0,1] is the discount factor; It is the sum of historical printing error characteristics; k lj Let k be the kernel matrix of the i-th contour in the l-th layer. l,i ={K nm anchor(x, y)}, K nm It is a Boolean matrix with elements of 0 or 1, where anchor(x, y) is the anchor point of the kernel matrix, 1 ≤ x ≤ n, 1 ≤ y ≤ m; iterations l,i Is with k l,j The number of iterations corresponding to the kernel matrix. l,i ∈Z, where Z represents the set of integers, when iterations l,i When the integer is negative, it represents the erosion operation, iterations l,i When it is a positive integer, it represents the expansion operation, iterations l,i A value of 0 indicates no operation is performed; the number of iterations. l,i =n indicates that the kernel matrix is ​​used to perform abs(n) loop operations, and abs(·) indicates taking the absolute value; layer_error j This represents the printing error of the j-th layer; The functional model for calculating the characteristics of printing errors is as follows: contour_num l This represents the total number of contours contained in the l-th slice image; contour_error l,j The error feature representing the j-th contour in the l-th slice image is calculated using the following function model: contour_error l,j =g(normal_contour l,j ,deform_contour l,j , deform_contour l,j It is the outline image of the slice printed by the j-th 3D printer in the slice image of the l-th layer; The compensation rules for the contour image are as follows: When iterations l,i <0, the image morphological operation of the contour image is represented as: normal_contour l,i The[k l,i ,iterations l,i ], The compensation result for the contour image is as follows: When iterations lj >0, the image morphological operation of the contour image is represented as: The compensation result for the contour image is as follows: When iterations l,i =0, the contour image is not processed, that is, the compensation result of the contour image is itself.

2. The 3D printing accuracy control method based on image morphology operations according to claim 1, characterized in that, The step S1, which obtains the contour image based on the sliced ​​image, specifically includes the following steps: S101. Extract the image contour data of the sliced ​​image, and construct a contour hierarchy tree based on the image contour data; S102. Divide the inner and outer contours according to the contour hierarchy tree, and fill the inner and outer contours to obtain a contour image.

3. The 3D printing accuracy control method based on image morphology operations according to claim 1, characterized in that, The historical printing error features are stored in an error feature database, which is formed by accumulating the error features of each new print.

4. The 3D printing accuracy control method based on image morphology operations according to claim 1, characterized in that, The compensated contour image is merged according to the contour merging function merge(·), and the compensated slice image of the l-th layer is represented as follows: compensated_layer l =merge(compensate_contours l ,contour_hierarchy_tree l ), Where OR stands for "or", meaning it uses either "erosion" or "dilation" operations, compensated_layer l For the compensated slice image of layer l, compensated_contours l The contour_hierarchy_tree is the set of compensated contour images of the l-th slice image. l This is the contour hierarchy tree of the slice image at layer l.

5. The 3D printing accuracy control method based on image morphology operations according to claim 4, characterized in that, The specific operation of merge(·) includes the following steps: S301. Perform a hierarchical traversal of the contour hierarchy tree of the l-th layer slice image to obtain the hierarchy number of each layer slice image in the contour hierarchy tree. S302. Perform image addition on each compensated contour image and merge them into a hierarchical contour image containing multiple contours. Sort the images according to the hierarchical number of the contour hierarchy tree. The contour hierarchy tree contains the hierarchical relationship of all contours, specifically including the index number of the next contour, the previous contour, the embedded contour, and the parent contour. S303. Perform image addition and subtraction operations on the hierarchical contour images to merge multiple hierarchical contour images into one, and obtain the compensated slice image.

6. The 3D printing accuracy control method based on image morphology operations according to claim 1, characterized in that, The machine learning algorithms include, but are not limited to, supervised learning algorithms and reinforcement learning algorithms. The supervised learning algorithm uses a kernel matrix of a deep neural network architecture for optimization training. The input is error feature data, and the output is a kernel matrix. Then, the kernel matrix and kernel matrix labels are used to calculate the loss, and backpropagation is used to train and optimize the parameters of the deep neural network. The reinforcement learning algorithm takes a reward function and error feature data as input and outputs a kernel matrix. The kernel matrix is ​​used to compensate for the morphological operations of the sliced ​​image. The compensated sliced ​​image is input into a 3D printer, and the sliced ​​image is output. The error between the compensated sliced ​​image and the sliced ​​image output is calculated to obtain error feature data, which is then fed into the reward function to give the reward value of the current kernel matrix, and the input continues to the next time step.

7. The 3D printing accuracy control method based on image morphology operations according to claim 1, characterized in that, The image processing method is Gaussian smoothing.

8. A system for controlling the accuracy of 3D printing based on image morphology operations according to any one of claims 1-7, characterized in that, include: The slicing module is used to process the 3D model to obtain sliced ​​images and to obtain contour images based on the sliced ​​images; The image processing module is used to perform image morphology operations on the contour image to obtain a compensated contour image, then merge the compensated contour images to obtain a compensated slice image, and then perform image processing on the compensated slice image. The 3D printing module is used to print the processed and compensated sliced ​​images.

9. A computer-readable storage medium storing a computer program, characterized in that, The computer program may be executed by at least one processor to cause the at least one processor to perform the steps of a 3D printing accuracy control method based on image morphology operations as described in any one of claims 1-7.

Citation Information

Patent Citations

  • High-precision smooth printing method of DLP (Digital Light Processing) photocuring 3D (Three-dimensional) printer

    CN107972266A

  • Visual inspection method for 3D printing model surface defects

    CN108760747A