Book Image

Android Application Programming with OpenCV 3

By : Joseph Howse
Book Image

Android Application Programming with OpenCV 3

By: Joseph Howse

Overview of this book

<p>Android Application Programming with OpenCV 3 is a practical, hands-on guide to computer vision and mobile app development. It shows how to capture, manipulate, and analyze images while building an application that combines photography and augmented reality. To help the reader become a well-rounded developer, the book covers OpenCV (a computer vision library), Android SDK (a mobile app framework), OpenGL ES (a 3D graphics framework), and even JNI (a Java/C++ interoperability layer).</p> <p>Now in its second edition, the book offers thoroughly reviewed code, instructions, and explanations. It is fully updated to support OpenCV 3 and Android 5, as well as earlier versions. Although it focuses on OpenCV's Java bindings, this edition adds an extensive chapter on JNI and C++, so that the reader is well primed to use OpenCV in other environments.</p>
Table of Contents (13 chapters)
Android Application Programming with OpenCV 3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding files to the project


For this chapter, we will modify our existing ImageDetectionFilter class. We will also add files for the following new classes and interfaces:

  • com.nummist.secondsight.ARCubeRenderer: This class represents the rendering logic for a colorful cube that sits in front of a tracked, real-world object. The class implements the GLSurfaceView.Renderer interface from the Android standard library. The projection matrix is determined by a CameraProjectionAdapter instance, and the cube's pose matrix is determined by an ARFilter instance, as described later.

  • com.nummist.secondsight.adapters.CameraProjectionAdapter: This class represents the relationship between a physical camera and a projection matrix. Other classes may fetch the projection matrix in either OpenCV or OpenGL format.

  • com.nummist.secondsight.filters.ar.ARFilter: This interface represents a filter that captures the position and rotation of a real-world object as an OpenGL matrix. We will modify ImageDetectionFilter...