O'Reilly logo

Android Application Programming with OpenCV by Joseph Howse

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Previewing and saving photos in CameraActivity

Our main activity, CameraActivity, needs to do the following:

  • On startup, use OpenCV Manager to ensure that the appropriate OpenCV shared libraries are available. (For more information about OpenCV Manager, refer back to the Building the OpenCV samples with Eclipse section in Chapter 1, Setting Up OpenCV.)
  • Display a live camera feed.
  • Provide the following menu actions:
    • Switch the active camera (for a device that has multiple cameras).
    • Save a photo and insert it into MediaStore so that it is accessible to apps such as Gallery. Immediately open the photo in LabActivity.

We will use OpenCV functionality wherever feasible, even though we could just use the standard Android libraries to display a live camera ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required