INTERPRETATION OF TOPOGRAPHIC DATA FROM 'SHAPE FROM SHADING' METHOD, APPLICATION IN VILLAGARCÍA DE CAMPOS CASTLE

Abstract. Generating digital products allowing the assessment and interpretation of Cultural Heritage is a key task in conservation processes. Thus a variety of ( Shape from X ) methods have been developed through photogrammetry with that aim in mind, which in the digital era widen their scope on account of independence of physical resources as well as high geometrical and radiometric qualities of their results. A method based on virtual 3D reconstruction of objects (scenarios) and the further 2.5 D maps generation by means of the Shape from Shading method for simulating the reflectance properties of surfaces within 2D images is being proposed. This alternative, seldom used when studying Urban-Architectural Heritage, is aimed at overcoming inadequacies when analyzing surfaces from the bi-dimentional view -or the three-dimensional one itself- over areas with little variations in elevation (relevant to urbanarchitectural context). The methodology is applied to Villagarcia de Campo Castle, Spain, stemming from the reconstruction of the property by the General Photogrammetry Method until achieving "Images by Reflectance Transformation", and ending by interpreting its topography for the inspection of un-documented historical traces.


INTRODUCTION
Approaching Cultural Heritage linked to the analysis of historical scenarios brings about, in many cases, a transformation generally defined by substantial degradation at the geometrical and radiometric level challenging the accuracy of its technical study, its historical interpretation and, lastly, the transmission of its values, involved in current society's teaching-learning process.
Nowadays, digital photogrammetry looms as one of the most efficient tools allowing for Cultural Heritage's geometrical and radiometric study.The generation of 3D models from that field has had, with the arrival of digital culture, a noticeable boom, although getting data with information about the three dimensions does not necessarily mean capability for the user to see all the information (in all its dimensions) in the right way.Current computers permit to capture only the information throughout the screen at the same time.Although stereoscopic vision might solve this setback, for the special case of Urban-Architectural Heritage, with unique characteristics given by the little or none perceptible variation in the height of surfaces or terrains in respect to the project's scale (with a tendency to 'flatland'), make it necessary to develop and implement the tools paving the way for interpreting the scenarios mentioned.The variety of methods for gathering and processing data attached to the "Shape from X" collection (Kersten, 2010) makes it possible to enlarge the scope of photogrammetry's application depending on the changes of contexts, needs as well as economic and technical possibilities.The current study suggests interlacing two techniques adscribed to capturing and processing information based on images: Shape from Stereo/Motion, for rigorous geometrical reconstruction of the surface under study and Shape from Shading for interpreting surfaces under varying lighting and reflectance conditions.The study will be focused on the latter due to the newness meant by its application to Urban-Architectural scenarios, thus allowing a detailed perception of topographic deformations, while easing its interpretation (Malzbender, Wolters and Gelg, 2001), in face of the above described problems.

ANALYTICAL STRUCTURE
Just as it has happened when making other geometrical and radiometric products from digital photogrammetry (True-orthophoto, vectorization from recognition of primitives, etc.), a new way for studying the Heritage going on a "round trip" in generating digital products is opening in front of us (Figure 1).Obtaining complex three-dimensional models (the final aims of the performances up to now), becomes an intermediate step for making new output, while in so doing, encompassing in the process not only efficient methods of documentation, but also handling and interpreting information for a detailed assessment.its materials, shapes and textures (Pavlidis et. al., 2007) and (García et. al., 2011).
The reconstruction process suggested is based on what has been called "General Photogrammetry Method" (Gómez Lahoz, 2009), joined together in the process of photo shot and calculus of internal and external orientation for discrete surface restitution, although currently appear more strongly Computer Vision related implementations, based on epipolar geometry: restitution homology or fundamental matrix (Denia, 2011).At present, various commercial programs are implementing this method along with algorithms for obtaining dense geometries.
(Dense Stereo Matching), enabling the emergence of thick clouds of dots and triangular meshes.
The proposed method relies on this new way (Figure 1), which departs from identifying the Heritage under study and its documentation.Once the geometrical information in three dimensions has been obtained, its import in applications of virtual modelling is undertaken.The three-dimensional model is imported to the "virtual laboratory", what provides us with the possibility of handling the parameters of the scenario: cameras, lighting, textures, colors, (whatever source of lighting is acceptable in order to keep suitable conditions for reconstructing the direction of light and those typical of the surface), allowing to process and take images either from sensing automatic lights or with more rigorous methods by manually managing the lighting measures defined by the direction vector's standardized components X, Y and Z from the lighting source up to each image to be processed.(Malzbender & Gelb, 2001).The 2D images with unique radiometric characteristics make up the necessary foundation for generating 2.5D* maps according to the Shape from Shading method (section 3).The result will include reflectance models adjusted to the study area, which according to various rendering alternatives (detailed in section 4) bring about interactive models that make it easier to interpret the surface through the changes of lighting conditions and the scene's reflectance properties.

General formulation
This technique, commonly used in reconstructing planets' surfaces from photographs taken from spacecraft (Ikeuchi & Horn, 1981), permits to reconstruct three-dimensional surfaces from a single point of view, based on the answer to luminous stimuli over surfaces.The problem began in the 70s and 80s (Kimmel & Sethian, 2000), when solutions to equation of brightness (Partial Differential Equation -PDE) and the search of a single solution were figured out, although nowadays, it is regarded a wrongly posed problem because this single solution is non-existent.The general modelling of the Shape From Shading method, put forward by Horn (Prados & Fagueras 2006), defined by the PDE, stems from the image point coordinates (x 1 , y 1 ), for connecting the Reflectance Map (R) to Image Brightness (I).Assuming that we are dealing with a Lambertian scenario, where the Reflectance Map is the cosine between the angle made up by the light L(x) vector and the normal vector with respect to the surface n(x). (1) (2) Team Prados and Faugueras (Prados & Faugueras 2006) describes the possibly defined formulations in three categories: With the camera while shooting an orthographic projection of the scenario and the source of lighting are boundless.
With the camera while shooting a perspective projection of the scenario and the source of lighting is boundless.
With the camera while shooting a perspective projection of the scenario and the source of lighting within a finite space.
Even researchers themselves (Prados 2002) consider the first category ideal for mathematical modelling and its further spreading to more realistic situations.For those cases, parallel light beams are assumed, and they can be represented by a constant vector, whose reflectance is Lambertian and its constant Albedo is equal to 1.It is also deemed that there are neither occlusions nor known distance from the point where the information was captured.In an independent way in each pixel, the PTM creation sets a order polynomial to samples collected in 2D image capture, the visualizer only needs to evaluate polynomial in real time, equally independent, producing a PTM image that varies depending on the reflectance methods applied by the visualizer and the user control: Specular Enhancement y Diffuse Gain Methods (detailed in section 4.)

CASE STUDY: VILLAGARCÍA DE CAMPOS CASTLE'S
Villagarcía de Campos Castle's, located in the province of Valladolid, is property declared as "Asset of Cultural Interest" of Spain, one of the leading exponents of Castle-Palace typologies of Castile and Leon kingdoms (Medieval Low), where residential functions are combined with medieval defensive structures (Fernandez et. al., 2006), besides the historical importance conferred by having been the youth residence of Don Juan of Austria, son of Emperor Charles V. Insufficient historical documentation and the advanced state of ruin, makes it difficult to hypothesize the original Castle state and the detection of characteristic features, objectives of government agencies in the region for future intervention efforts.
Figure 3: Position of information captures based on images over the cloud of correspondence dots.
The rigorous three-dimensional reconstruction, previously performed by photogrammetric techniques (Shape from Stereo / Motion) from ground and air positions (Figure 3), allowed an accurate meshed model (Figure 4), which fulfill the conditions of the first stage referred in Section 2(Analytical Structure), enabling the achievement to the next step: 2.5D Map Generation of the surface from Shape from Shading.Once obtained the geometrical information, the mesh model has been exported and a virtual scenario has been recreated from the 3D Max modelling application, what made it possible to idealize the conditions for taking, sending and responding to lighting, material reflectivity, as well as the scale and format of images for their post-processing with the Shape for Shading technique (Figure 5).As it has been said in details, the scenario generation from the "virtual laboratory" in 3D Max, can be done by hand, and by incorporating restrictions in geometry and lighting conditions (thus better outcomes are likely).For this study, processing (Detection of normals to the surface) has been done automatically; therefor the method has been generalized not only for cases of idealized studies (virtual models) but also over real scenarios, where the position of the light-sending focus is not certainly known.Thus two spheres with unique reflecting properties are brought into the virtual scene so that they can be neatly identifiable in the photograms (from the recognition methods stated by the RTI image-creating applications) the specular reflectance area (highlight) over a spherical surface.This way the lighting direction has been determined.The collection of resulting images, are processed by means of RTI image makers from an adjustment of Polynomial Texture Mapping (detailed in section 3.2) and the resulting document is attached to interactive viewers, that allow to implement and emphasize only the surface reflectivity of mathematical transformations either to normal of the surface or to RGB color information (CHI, 2010).For the study shown, the color information has been left out with a view to emphasize only the surface reflectivity and do away with possibly wrong tracks that could input the low vegetation's heterogeneous color present in the layer.That is why the rendering modes applied only work on the relationship between normals and lighting conditions.The methods suggested by (Malzbender andGelb, 2001 andCHI, 2010) have been applied: "Diffuse gain": Emphasizes the representation in sudden changes of height and depth.In areas showing a fast and dense sequence of changes, the function deepens depression by increasing the rate of direction change (the parabola's Gaussian curvature; that is, the second derivative) of the surface's slope (Malzbender, Wolters and Gelb, 2001, p.7).
The mode, according to what the aforementioned authors state, may have secondary effects from the introduction of false color in some images, although it is not important in our case, as we are doing without the RGB information."Specular enhancement": It allows to modify the surface's conditions (based on specularity) and simulated lighting by setting apart RGB diffuse color, the surface's specular reflection and the specular highlights' size, thus achieving a particularized interpretation in the different materials making up the scenario.For Villagarcia de Campos Castle's case, the aforementioned insufficient historical documentation, and its 'flat-land' topographic characteristics enable the application of the method stated for the superficial interpretation of the layer.The outcome of the process provides us as final result with an interactive map of variations of reflectance, intensities and lighting directions, allowing for the topographical reading of the terrain with higher emphasis on its three-dimensional nature.
Visual evaluations stemming from variation of lighting stimuli and different rendering forms have permitted to elucidate and itemize the following features of the property (visually represented in figure 6). 1. Position of the two cisterns mouths reported by historical studies.
3. Limits of the Northern Facade's second bay (or passage) (Arm Courtyard) 4. Sedimentary accumulation due to degradation of adobe walls. 5. Trace of likely walls, predictably built after the property was used as a castle (Eastern Facade).6. Trace of a possible section adjoining the grain store and of like dimension (un-documented in historical studies) Figure 6: Interpretación visual de los rasgos topográficos de la ruina del Castillo de Villagarcía de Campos.

CONCLUSIONS AND FUTURE WORK
The growing need of conserving Patrimonial resources compels its study techniques to develop constantly.In particular, the analysis and interpretation of surfaces is shown as one of the most pressing requirements for rescuing Urban-Architectural Heritage at present.The method of analysis put forward, hails from using techniques of photogrammetric documentation based on images: Shape from Stereo/Motion up to 2.5D map-making of surface topography by means of Shape From Shading, while minimizing reliance on physical devises (household appliances) and making a coherent use of the possibilities provided by digital culture.The generation of interactive maps using properties little explored up to now in the Cultural Heritage realm, such as reflectance of materials and lighting conditions, pose an efficient solution to deficiencies of interpretation and evaluation of surfaces from a bi-dimensional or threedimensional viewpoint in the case of surfaces with unnoticed variability of depth, thus making it possible, as it has been shown in the case study, the solution to questions and requests of technical-historical nature.
The width and scope of the proposal make it impossible to cover it thoroughly in one presentation.Its up to now hardly spread implementation in the patrimonial area makes it foreseeable that in the next few years the development of algorithms and associated working methods will continue.The particular case approached here opens immediate research lines such as (1) the assessment of various modes of rendering and their relationship with RGB textures and colors typical in urbanarchitectural scenarios: limestone, slate, vegetation, etc. (2) the parametrical assessment of the lighting position calculus' gain in face of the automatic sensing of its direction for attaining an increasing processing efficiency and higher accuracy in interpretation processes.

Figure 1 :
Figure 1: New "round trip" for generating digital products in Cultural Heritage As it was stated in the introduction, the analytical structure stems from the rigorous tridimensional reconstruction of scenarios.Once analyzed the tool kit suggested by current digital photogrammetry, the Shape from Stereo method looms as one of the most effective in documenting the Urban Architectural Heritage, because of the general characteristics of

Figure 2 :
Figure 2: Relationship between the object point intensity and the replanted point (pixel in case of the camera) [Image made from (Prados 2002) and (CHI 2010)]With the hypothesis already defined, the Shape from Shading problem occurs: Given I and L, finding a function , satisfying the PDE equation:

Figure 5 :
Figure 5: Images Collection obtained from 3DMax modeling software for posprocessing under Shape from Shading technique with automatic highlight calculation variant

Figure 6 :
Figure 6: 2.5D Maps renderized with the Specular Enhancement method 4.1 Outcomes in the case under study