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
  • To initialize sdk on app start:
  • Update filters config like below.
  • Set CameraView
  1. Solutions
  2. MRZ
  3. iOS

Setup Accura MRZ

To initialize sdk on app start:

import AccuraMRZ

var accuraCameraWrapper: AccuraCameraWrapper? = nil
var arrCountryList = NSMutableArray()
accuraCameraWrapper = AccuraCameraWrapper.init()
	let sdkModel = accuraCameraWrapper.loadEngine(your PathForDirectories)
	if (sdkModel.i > 0) {
		if(sdkModel!.isMRZEnable) {
			self.arrCountryList.add("All MRZ")
			// ID MRZ
			// Visa MRZ
			// Passport MRZ
			// All MRZ
		}
		
	}

Update filters config like below.

Call this function after initialize sdk if license is valid(sdkModel.i > 0)

  • Set Blur Percentage to allow blur on document

// 0 for clean document and 100 for Blurry document
self.accuraCameraWrapper?.setBlurPercentage(60/*blurPercentage*/)
  • Set Blur Face Percentage to allow blur on detected Face

// 0 for clean face and 100 for Blurry face
accuraCameraWrapper?.setFaceBlurPercentage(80/*faceBlurPercentage*/)
  • Set Glare Percentage to detect Glare on document

// Set min and max percentage for glare
accuraCameraWrapper?.setGlarePercentage(6/*minPercentage*/, 98/*maxPercentage*/)
  • Set Photo Copy to allow photocopy document or not

// Set allow photocopy document or not
accuraCameraWrapper?.setCheckPhotoCopy(false/*isCheckPhotoCopy*/)
  • Set Hologram detection to verify the hologram on the face

// true to check hologram on face
accuraCameraWrapper?.setHologramDetection(true/*isDetectHologram*/)
  • Set Low Light Tolerance to allow lighting to detect documant

// 0 for full dark document and 100 for full bright document
accuraCameraWrapper?.setLowLightTolerance(10/*lowlighttolerance*/)
  • Set motion threshold to detect motion on camera document

// 1 - allows 1% motion on document and
// 100 - it can not detect motion and allow document to scan.
accuraCameraWrapper?.setMotionThreshold(25/*setMotionThreshold*/)
  • Sets camera Facing front or back camera

accuraCameraWrapper?.setCameraFacing(.CAMERA_FACING_BACK)
  • Flip camera

accuraCameraWrapper?.switchCamera()
  • Set Front/Back Side Scan

accuraCameraWrapper?.cardSide(.FRONT_CARD_SCAN)

Set CameraView

    import AccuraMRZ
    import AVFoundation
    
    var accuraCameraWrapper: AccuraCameraWrapper? = nil

  	override func viewDidLoad() {
    	super.viewDidLoad()
    	let status = AVCaptureDevice.authorizationStatus(for: .video)
    
    
    	if status == .authorized {
         	accuraCameraWrapper = AccuraCameraWrapper.init(delegate: self, andImageView: /*setImageView*/ _imageView, andLabelMsg: */setLable*/ lblOCRMsg, andurl: */your PathForDirectories*/ NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as String, cardId: /*setCardId*/ Int32(0!), countryID: /*setcountryid*/ Int32(0!), isScanOCR:/*Bool*/ false, andLabelMsgTop:/*Lable*/ _lblTitle, andcardName:/*string*/  docName, andcardType: Int32(cardType), andMRZDocType: /*SetMRZDocumentType*/ Int32(MRZDocType!/*0 = OtherMRZ, 1 = PassportMRZ, 2 = IDMRZ, 3 = VisaMRZ*/))
    	} 
    }
    
    override func viewDidAppear(_ animated: Bool) {
      super.viewDidAppear(animated)
          accuraCameraWrapper?.startCamera()
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        accuraCameraWrapper?.stopCamera()
        accuraCameraWrapper = nil
        super.viewWillDisappear(animated)
    }
    
    extension ViewController: VideoCameraWrapperDelegate{
    
   		//  it calls continues when scan cards
   		func processedImage(_ image: UIImage!) {
    		image:- get camara image.
    	}
    
    	// it call when license key wrong otherwise didnt get key
    	func recognizeFailed(_ message: String!) {
    		message:- message is a set alert message.
    	}
    
    	// it calls when get MRZ data
    	func recognizeSucceed(_ scanedInfo: NSMutableDictionary!, recType: RecType, bRecDone: Bool, bFaceReplace: Bool, bMrzFirst: Bool, photoImage: UIImage, docFrontImage: UIImage!, docbackImage: UIImage!) {
    		scanedInfo :- get MRZ data.
    		photoImage:- get a document face Image.
    		docFrontImage:- get document frontside image.
   		 	docbackImage:- get document backside image.
    	}
        
    // it calls when recieve error message
    func reco_msg(_ messageCode: String!) {
			var message = String()
        if messageCode == ACCURA_ERROR_CODE_MOTION {
            message = "Keep Document Steady";
        } else if(messageCode == ACCURA_ERROR_CODE_DOCUMENT_IN_FRAME) {
            message = "Keep document in frame";
        } else if(messageCode == ACCURA_ERROR_CODE_BRING_DOCUMENT_IN_FRAME) {
            message = "Bring card near to frame";
        } else if(messageCode == ACCURA_ERROR_CODE_PROCESSING) {
            message = "Processing...";
        } else if(messageCode == ACCURA_ERROR_CODE_BLUR_DOCUMENT) {
            message = "Blur detect in document";
        } else if(messageCode == ACCURA_ERROR_CODE_FACE_BLUR) {
            message = "Blur detected over face";
        } else if(messageCode == ACCURA_ERROR_CODE_GLARE_DOCUMENT) {
            message = "Glare detect in document";
        } else if(messageCode == ACCURA_ERROR_CODE_HOLOGRAM) {
            message = "Hologram Detected";
        } else if(messageCode == ACCURA_ERROR_CODE_DARK_DOCUMENT) {
            message = "Low lighting detected";
        } else if(messageCode == ACCURA_ERROR_CODE_PHOTO_COPY_DOCUMENT) {
            message = "Can not accept Photo Copy Document";
        } else if(messageCode == ACCURA_ERROR_CODE_FACE) {
            message = "Face not detected";
        } else if(messageCode == ACCURA_ERROR_CODE_MRZ) {
            message = "MRZ not detected";
        } else if(messageCode == ACCURA_ERROR_CODE_PASSPORT_MRZ) {
            message = "Passport MRZ not detected";
        } else if(messageCode == ACCURA_ERROR_CODE_ID_MRZ) {
            message = "ID MRZ not detected"
        } else if(messageCode == ACCURA_ERROR_CODE_VISA_MRZ) {
            message = "Visa MRZ not detected"
        }else {
            message = message;
        }
    		print(message)
 	}
PreviousSDK SetupNextFlutter

Last updated 2 months ago