Click here to Skip to main content
14,266,113 members
Rate this:
Please Sign up or sign in to vote.
I am using "Native IOS API" and was able to detect the face feature of the user from "Front Angle" but will like to get detect user face features from "Side Angle". I am using "CIDETECTOR" at my end. I am using "CIDECTORTYPEFACE" at my end. Side angle for the image Please refer to the added image and will like to get the following detected at my end.
If the same can be achieved by "OpenCv" in "iOS", Please provide any links or set of code through which this can be achieved. Any help will be appreciated.



What I have tried:

I have used CIDETECTOR Native API

if let inputImage = UIImage(named: "taylor-swift") {
    let ciImage = CIImage(cgImage: inputImage.cgImage!)

    let options = [CIDetectorAccuracy: CIDetectorAccuracyHigh]
    let faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: options)!

    let faces = faceDetector.features(in: ciImage)

    if let face = faces.first as? CIFaceFeature {
        print("Found face at \(face.bounds)")

        if face.hasLeftEyePosition {
            print("Found left eye at \(face.leftEyePosition)")
        }

        if face.hasRightEyePosition {
            print("Found right eye at \(face.rightEyePosition)")
        }

        if face.hasMouthPosition {
            print("Found mouth at \(face.mouthPosition)")
        }
    }
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100