High Accuracy OCR, Face Recognition & Liveness
  • Language
    • Overview
    • Android
      • Project Setup
      • Accura OCR
      • Accura Face Match
      • Accura Liveness
    • iOS
      • Project Setup
        • Check Pod Size
      • Accura OCR
        • Setup Accura License and Configurations
        • Set Camera View
      • Accura Face Match
      • Accura liveness
    • Flutter
      • Project Setup
      • Android Setup
        • Adding Permissions, Packaging options and Auth Token
        • Adding License
      • iOS Setup
        • Installing pods and Adding Permissions.
        • Adding License
      • Functions
        • Fetching Details From License
        • Setting Configurations, Error messages, Camera customization
        • OCR
        • MRZ
        • Barcode and Bankcard
        • Facematch and Liveness
    • Cordova
      • Project Setup
      • Android Setup
        • Packaging options and Auth Token
        • Adding License
      • iOS Setup
        • Installing pods
        • Adding License
      • Functions
        • Fetching Details From License
        • Setting Title & Error messages
        • OCR
        • MRZ
        • Barcode & Bankcard
        • Facematch & Liveness
    • React-Native
      • Project Setup
      • Android Setup
        • Adding Permissions, Packaging options and Auth Token
        • Adding License
      • iOS Setup
        • Adding Permissions.
        • Adding License
      • Functions
        • Fetching License Details
        • Setting Configurations, Error messages, Camera customization
        • OCR
        • MRZ
        • Barcode & Bankcard
        • Facematch & Liveness
    • Xamarin
      • Project Setup
      • Android Setup
        • Adding Permission & Packages
        • Adding License
      • iOS Setup
        • Adding Permissions
        • Adding License
      • Functions
        • Fetching License details
        • Setup custom messages
        • OCR
        • MRZ
        • Barcode & Bankcard
        • Facematch & Liveness
    • Docker
      • MRZ
      • FaceMatch
      • Face Liveness
      • ID Liveness
      • ID Forgery
    • Web API
      • Accura OCR
      • Accura Face Match
      • Accura Face Liveness
      • Accura ID Liveness
  • Solutions
    • MRZ
      • Android
        • SDK Setup
        • Setup Accura MRZ
      • iOS
        • SDK Setup
        • Setup Accura MRZ
      • Flutter
        • SDK Setup
        • Setup Accura MRZ
      • React Native
        • SDK Setup
        • Setup Accura MRZ
      • Cordova
        • SDK Setup
        • Setup Accura MRZ
    • OCR
      • Android
        • SDK Setup
        • Setup Accura OCR
      • iOS
        • SDK Setup
        • Setup Accura OCR
      • Flutter
        • SDK Setup
        • Setup Accura OCR
      • React Native
        • SDK Setup
        • Setup Accura OCR
      • Cordova
        • SDK Setup
        • Setup Accura OCR
    • Barcode with PDF417
      • Android
        • SDK Setup
        • Setup Accura Barcode with PDF417
      • iOS
        • SDK Setup
        • Setup Accura Barcode with PDF417
      • Flutter
        • SDK Setup
        • Setup Accura Barcode with PDF417
      • React Native
        • SDK Setup
        • Setup Accura Barcode with PDF417
      • Cordova
        • SDK Setup
        • Setup Accura Barcode with PDF417
    • Face Match
      • Android
        • Setup SDK
        • Setup Accura Face Match
      • iOS
        • Setup SDK
        • Setup Accura Face Match
      • Flutter
        • Setup SDK
        • Setup Accura Face Match
      • React Native
        • Setup SDK
        • Setup Accura Face Match
      • Cordova
        • Setup SDK
        • Setup Accura Face Match
    • Face Liveness (2D / Silent / Passive)
      • Android
        • SDK Setup
        • Setup Accura Face Liveness
      • iOS
        • SDK Setup
        • Setup Accura Face Liveness
      • Flutter
        • Setup SDK
        • Setup Accura Face Liveness
      • React Native
        • SDK Setup
        • Setup Accura Face Liveness
      • Cordova
        • Setup SDK
        • Setup Accura Face Liveness
    • Face Liveness (3D / Face Movement)
      • Android
        • SDK Setup
        • Setup Accura Face Liveness
      • iOS
        • SDK Setup
        • Setup Accura Face Liveness
      • Flutter
        • Setup SDK
        • Setup Accura Face Liveness
      • React Native
        • SDK Setup
        • Setup Accura Face Liveness
      • Cordova
        • Setup SDK
        • Setup Accura Face Liveness
    • Face Liveness with Voice Authentication
      • Android
        • SDK Setup
        • Setup Accura Face Liveness
      • iOS
        • SDK Setup
        • Setup Accura Face Liveness
      • Flutter
        • Setup SDK
        • Setup Accura Face Liveness
      • React Native
        • SDK Setup
        • Setup Accura Face Liveness
      • Cordova
        • Setup SDK
        • Set up Accura Face Liveness
    • ⁠Document Liveness and ID Forgery
      • Android
        • SDK Setup
        • Setup Accura OCR
      • iOS
        • SDK Setup
        • Setup Accura OCR
      • Flutter
        • SDK Setup
        • Setup Accura OCR
      • React Native
        • SDK Setup
        • Setup Accura OCR
      • Cordova
        • SDK Setup
        • Setup Accura OCR
    • NFC scanner
      • Android
        • SDK Setup
        • Setup Accura NFC
      • iOS
        • SDK Setup
        • Setup Accura NFC
      • Flutter
        • SDK Setup
        • Setup Accura NFC
      • React Native
        • SDK Setup
        • Setup Accura NFC
      • Cordova
        • SDK Setup
        • Setup Accura NFC
    • Voice Biometrics
      • Android
        • Setup Voice Verification
      • iOS
        • Setup Voice Verification
      • Flutter
        • Setup Voice Verification
      • React Native
        • Setup Voice Verification
      • Cordova
        • Setup Voice Verification
    • Finger Biometrics
      • Android
        • SDK Setup
        • Setup Accura Finger
      • iOS
        • SDK Setup
        • Setup Accura Finger
      • Flutter
        • SDK Setup
        • Setup Accura Finger
      • React Native
        • SDK Setup
        • Setup Accura Finger
      • Cordova
        • SDK Setup
        • Setup Accura Finger
    • MICR Cheque scanner
      • Android
        • SDK Setup
        • Setup Accura MICR
      • iOS
        • SDK Setup
        • Setup Accura MICR
      • Flutter
        • SDK Setup
        • Setup Accura MICR
      • React Native
        • SDK Setup
        • Setup Accura MICR
      • Cordova
        • SDK Setup
        • Setup Accura MICR
Powered by GitBook
On this page
  • Open auto capture camera
  • Detect face image
  • Implement face match code manually to your activity.
  • Optional: Dynamically Place License File
  • Additional Face Match Logic
  1. Solutions
  2. Face Match
  3. iOS

Setup Accura Face Match

Open auto capture camera

import the module name import AccuraLiveness_fm if you are using AccuraLiveness_FM pod

// To customize your screen theme and feed back messages
var facematch = Facematch()
facematch.setBackGroundColor("#C4C4C5")
facematch.setCloseIconColor("#000000")
facematch.setFeedbackBackGroundColor("#C4C4C5")
facematch.setFeedbackTextColor("#000000")
facematch.setFeedbackTextSize(Float(18.0))
facematch.setFeedBackframeMessage("Frame Your Face")
facematch.setFeedBackAwayMessage("Move Phone Away")
facematch.setFeedBackOpenEyesMessage("Keep Open Your Eyes")
facematch.setFeedBackCloserMessage("Move Phone Closer")
facematch.setFeedBackCenterMessage("Center Your Face")
facematch.setFeedbackMultipleFaceMessage("Multiple face detected")
facematch.setFeedBackFaceSteadymessage("Keep Your Head Straight")
facematch.setFeedBackLowLightMessage("Low light detected")
facematch.setFeedBackBlurFaceMessage("Blur detected over face")
facematch.setFeedBackGlareFaceMessage("Glare detected")

// 0 for clean face and 100 for Blurry face
facematch.setBlurPercentage(80) // set blure percentage -1 to remove this filter

// Set min and max percentage for glare
facematch.setGlarePercentage(6, 99) //set glaremin -1 and glaremax -1 to remove this filter

Detect face image

// it calls when Face image
func facematchData(_ FaceImage: UIImage!) {
	setFaceRegion(FaceImage)
}
// it calls when Facematch camera view dissappear
func facematchViewDisappear() {
}

Implement face match code manually to your activity.

Important Grant Camera and storage Permission.

//if you are using Accura kyc pod need to import module 'import AccuraOCR' and if you using FaceMatchSDK pod need to import module 'import FaceMatchSDK'
import AccuraOCR
override func viewDidLoad() {
	super.viewDidLoad()
	/*
	 * FaceMatch SDK method to check if engine is initiated or not
	 * Return: true or false
	 */
	let fmInit = EngineWrapper.isEngineInit()
	if !fmInit{
		/*
		 * FaceMatch SDK method initiate SDK engine
		 */
		EngineWrapper.faceEngineInit()
	}
}

Optional: Dynamically Place License File

If you prefer to place the license file dynamically, you can use the following method. This allows you to specify the license file path at runtime.

EngineWrapper.faceEngineInit("Face License Path")

Additional Face Match Logic

override func viewDidAppear(_ animated: Bool) {
	super.viewDidAppear(animated)
	/*
	 * Facematch SDK method to get SDK engine status after initialization
	 * Return: -20 = Face Match license key not found, -15 = Face Match license is invalid.
	 */
	let fmValue = EngineWrapper.getEngineInitValue() //get engineWrapper load status
	if fmValue == -20{
		// key not found
	}else if fmValue == -15{
		// License Invalid
	}
}

//make sure close FaceEngine when view disappear
override func viewDidDisappear(_ animated: Bool) {
    EngineWrapper.faceEngineClose()
}

/**
 * This method use calculate faceMatch score
 * Parameters to Pass: selected uiimage
 *
 */
func setFaceRegion(_ image: UIImage) {
	var faceRegion : NSFaceRegion?
	/*
	 * Accura Face SDK method to detect user face from document image
	 * Param: Document image
	 * Return: User Face
	 */
	faceRegion = EngineWrapper.detectSourceFaces(image)
	let face1 : NSFaceRegion? = faceView1.getFaceRegion(); // Get image data
	if (face1 == nil) {
		/*
		 * Accura Face SDK method to detect user face from document image
		 * Param: Document image
		 * Return: User Face
		 */
		faceRegion = EngineWrapper.detectSourceFaces(image);
	} else {
		/*
		 * Accura Face SDK method to detect user face from selfie or camera stream
		 * Params: User photo, user face found in document scanning
		 * Return: User face from user photo
		 */
		faceRegion = EngineWrapper.detectTargetFaces(image, feature1: face1?.feature);
	}
	if (selectFirstImage){
		if (faceRegion != nil){
			/*
			 * SDK method call to draw square face around
			 * @Params: BackImage, Front Image faceRegion Data
			 */
			faceView1.setFaceRegion(faceRegion)
		}
		let face2 : NSFaceRegion? = faceView2.getFaceRegion(); // Get image data
		if (face2 != nil) {
			let face1 : NSFaceRegion? = faceView1.getFaceRegion(); // Get image data
			var faceRegion2 : NSFaceRegion?
			if (face1 == nil){
				/*
				 * Accura Face SDK method to detect user face from document image
				 * Param: Document image
				 * Return: User Face
				 */
				faceRegion2 = EngineWrapper.detectSourceFaces(face2?.image)
			}else{
				/*
				 * Accura Face SDK method to detect user face from selfie or camera stream
				 * Params: User photo, user face found in document scanning
				 * Return: User face from user photo
				 */
				faceRegion2 = EngineWrapper.detectTargetFaces(face2?.image, feature1: face2?.feature)  //Identify face in back image which found in front
			}
			if(faceRegion2 != nil){
				/*
			     * SDK method call to draw square face around
				 * @Params: BackImage, Front Image faceRegion Data
				 */
				faceView2.setFaceRegion(faceRegion2)
				/*
				 * SDK method call to draw square face around
				 * @Params: BackImage, Front faceRegion Image
				 */
			}
		}
	} else if(faceRegion != nil){
	/*
	 * SDK method call to draw square face around
	 * @Params: BackImage, Front Image faceRegion Data
	 */
	faceView2.setFaceRegion(faceRegion)
	/*
	 * SDK method call to draw square face around
	 * @Params: BackImage, Front faceRegion Image
	 *
	}
	let face1:NSFaceRegion? = faceView1.getFaceRegion() // Get image data
	let face2:NSFaceRegion? = faceView2.getFaceRegion() // Get image data
	/*
	 * FaceMatch SDK method call to get FaceMatch Score
	 * @Params: FrontImage Face, BackImage Face
	 * @Return: Match Score
	 */
	let fmSore = EngineWrapper.identify(face1?.feature, featurebuff2: face2?.feature)
	let twoDecimalPlaces = String(format: "%.2f", fmSore*100) //Match score Convert Float Value
	print(Match Score :- "\(twoDecimalPlaces) %")
}

PreviousSetup SDKNextFlutter

Last updated 2 months ago