You are previewing Android Application Programming with OpenCV.
O'Reilly logo
Android Application Programming with OpenCV

Book Description

For Java developers OpenCV is a fantastic opportunity to benefit from the popularity of image related mobile apps on Android. This book teaches you all you need to know about computer vision with practical projects.

  • Set up OpenCV and an Android development environment on Windows, Mac, or Linux

  • Capture and display real-time videos and still images

  • Manipulate image data using OpenCV and Apache Commons Math

  • Track objects and render 2D and 3D graphics on top of them

  • Create a photo-capture and photo-sharing app that supports a variety of filters with a real-time preview feature

  • In Detail

    Take a smartphone from your pocket, and within a few seconds, you can snap a photo, manipulate it, and share it with the world. You have just achieved mass production of image data. With a computer vision library such as OpenCV, you can analyze and transform copious amounts of image data in real time on a mobile device. The upshot to this is that you, as developers, can provide mobile users with many new kinds of images, constantly highlighting certain visual features that are of artistic or practical interest. Android is a convenient platform for such experiments because it uses a high-level language (Java), it provides standardized interfaces for sharing image data between applications, and it is mostly open source, so everyone can study its implementation.

    Android Application Programming with OpenCV is a practical, hands-on guide that covers the fundamental tasks of computer vision—capturing, filtering, and analyzing images-with step-by-step instructions for writing both an application and reusable library classes.

    Android Application Programming with OpenCV is a practical, hands-on guide that covers the fundamental tasks of computer vision—capturing, filtering, and analyzing images-with step-by-step instructions for writing both an application and reusable library classes.

    Android Application Programming with OpenCV looks at OpenCV's Java bindings for Android and dispels mysteries such as which version of these bindings to use, how to integrate with standard Android functionality for layout, event handling, and data sharing, and how to integrate with OpenGL for rendering. By following the clear, concise, and modular examples provided in this book, you will develop an application that previews, captures, and shares photos with special effects based on color manipulation, edge detection, image tracking, and 3D rendering. Beneath the application layer, you will develop a small but extensible library that you can reuse in your future projects. This library will include filters for selectively modifying an image based on edge detection, 2D and 3D image trackers, and adapters to convert the Android system's camera specifications into OpenCV and OpenGL projection matrices. If you want a quick start in computer vision for Android, then this is the book for you.

    By the end of Android Application Programming with OpenCV, you will have developed a computer vision application that integrates OpenCV, Android SDK, and OpenGL.

    Table of Contents

    1. Android Application Programming with OpenCV
      1. Table of Contents
      2. Android Application Programming with OpenCV
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Setting Up OpenCV
        1. System requirements
        2. Setting up a development environment
          1. Getting a ready-made development environment – Tegra Android Development Pack (TAPD)
          2. Assembling a development environment piece-by-piece
            1. Getting the prebuilt OpenCV4Android
            2. Building OpenCV4Android from source
        3. Building the OpenCV samples with Eclipse
        4. Finding documentation and help
        5. Summary
      9. 2. Working with Camera Frames
        1. Designing our app – Second Sight
        2. Creating the Eclipse project
        3. Enabling camera and disk access in the manifest
        4. Creating menu and string resources
        5. Previewing and saving photos in CameraActivity
        6. Deleting, editing, and sharing photos in LabActivity
        7. Summary
      10. 3. Applying Image Effects
        1. Adding files to the project
          1. Defining the Filter interface
        2. Mixing color channels
        3. Making subtle color shifts with curves
        4. Processing a neighborhood of pixels with convolution filters
        5. Adding the filters to CameraActivity
        6. Summary
      11. 4. Recognizing and Tracking Images
        1. Adding files to the project
        2. Understanding image tracking
        3. Writing an image tracking filter
        4. Adding the tracker filters to CameraActivity
        5. Summary
      12. 5. Combining Image Tracking with 3D Rendering
        1. Adding files to the project
        2. Defining the ARFilter interface
        3. Building projection matrices in CameraProjectionAdapter
        4. Modifying ImageDetectionFilter for 3D tracking
        5. Rendering the cube in ARCubeRenderer
        6. Adding 3D tracking and rendering to CameraActivity
        7. Learning more about 3D graphics on Android
        8. Summary
      13. Index