O'Reilly logo

Instant OpenCV for iOS by Kirill Kornyakov, Alexander Shishkov

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

Taking photos from camera (Intermediate)

In this recipe, we will learn how we can capture images the camera. We'll use the CvPhotoCamera class, which is a part of OpenCV, and apply our retro effect from the previous recipe.

Getting ready

For this recipe, you will need a real iOS device, because we're going to take photos. The source code can be found in the Recipe08_TakingPhotosFromCamera folder in the code bundle that accompanies this book.

How to do it...

The following are the steps required to apply our filter to a photo, taken with camera app:

  1. The ViewController interface should implement the protocol from CvPhotoCameraDelegate, and should have a member of the CvPhotoCamera* type.
  2. You will also need a couple of buttons, one to start capturing (stream ...

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