Skip to content

Instantly share code, notes, and snippets.

@SubhiH
Created March 4, 2018 15:54
Show Gist options
  • Select an option

  • Save SubhiH/50d6edea4a8dcde44e18b12f3a5a8b5c to your computer and use it in GitHub Desktop.

Select an option

Save SubhiH/50d6edea4a8dcde44e18b12f3a5a8b5c to your computer and use it in GitHub Desktop.
Face detection
import UIKit
class ViewController: UIViewController, FrameExtractorDelegate {
@IBOutlet var imageview: UIImageView!
var frameExtractor: FrameExtractor!
func captured(image: UIImage) {
imageview.image = OpencvWrapper.detect(image);
}
override func viewDidLoad() {
super.viewDidLoad()
frameExtractor = FrameExtractor()
frameExtractor.delegate = self
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func flip_camera(_ sender: UIButton) {
frameExtractor.flipCamera()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment