For the complete documentation index, see llms.txt. This page is also available as Markdown.

Development Guide

This page contains the information of Usage, Configuration, Result of OkayDoc for Android and iOS

Usage

For Android, a valid license key is required to start the process.

Configuration

Build the configuration object with the following Config properties listed below:

Config

Possible Input Range

Default

path

String

null

faceThreshold

between 0.0 and 1.0

0.9

eyeThreshold

between 0.0 and 1.0

0.5

Config config = new Config.Builder()
                .setImagePath(imagePath)
                .setFaceThreshold(0.9f)
                .setEyeThreshold(0.5f)
                .build();

SDK Initialization

Start the process by calling startDetection on FaceDetectorSDK as shown below. You must also pass a valid license string and a config into it.

Result

Name

Description

getFaceImage

face image

isFaceDetected

returns true if face detected

isEye1Detected

returns true if first eye is detected

isEye2Detected

return true if second eye is detected

Error Code

errorCode is an int which can have the following values:

Error Code

Constant Name

Description

-1

FaceError.NO_ERROR

Face is successfully detected

1

FaceError.ERROR_INVALID_LICENSE_KEY

The license is invalid

2

FaceError.ERROR_PERMISSION_DENIED

The user did not grant the permission to access camera

3

FaceError.ERROR_USER_CANCEL_ACTION

The user canceled during the scanning process

4

FaceError.ERROR_TIME_OUT

10 seconds timer is triggered when face is detected

Usage

Start by adding the NSCameraUsageDescription to your info.plist.

import FaceDetector module into your swift file.

Configuration

Build the configuration object with the following Config properties listed below:

Config

Possible Input Range

Default

path

String

nil

faceThreshold

between 0.0 and 1.0

0.9

eyeThreshold

between 0.0 and 1.0

0.5

SDK Initialization

Start the process by calling startDetection on FaceDetectorSDK as shown below. You must also pass a valid license string and a reference to your view controller. self refers to the current view controller in this example below:

Result

Name

Description

faceImage

face image

faceDetected

returns true if face detected

eye1Detected

returns true if first eye is detected

eye2Detected

return true if second eye is detected

Error Handling

The error received in the completion handler is of the type FaceError:

Usage

Import plugin by using the code below:

Configurations

Property name
Description
Default value

license

license key

empty

base64

return base64 string as image ouput

false

path

image file path

nil

faceThreshold

face threshold

0.9

eyeThreshold

eye threshold

0.5

Code Implementation

Detect face with video processing

Detect face with image processing

Result

Result
Description

faceImage

face image output

isFaceDetected

return true if face is detected

isEye1Detected

return true if eye 1 is detected

isEye2Detected

return true if eye 2 is detected

Error Codes

Error
Description

invalid license

The license is invalid

camera permission denied

The user did not grant the permission to access camera

cancel

The user canceled during the scanning process

timeout

Timeout due to face not detected within preset timer

Last updated