Disclosure of Temporary Exposures as Permanent Website Applications through the Patrimonial Survey

In a context of web application in the field of the dissemination of cultural heritage, this article advances in a methodology for the optimization of points clouds obtained through the technology of Laser Scanner (TLS). Identifying the potential of TLS surveys as interactive models that allow the cultural heritage to be perpetuated over time. This point cloud optimization is developed with free software, focusing its exploitation on an interactive web application, which has made it possible to convert two temporary museum exhibitions into permanent exhibitions in virtual format. Developed in conjunction with the Museu d’Història de la Ciutat de Barcelona. The case study focuses on the Palau Reial Major, Gothic style, formed by the chapel of Santa Àgata (built in 1302, on the Roman wall) and Saló del Tinell (built between 1359 and 1370, on the Roman remains). Located in the Plaça del Rei, in the old town of Barcelona. In this application is very important the visual impact, it requires to represent a faithful model of the interior of the building, from the point of view of color and lighting, avoiding the transparencies of the model through a dense cloud of dots, without occlusions, this requires a great quantity of positions. This implies a clear methodology, using different techniques such as photographic proyection, given the complexity of lighting of the building, as much for the artificial lighting as for the lighting of the stained glass. In this process, there were 84 positions that provide greater density of points, which are optimized with free programs. The temporary exhibitions of the case studies, elaborated by the MUHBA in the Saló del Tinell are: “Indianas, 1736-1847. The origins of industrial Barcelona” exposed from May 19, 2012 to March 3, 2013 and “El Món del 1714” exposed from December 20 to September 28, 2014. Both are based on a tour with showcases and exhibitors where different objects of a museum character are shown, such as looms, cloths, dresses, books, among others, accompanied by panels with texts and images that contain the information that each exhibition shows. Virtual applications allow such temporary exposures to become an interactive model, in which information can be permanently consulted. A virtual tour where the user can interact with the information panels and observe in detail the different objects of the exhibition. The results of this work manage to generate a powerful mechanism of diffusion and approximation to the society of the cultural heritage that, otherwise, as a whole as exhibition would disappear.


Introduction
The virtualization of museums has been a constant in recent years. It seeks to bring knowledge to the general public, but also to the scientific community, in order to create a continuous debate. Generally, depending on the technology used for data collection (Terrestrial laser scanner TLS, photogrammetry, classical topography, panoramas ...), one technology or another is used for the development of the virtual application. For the musealization on an architectural scale, the most used application is the navigation between panoramas [1], which allows a very fast documentation. But when the user has more movement freedom, using videogame technology is more common [2], although there are also web applications [3].
For the representation of elements on a detailed scale, there is a great variety of websites that allow for sharing 3D models, sketchfab [4] stands out among them for 3D mesh models, and Potree [5] or Euclideon [6], for point clouds. When flat elements are used, such as paintings, 2D applications are generally used [7].
In this article, together with the Museu d'Història de la Ciutat de Barcelona (MUHBA), we propose the virtualization using the most appropriate methodology for the representation of each element, without depending on the technology used to collect the data. In addition, virtualization is presented, not only as a methodology for the dissemination of cultural heritage, but as a tool to convert temporary exhibitions into permanent ones.
Starting from the laser scanning of two temporary exhibitions and the building Palau Reial Major where they took place, a methodology is established for the optimization of the point cloud models as basic documentation for the development of a web application that allows visiting such exhibitions.
The realization of the application is a test that initiates a critical debate analyzing the advantages and disadvantages of the use of each one of the techniques of modeling (cloud of points, free mesh or textured planes), establishing basic criteria to analyze their suitability.

Study cases
The study cases focus on two of the three buildings that form the Palau Reial Major in Barcelona [8], the Saló del Tinell and the chapel of Santa Àgata. These two buildings are part of the Museu d'Història de la Ciutat de Barcelona. Palau Reial Major is in the center of the Gothic quarter of the city, in the Plaça del Rei. It was the residence of the counts of Barcelona and kings of Aragon.
The Saló del Tinell was built between 1359 and 1370 under the order of King Peter the Ceremonious, and under the supervision of the master builder Guillem Carbonell. It is a representative example of Catalan Gothic civil building. It is a rectangular room with very singular proportions: 33 meters long, 18 meters wide and 12 meters high. It is covered with a wood paneling, supported by diaphragmatic rounded arcs, that lean on prismatic pillars with sculpted capitals. Transverse to the arcs, there are narrow canyon vaults on the sides of the side walls. Between the buttresses that counteract the force of the interior arches, windows of different periods can be seen: SXIII three-light windows, or rosettes of the SXIV. These buttresses had to be reinforced with underground iron brace in the final decades of the SXX.
After serving as a ceremonial room of the old Palau Reial Major, it became the Real Hearing and headquaters of the Inquisition in the SXVI. In 1720 it was converted into a convent of the Clarisses nuns, who left it in 1936 when the Republican Generalitat confiscated it. In 1943 it turned into part of the Museu d'Història de la Ciutat de Barcelona.
The second building that completes the case study is the chapel of Santa Agatha [9]. The construction began in the year 1302 under the order of the king James II of Aragon, and under the supervision of the craftsman Bertrán Riquer. The chapel is built in the Catalan Gothic style on the Roman wall. It has a rectangular shape and a polygonal apse, it is covered by polychrome-wood paneling, that is supported by diaphragmatic arcs. The apse is covered with ribbed vaults and behind it is the sacristy, embedded in the Roman wall.
The chapel ceased to be part of the Church's assets since it was included in the confiscation of Mendizabal in 1835. Since then, it has had different uses, such as being the Provincial Museum of Antiquities from 1877 to 1932, when it turned into part of the Museu d'Història de la Ciutat de Barcelona. It is possible to emphasize the altarpiece of the Epiphany of Jaume Huguet, that is considered one of the most important works of the painting of the SXV.

Data collection
For these case studies, two different scanners were used. The Saló del Tinell was scanned by Faro Focus3D (phase difference scanner) in 2013 and 2014, and the chapel of Santa Agatha was scanned in 2017 with the FARO Focus 3D X330 (flight time scanner). The capture range of both scanners is 360° H* 305° V and have a built-in camera of 70 mega pixels.
In the Saló del Tinell, three TLS surveys have been carried out. The first, with the exhibition "Indianas, 1736-1847. The origins of industrial Barcelona". In this exhibition they emphasized elements with great geometric complexity and with a degree of important occlusions. Elements such as looms, fabrics that dress mannequins, and other items in showcases, had to be scanned without moving them or removing the glass cabinet, generating the previously mentioned occlusions and increasing the complexity of the scanning. In addition, these elements generated intensity changing problems and instrumental errors inside the showcase (like noise of points or isolated groups in the point cloud). The second survey was the interior of the building, with the room empty, without any exhibition. This was done to have all areas that were hidden by the aforementioned exhibition, such as the floor and areas behind panels. The third survey was the scanning of the exhibition "El Món del 1714", which consisted mainly of panels with images and texts, distributed in a route formed by curves and circles.
The case of Santa Àgata is complex given the amount of details it has, for example, paintings and low reliefs in the ceiling beams (12 meters high), or the altarpiece of the Epiphany of Jaume Huguet. Complementary to this, the "clock of the flamencos" or "big clock of Barcelona" was scanned, which was the reference clock of the city of Barcelona between 1577 and 1864, and is located in the sacristy of the chapel. It is a large iron machine (base of 2.08 x 2.40m and maximum height of 4.4m, originally weighed 5.5 MT) probably the biggest in the world of its kind. From the point of view of the survey, this watch has great complexity because of the self-concealment it generates. The survey has great interest because, given the weight it has, and being in a restricted area of the museum, it is difficult to make the clock accessible to the general public.

Methodology for the optimization of the point cloud models
The scanner used in the data collection comes with a software that allows to perform the three phases of the edition of point clouds: union, color and filtering. Even so, in projects of great complexity, as in this case study, there are different programs that allow a more precise optimization.

Union of positions
The union of the different positions consists of applying a transformation to each of them, with the aim to obtain a single model. For this purpose, the PolyWorks IMAlign extension has been used, allowing a large number of scanners to be joined together, averaging the adjustment of all positions in a single block.
The first base junction is performed manually by matching pairs of points, which consists of finding a minimum of three points that coincide between each of the positions and the base position that is used as a reference. Once all the positions are in their approximate position, we perform "the iterative best-fit alignment technique" which consists in minimizing the distances between superimposed surfaces by a least squares fit. This process is repeated as many times as necessary to obtain a union with the required tolerance.
Finally, in order to use the cartography of the Institut Cartogràfic i Geològic de Catalunya (ICGC) as a basis for context modeling, an approximate georeferencing has been performed by calculating the best transformation of four parameters (coordinates X, Y, Z, and rotation about the axis Z) to adapt the point cloud to the base map.

Editing color and projecting images
Since the objective of the survey is a visual product, the color of the point cloud must be of high quality. Therefore, the color must be edited, especially in the stained glass, as it gets overexposed in the pictures by the backlight. For this edition, pictures taken from the same spot as we scanned were projected to the scan pictures, projecting the information by position, based on the panorama of intensities (which is not affected by the backlight). This process is done with the Faro Scene program.
Complementary to this, it is realized a process of detecting zones with the colour overexposed by the interior illumination, due to the indirect exterior light that is projected on the walls and cornices. This overexposed colour information is isolated from the model by converting colour to a scalar factor, which is the average of the RGB values called "composite". From this value the cloud of points is divided in two, superior and inferior to 220, being the area overexposed a value between 220 and 256. These zones are completed by means of complementary scans, that were realized in the chapel with the lights off.

Filtered by position
Given the complexity of the case study volume, the union of all positions generates certain errors (noise in the point cloud). Each individual position generates several of these errors, which are accentuated in the union of the complete cloud. The most important errors discussed below are those generated by mixed edges and the reflectance of the surfaces materials. In addition, it is performed a surface analysis to optimize the cloud, which facilitates his future meshing. The different softwares that are used for these processes are Meshlab and CloudCompare v2 , since each one presents different tools to filter the cloud, eliminating these errors mentioned previously.

Mixed edge
One of the errors that must be corrected is the mixed edge [10]. This error is generated when the scanner samples a surface with an edge in the direction of the laser pulse. When this happens, the beam is divided into multiple pulses, one that impacts the first area of the edge of the object, the last one will look for the "back" area of the edge, where it converges with another surface. Therefore, for the same pulse, the information received by the scanner has several points in the space and since the Focus x330 does not store all the pulses (it does an average of these), it generates a series of scattered points that are projected in the direction of that edge.
The problem of mixed edge errors becomes a priority because of the need of a point cloud without noise, for both the architecture and the elements of the exhibition. To solve the problem, it is necessary to know the position of the scanner in relation the angle of incidence.
In the applied case, it is shown that by eliminating the points between 85º and 90º, this mixed edge error is solved (Figure 1). Given the volumetric complexity of the case study, this filtering becomes of paramount importance for the optimization of the cloud. Having so many scanning positions, eliminating these points does not generate any more problems, since the points erased by the mixed edge error are recovered with complementary positions.

Low intensities
When scanning glass surfaces, metal or any surface that reflects the laser pulse, this create noise in the point cloud. These surfaces are mostly of low intensity (taking as low values around 0.6, on a scale of 0 to 1). To eliminate the noise generated by these surfaces, a filtering is performed where the intensities are divided into high and low (0-0.6, low, 0.6-1, high), separating then the glazed and metallic surfaces from the rest of the cloud. Filtering is done using the CloudCompare v2 software. Once separated, the RANSAC method [11] selects the useful points that will form the final plane of the crystals (Figure 2). This method generates primitive forms, based on pre-established segmentation parameters. Since the parts to be recovered tend to be plane, "plane" is selected as the primitive form, and the minimum number of points that the primitive must contain is added. This classification in planes arises from the assignment of maximum distance to the primitive for the points that are analyzed. In addition, a sampling distance must also be configured to optimize the plane generation process. Another important parameter is the maximum deviation from the normal, since the normal of the points in the cloud can have several directions, reducing the noise of the points with normal that would not conform the plane surfaces is convenient.
With this processes, different planes of the selected cloud are obtained, achieving an important noise cleaning in the glazed areas ( Figure 3). . From a top view, the glass (in gray) before the filtration from the RANSAC method, and below (in colours) its final result. There is a significant reduction of cloud noise.

SOR filter (Statical Outlier Removal)
Due to instrumental errors of the scanner itself, there are some misplaced points in the point cloud.
They can be isolated points or sets of points. The final filtering process applied to the cloud is the SOR filter [12], this process is realized with CloudCompare v2 software. This way, the cloud is optimized for the future meshing process. This filter first calculates the average distance of each point to its neighbors (establishing first the number of points that will be considered neighbors), and then rejects the points that are farther away than the mean distance plus a number of times the standard deviation (second parameter to be entered). With this, the isolated points of the cloud disappear since it has no neighbors with which to relate the information (Figure 4). For the future meshing, this filter is basic to prevent errors in the generation of the mesh. It was possible to enjoy this temporary exhibition from December 2013 to September 2014. The exhibition hosted a hundred pieces, from 32 museums, libraries, archives and private collections. Information panels, books, pictures and illustrations formed a route that gave shape to the exhibition.

Apps
The 1847. The origins of industrial Barcelona". So, navigation starts in the first person ( Figure 5, left) allowing to activate one of the exhibitions. In addition, the different rooms can be displayed in orthogonal projection, plan view or elevation, and section the model to better understand the building (Figure 5, right).
In order to implement the application, we had to decide which elements were maintained as point clouds, which were represented as textured planes and which were modeled as free mesh. As an example, there are screenshots of the application in figure 5, the image on the left shows the Tinell 3D model in an automatic route by the architecture, and the one on the right, an interactive that allows to section the building in any orthogonal plane; both visualizations allow to highlight the architecture in perspective as well as in orthogonal view, allowing a greater understanding of the it.

Meshing
With the final point cloud optimized, the model grid is generated. For a better performance of the meshing processes, the point cloud is subsampled to 3mm. For meshing, we used the software Meshlab, with it, a high-resolution mesh is obtained through the Screened Poisson Surface Reconstruction filter [13]. The resulting mesh is optimized eliminating polygons larger than 5mm, which correspond to areas of doors and windows. Given the coatings that were made in the interior of the Saló del Tinell and the chapel of Santa Àgata, we only had to fill the holes corresponding to an inner staircase of the chapel and a lower area of the altarpiece of the Epiphany of Jaume Huguet. Windows and doors required a specific edition, reducing the closing edge and completing those edges in modeling processes.
The polygonal high resolution models have to be decimated, so they could be used in the development of the app that has some limitations, in this case study, we used Unity3D, which has a limit of 65,000 polygons in the version of Unity3D 4.3. Therefore, the mesh is reduced from 10 million polygons to 2 models of 60,000 polygons approximately, using the Quadric Edge Collapse Decimation filter (Meshlab) for such simplification. The texture of the model is generated later, passing the texel color of the mesh of high resolution to the model of low resolution, like a texture. As two low-resolution models were generated, two 4K textures are created. The transfer of color information is done using the Transfer Vertex Attribute to Texture filter (Meshlab).

Comparison of 3 rendering techniques in apps
The 3D structure of the application is divided into several zones. To generate each one of them, it is considered the best technique in terms of optimizing the good operation of the application. The techniques that are taken into account when generating the complete model are three: Images as textures (including panoramas), modelling from meshes, and optimized point clouds. In some cases, the best option is to combine several or some of them. The areas in which the application is divided are the external context of the Palau Reial, the architecture of the building of the case study, and the various temporary exhibitions that were carried out inside the buildings.

Outside
To perform the exterior of the buildings (the urban context of the application), it has been considered to generate 3D drawings to which images are added as texture as a context (Figure 6), taking into account that the exterior does not conform the direct interactive part application. This option is more advantageous than meshing the exterior with detail, because complexity would recharge the processing of the application, directly affecting its performance. It was not contemplated to add a point cloud as context since, to have an adequate resolution, the file would be very large and we wanted an application whose visualization by Internet is agile and with limited weight. This decision improves application performance. Figure 6. The outside. Conformed by 3D plans to which an image is added.

Architecture
The interior architectural elements have been generated as low resolution mesh models, seeking the optimization of the app, where the texture gives a greater detail of the stone, as explained in section 5.1. The interior is not represented as a point cloud, because of the size of the files needed for it and the cost of performance that this would require. It was not chosen to represent the interior of the building as textures, because of the volumetric complexity of the building. In addition, the mesh has been created from the conversion of the point cloud after its optimization. This provides the reliability necessary for the model to be a faithful reproduction of the building in question (Figure 7).

Temporary exhibitions
Exhibitions are the main element of the application. They are tours with informative panels and important objects that are shown in showcases. During the virtual tour is essential to be able to read the panels perfectly. For this reason, the posters are generated by 3D drawings to which the images of the panels are added as textures (Figure 8, left).
A point to analyze are the objects of exhibition. Mostly they are authentic objects of the different periods in which the expositions refer. They are complex objects that have been subjected to the passage of time (with the wear and tear that this implies). This means that 3D rendering has to be accurate and faithful. Therefore, the best option to generate the models are the point clouds (Figure 8, right). These provide the necessary reliability that the objects require. Modeling these elements, apart from being an expensive process, would entail a simplification of the element that would alter the perception of the element.
The cloud point models of exhibitions have a resolution of one point every 2mm, allowing adequate resolution for the display in relation to the distance the user is allowed to approach these elements. These point clouds consist of four million points, which is a reasonable size, since a Unity scrip was used that allows to introduce up to 150 million points [14]. From 40 million points on, the point clouds load less quickly, slowing down the app. Combining these two techniques offers the best result, on the one hand, informative panels as images with text have the appropriate resolution for reading, which would not be achieved with a point cloud model, on the other hand, point cloud models give the reliability and correct representation of the exhibition elements, with the added value of preserving the exact characteristics of the scenery in the musealization of these.

Conclusions
The effort made by the MUHBA to document the temporary exhibitions in the years 2013 and 2014 has allowed, years later, to reuse this information for the development of this application that allowed to perpetuate in time a reality whose physical entity has disappeared or has been stored. This documentation seems to be a fundamental element in the preservation of cultural heritage. Laser scanning technology and point cloud rendering have evolved enough to show highly complex elements without the need to be meshed, thus reducing the time required for virtualization of these elements. The representation of reality is not the same as the simplification of reality.
Even so, the limitation of not being able to exceed 40 million points in the application makes it necessary to model the simplest geometries. For this reason, this methodology of optimization of points clouds had to be developed, to arrive at mesh models that allow a high performance in interactive applications.
Developing each interactive element with a different modelling technique (or combination of several) optimizes the generation of the application's basic documentation. Making the navigation through it agile and fluid without excessive loading times, which would make the experience more tedious.