Skip to content

An example app with AVFoundation camera support and face features tracking

Notifications You must be signed in to change notification settings

pranavansp/FaceTracking

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FaceTracking

An example app with AVFoundation camera support and face features tracking written in Swift 3.0.

Below an example how it works.

Store image on Device

Calling below function will help you to store image on device.

func saveToCamera() {
   if let videoConnection = stillImageOutput.connection(withMediaType: AVMediaTypeVideo) {
        stillImageOutput.captureStillImageAsynchronously(from: videoConnection, completionHandler: { (CMSampleBuffer, Error) in
            if let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(CMSampleBuffer) {
                if let cameraImage = UIImage(data: imageData) {
                        UIImageWriteToSavedPhotosAlbum(cameraImage, nil, nil, nil)
                }
            }
        })
   }
}

If this code was helpful, I would love to hear from you. Twitter : @Pranavan

About

An example app with AVFoundation camera support and face features tracking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%