________________________________________________________________________________ Geoinformatics CTU FCE 2011 62 IMAGE BASED MODELING FROM SPHERICAL PHOTOGRAMMETRY AND STRUCTURE FOR MOTION. THE CASE OF THE TREASURY, NABATEAN ARCHITECTURE IN PETRA E. d’ANNIBALE D.A.R.D.U.S., Engineering Faculty, Università Politecnica delle Marche, Ancona, Italy e.dannibale @univpm.it Keywords: spherical photogrammetry, structure for motion, image based modeling, Cultural Heritage 3D Documentation Abstract: This research deals with an efficient and low cost methodology to obtain a metric and photorealstic survey of a complex architecture. Photomodeling is an already tested interactive approach to produce a detailed and quick 3D model reconstruction. Photomodeling goes along with the creation of a rough surface over which oriented images can be back-projected in real time. Lastly the model can be enhanced checking the coincidence between the surface and the projected texture. The challenge of this research is to combine the advantages of two technologies already set up and used in many projects: spherical photogrammetry (Fangi, 2007,2008,2009,2010) and structure for motion (Photosynth web service and Bundler + CMVS2 + PMVS2). The input images are taken from the same points of view to form the set of panoramic photos paying attention to use well-suited projections: equirectangular for spherical photogrammetry and rectilinear for Photosynth web service. The performance of the spherical photogrammetry is already known in terms of its metric accuracy and acquisition quickness but time is required in the restitution step because of the manual homologous point recognition from different panoramas. In Photosynth instead the restitution is quick and automated: the provided point clouds are useful benchmarks to start with the model reconstruction even if lacking in details and scale. The proposed workflow needs of ad-hoc tools to capture high resolution rectilinear panoramic images and visualize Photosynth point clouds and orientation camera parameters. All of them are developed in VVVV programming environment. 3DStudio Max environment is then chosen because of its performance in terms of interactive modeling, UV mapping parameters handling and real time visualization of projected texture on the model surface. Experimental results show how is possible to obtain a 3D photorealistic model using the scale of the spherical photogrammetry restitution to orient web provided point clouds. Moreover the proposed research highlights how is possible to speed up the model reconstruction without losing metric and photometric accuracy. In the same time, using the same panorama dataset, it picks out a useful chance to compare the orientations coming from the two mentioned technologies (Spherical Photogrammetry and Structure for Motion). 1. INTRODUCTION This research tries to improve an already tested approach for the metric and photorealistic reconstruction of a complex architecture: the Interactive Image Based Modeling [1]. Photomodeling it is possible to produce a detailed and quick 3D surface reconstruction thanks to real time texture projection on model surfaces. The challenge here is to combine the advantages of two technologies already set up and used in many projects: Spherical Photogrammetry and Structure for Motion (SfM) (Figure 1). The main difference with previous experiences [2] is the type of planar photo used as input for the SfM: here the images are shots acquired by a developed VR tool, saving a high resolution frame of the entire subject. Key points of the proposed research are: low-cost instrumentation, single operator, single PC, measure accuracy, procedure speed, real time control of the result, high resolution photo-realistic textures, and shareable output. All the working phases are tested and optimized to work quickly with an ordinary pc. 2. INSTRUMENT AND PHOTO ACQUISITION The input data for Spherical Photogrammetry are panoramic images with equirectangular projection, obtained by stitching different photos, taken from the same point and rotating around a pivot (Figure 2). It allows to work with high resolution images and have a large (complete if it‟s necessary) photographic scene information. The acquisition instruments are only a reflex camera (Canon 60D, 18MPx, 50mm zoom lens-35mm.eq), a long lens monopod bracket and a tripod. The head is adapted to have the camera nodal point in the center of two rotation axis and so to create a panoramic head. This system guarantees a good stability, important when it‟s necessary to work with long exposure ________________________________________________________________________________ Geoinformatics CTU FCE 2011 63 time because of poor illumination. A sharp image is decisive carrying out a SfM procedure: a bad acquisition can in fact give no results. Figure 1: More photogrammetric survey information in a single 3D environment a) Panoramic Head b) Some photos with the same nodal point. Stitching software enables to give spherical panorama c) Cropping the first panorama (L=77000 px) d) Data sheet to store information and convert pixel values in Angle and UV Coordinates e) Set of panorama (equirectangular projection). Average resolution 10000x10000px Figure 2: Panoramic photo acquisition Because of hardware limitations some images are resized into 10000x10000 px resolution. Software and hardware restrictions are known problems in this research field; on the other hand they drive to optimize the entire survey process. 3. SPHERICAL PHOTOGRAMMETRY SURVEY The Spherical Photogrammetry [3,4,5,6,7,8] is particularly suitable for architecture and archaeology metric recording and characterized by a proved precision. The Sp.Ph., making use of low-cost instrumentation and few steps allows to ________________________________________________________________________________ Geoinformatics CTU FCE 2011 64 orient the acquired panorama and obtain some shape primitives (.dxf format) (Figure3). Orientation and restitution procedures are manual: homologous points are collected by the user one by one. a) Create Points.exe Manual identification of homologous points b) Sphera.exe panorama orientation tool by Prof.Fangi d) Geometric Output (dxf) Restitution lines in red, acquisition stations in green, collimation rays in gray c) Panorama Orientation Info Figure 3: Spherical Photogrammetry process The 3D model scale is given trough a direct measure while the reference system origin and the model orientation are fixed by the user. In this way Sp.Ph., gives the chance to have an accurate orientation of the images while the following 3D point restitution remains time-consuming. In this manual restitution lies the main problem for complex architecture. The reliability of the Sp.Ph. approach allows to use it as reference system to orient and scale the following SfM 3D models. 4. INTEGRATION METHODOLOGY Complementing the 2 techniques it is possible to combine a large number of geometrical 3D information (from SfM) with the Sp.Ph. precision. The SfM [9,10,11,12] approach allows to recover good 3D models from scattered photos but not directly suitable for photogrammetric use: we have no information about scale and survey precision. There are different available SfM tools. They carry out a full automatic 3D reconstruction of subjects visible in more images by means of automated operations: image matching, camera calibration and dense point cloud creation. In this experience are tested two different SfM based tools: Photosynth Web Service and SfM Toolkit (Bundler+CMVS2+PMVS2). They are investigated by the comparison between their point cloud results and the lines or shapes coming from Sp.Ph. (Figure 4). A good way to integrate different survey techniques and have a clear comparison is to visualize all the results in a unique 3D digital environment. One research goal is to test the approach flexibility in integrating data from different survey techniques, laser scan data and direct survey measures when available. These in fact could be useful hints for a reliable precision comparison. a) Photosynth + Sp.Ph. b) Bundler + PMVS2 +Sp.Ph. Figure 4: Photogrammetric data visualization and management in 3D graphic software ________________________________________________________________________________ Geoinformatics CTU FCE 2011 65 To make the comparison possible (SfM versus Ph.Sp.) it is chosen to work with the same nodal point: high resolution planar images of the entire subject are acquired in laboratory from the same panorama used as input for the Sp.Ph. process. The idea of obtaining quickly these planar projections come during a virtual navigation with experimental tools. 5. VR TOOLS TO CAPTURE HIGH RESOLUTION PLANAR PHOTOS FROM EQUIRECTANGULAR PANORAMA A VR tool [13] is created to have an interactive navigation of the high resolution spherical panorama. The software is scalable and flexible, making possible to develop a large number of functions. It this case were developed plug-ins to automate the UV spherical mapping and save the planar projection visualized along (Figure 5). In the same time other information about the virtual camera are stored, first of all the FOV (Figure 6). The user can navigate and choose the frame to save in a common image file format with a very high resolution photo and 64Mpx. The powerful render engine enables to visualize a real time render of 8096x8096 px max resolution. This procedure minimize the image distortion according to two main reasons: the stitching software produces undistorted images and the VR tool adds no perspective distortion. This is confirmed by the only two camera parameters (Radial distortion: k1, k2) coming out from one of the two SfM processes used (Fig. 8-a, 8-b). a) VR GUI: after the panorama and frame are chosen with a mouse click is possible to save a very high resolution shot b) The nodal point of the (virtual) pinhole camera is in the textured sphere centre Figure 5: High resolution photo acquisition from spherical panorama 6. STRUCTURE FOR MOTION 6.1 Photosynth Photosynth is the first software used to carry out the research. It is a user friendly web service to automatically orient scattered photo making use of few on line steps. Its Web interface allows the user to navigate a virtual scene where his oriented photos are combined with the produced point cloud. Lastly camera calibration data and tie points are exported with additional software (SynthExport). Different tests are fulfilled, but only two of them are reported hereafter (Figure 7). First, 10 photos (4288x2848px) are acquired using a reflex camera (Nikon D90, 12 Mpx). Then, 10 planar projections are taken with the developed VR tool and then only resized to 4096x4096px resolution to give the 2 tests similar starting input. No additional information are required by Photosynth. It is interesting to focus on the parameters of radial distortion stored in the exported calibration data (Figure 8): one order of magnitude differentiates common photos from the VR shots. ________________________________________________________________________________ Geoinformatics CTU FCE 2011 66 a) FOV of shots stored in a txt file b) Set of Planar Projections. Images Resolution: 8096x8096px Figure 6: High resolution images and their information a) First Photo set by digital camera c) SynthExport permits to direct download point cloud and camera orientation d) First output: 16148 points b) Second Image set by VR Tool e) Second output: 9233 points Figure 7: Experimental tests: from the photo set acquisition to the point clouds a) Camera images distortion parameter b) VR images distortion parameter Figure 8: Parameters of Radial distortion from the exported calibration data ________________________________________________________________________________ Geoinformatics CTU FCE 2011 67 An ad-hoc tool (Vedo.exe, Fangi and d‟Annibale) is developed to convert only the point cloud coming from the second test (VR shots) from .ply to .dxf format. The model is then scaled and rototraslated according to the same reference system used in the restitution from panorama. Experimental results are visualized in the same working environment to underline how the SfM result (test with a second image set) differs in terms of orientation from the restitution coming from the Sp.Ph. Figure 9 shows this comparison: Sp.Ph. results on the left (restitution lines in red and panorama stations in green) and Photosynth outputs on the right (oriented point clouds in black and image stations in blue). Figure 9: Photosynth versus Sp.Ph. survey 6.2 SFM Toolkit (Budler+CMVS2+PMVS2) Different open-source toolkit are available on web to exploit fully automatic 3D image based reconstruction. Henri Astre, R&D Computer Vision Engineer, provides an SFM Toolkit, available to be downloaded and simply used as stand-alone application on Windows platform. Toolkit contains different tools: BundlerFocalExtractor: to extract CCD width from Exif using XML database BundlerMatcher: to extract and match feature using SiftGPU Bundler, created by Noah Snavely CMVS, Clustering Views for Multi-view Stereo created by Yasutaka Furukawa PMVS2, Patch-based Multi-view Stereo Software created by Yasutaka Furukawa. As done previously with Photosynth, the same 2 photo set are tested: the first from digital camera and second from VR tool. VR shots don‟t have the Exif information used to extract CCD width, but it is possible to pair them with their previously stored FOV info (Fig.6-a). Starting from an existing model it is possible to modify image Exif information by inserting the relative image focal length values (35mm eq.) (Figure 10-b, 10-d). a) VR images set and virtual camera info c) XML data base updated http://grail.cs.washington.edu/software/cmvs ________________________________________________________________________________ Geoinformatics CTU FCE 2011 68 b) GUI for Exif editing d)Focal length value (exif file) Figure 10: Exif info association and XML database update It‟s necessary to update .XML data base adding a new camera and its hypothetical sensor dimension width.(Figure 10- c). Problems with hardware engine and time-consuming elaborations can be overcome by resizing the images: a max resolution of 5120x5120px is processed for all the 9 images.ply files store the restitutions with the RGB information associated with the point clouds (Figure 11). a) First Photo set by digital camera Res: 4288x2848px b) Second Image set by VR Tool Res:5120x5120px c) First point cloud: 639.728 vertices d) Second point cloud: 1.089.854 vertices Figure 11: Tests with their different results Experimental results underline the performance of the proposed approach: the extracted point clouds are characterized by a good level of coverage, detail and noise reduction. Not so far from the feeling to have to deal with a laser scanning. To test the experimental results by the comparison with the Sp.Ph., again the second photo set is chosen: it shares the projection center with the oriented panoramas (Figure 12). MeshLab environment is chosen to visualize and process the point cloud, because of its advanced mesh processing system. Interesting is the chance to align meshes taking into account variation in scale: it is necessary for point clouds not collected directly by a 3D scanner device. ________________________________________________________________________________ Geoinformatics CTU FCE 2011 69 Figure 12: Dense point clouds by VR and SFM toolkits combination 7. POINT CLOUD ORIENTATION AND MESH OPTIMIZATION All the restitutions are oriented according to the Reference System used in the Ph.Sp. (Figure 13). The mesh is made up of 1500000 triangles, too many to be handle in the graphic environment used to draw surfaces. Therefore the mesh is optimized trying not to lose important information about the subject geometry (Figure 14). a) Point cloud orientation according to some points restituited by using the Sp.Ph. method Figure 13: Point cloud orientation a) High Poly Model: 970333 Vertices, 1552226 Faces b) Optimized Model: 44959 Vertices, 98662 Faces c) Exported Low Poly Mesh Figure 14: Mesh optimization ________________________________________________________________________________ Geoinformatics CTU FCE 2011 70 Visualizing the results in a unique Reference System it is possible to add visual control and underline differences between orientation camera parameters (Figure 15). The mesh from PMVS2 and the lines restitutied by using the Sp.Ph. approach are very similar: it‟s difficult to highlight differences without other kind of control. Figure 15: SFM and SP. Ph. geometrical survey in the same 3D environment 8. TEXTURE MAPPING AND IMAGE BASED MODELING High resolution texture is a valid alternative to heavy 3D geometric details, wasting hardware resources. Texture mapping is already known [2 ] to be possible thanks to the panorama orientation and UV mapping parameters. Because the center and the orientation of spherical projection are note, a datasheet can be created to automate the UV mapping tiling and the offset computation (Figure 16-a). The scene is so ready to perform spherical projections over any surface (Figure 16-b). In particular the texture projection on the SFM mesh reveals a good fitting: it validates the experimental procedure and shows the possibility to use the extracted mesh as good starting rough model to redraw 3D surfaces. a) Data sheet for UV Map conversion parameters b) Spheres with correct texture projection mapping Figure 16: Orientation and UV spherical mapping The mesh is so imported in the graphic environment to be a useful help to speed up the Interactive Image Based Modeling, devised to draw geometrical elements of architecture with the photogrammetric control. The imported mesh can now be enhanced under the review of the photogrammetric geometric data and texture mapped on the surface. Real time rendering allows visualizing a photorealistic texture during the modeling phase (Figure 17). This is a useful help to control the drawn geometries. ________________________________________________________________________________ Geoinformatics CTU FCE 2011 71 a) PMVS2 mesh, Sp.Ph. lines and oriented panorama b) Photorealistich texture with spherical mapping c) PMVS2 mesh with texture and lines from Sph.Ph Figure 17: Texture projection and mesh control 8. CONCLUSION Experimental results show how is possible to speed up and geometrically check the Image Based Modeling to obtain a 3D photorealistic model. First, it is possible to take advantage of VR tools to acquire high resolution shots and use them to run automatic reconstructions by means of SfM techniques (Photosynth web service and Bundler + CMVS2 + PMVS2). Resulting point clouds have good performance in terms of coverage and accuracy and can be oriented in accordance with the spherical photogrammetry restitution. Then, with the aim of building a 3D digital model, the mesh can be optimized, resized and imported in a graphic environment. Here it becomes a good rough 3D reference to aid the modeling phase. Image Based Modeling (Figure 18, 19) can in this way take advantage of three different benchmarks: Restitutied data from Spherical Photogrammetry Optimized mesh from Bundler+PMVS2 High Resolution Texture Projected on surface. Step by step, the combination of these three references drives the modeler towards a photorealistic description of a complex architecture, without losing in quickness and hardware performance. ________________________________________________________________________________ Geoinformatics CTU FCE 2011 72 Figure 18: Image Base Modeling of some elements In each working phase, thanks to innovative interactive systems, the outputs allow efficient real time visualizations of the complex architectural model. The performance of the proposed photogrammetic tools favors‟ testing and investigation. Lastly, using the same panorama dataset, the proposed research picks out a useful chance to make comparison between Spherical Photogrammetry and Structure for Motion in terms of orientations and accuracy. Moreover the research underlines how this combination allows to speed up the interactive Image Based Modeling, taking advantage of a correct image orientation (Spherical Photogrammetry) and a large extracted point cloud as geometric reference. Figure 19: Low Poly Model with high resolution texture ________________________________________________________________________________ Geoinformatics CTU FCE 2011 73 9. REFERENCES [1] E.d‟Annibale, G.Fangi (200ř) – Interactive modelling by projection of oriented spherical panorama – 3D-Arc‟200ř, 3D Virtual Reconstruction and Visualisation of complex Architectures – Trento 25-29 February 2009- ISPRS Archives - Vol XXXVIII-5/W1 : 1682-1777 on cd. [2] E.d‟Annibale, S.Massa, G.Fangi (2010) - Photomodeling and point clouds from spherical panorama - Nabatean Architecture in Petra, Jordan - C.I.P.A. Workshop, Petra 4-8 November 2010. [3] G.Fangi (2006) - Investigation On The Suitability Of The Spherical Panoramas By Realviz Stitcher For Metric Purposes, ISPRS Archive vol.XXXVI Part 5, Dresden 25-27 September 2006. [4] G.Fangi- Una nuova fotogrammetria architettonica con i panor ami sferici multimmagine – Sifet Symposium, Arezzo 27-29 Giugno 2007, CD. [5] G.Fangi – The Multi-image spherical Panoramas as a tool for Architectural Survey - XXI International CIPA Symposium, 1-6 October 2007, Atene, ISPRS International Archive – vol. XXXVI-5/C53 – ISSN 1682-1750 – CIPA Archives vol. XXI – 2007, ISSN 0256-1840 - pg.311-316. [6] G.Fangi – La Fotogrammetria sferica dei mosaici di scena per il rilievo architettonico – bollettino SIFET n. 3 2007 pg. 23-42. [7] G.Fangi, P.Clini, F.Fiori – Simple and quick digital technique for the safeguard of Cultural Heritage. The Rustem Pasha mosque in Istanbul – DMACH 4 - 2008 - Digital Media and its Applications in Cultural Heritage 5 - 6 November, 2008, Amman pp 209-217. [8] G.Fangi (2009) – Further Developments of the Spherical Photogrammetry for Cultural Heritage – XXII Cipa Symposium, Kyoto, 11-15 Ottobre 2009. [9] Richard Hartley and Andrew Zisserman (2003).Multiple View Geometry in Computer Vision, . Cambridge University Press. ISBN 0-521-54051-8. [10] Noah Snavely, Steven M. Seitz, Richard Szeliski (2006). Photo Tourism: Exploring image collections in 3D.ACM Transactions on Graphics (Proceedings of SIGGRAPH 2006). [11] Noah Snavely, Steven M. Seitz, Richard Szeliski, (2007). Modeling the World from Internet Photo Collections. International Journal of Computer Vision. [12] L.Barazzetti, G.Fangi, F.Remondino, M.Scaioni, (2010) Automation in Multi-Image Spherical Photogrammetry for 3D Architectural Reconstructions - The 11th International Symposium on Virtual Reality, Archaeology and Cultural Heritage VAST (2010) A. Artusi, M. Joly-Parvex, G. Lucet, A. Ribes, and D. Pitzalis (Editors). [13] E.d‟Annibale (2010) – New VR system for navigation and documentation of Cultural Heritage – C.I.P.A. Workshop, Petra 4-8 November 2010. MeshLab http://meshlab.sourceforge.net/ Photosynth http://www.photosynth.net SynthExport http://synthexport.codeplex.com/ SFM toolkit http://www.visual-experiments.com/demos/sfmtoolkit/ SIFT GPU http://www.cs.unc.edu/~ccwu/siftgpu/ Bundler http://phototour.cs.washington.edu/bundler/ CMVS2 http://grail.cs.washington.edu/software/cmvs/ PMVS2 http://grail.cs.washington.edu/software/pmvs/ http://en.wikipedia.org/wiki/International_Standard_Book_Number http://en.wikipedia.org/wiki/Special:BookSources/0-521-54051-8 http://phototour.cs.washington.edu/Photo_Tourism.pdf http://phototour.cs.washington.edu/ModelingTheWorld_ijcv07.pdf http://meshlab.sourceforge.net/ http://www.photosynth.net/ http://synthexport.codeplex.com/ http://www.visual-experiments.com/demos/sfmtoolkit/ http://www.cs.unc.edu/~ccwu/siftgpu/ http://phototour.cs.washington.edu/bundler/ http://grail.cs.washington.edu/software/cmvs/ http://grail.cs.washington.edu/software/pmvs/