Android Application Programming with OpenCV

Android Application Programming with OpenCV
eBook: $20.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 20%!
Print + free eBook + free PacktLib access to the book: $55.98    Print cover: $34.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • 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

Book Details

Language : English
Paperback : 130 pages [ 235mm x 191mm ]
Release Date : September 2013
ISBN : 1849695202
ISBN 13 : 9781849695206
Author(s) : Joseph Howse
Topics and Technologies : All Books

Table of Contents

Chapter 1: Setting Up OpenCV
Chapter 2: Working with Camera Frames
Chapter 3: Applying Image Effects
Chapter 4: Recognizing and Tracking Images
Chapter 5: Combining Image Tracking with 3D Rendering
  • Chapter 1: Setting Up OpenCV
    • System requirements
    • Setting up a development environment
      • Getting a ready-made development environment – Tegra Android Development Pack (TAPD)
      • Assembling a development environment piece-by-piece
        • Getting the prebuilt OpenCV4Android
        • Building OpenCV4Android from source
    • Building the OpenCV samples with Eclipse
    • Finding documentation and help
    • Summary
  • Chapter 2: Working with Camera Frames
    • Designing our app – Second Sight
    • Creating the Eclipse project
    • Enabling camera and disk access in the manifest
    • Creating menu and string resources
    • Previewing and saving photos in CameraActivity
    • Deleting, editing, and sharing photos in LabActivity
    • Summary
  • Chapter 3: Applying Image Effects
    • Adding files to the project
      • Defining the Filter interface
    • Mixing color channels
    • Making subtle color shifts with curves
    • Processing a neighborhood of pixels with convolution filters
    • Adding the filters to CameraActivity
    • Summary
  • Chapter 5: Combining Image Tracking with 3D Rendering
    • Adding files to the project
    • Defining the ARFilter interface
    • Building projection matrices in CameraProjectionAdapter
    • Modifying ImageDetectionFilter for 3D tracking
    • Rendering the cube in ARCubeRenderer
    • Adding 3D tracking and rendering to CameraActivity
    • Learning more about 3D graphics on Android
    • Summary

Joseph Howse

Joseph Howse might be at home right now, sitting on a sofa and writing a book, or he might have dashed away with a suitcase full of books, cameras, and computers. He is equipped to "see the world" or at least to do his work in computer vision. He is a software developer at Ad-Dispatch (Canada), where he makes augmented reality games for iOS and Android. Thanks to computer vision, the games can make use of real-world props such as a child's drawings, toys, or blanket-forts. He also provides training and consulting services. He is currently consulting at Market Beat (El Salvador) on an embedded systems project that uses OpenCV for face recognition. He holds three masters degrees in Computer Science, International Development Studies, and Business Administration (Dalhousie University, Canada). His research has been published by ISMAR (International Symposium on Mixed and Augmented Realities), and he would love to meet you there if you go. Android Application Programming with OpenCV is Joe's second book with Packt. His first book, OpenCV Computer Vision with Python, includes an introduction to face tracking and depth cameras (for example, Kinect) on Windows, Mac, and Linux. Joe likes cats, kittens, oceans, and seas. Felines and saline water sustain him. He lives with his multi-species family in Halifax, on Canada's Atlantic coast.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Android Application Programming with OpenCV +    Node.js Blueprints =
50% Off
the second eBook
Price for both: £24.85

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Install OpenCV and an Android development environment on Windows, Mac, or Linux
  • Capture, display, and save images
  • Make images accessible to other apps via Android's MediaStore and Intent classes
  • Integrate OpenCV events and views with Android's standard activity lifecycle and view hierarchy
  • Learn how OpenCV uses matrices to store data about images, recognizable features in images, and camera characteristics
  • Apply curves and other color transformations to simulate the look of old photos, movies, or video games
  • Apply convolution filters that sharpen, blur, emboss, or darken edges and textures in an image
  • Track real-world objects, especially printed images, in 2D and 3D space
  • Extract camera data from Android SDK and use it to construct OpenCV and OpenGL projection matrices
  • Render basic 3D graphics in OpenGL

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 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.


A step-by-step tutorial to help you master computer vision and mobile app development.

Who this book is for

This book is for Java developers who are new to computer vision and who would like to learn about how it is used in relation to application development. It is assumed that you have previous experience in Java, but not necessarily Android. A basic understanding of image data (for example pixels and color channels) would be helpful too. You are expected to have a mobile device running Android 2.2 (Froyo) or greater and it must have a camera.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software