TO ACHIEVE REAL IMMERSION: THE 3D VIRTUAL AND PHYSICAL RECONSTRUCTION OF CAVE 3 AND CAVE 12 OF YUNGANG GROTTOES

: As the 3D laser scanning and photogrammetry technologies continue to mature, more and more applications founded in numerous areas. The realistic 3D models are mainly adopted for digital display uses, such as the 3D game, web showcases, head-mounted display, etc. While we are enjoying the vivid digital sceneries through different kinds of digital display screens, there are still challenges exist for the 3D printing application, especially for large size objects. In this article, we will present an approach on digitizing and 3D replicating large grottoes. Unlike 3D rendering, 3D printing requires high detailed shape data for the fabrication. Such demands cause many technical difficulties including huge data amount, accurate dense point cloud, high-resolution texture mapping. We chose cascade SfM, grouped MVS, automatic texture mapping to prepare the high definition colored 3D model for printing and painting references. Meanwhile, we optimized 3D printing procedure as well as post-processing, installation, lacquer and painting. Two replicas of 10-meter sized grottoes have been manufactured after four years of efforts, which have earned some appreciations from audiences.


INTRODUCTION
The natural characteristic of photogrammetry is to make the digital copy of real objects, which is most suitable for the digital preservation of cultural heritage.Although photogrammetry can't provide 3D copies with great detailed shape information as good as laser 3D scanning, it has significant advantages on the completeness of complex objects or scenes.After we adopted photogrammetry as a creative and powerful method in archaeological research and digital heritage preservation for several years, we started to explore the possibilities to combine it with 3D printing technology to conquer the challenge of replicating large grottoes in life size with high definition.The Yungang Grottoes are ancient Chinese Buddhist temple grottoes in Shanxi province of China.There are 252 caves and 51,000 statues in the Yungang Grottoes, which represent the remarkable achievement of Buddhist cave art in the 5th and 6th centuries in China and the whole world.Because of the masterpiece Chinese Buddhist cave art and historical value for the symbolic fusion of the Buddhist religious art from south and central Asia with Chinese traditions, the Yungang Grottoes were made a UNESCO World Heritage Site in 2001.China is a country with profound Buddhism Culture, and the Yungang Grottoes is one of most important three sites together with the Dunhuang Grottoes and the Longmen Grottoes.However, with the location in the suburban area 16 kilometers away from the Datong city, the Yungang Grottoes are not so easy to reach for the citizens.The airlines and trains connect the Datong city with the country are also limited for now, so it would be impractical to imagine inviting everyone around the country or the world who was interested in visiting this great site in the years ahead.The expectations of outreach exhibition kept increasing for years to the Yungang Academy.There have been several successful outreach exhibitions of the Dunhuang Grottoes, but the cave replicas with large frescos and few handmade statues can't be taken as direct references for the circumstances of the Yungang Grottoes.When the Yungang Grottoes were built by the royal power of the North Wei dynasty, Carving had been chosen to be the primary method to present the significance of Buddhism.So, the walls of Yungang Grottoes consist of plenty of reliefs rather than frescos, as shown in Figure 1.In order to document the detailed Grotto information, the Yungang Academy started using laser 3D scanning technologies to reconstruct 3D models of the grottoes from 2005, and the photogrammetry method was adopted as one main technic since 2014.The typical height of the Yungang Grottoes is around 10 meters, so it is hard to set up a stable support platform for laser scanners to scan the upper part.Taking photos doesn't require a remarkably steady platform, so photogrammetry has advantages while digitizing the upper part of the grotto and generally provide 3D shape more complete than laser scanners.However, the number of photos could be more than 20,000 to cover all the angles of the reliefs and statues, which will cause massive The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLII-2/W9, 2019 8th Intl.Workshop 3D-ARCH "3D Virtual Reconstruction and Visualization of Complex Architectures", 6-8 February 2019, Bergamo, Italy calculation requirements.Meanwhile, the 3D printing procedure needs dense point cloud to fabricate the shape details, and the painting procedure requires detailed colored 3D model to reference.
In this paper, we analyze the existing technics first, then introduce our approach to the improvement of photogrammetry quality and 3D printing efficiency.At last, we present the results of 3D printed replicating of Cave 3 and Cave 12 of the Yungang Grottoes.

Photogrammetry
Photogrammetry has become more and more widely used in many fields since it achieved a robust automation breakthrough in SfM algorithm in 2006 (Snavely et al., 2006).The input data of photogrammetry can be taken at any position and angle, providing accurate and detailed 3D information in any size application, making it ideal for 3D scanning of significant sites and ancient buildings.The data source for photogrammetry can be an image captured by a dedicated aerial camera or a photo taken with a regular camera.Photogrammetry techniques have been used in many application cases to create accurate 3D documents for cultural heritage (Logothetis et al, 2015).Photogrammetric jobs at large cultural sites often require the taking of large numbers of photographs, which leads to difficulty in data calculation efficiency and sometimes even uncalculatable.In the same time, 3D printing replication is more concerned with the accuracy of photogrammetric results than the computational efficiency of the data.The factorization method (Sturm and Triggs, 1996) is the earliest SFM solution for noisy data, but it does not handle well with missing data and outer points.Snavely et al. built Bundler (Snavely et al., 2006) using incremental calculations and used it in a photo-based virtual tour system.The incremental calculation method first selects two images from the image set to solve the initial camera pose and 3D points.Then, other images are added to the scene little by little.The newly added image is corresponding to the existing reconstruction according to the local feature matching relationship, and then the PnP algorithm is used to solve its orientation and position in the scene.Wu et al. (Wu et al., 2011) used multi-core parallelism and GPU acceleration to improve the computational efficiency of incremental methods significantly and released the VisualSFM tool.However, incremental SfM is easy to produce drift errors, and the results will be affected by the initial image selection and the order of image sequence.For every newly added image, it needs to optimize BA and 3D structure values.So, the time consumption will increase dramatically as the number of images increases.Different from solving the incremental SfM calculation method, the global SfM calculation method adds all the pictures to the scene at one time, and the whole process only needs to calculate BA once.Furthermore, the final result cannot be affected by the drift error generated by adding the pictures one by one.The global SfM calculation method can usually be divided into two steps: absolute rotation calculation and absolute displacement calculation.The absolute rotation of the camera is only related to relative rotation.The global camera attitude solution can be constructed as discrete Markov random mixed continuous optimization problem (Donoser and Schmalstieg, 2014), and the objective function can be solved by nonlinear least squares method in discrete rotation space.Because Only rough initial results can be obtained, it is easy to fall into a local minimum during BA optimization.Jiang etc. solve absolute displacement based on the geometric relationship between camera triplets in the polar geometry diagram (Jiang et al., 2013), but this method requires each triple to have at least one adjacent edge to the other triples.A single camera-centric star-shaped camera map can eliminate this limitation in the main.When Wilson et al. solved the absolute displacement, the relative displacement of the camera was projected into a one-dimensional space, and the global solution was performed after filtering the camera that did not match the relative displacement relationship (Wilson and Snavely, 2014).Cui et al. proposed using the similarity average to calculate the absolute displacement, and can filter out the noise feature points in the calculation process, so as to obtain better reconstruction results (Cui and Tan, 2015).For 3D printing, the density of 3D point clouds is also a critical aspect.At present, the popular dense point cloud generation algorithms mainly include featured-region growing & expansion based algorithm and depth-map fusion based algorithm.The depth-map fusion based algorithm generally yield better data quality, but the amount of computation and memory usage is also significant.
In the photogrammetric calculation process, texture mapping quality is reliable mostly because of the large number of images input.It can utilize more texture information provided by the camera (Waechter et al., 2014).But this also brings a lot of difficulties, such as choosing the best texture image source for a specific face.Different images have different parameters, exposure, saturation, sharpness, angle, etc.These various parameters will result in a tremendous difference in the selected images, seal gaps in the texture between different patches, and so on.

3D printing
3D printing technology has been continuously updated in recent years, the selection of materials for 3D printing is becoming more and more abundant, and its application in the field of cultural relics is also increasing.In the restoration of cultural relics, 3D printing technology can be used to create missing parts or perfectly matched brackets for cultural relics, achieving better perception and better protection of cultural relics.In museums, 3D printing technology is used to create replicas as same as the originals or virtually restored for the audience to experience, which can significantly expand the exhibition possibilities of rare artifacts (Flaherty, 2012).However, when 3D printing technology is used to make replicas of large artifacts for exhibition applications, there are still many practical difficulties.First, 3D printing requires a long production cycle.The printing job of large 3D models often takes several days to complete.Second, when the volume of the 3D printer is smaller than the size of the cultural relic, it is necessary to design a reasonable assembly method.Finally, when using 3D printing technology to make replicas of large-scale grottoes, we must consider the support structure and installation issues.
Even though 3D printers can already support a wide variety of materials, and already have color 3D printers available, it is still impossible to use 3D printers to directly create replicas with textures and colors that are comparable to original artifacts for now.

LARGE-SCALE DETAILED PHOTOGRAMMETRY
The vast measurement of Yungang Grottoes, the large number of reliefs, and the significant shape details have all placed high demands on photogrammetry results for 3D printing and formed key technical challenges on specific indicators such as data volume, calculation speed, calculation error, and point cloud density.We present an optimized photogrammetry pipeline as shown in Figure 3.
Figure 3.The basic photogrammetry pipeline for large grottoes

Image feature matching acceleration
In the SfM calculation process, if a pairwise matching attempt is performed on all the images, it takes a lot of time, and the reconstruction jobs for tens of thousands of images usually cannot be completed in a reasonable time.
In fact, when we try to match features between tens of thousands of photos, pairwise matching will result in hundreds of millions of image pairs.Although pairwise matching can maximize the reliability of the camera track chain, the computational cost of doing so is unacceptable.Since professional cameras are often used in photogrammetry of cultural sites, each image contains a wealth of features, which makes image feature matching the first bottleneck in the entire calculation process.
Using low-resolution images for pre-matching or using highlevel SIFT features can reduce the amount of computation, so we can use kd-tree to complete all calculations.But considering that the probability of a successful match among so many images may be mostly less than 1%, we use the vocabulary tree method to select candidate matching images for each image and then perform pairwise image matching on the candidates.

Cascade SfM
Both traditional incremental SfM and global SfM methods have their own problems.The incremental SfM method is robust generally and can filter out the outer points in the process of adding pictures; the global SfM method can avoid the drift error that often occurs in incremental SfM methods.
To achieve robust and accurate SfM calculations on large data sets, we use a simple cascading approach that combines the advantages of both methods.Firstly, based on the traditional incremental method, the initial camera pose estimation is performed, and then the outer points in the image matching of the two images are filtered to improve the quality of image matching.
Based on the optimized image matching, more accurate relative camera rotation and displacement can be obtained, then the global camera pose is solved according to the relative camera pose, and the camera pose obtained by the incremental method imposes constraints on the global solution result.
Finally, the feature matchings that satisfies both the initial relative camera pose and the final relative camera pose are selected, to construct the track and triangulations, and then the bundle adjustment is performed to make the final joint optimization.

Robust detailed MVS
The high-quality MVS dense point cloud reconstruction method is very computationally intensive, so it is often necessary to adopt the idea of grouped computing.However, after the grouped calculation, multiple dense point cloud blocks will have inconsistencies in the overlapped area, which is represented by a large amount of layered data.The presence of layered data will cause very large interference to the subsequent processing and use of the 3D point cloud.Worse, it is very difficult to eliminate or merge them by automatic postprocessing methods.However, if two or two pairs of data are directly registered in the dense point cloud reconstruction, a large amount of calculation will be generated, so we use the key 3D features for fast registration.In order to ensure the overall consistency, we create pose graphs to optimize the transformation obtained by registration.

Automatic texture mapping
View-Dependent Texture Mapping is a convenience provided by photogrammetry for 3D reconstruction, which can accurately attach a layer of realistic image texture to the 3D model.When selecting the corresponding best photo image for each triangle of the 3D model, it is often necessary to consider the parameters such as the normal angle, sampling resolution, continuity, and consistency.However, when the shape of the three-dimensional model is complicated, or there is an occlusion in the shooting process, or the color difference of the image at different angles is significant, the conventional texture image mapping method may generate a locally defective texture.Such texture defects are often difficult to find and repair in the later data processing procedure.
There are some prominent difficulties in the data collection of large grottoes.First of all, the scaffolding for photographing will inevitably appear in some photos, which will bring confusion to the later texture mapping.Secondly, due to the large number of sculptures and reliefs inside the grotto, the local consistency of the images between the different angles is poor.Finally, due to the large number of 3D model patches and the number of photos in large grottoes, choosing the best texture mapping for each patch and optimizing continuity will face the challenge of insufficient memory.In order to improve the stability of texture mapping results, we redefine the optimal texture image quality function, improve the weight of color consistency and local texture consistency to create better continuity of texture image distribution, and reduce the probability of confusing texture mapping.To guarantee the computability of the texture calculation process under the condition of large data volume, we use the similarity and continuity characteristics of local texture mapping and propose a method for optimizing the calculation of patch grouping.For an adjacent group of patches, if the area is small or the normal vector parallelism is high, the probability that the texture mapping data comes from the same photo is high.To this end, all the patch groups can be globally optimized, the photo map of the best quality is calculated, and the inner faces of the group is locally optimized to improve the texture quality further.After rebuilding the 3D model of the grotto with sufficient precision, we actually have many options to make a replica of the grotto using 3D printing technology.We can choose FDM (Fused Deposition Modeling), SLS (Selective Laser Sintering) or SLA (Stereolithography) to produce 3D shapes, and each technology can use many different kinds of materials.If we consider the possibility of using a full-fledged mold technology, there are more options for the methods and materials for making replicas.For the replicating of large-scale grottoes, processing costs, processing cycles, realism, weight, durability, etc. are important considerations.Therefore, after combining various factors, we have selected the production technology flow as shown in Figure 4.

Explorations on 3D replicating large grottoes
After considering a variety of factors, we decided to use FDM as a technical means to produce 3D shapes.First, the production cost of FDM is low, the production process is clean, and the printed materials are healthy.Secondly, the results obtained by FDM production have good strength and can be used directly without molding.Finally, even FDM's production speed is not the fastest, but because of the lower cost of the printer, multiple devices can be used in parallel to improve efficiency.However, printing a replica of a large grotto requires a very large processing volume.If the volume of a single copy block is too small, the workload of the stitch and flattening process will be greatly increased.To this end, we have assembled 20 large FDM 3D printers in tandem with our production units.The working volume of each 3D printer is 1 meter wide x 1 meter deep x 1.5 meters high.Even with the support of these large 3D printers, a grotto replica still needs to be split into nearly 1000 pieces to print separately.When it is necessary to split a model into nearly 1000 small blocks, the strategy of splitting the model also needs to be optimized.If we do an irregular split along the surface shape of the 3D model, the stitching effect will be optimal.However, such a splitting method will result in obvious installation and maintenance difficulties.Therefore, we choose to cut the grotto into several layers in the horizontal direction.When selecting the layer height, we will try to avoid leaving the cutting line in the critical details and try to use the best out the volume height of the printer.For longitudinal cuts in the layer, we chose an irregular cut method based on surface shape and printer volume size to achieve the best shape results.The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Volume XLII-2/W9, 2019 8th Intl.Workshop 3D-ARCH "3D Virtual Reconstruction and Visualization of Complex Architectures", 6-8 February 2019, Bergamo, Italy each data block is made into a shell of 2 mm thickness when printed.With the print width set to 0.5 mm, the nozzle prints on each layer for two weeks.This method of operation can avoid the consumption of a large amount of infill structure printing time, thereby significantly improving production efficiency.The 2mm thickness is unable to support the construction of a large grotto replica, so we chose to spray customized polymer materials on the back face of the print results for reinforcement.The embossed printed portion can withstand a large amount of pressure, preventing cracking and maintaining a good shape.At the same time, in order to make the replica more realistic, we have customized the surface coating material according to the stone color of the Yungang Grottoes and applied it to the front face of the printed results.The 3D printed result processed in this way is closer to the stone in effect, not PLA.To ensure the stability and safety of large grotto replicas, we designed a metal support structure according to the shape of the grotto.The load-bearing part of the support structure is made of steel, and then the thin support structure is constructed with a lighter aluminum structure.Finally, the elastic support piece is used to connect the support structure and the 3D printing result.This design provides flexibility in the installation process while maintaining overall structural rigidity.When the replica cave is installed in the exhibition space, we first test and adjust the lighting position, angle and color temperature to simulate the lighting conditions of the grotto scene during the day.When the simulation of the light reaches a satisfactory effect, the specialists perform coloring on the surface of the replica according to the effect of the colored 3d model to complete the final replicating process.

Two replica caves in practice
In order to break through the barrier of the resolution and rendering capabilities of digital display devices, we proceeded to physically reconstruct the giant caves with the help of 3D technologies.The replica of Cave 3 of the Yungang Grottoes, measuring at 17.9 m x 13.6 m x 10.0 m for its width, depth and height, has been installed in a huge room for the exhibition.The replica of Cave 12 of the Yungang Grottoes, measuring at 14.0m x 11.0m x 9.0 m for its width, depth and height, has been designed and produced as portable modules and will be used for the international tour exhibition.high.The original construction work was started in the Northern Wei period but for some unknown reason, the work was stopped midway and the cave abandoned in its unfinished state.The upper room is small and rectangular in shape.The carvings in this room were all completed in the Northern Wei dynasty.The center of the niche is occupied by a Buddha seated with both legs pendant, attended on the right and left by standing Bodhisattvas, which is works of a later date.
The cave replica was split into 842 blocks in 3D printing, and it took six months to produce on 20 large 3D printers.The subsequent installation and coloring process took about four months and eventually opened to the public as a free exhibition in another city more than 1,000 kilometers away from the original cave.The scale of the cave 12 is similar to the cave 3, but a lot of improvements have been made in terms of portability.The main supporting structure of the replica cave can be assembled on the ground and then hoisted from top to bottom.This design releases the error caused by the assembly process to the bottom of the replica cave, which greatly improves the assemblability.The total weight of the replica cave 12 is less than 5 tons, and the convenient installation design makes it possible for the world tour exhibition.

CONCLUSIONS
It took us four years to finish those two replicating projects.Most of the feedback from the visitors declare that they got much better immersive experience than digital display devices.For the rare heritage architectures and monuments, our works can be regarded as one kind of solution besides digital exhibitions.We usually tend to use precision and completeness as the standards for evaluating the level of one virtual 3D reconstruction algorithm.However, it is hard to get the ground truth value of large architecture.So, the quality of the 3D reconstructed architecture model is difficult to be assessed in most cases.In our physical reconstruction project, the small nozzles of the 3D printers worked as detailed rulers, which put forward high request to the precision of the 3D data.
The realism that Photogrammetry technology can create is not limited to the virtual world.Making replicas using 3D printing reflects the potential value of Photogrammetry technology in the case of Yungang Grottoes.However, in practice, we find that there is still ample room for improvement in computational efficiency and quality of results on large datasets.In future work, robust multi-cluster parallel computing and rapid depth map synthesis method should provide better results.At the same time, we also expect large-volume, low-cost SLA 3D printing products to appear to improve the accuracy of the replicating of cultural relics.
Zhejiang University, and the Joint Laboratory of Digital Yungang.

Figure 2 .
Figure 2. The application of 3D printing on virtual restoration in the Harvard Semitic Museum (Flasherty, 2012)

Figure 4 .
Figure 4.The 3D replicating pipeline for large grottoes

Figure 5 .
Figure 5. Large FDM 3D printerTo achieve a trade-off between 3D printing speed and quality, the speed of the FDM printer nozzle movement and the thickness of each layer of printing are key indicators.At the same time, in order to avoid unnecessary printing to increase the printing time,

Figure 6 .
Figure 6.The support structures of the replica Cave 3 of the Yungang Grottoes, located in Qingdao City, China Cave 3 of the Yungang Grottoes, also known as Lingyan Temple, is located in the east of Yungang Grottoes.In size, it is the largest of Yungang Grottoes.It measures about 50 m.wide and 25 m.

Figure 7 .
Figure 7.The full view of the replica Cave 3 of the Yungang Grottoes.A painter is refining the details of the bottom part.

Figure 8 .
Figure 8.The details of the Replica Cave 3.Cave 12 of the Yungang Grottoes is well known as the music cave.This cave comprises an ante-room and a main room.The façade is divided into three spans by four pillars.Above these pillars there seems once to have existed a deeply carved roof probably with eaves and brackets represented on it.The walls in the cave are carved with a lot of celestial musicians and flying celestials with more than fourteen types of musical instruments and fifty musical instruments.They are carved so vividly that the whole cave is filled up with musical atmosphere.Cave 12 is a representative of celestial musicians' sculpture in Yungang

Figure 9 .
Figure 9.The portable support structure of the replica Cave 12 of the Yungang Grottoes

Figure 10 .
Figure 10.The full view of the replica Cave 12 of the Yungang Grottoes.Engineers are refining the exterior wall.

Figure 11 .
Figure 11.The details of the Replica Cave 12.