Image Stitching
Total Page:16
File Type:pdf, Size:1020Kb
Department of Electronic and Computer Engineering FINAL DEGREE PROJECT June 2011 IMAGE STITCHING Studies: Telecommunications Engineering Author: Oscar Soler Cubero Supervisors: Dr. Sean McGrath, Dr. Colin Flanagan Image Stitching 1 CONTENTS Abstract ................................................................................................................................ 3 Resum .................................................................................................................................. 4 Resumen .............................................................................................................................. 5 1. Introduction ...................................................................................................................... 6 1.1. General Introduction .................................................................................................... 6 1.2. Image .......................................................................................................................... 7 1.2.1. Still Image ............................................................................................................. 7 1.2.2. Moving Image ..................................................................................................... 10 2. Image Processing .......................................................................................................... 11 2.1. Points Operators ....................................................................................................... 11 2.2. Neighbourhood Operators ......................................................................................... 13 2.2.1. Linear Filtering .................................................................................................... 13 2.2.2. Non-linear Filtering.............................................................................................. 14 2.3. Image Pyramids and Wavelets .................................................................................. 14 2.3.1. Pyramids ............................................................................................................. 15 2.3.2. Wavelets ............................................................................................................. 15 2.4. Geometric Transformations ....................................................................................... 16 3. Stitching Process ........................................................................................................... 18 3.1. History ....................................................................................................................... 18 3.2. Image Registration .................................................................................................... 19 3.2.1. Direct (Pixel-Based) Registration ........................................................................ 19 3.2.2. Feature-Based Registration ................................................................................ 21 3.3. Image Calibration ...................................................................................................... 28 3.3.1. Bundle Adjustment .............................................................................................. 28 3.3.2. Parallax Removal ................................................................................................ 29 3.4. Image Blending ......................................................................................................... 30 3.4.1. Compositing Surface ........................................................................................... 30 3.4.2. Pixel/Seam Selection and Weighting .................................................................. 31 3.4.2. Blending .............................................................................................................. 32 4. Stitching Issues ............................................................................................................. 35 4.1. Algorithms ................................................................................................................. 35 4.1.1. Scale Invariant Feature Transform ...................................................................... 35 4.1.2. Random Sample Consensus .............................................................................. 38 4.1.3. Kd-Tree Nearest Neighbour Search .................................................................... 39 Image Stitching 2 4.2. Common Problems .................................................................................................... 40 4.2.1. Exposure ............................................................................................................ 40 4.2.2. Lens Distortion .................................................................................................... 41 4.2.3. Parallax Error ...................................................................................................... 42 4.2.4. Ghosting ............................................................................................................. 42 4.2.5. Overlapping ........................................................................................................ 43 4.2.6. HFOV and Image Resolution .............................................................................. 44 4.3. Software .................................................................................................................... 45 4.3.1. Panorama Tools ................................................................................................. 45 4.3.2. Hugin .................................................................................................................. 46 4.3.3. PTGui ................................................................................................................. 46 4.3.4. AutoStitch and AutopanoPro ............................................................................... 47 4.3.5. Microsoft Image Composite Editor ...................................................................... 48 4.3.6. CleVR ................................................................................................................. 48 5. Stitching Application ..................................................................................................... 49 5.1. Smart Tour UL project ............................................................................................... 49 5.2. Panorama Stitching Formats ..................................................................................... 50 5.3. Script ......................................................................................................................... 53 5.3.1. Package and Libraries ........................................................................................ 53 5.3.2. Panorama_Script.sh ........................................................................................... 54 5.4. Results ...................................................................................................................... 59 5.4.1. Original Image Re-Stitched ................................................................................ 59 5.4.2. Camera Phone .................................................................................................... 60 5.4.2. University of Limerick .......................................................................................... 61 6. Conclusions ................................................................................................................... 63 6.1. Future Work Development ......................................................................................... 63 7. References ..................................................................................................................... 65 Appendix A. Panorama_Script.sh ..................................................................................... 66 Appendix B. Manual Pages ............................................................................................... 67 Appendix C. Project Files Examples ................................................................................ 86 C.1. Project File for autooptimiser .................................................................................... 86 C.1. Project File for nona .................................................................................................. 91 Image Stitching 3 ABSTRACT Image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image. Most image processing techniques involve treating the image as a two-dimensional signal and applying standard signal processing techniques to it. Specifically, image stitching presents different stages to render two or more overlapping images into a seamless stitched image, from the detection of features to blending in a final image. In this process, Scale Invariant Feature Transform (SIFT) algorithm can be applied to perform the detection and matching control points step, due to its good properties. The process of create an automatic and effective whole stitching process leads to analyze different methods of the stitching stages. Several commercial and online software tools are available to perform the stitching process, offering