3 D MODELS MAPPING OPTIMIZATION THROUGH AN INTEGRATED PARAMETERIZATION APPROACH : CASES STUDIES FROM RAVENNA

Image-based modelling tools based on SfM algorithms gained great popularity since several software houses provided applications able to achieve 3D textured models easily and automatically. The aim of this paper is to point out the importance of controlling models parameterization process, considering that automatic solutions included in these modelling tools can produce poor results in terms of texture utilization. In order to achieve a better quality of textured models from image-based modelling applications, this research presents a series of practical strategies aimed at providing a better balance between geometric resolution of models from passive sensors and their corresponding (u,v) map reference systems. This aspect is essential for the achievement of a high-quality 3D representation, since “apparent colour” is a fundamental aspect in the field of Cultural Heritage documentation. Complex meshes without native parameterization have to be “flatten” or “unwrapped” in the (u,v) parameter space, with the main objective to be mapped with a single image. This result can be obtained by using two different strategies: the former automatic and faster, while the latter manual and time-consuming. Reverse modelling applications provide automatic solutions based on splitting the models by means of different algorithms, that produce a sort of “atlas” of the original model in the parameter space, in many instances not adequate and negatively affecting the overall quality of representation. Using in synergy different solutions, ranging from semantic aware modelling techniques to quad-dominant meshes achieved using retopology tools, it is possible to obtain a complete control of the parameterization process.


INTRODUCTION
The field of entertainment software for the creation of 3D digital models has been developing on the subject of advanced texturing techniques starting from the end of the nineties.Some relevant papers proposed at international conferences on Computer Graphics in the last decade (Piponi-Borshukov, 2000;Levy, 2001) focused on a crucial aspect of texturingcalled parameterizationand gave suggestions to software developers for the implementation of new tools inside 3D modelling applications.
The fundamental idea these studies were based on relates to specific requirements from 3D artists domain: an easy and intuitive way to unwrap in two dimensions a complex 3D shape in order to use a 2D template for texture painting.
The intuition of a sort of digital "pelting" (Piponi-Borshukov, 2000) gained great popularity in the framework of entertainment software and, in the early years of the 21th century, all software houses operating in that sector have customized and developed different tools for the interactive parameterization of 3D meshes.
Computer graphics researchers were interested in providing 3D artists with an easy way to map complex organic meshes on an auxiliary 2D reference system (u,v), since meshes modelsunlike NURBSare not generated with natural parameterization (Ciarloni, 2009).Given that complex surfaces could not be developed into the (u,v) reference system without introducing distortions and cuts, the last ten years of studies on parameterization were focused on the creation of different and more performing algorithms, also considering that the application of parameterization is not just limited to the field of texture mapping, since it now includes detail transfer, morphing, mesh completion, remeshing and surface fitting (Sheffer et alii, 2006).
A complete survey carried out by Floater and Hormann (2005) analysed different methods for parameterizing surfaces in geometric modelling and computer graphics, underlining the importance of two critical aspects relating to the achievement of a good mapping: the minimization of angle distortions into the parameter space and the conservation of proportion between triangle areas of the mesh model in R 3 and in R 2 (parameter space).
Table 1.Scholarly papers on the problem of surface parameterization published per year in the period 1985-2003.Survey by (Floater-Hoffman, 2006: 25).Lévy et alii (2002) carried out an interesting research aimed at finding a solution to another aspect of surface parameterization, that is the way to split complex models before making them fit with the (u,v) parameter space, in order to minimize texture errors along boundaries, to achieve an uniform sampling in texture space andlast but not leastto use properly and completely the parameter space (no waste of useful pixels).
In particular the researchers highlighted the importance of reducing a the number of cuts along connected trees of triangles edges in order to limit the number of island (or charts) of polygons in (u,v).
Recently the interest in parameterization by many operators and developers in the field of Computer Graphics has been actually confirmed during two past Asian editions of Siggraph conference (years 2007 and 2008), when special courses took place focused on this topic: Mesh Parameterization Theory and Practice.
Concerning the documentation of Cultural Heritage and the related software aimed at surveying and processing geometrical data, it is important to point out that the quality of parameterizationdecisive in case of 3D model texturinghas always be considered as a sort of optional topic, up to the introduction of SfM tools.
In fact, the majority of applications focused on point cloud management, mesh processing, etc., is only equipped with automatic and not interactive parameterization, that in most cases produces an uncontrolled number of islands in the (u,v) parameter space (Merlo et alii, 2013a).
Thanks to the implementation of SfM algorithms from the field of computer vision into photo-modelling applications and the consequent achievement of highly detailed 3D meshes from a set of images, the problem of parameterization became as important as in the field of geometric modelling for entertainment.
The main reason is due to the aleatory or random quality achieved by automatic parameterization solutions used in common photo-modelling applications: to a very accurate 3D model from SfM could correspond poor parameterization, with the consequence of compromising its texturing quality.In this paper two different methods will be taken into accountthe former automatic and the latter manualboth aimed at controlling the parameterization in a current SfM application, Agisoft Photoscan, with the objective of achieving a higher quality for texturing of 3D assets from photo-modelling and from active sensors.

AIMS
The purpose of this paper is to provide a series of approaches for a full utilization of automatic parameterization solutions in Agisoft Photoscan, solving the mentioned problems of uncontrolled islands in (u,v) space, at the same time as preventing a wrong balance between the areas of polygons once the mesh is "flattened" into R 2 and above all the possible waste of pixels of the texture map.
There are some positive consequences of these initial results:  Simplification of the editing activities for apparent colour texture in raster applications;  Easier integration into the (u,v) parameter space of other bitmaps obtained through render-to-texture solutions (baking). Performing use of SfM applications for parameterization and mapping of meshes from active sensors.
The case studies illustrated in this paper are part of the Unesco Site of Ravenna and their analysis provides an ample range of examples with different levels of complexity, explaining in what manner the research team has employed active and passive sensors for the documentation of both architecture and small art objects.
These case studies intend to underline the importance of correct parameterization not only for the quality of texture mapping but also from another point of view, that is to say a correct use of (u,v) parameter space for the achievement of highly portable, multipurpose and optimized models, able to documentand at the same time disseminate contentsby means of real-time interactive applications.
The improvement of portability of high-poly meshes through image-based data processing techniques (Fantini, 2010) can now have the advantage of automatic parameterization, in this way avoiding time consuming manual UV mapping operations, besides manual blending of large sets of images in the parameter space (Merlo et alii, 2013b).
Compression can be obtained through low polygonal models first and foremost with the application of special textures, normal maps and displacement maps, but in any case meshes should be as regular as possible in regard to their topology and geometry (Sheffer et alii, 2006: 110).
In other words, it is important to highlight that the quality of the boundary representation deeply influences the quality of its parameterization, and for this reason this contribution explains two different strategies focused on the achievement of meshes characterized by both topological and geometrical regularity:  Topological regularity: all vertices have the same degree or valence;  Geometrical regularity: triangles are similar to each other in terms of shape and size (isotropic mesh) and vertices are close to the centroid of their neighbours.
Therefore another important topic is the purpose of a "semantic reading" of the surveyed objects.In order to improve the quality of parameterization, will be examined the importance of splitting high definition and undifferentiated meshes into different parts, following the original design process that lead to a work of art.In fact a previous semantic reading can lead to a design-driven partition of 3D models, hence facilitating the time-consuming parameterization process of both high-poly and low-poly representations.

TWO STRATEGIES FOR PARAMETERIZATION ENHANCEMENT
With reference to the aims mentioned, it is necessary to distinguish between 3D models for documentation and 3D models for dissemination; other models, multipurpose ones, can be used for both tasks being based on LOD solutions (Fantini, 2012).
High-poly representations from active and passive sensors are suitable for the requirements of documentation of Cultural Heritage, whereas Low-Poly ones are more appropriate for dissemination.
The enhancement of their parameterization can be achieved by means of different strategies:  in case of High-Poly models from SfM, the first highly detailed raw model has to be topologically and geometrically improved in order to facilitate the task of automatic parameterization.In the event of complex shapes, it is essential to break the connectivity between polygons before parameterization; this last operation is the outcome of the application of semantics to the shape of an historical building (Benedetti et alii, 2010);  in the case of Low-Poly representations it is important to point out which kind of output is expected: is the coarse mesh used as it is, or is it going to be subdivided and displaced?In the first case the mesh is composed of triangles, while in the second it has to be quad-dominant (Lai et alii, 2010), since the final output must be compatible with Catmull-Clark subdivision rules (Catmull-Clark, 1978).
In both cases, parameterization is lighter than in the High-Poly instance, but problems of different nature occur in particular along the seams necessary to unwrap the model.
Applications based on SfM algorithms, such as Agisoft Photoscan, produce textured models with different levels of details in accord to the user's requirements, butas a matter of factit is advisable first of all to calculate a full detailed model that can be decimated at a later time.
This kind of High-Poly models is characterized by many topological/geometrical problems: among them it is important to point out one in particular, since more than others it negatively affects the result of parameterization, that is small faces.
Small faces can be easily detected and eliminated with the tools of mesh processing software, exactly because many applications of 3D models need isotropic meshes (finite elements analysis is one of them).
Figure 4. A) the initial mesh from SfM application with geometrical and topological errors.B) the isotropic mesh obtained through global re-meshing.For this reason, the more suitable solutionbefore starting the texturing phase with Agisoft Photoscanis to apply tools such as Rapidform XOR's global remeshing to the mesh from SfM (exported in .PLY or .OBJ file format), in order to obtain a mesh whose triangles are possibly equilateral, with the edge's lengths similar to the average of all those of the model.
In this way the role of semantics partition becomes worthwhile for carrying out a partition on unstructured meshes: the aim of this operation is to break the connectivity among polygons using as reference the constructive features of surveyed objects.This operation is quite simple, since it consists in cutting and pasting in place a set of polygons corresponding to the main elements forming the conceptual/structural hierarchy beneath an object; furthermore the operator should take into consideration that every set of polygons forming the partition has to be topologically disk-like (Sheffer et alii, 2006: 116).
The semantic partition produces the effect of doubling the number of edges along each disconnected part, so the model is no longer a constructive solid geometry and it will presents some modelling limitations, which will be solved in next phases of the workflow.
Once the object is re-imported (Tools > Import > Import mesh), the automatic parameterization in Agisoft Photoscan interprets each part as a different object, that will correspond to different islands in the (u,v) parameter space.
The parameterization quality now fits with the purposes declared in the former paragraph.
A new type of re-meshing technique became very popular in the sector of geometric modelling applications for entertainment, that is the so-called "retopology".This strategy was adopted to carry out experimentations described in this paper for the achievement of low-poly models instead of automatic decimation.
There are many reasons for this choice:  Low-poly models from retopology are quad-dominant structured meshes and this simplifies the conversion into displaced subD;  Both automatic and manual retopology techniques provide a smart and natural flow of quadrangular polygon loops following objects' formal features;  The selection of loops in entertainment applications is easier if compared with unstructured triangular meshes.The implementation of efficient automatic and manual solutions in most entertainment applications (Pilgway 3D Coat, Pixelmachine Topogun, Autodesk Mudbox, Pixologic Zbrush, Luxology Modo, etc.) confirms the interest of software developers towards this new approach of re-meshing, since heavy meshes from scanner laser and SfM became part of the pipelines for 3D asset creation in their field of production.
The use of retopologyas an alternative to traditional mesh editing applicationshas already been discussed (Merlo et alii, 2013b), but in this case it is necessary to highlight the advantage of the automatic parameterization of quad-dominant meshes by SfM programs that underwent semantic partition, which makes this operation more effective and time-saving.
As in the previous case, the coarse quad meshonce broken its connectivity along trees of edges defining the main parts of the objectis re-imported in Agisoft Photoscan, where the automatic parameterization turns out to be significantly simplified.
It is better to prevent time-consuming manual parameterization in entertainment applications, even if it could be a logic alternative to import-export operations back-and-forth SfM and reverse modelling software; in any way, before the final texturing, it is recommended a final set up of parameterization in other applications.
The comparison between the distortion factor (in red colour = compression, in blue = expansion, in green = balanced) of the same island of polygons in the parameter spaceshown in case A and B of the figure 6 is significant: on the left (A) the result of automatic parameterization from SfM after partitioning a quad-dominant mesh; on the right (B) the same island after a "relax" process.Figure 6.A) Automatic parameterization, B) the same island after the application of a relax tool inside an entertainment application.
In most applications the relax tool is a global optimization solver that processes the model within the parameter space as a spring system, with the aim of finding an optimal global solution (Piponi-Borshukov, 2000).
For an improved parameterization outcome, it is then advisable to run a first parameterization in SfM applications and then revise it through entertainment applications that supply a wider set of tools for the achievement of a better use of the (u,v) space.
In both cases, in the example of high density meshes (global remesh and semantic partition) and low resolution ones (retopology and semantic partition), the experiments carried out by the team proved the effectiveness of this approachin particular on complex shapesthat in the absence of any previous editing were affected by poor parameterizations and consequently by inappropriate texturing.
It is essential to highlight that earlier editions of Agisoft Photoscan did not support a fundamental option concerning the This contribution has been peer-reviewed.doi:10.5194/isprsarchives-XL-5-173-2014possibility to read (u,v) reference systems encoded in .OBJ, .PLY formats; before the introduction of this aspect concerning import-export capabilities, the workflow thus far explained could not have worked.
Now that parameterization is more portable, it will be possible to achieve more easily and efficiently other objectives concerning model optimization: once the parameter space is perfectly read both from entertainment and from SfM applications in import and export, other maps will use (u,v) references also to encode normal, displacement and other useful maps generated by means of "baking".

CASE STUDIES
CT Lab Research Team is carrying out an extensive surveying campaign of Ravenna's city walls, paying specific attention to city gates; at the same time some relevant Byzantine and Late Antiquity monuments have been studied through photogrammetric applications since they present important examples of mosaic art or frescos on their dome's surfaces.
By means of these experiences, it was possible to test different software solutions and spot several problems.Among them, the parameterization was one of the main aspects to consider, given that it can compromise the quality of 3D assets in spite of their end use.
Walls, urban gates, interiors of Baptisteries, frescos, they all present different problems concerning the acquisition phase and the more appropriate strategies for a real utilization as tools for documentation and dissemination/visualization.The three cases studies presented range from architectural scale to small objects, but in each one of them the research team intended to obtain the better texturing solution from the point of view of colour reliability, image resolution and true interaction with models.
The first example deals with Porta Sisi in Ravenna: this ancient urban gate was documented through a photographic campaign aimed at SfM applications.
The principal purpose was to produce a high-poly photorealistic 3D model, usable as base for ortho-images of the monument.The pipeline for the achievement of a correct colour representation was based on (Apollonio et alii, 2013), while the rest was adopted as in the previous paragraphs (global re-mesh, semantic partition) for enhancing the poor (u,v) layout.
The problem of textured models from SfM applications such as Agisoft Photoscan concerns the presence of "double shadows" once the 3D asset is exported towards entertainment applications.
The combination of apparent colour directly applied on the texture map with the simulation of light provided by ray-tracing and global illumination algorithms leads to an artificial effect, that in some case can be empirically reduced using both render gamma output and texture gamma, or reducing other lighting parameters concerning environment, direct lighting, etc..In this first case study a simple strategy was adopted in order to escape physically accurate light simulation and BRDF.For the purpose of erasing direct and indirect illumination effect on the model, the diffuse colour texture was swapped into luminous colour and the material luminous intensity was set to 1.0 W/srm 2 , while diffuse amount was set to 0.   In this case, the main aim was the possibility to export the 3D asset toward a real-time application and, in order to obtain a proper simulation under different lighting conditions, it was essential to supply render engines with un-shadowed texture maps.
The pipeline adopted in this case is based on an extensive use of render to texture or "baking": a first baking was utilized for the production of normal maps from the high-poly model to the low poly one.The second baking was used for calculating the indirect lighting map whose function is to un-shadow the apparent colour map from Agisoft Photoscan: the workflow is similar to the one developed by Juhani Karlsson from Talvi Digital for the production or photorealistic asset creation.
The technique is a simplified and efficient customization inspired by the research from Debevec et alii (2004) on the Pantheon, where an iterative inverse global illumination technique was used to compute surface colours for the scene and so to achieve a lighting-independent textured model.
In this case, the BRDF is considered approximated to a perfect Lambertian surface, being brick walls of the Baptistery perfectly "matte".Every frame was shot in .NEF file format in order to achieve a proper colour calibration by means of a ColorChecker; regarding natural illumination capture, a series of pictures of a mirrored sphere have been taken, placing it outside of the Baptistery and following the common procedure for the generation of HDR images.
Once combined multiple images of the scene with different intensity levels, all they were introduced as lighting environment in the software The Foundry Modo 701: this high dynamic range images provided the scene with the lighting condition at the time of the photographic campaign.
The resulting indirect lighting was stored inside the Low-Poly (u,v) reference system through the "baking" of High-Poly model's lighting solution.
The outcome was a bitmap able to "un-shadow" the apparent colour texture from Agisoft Photoscan in Adobe Photoshop: once introduced in the .PSD colour map the upper layer with indirect lighting stored, its blending method was turned from "normal" to "soft light", producing the effect of removing shadows, preserving at the same time the other parts of the image.
A last case study is about the integrated use of active sensors and passive sensors for the reproduction of a 15th century fresco preserved in the Church of Santa Maria Maggiore in Ravenna.The aim was the production of a full-scale coloured representation of the fresco by means of a 3D Printer.
The model from SfM was used as a reference to align all the 80 range maps acquired with a sampling resolution of 0,4 mm; once merged in a single mesh, the two main problems were to provide it with an appropriate thickness and high resolution colour map.
The high-poly model underwent a retopology phase that lead to a coarse mesh formed by 384 quad-polygons, whose low number of faces converted both the modelling of its depth, and the parameterization into a very fast and reliable operation.a Low-Poly mesh, its (u,v) parameter space occupation is optimal so as the distortion factor of polygons.
The clearly recognizable relation between the polygons in 3D and their corresponding 2D versions simplified the necessary bitmap editing before the 3D printing phase: in absence of a clear relation between model and its parameterization, every texture editing is inaccurate and difficult.

CONCLUSIONS
This paper presented a process for improving the parameterization quality of High-Poly and Low-Poly models obtained from SfM software and active sensors, showing at the same time the advantages on 3D assets: enhanced portability, better colour representation, more efficient BRDF under different lighting conditions.
Even if some annoying import-export tasks are still present in the described workflow, the final texture quality of geometrically and topologically "healed" models undergone to semantic partition is evident: no waste of parameter space and a controlled number of islands.
This paper was written in the hope that software houses operating in the field of Cultural heritage documentations will become more aware about the need to unify different tools concerning mesh processing and parameterization in SfM applications.
In addition, the possibility to use a combination of automatic and manual tools for enhancing parameterization, respectively coming from photo-modelling applications and geometric modelling software, allows users to control more accurately the balance between areas of 3D meshes and their corresponding (u,v) version.
The encouraging results achieved thanks to the synergy of applications used in these experimentation, ranging from SfM to reverse modelling, geometric modelling and colour processing, suggests to carry out further developments, in particular on the topic of un-shadowing textures preventing empirical solutions or complex and time-consuming procedures.  .

Figure 2 .
Figure 2. A) mesh model of Porta Nuova in Ravenna with incorrect automatic texturing; B) the corresponding parameterization and texture obtained automatically (photographic survey by M. El Yamani).

Figure 5 .
Figure 5. Examples of semantic partition on a High-Poly mesh (A) and on a Low-Poly mesh from retopology.

Figure 7 .
Figure 7. Ortho-graphic view of Porta Sisi with double shadows (apparent colour, global illumination and ray-tracing).

Figure 8 .
Figure 8. Detail of Porta Sisi: A) mesh shading (direct and indirect illumination); B) apparent colour used as luminous texture; C) and D) "double shadowed" model rendered under different lighting conditions.The second case study deals with the Arian Baptistery of Ravenna and represents a generalization of the former, as the

Figure 9 .
Figure 9. A) product of automatic parameterization.B) automatic parameterization of Low-Poly mesh from retopology after semantic partition.

Figure 10 .
Figure 10.A) Apparent colour texture from SfM application; B) indirect illumination baked on the same (u,v) reference system; C) colour texture after shadow removal.This Low-Poly model of the fresco was then converted into a displaced sub-D model then "frozen" into a High-Poly for the last texturing phase since Agisoft Photoscan cannot support LOD representations.Being the parameterization carried out on

Figure 12 .
Figure 12.A) SfM model used as reference for range maps alignment.B) the use of a reliable template supplied by SfM improved the quality of range maps' registration.

Figure 13 .
Figure 13.A) High-poly from active sensors; B) displaced sub-D textured model; C) a panel of the fresco made through 3D printing.. ACKNOWLEDGEMENTS The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, VolumeXL-5, 2014   ISPRS Technical Commission V Symposium, 23 -25 June 2014, Riva del Garda, Italy