# OkayLive

### Image Requirements

Originally, anti-spoofing methods have been developed on smartphone database, which consists of 720p and 1080p horizontally and vertically oriented selfies, taken without any additional post-compression. Photo capturing mode result in an increase of True Liveness Rate because it relies less on blur effects.

* Recommended image size:  600x800 to 960x1280. 🆕

* Recommended height: 800px or 1080px. 🆕

* Minimal supported height: 800px. 🆕

* No image compression is highly recommended: JPEG 70 level as low as practicable.

* Vertical Orientation

It’s recommended to use uncompressed formats. If it’s not possible, then it’s recommended to compress image with the highest quality. The difference between near compression levels is invisible to the naked eye but very significant for the anti-spoofing methods retina.

### Face Requirements

* Out-of-plane rotation angle: from -20±3 to 20±3 degrees.
* In-plane rotation angle: from -30±3 to 30±3 degrees.
* The minimal distance between the eyes of the subject: 80 px.
* The minimal face size is 224 pixels in any dimension.
* Sunglasses can be confusing.

### Capture Requirements

* Motion blur effect can significantly increase BPCER.
* Fish-eye lenses are not supported by this API.
* Texture filtering can significantly increase APCER.
* Spotlights on the faces and nearest surroundings can significantly increase BPCER.
* Ill-lighted environment and colored light can significantly increase BPCER.
* Rectangular-shaped objects in the background can significantly increase BPCER.

### Bad Sample

| Checking                | Error Code                                 | Sample Image                                                                                                                                                                                                                                                                                                |
| ----------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Selfie Occlusion Check  | FACE\_IS\_OCCLUDED                         | ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2FPA2zGd6YYx3gWBnKMzou%2FFACE_IS_OCCLUDED.jpg?alt=media\&token=b6e5c856-01a2-427b-924b-4fe1423c8cfc)                                                                              |
| Face Detection          | FACE\_NOT\_FOUND                           | ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2FoTmQ63sDfMQiAjdq9Mqn%2FFACE_NOT_FOUND.jpg?alt=media\&token=f548d30c-a96e-40eb-95f6-ef82957bb43c)                                                                                |
| Multiple Face Detection | TOO\_MANY\_FACES                           | ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2Fq73s88ITWTXsFPrwziU9%2FTOO_MANY_FACES.jpg?alt=media\&token=d6bf4763-83ec-4217-ae7a-952a456ec54e)                                                                                |
| Face Distance Check     | <p>FACE\_ANGLE\_TOO\_LARGE<br><br><br></p> | ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2Fs3C1qMIeo6mbm7xpSoQO%2FFACE_ANGLE_TOO_LARGE.jpg?alt=media\&token=de641754-4fa8-4c24-998c-9c4371373d7b)                                                                          |
| Face Distance Check     | FACE\_TOO\_SMALL                           | ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2F42gh4SiOxVQJYhFX5JKV%2FFACE_TOO_SMALL.jpg?alt=media\&token=5f0f00cf-e162-4b01-a549-d13612e7d49e)                                                                                |
| Eye Closed Detection    | EYES\_CLOSED                               | ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2FIeaUfrSuxp42RjSEKxZp%2FEYES_CLOSED.jpg?alt=media\&token=5eeda885-47ba-406d-9178-b9ec3bfee94e)                                                                                   |
| Face Distance Check     | FACE\_CLOSE\_TO\_BORDER                    | <p></p><p><img src="https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2F9g9roVcymYnGNjmU9Ay4%2FFACE_CLOSE_TO_BORDER.jpg?alt=media&#x26;token=eb3b48a9-e194-4dc1-a751-c60824180db5" alt="FACE_CLOSE_TO_BORDER" data-size="original"></p> |

### Good Sample

|                                                                                                         Selfie Image                                                                                                        |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://4019998022-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRYsITG7N76MNv67B20iW%2Fuploads%2F1WB097qfVFojlAIGEkFA%2Fselfie-Edited.JPG?alt=media\&token=0221408e-cfc1-430a-8c1a-daa570b2ce9c) |

### Capture module

Capturing images and pictures correctly with the mobile device camera is an important element of the anti-spoofing detection routine.

#### Mobile Web

There are two general approaches in Web API to capture a single frame:

<table data-header-hidden><thead><tr><th width="200">Source</th><th width="183">Pros</th><th>Cons</th><th>Compatibility</th><th>Sample Code</th></tr></thead><tbody><tr><td><strong>Source</strong></td><td>Pros</td><td>Cons</td><td>Compatibility</td><td>Sample Code</td></tr><tr><td>File API</td><td>Available from any browser</td><td>Camera mode control not guaranteed</td><td>Low</td><td>-</td></tr><tr><td>getUserMedia</td><td>Camera mode control</td><td>The list of supported browsers is limited</td><td>High</td><td><a href="https://github.com/IDRnD/Capture-Samples">github</a></td></tr></tbody></table>
