/opencv-ios-demos

OpenCV iOS demo applications developed during Google Summer of Code 2012

Primary LanguageObjective-C++GNU Lesser General Public License v3.0LGPL-3.0

Overview


This repository contains iOS demo applications developed during Google Summer of Code 2012 with opencv.org. Note, the demos require the opencv ios framework. See "Getting Started" section.

  • HelloIosVideo: Beginners tutorial on using opencv's ios camera interface. Screenshot-Intro

  • FullscaleDemoApp: Meta project containing all other demos.

  • FaceDetectVideo: Face detection on still images and iphone video camera. Screenshot-Facedetect

  • FindHomography: Planar object recognition on video input. Screenshot-Homography1 Screenshot-Homography2

  • GrabCut: Grabcut segmentation algorithm. Paint foreground/background seeds with touch gestures. Screenshot-Grabcut

  • VideoConvolution: Process video frames with basic convolution kernels: Gaussian blur, median blur, bilateral blur, laplacian, sobel, canny. Screenshot-Convolution1 Screenshot-Convolution2

  • VideoFilter: Advanced video filters: pixelation, color inversion, retro filter, soft focus, cartoon, pinhole. Screenshot-Video-Pixelation

Getting Started


  1. You need opencv.framework (statically compiled opencv framework for iOS).

Note, the XCode projects are configured to look for opencv2.framework at /build/opencv2.framework.

  1. Include opencv.framework in your Xcode project.

  2. OpenCV provides a wrapper to use Apple's native camera interface to obtain image/video frames. Each frame is converted automatically to cv::Mat and delivered to a C callback via delegation. Learn more.

  3. Continue writing your first video processing project.

  4. Once you have understood how to obtain a cv::Mat in your iOS project, feel free to re-use the modular demo controllers in shared and please feel free to contribute.

  5. Advanced: Dig deep into how OpenCV obtains image/video frames from the native interface, wraps them into C datastructures, calls the C callback to let you process each frame (hence .mm files), and then updates the output target:

opencv/modules/videoio/include/opencv2/videoio/cap_ios.h opencv/modules/videoio/src/cap_ios_abstract_camera.mm opencv/modules/videoio/src/cap_ios_photo_camera.mm opencv/modules/videoio/src/cap_ios_video_camera.mm

  1. Contribute to the iOS project, for example by adding to the very sparse documentation.

TODOs


  • Note, the XCode projects are currently outdated. Last time they have been updated in 2012.
  • The XCode projects compile, but the XIB files/storyboards are not up to date with current layout guides.