Application of 3D Printing Reconstruction Algorithm in Ancient Ceramic Restoration

The study of the ancient ceramic is of great signiﬁcance to the identiﬁcation of authenticity, value recognition, cultural types, and dissemination channels of the ceramic. In this study, a series of technical problems such as ceramic contour extraction, image distortion correction, and nonlinear contour modeling for 3D printing of rotating body under complex background were solved and a restoration algorithm for the shape of ancient ceramics was proposed. Then, an accurate contour model is established by using the two-dimensional images of the rotating ancient ceramics to reconstruct the three-dimensional model of the ceramic shape. The experimental results show that the modeling algorithm for three-dimensional printed ceramics can accurately obtain the three-dimensional model of rotating ancient ceramics, which is of certain signiﬁcance to explore a new direction of the research and development of three-dimensional printed ancient ceramics.


Introduction
Archaeological Ceramics in China have a long history and are rich in cultural relics. With the continuous improvement of material life in Chinese society, more and more people are interested in ceramic cultural relics, and the identification, protection, and inheritance of ancient ceramics are increasingly important. In the identification process of ancient ceramics, the origin and age of products are the most important, and its technical difficulty is also the highest [1]. Since ancient times, the main method of source and date identification is the use of human eye recognition, that is, relying on the long-term accumulated experience of appraisers to judge, inevitably into the influence of subjective factors, more importantly, the lack of multi-information data management and big data analysis, resulting in a lot of useful information hidden in it being ignored or misread [2]. With the appearance of 3D printing technology, this technology provides a better technical means for the finishing of ceramic materials. It is flexible in design, can print highly complex structure, with precise three-dimensional size, and can simultaneously build multiple print objects at one time, significantly improving production efficiency. is research status of ancient ceramics seriously affects the inheritance and development of ancient ceramic technology [3].
In the multiple ceramic product information, the product type has the distinct characteristics of times and regions, so the ancient ceramic type plays an incomparable role in the identification and numerical simulations [4]. In the information age, the extraction and analysis of the morphological characteristics of ancient porcelain in different historical periods and different structural characteristics can provide reference for the traceability of ancient porcelain and the identification of authenticity. is work is of great significance to further study the relationship between the artistic characteristics of ceramics and culture and aesthetics. Traditional potteries are typically made from a mixture of powder and binder or other additives, processed using conventional techniques such as injection molding, molding, casting, and gel casting, and sintered green at higher temperatures for densification [5,6]. However, these ceramic molding techniques are limited by long processing time and high cost. Furthermore, those algorithms used for studying archaeological ceramic, mainly concerning the axially symmetric geometry recognition, which is a geometry property of the greater region of a vessel [7]. For ancient ceramic, the elements not regarded as this category of axially symmetric geometry can be discerned in general [8].
With the appearance of 3D printing technology, this technology provides a better technical means for the finishing of ceramic materials [9,10]. It is flexible in design, can print highly complex structure, with precise three-dimensional size, and can simultaneously build multiple print objects, significantly improving the restoration efficiency of ancient ceramics. e earliest 3D printing technology for potteries was developed and realized in the 1990s. With the continuous development of 3D printing technology and the increasing demand for ancient ceramic restoration, personalized design and processing can also be realized through 3D printing technology [11]. However, for complex potteries, especially ancient ceramics used for structural restoration, such as restored bowls, vases, and other handicrafts, their complex geometric shape and interconnection between the internal apertures lead to their difficult processing, which presents a great challenge for the processing of materials. 3D printing technology has developed from the initial melting deposition manufacturing, inkjet printing technology to prepare ceramic green, and then sintering, to the present integration of laser sintering and light curing molding new technology [12]. As presented in Figure 1, 3D printing technology has been widely used in ceramic industry, such as multifunctional ceramics, high temperature resistant materials, aerospace industry, medical engineering, and cultural relic restoration [13].
e study on the dimensions of the properties is significant for identifying the tools applied in the creation of the decoration. However, it is difficult and inefficient to accurately extract ceramic types and to obtain the real parameters of ceramic types by conventional measurement methods due to the diversity and complexity of ancient ceramic products [14]. Furthermore, most ancient ceramics are genuinely stored in the museum and with private collectors; for reasons of security or privacy, the owner of these ceramic products or unit is generally not willing to put their expensive ancient ceramics for equipment scanning and data acquisition, even if reluctantly agreed to also pass through the complex procedures, making ancient ceramics 3D scanning data [15]. All these have caused the serious shortage of digital data of ancient ceramic ware in the era of big data with information expansion, which has seriously restricted the progress of research on big data of ceramic wares. In recent years, using machine vision technology to accurately restore two-dimensional image information to three-dimensional model has become a new direction of ancient ceramics research [16][17][18]. Some scholars have done some work in the curve fitting of a skimming bottle. Besides, the edge characteristics of skimming bowl have been studied [17,19]. Although many researchers have tried to obtain the ancient ceramic shape by using various image processing methods, due to the problems of two-dimensional image distortion, complex image background, and large difference in image quality, the extracted model error is large, and the restored 3D model deformation is serious [20]. ese problems have long been difficult to break through and become the shackles of the development of 3D printing technology of ancient ceramics [21][22][23][24][25].
In view of this background, this paper under the background of solving complex contour extraction and image distortion correction, under the premise of technical bottlenecks, developed a set of technologies based on machine vision of the ancient porcelain ware three-dimensional reduction algorithm; this algorithm can go through nonlinear image enhancement, the distortion compensation, and curve fitting such as machine vision and pattern recognition technology to build accurate model of the ancient porcelain ware. e complete information of ancient ceramic ware type can be obtained by a few parameters.

3D Restoration Algorithm.
is study used threedimensional virtual models to reconstruct the ancient ceramic. Hence, the term samples are the ancient ceramic bottles from Chinese museum. In this study, three different ancient Chinese ceramic vases were used for threedimensional morphological analysis. e 3D restoration algorithm mainly includes image enhancement, image distortion correction, modeling, and 3D reproduction of ancient ceramic. e working principle diagram of 3D reduction algorithm for ancient ceramic vessel type is shown in Figure 2, which is core studying object of this paper. A special recognition process of real ancient potteries based on three-dimensional calculations by computer is used for analyzing the discrete model generated by real scans. Besides, the original surface is approximated by triangular surface of the threedimensional models. rough the complex processing of 3D data, the 3D geometric model is obtained, which contains low-level geometric information, such as the coordinates of points and the normals of triangles, and advanced information, such as measurement of ceramic bottle radius. For ancient ceramic bottles, the above evaluation is complex due to the limited grid sampling range, manufacturing errors, and other factors [26].

ree-Dimensional Reconstruction
Technique. Accurate extraction of ancient ceramic wares from 2D image contour is the first step to shape three-dimensional reduction, but because of the variety of forms, the image with low pixel restored by the 3D model is far from the real ancient porcelain, and, precision is very low; you cannot even get a threedimensional model. Accordingly, this algorithm first uses the edge of images, which is enhanced by wavelet transform to improve the discernibility of the edge of ancient potteries, and the edge contour of ancient potteries is clearly extracted and accurately located. e specific process is as follows.
Equations (1) and (2) are used to perform two-dimensional discrete wavelet transform on the image F (x, y) with the original image size of M × N and decompose the original image into a low frequency subimage band containing image contour information and a high-frequency subimage band dominated by background noise. By adjusting the weight of the approximate coefficient Wφ and the detail coefficient Wiψ of the high and low frequency subbands in equations (1) and (2) after wavelet transform, the sharpness of the image contour can be improved and the image noise can be further reduced. Finally, the inverse wavelet transform formula is used to synthesize the image after edge enhancement, which can realize the image edge enhancement and achieve the purpose of highlighting the edge contour of ceramic ware images.
where W φ is the approximate coefficient of image contour information. W i ψ is the detail coefficient of identification image. φ j0,M,N are scale basis functions. ψ ij, M, N are translation basis functions. {H, V, D} respectively represent different orientation image details.
By adjusting the weight of the approximate coefficient W φ and the detail coefficient W iψ of the high and low frequency subbands in equations (1) and (2) after wavelet transform, the sharpness of the contour can be improved.

Adaptive Perspective Correction of 2D
Images. Based on the 2D images, the image distortion caused by the shooting angle, distance, and lens difference will greatly affect the 3D restoration accuracy of the device. erefore, this paper proposes a method to estimate the shooting angle of an image using elliptic Hough transform, which can accurately estimate the shooting angle of  Scientific Programming the camera relative to each region of the image. On this basis, the perspective transform method is used to realize the distortion compensation of two-dimensional image partition [27].
(1) According to the contour image of ancient ceramics, extract the contour curves of its top and bottom. (2) Elliptic contour detection algorithm based on Hough transform is used to fit the elliptic models of the top and bottom of contour image. (3) Calculate the shooting angle of the image according to the ellipse. e angle calculation process is shown in Figure 3. Under ideal conditions, assuming that the camera is a parallel incident ray, when the camera shoots a ceramic shape with a radius of M at angle θ, the PQVW surface on the top of the ceramic shape forms an ellipse in the ABCD plane, and the shooting angle can be calculated by the algorithm. Similarly, the shooting angle of the lower edge of the ancient ceramics can be obtained by extracting contour lines of the lower edge according to the contour line. e values l and l ' are the longitudinal dimensions before and after correction [28]. where, C 1 and C 2 are empirical parameters, and c j is maximum tangent value of the dihedral angle.
e membership function satisfies the normality condition because of the generic node: A comparison between the node p j on the boundary region F j and the node p k is used as the following dissimilarity parameter D (p j , F j ): where μ ek is the evaluated membership functions at the node p k .
In this study, the value μ rk1 is assigned as shown in equation (9).

Modeling of Shape and Edge of Ancient Ceramic Ware
Based on Neural Network Technology. e lateral edge contour baseline was extracted from the ancient ceramic edge contour image after distortion correction, and the mathematical model of the baseline was constructed. e accuracy of the edge contour model directly affects the effect of 3D modeling. In principle, neural network can approximate any nonlinear curve, so this paper uses backpropagation (BP) neural network to accurately model the baseline of ancient ceramic side edge contour [29].
A specific BP neural network with three layers is used in the study. ey are input layer, hidden layer, and output layer [17]. Both the input layer and the output layer of the network have one node; that is, the input layer receives the horizontal coordinate data of 1 × 1 side edge curve, and the output layer generates the vertical coordinate data of 1 × 1 side edge curve prediction. e hidden layer activation function uses nonlinear Sigmoid function to map input and output data nonlinearly. In building a network of hidden layer nodes, in order to guarantee the network error converges to the premise as small as possible, to reduce the training time of network and at the same time avoid network overfitting phenomenon of samples, the experiment is done many times to adjust the network parameters, and finally selected use of 30 nodes of neurons in hidden layer neural network structure is set up. In this paper, MSE means the Scientific Programming mean square error. In order to ensure the training accuracy, the number of network iterations is set as 500, and the MSE converges to 0 during the training. e samples and labels are continuously sent into the constructed BP network. rough the forward propagation of signals and the parameter feedback modification based on error, the network continuously descends to the gradient direction according to the deviation and iteratively adjusts the weights and thresholds of each neuron node until the error drops to the target range. e neural network transfer model adopted in this paper is shown in equations (10) and (11).
e key of network model is used for the acquisition of training samples and tags. e samples and labels used in this paper are the horizontal and vertical coordinates corresponding to the side edge contour. After contour extraction and distortion correction of the original ancient ceramic image, the upper left, upper right, lower left, and lower right endpoints of the corrected ancient ceramic contour image were extracted as the starting and ending endpoints of the two side edge contour lines according to the change of contour edge curvature, so as to obtain the accurate side edge curves. After that, the symmetrical central axis was obtained through the four endpoints and used as the X-ray to extract every pixel on any side edge contour and map its horizontal and vertical coordinates of the corresponding X axis, which were used as training samples of neural network and tag training in this paper.

3D Reconstruction Algorithm Flow of Ancient Ceramics.
e curve model of ancient ceramic side edge contour established by BP neural network contains complete information about the shape of the rotating body ancient ceramic, which can be saved as the original data of the shape. erefore, the 3D model of the shape can be obtained by rotating around the central axis of the shape through the curve model, which is the final 3D reproduction model of the ancient ceramic shape. e complete flowchart of the algorithm in this paper is shown in Figure 4. In the process, K is used to represent the times of image enhancement algorithm, while the interactive extraction module is an auxiliary means when automatic curve extraction is not accurate enough. e specific steps are as follows: (1) Use wavelet transform to read the original image, sharpen and enhance the contour while reducing the image noise, and then use edge detection algorithm to extract the image edge contour; image enhancement algorithm can be used repeatedly to achieve the best effect; here set a maximum of three times; after exceeding the upper limit, use interactive extraction algorithm to assist extraction. Based on wavelet transform, a new method for detecting transient signals of three-dimensional model has been applied.

Computer Experiment and Analysis
e ancient ceramic wares were scanned by 3D printing model with cultural relics type contactless digital scanning and measuring equipment and the point cloud data obtained from the standard ancient ceramic objects were used as the standard size to verify the accuracy of the proposed method.

Working Process of 3D Reduction Algorithm.
e method has been used in the study of refactoring shapes on an ancient vase, which is a very critical test case. In this experiment, twodimensional images of common jade pot spring vase were used as objects to show the complete restoration process of ancient ceramics from two-dimensional images to 3D models in detail. rough the steps of contour enhancement, angle distortion correction, side edge contour curve modeling, and 3D reconstruction of ceramic shape, the 3D restoration of ceramic shape is completed. e restore steps are shown in Figure 5.
rough simulation experiments, the adaptive perspective correction algorithm and the traditional distortion correction algorithm are, respectively, used to extract the side edge contour of ancient ceramics, and then the accuracy of the two algorithms is compared. e experimental results are shown in Figure 6. e left and right red curves in the figure are standard edge contour curves of jade spring bottles, which are fitted by interpolation function according to the physical standard point cloud data obtained by 3D scanner. e blue curve on the left is the edge contour curve of the jade pot spring bottle after processing the two-dimensional image with the traditional perspective correction method. e blue curve on the right is the edge contour curve of the jade pot spring bottle after processing the 2D image with the perspective correction algorithm in this paper. By comparison, it is found that the algorithm in this paper plays a significant role in improving the fitting accuracy of the area with large curve fitting error (the part circled in Figure 6), which makes the fitting error decrease from 2.65% to 0.81%.
In order to verify the accuracy of the neural network fitting curve, the neural network algorithm in this paper is compared with the traditional polynomial interpolation function through experiments, and the accuracy difference Scientific Programming between the two methods in constructing the side edge model of ancient ceramics is compared. Figure 6 shows the convergence curve of MSE error with iterative training when BP network is trained using sample data of ancient ceramic side edge curve. It shows the effect diagram of modeling the contour curve of the side edge of the mulberry grape tank constructed by using the above-mentioned methods. After 500 iterations, the MSE error of the curve is only 5, about 12 × 10 −3 . As can be seen from Figure 6, the overall effect of the two methods on modeling the side edge of ancient ceramic bottles is relatively good. However, it can be seen from the effect diagram of the local contour detail model of the edge of ancient ceramic bottles constructed by the proposed method that the curve model constructed in this paper is more approximate to the contour details of the strange parts such as neck, tail, and base of the ceramic bottle.
It can be seen that the MSE error of the curve is only about 0.052% and the overall effect of the two methods on modeling the side edge of mulberry grape pot is relatively good. However, it can be seen from the local contour detail model of side edge of mulberry grape pot constructed in Figure 6 that the curve model constructed by the method in this paper is more approximate to the contour details of the Two-dimensional image ree-dimensional model Contour enhancement Distortion correction Side edge modeling strange parts such as neck, tail, and base. e data show that the mean square error (MSE) of the precision of mold fitting is only 5.12 × 10 −3 , much smaller than the traditional method of mean square error (MSE) 1.2 × 10 −2 ; for the realization of three-dimensional accurate reduction of ancient ceramics lay a solid foundation.

Accuracy Experiment of 3D Reduction
Algorithm. e results of reconstruction of 3D restored ancient ceramics are shown in Figure 7. In order to verify the restoration accuracy of the algorithm, 50 points were extracted from the point cloud coordinate data obtained from the physical object scanned by the 3D scanner as standard data to test the accuracy of the algorithm builder model. e calculating data of the sample analysis is listed in Table 1. e 2D images of ancient ceramics were obtained by changing the shooting angle and distance to verify the accuracy and robustness of the algorithm in 3D restoration. Besides, the test distance is the distance between the camera lens and the center of ancient ceramics, and the test angle is the included angle between the lens and the horizontal ground when the lens center is aligned with the center of ancient ceramics. e image quality of pictures under different conditions is expressed by using the degree of desirable, H_NRMSD is the percentage of longitudinal normalized root mean square error, and W_NRMSD is the percentage of normalized root mean square error in horizontal direction.
Comparing the data of the 3D model, the standard model is obtained by the algorithm flow in this paper. e H_NRMSD and W_NRMSD both mean the error of model size. H represents height and W represents width. It is found that the errors of the algorithm under H_NRMSD and W_NRMSD indexes are all less than 1.00. en, it can be seen that the algorithm can restore 3D objects using 2D images. With a high restoration accuracy and strong robustness, the reconstruction process adapts to changes in shooting conditions and overcomes the technical problems such as the image distortion and nonlinear contour model that cannot be completely solved in traditional 3D restoration results.

Precision Experiment of 3D Reconstruction.
In order to further test the restoration accuracy of 3D printing model algorithm, two 3D scanners, the noncontact digital scanning and measuring equipment of cultural relics and the advanced 3D scanner Einscan-SP on the market, were used to scan the ancient ceramic samples, respectively. ey are denoted as scanner I and scanner II below. e height data and side edge contour data extracted from the two sets of point cloud data were integrated and compared with the data extracted by the algorithm in this paper. e experimental test data are shown in Table 2. e data obtained from scanner I was used as the standard value to verify and compare the accuracy of the proposed method and the scanner II. H1 and W1 in Table 2 represent the vertical and horizontal precision of the ceramic contour model constructed by the algorithm in this paper. Meanwhile, H and W represent the vertical and horizontal precision of the data acquired by the scanner II. According to the testing data in Table 2, the modeling accuracy of the algorithm in this paper is closer to the standard data of the scanner. Besides, this conclusion can be seen more intuitively.
rough simulation experiments, the adaptive perspective correction algorithm and the traditional distortion correction algorithm are, respectively, used to extract the side edge contour of ancient ceramics, and then the accuracy of the two algorithms is compared. e experimental results are shown in Figure 8. e left and right red curves are standard edge contour curves of jade spring bottles, which are fitted by interpolation function according to the physical standard point cloud data obtained by 3D scanner. e blue curve on the left is the contour curve of the bottle side after processing the 2D image with the traditional perspective correction method. e blue curve on the right is the edge contour curve of the jade pot spring bottle after processing the 2D image with the perspective correction algorithm in this paper.

Conclusion
In this study, a series of technical problems such as ceramic contour extraction, image distortion correction, and nonlinear contour modeling for 3D printing of rotating body under complex background were solved and a restoration algorithm for the shape of ancient ceramics was proposed. e following conclusions are drawn.
(1) An accurate contour model is established by using the two-dimensional images of the rotating ancient ceramics to reconstruct the three-dimensional model of the ceramic shape. By studying a series of algorithms such as image enhancement, image distortion correction, modeling, and 3D reproduction of ancient ceramics, a complete 3D restoration algorithm of ancient ceramics was obtained. (2) Experimental results show that when the shooting angle is from −10°to 10°and the resolution is above 40,000 pixels, the algorithm can be used to reduce the    shooting angle to less than 1. Accurate reduction of 3D model of ceramic ware has error less than 6%. (3) e modeling algorithm for three-dimensional printed ceramics can accurately obtain the threedimensional model of rotating ancient ceramics, which is of certain significance to explore a new direction of the research and development of threedimensional printed ancient ceramics. erefore, the algorithm proposed in this study greatly facilitates the analysis, research, restoration, and display of ancient ceramics and provides a new method for the study of ancient ceramics. (4) With the continuous development and progress of 3D printing equipment, combined with the integration and intersection of multidisciplinary knowledge such as digitization, biomedical engineering, and medical imaging, 3D printing technology can not only customize personalized bioceramics products, but also realize the restoration of ancient ceramic crafts through 3D reconstruction technology. ere is reason to believe that 3D printing technology will certainly become one of the key technologies in the development of the restoration of cultural relics.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.