From fc2f3a7539e4064d30f59084f3e55880cf17bbed Mon Sep 17 00:00:00 2001 From: Sergey Maltsev Date: Mon, 14 Mar 2022 13:10:37 -0700 Subject: [PATCH] added v11.5.2 --- README.md | 24 +++++++++---------- acuantcamera/build.gradle | 10 ++++---- .../camera/AcuantBaseCameraFragment.kt | 5 ---- acuantfacecapture/build.gradle | 12 ++++------ .../camera/AcuantBaseFaceCameraFragment.kt | 10 +++----- .../facecapture/AcuantFaceCaptureFragment.kt | 2 +- .../detector/FaceFrameAnalyzer.kt | 2 +- app/build.gradle | 18 +++++++------- 8 files changed, 35 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 997a453..a4341aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Acuant Android SDK v11.5.1 -**February 2022** +# Acuant Android SDK v11.5.2 +**March 2022** See [https://github.com/Acuant/AndroidSDKV11/releases](https://github.com/Acuant/AndroidSDKV11/releases) for release notes. @@ -112,19 +112,19 @@ The SDK includes the following modules: maven { url 'https://maven.google.com' } maven { url 'https://raw.githubusercontent.com/Acuant/AndroidSdkMaven/main/maven/' } - maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' } + maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' } - Add the following dependencies - implementation 'com.acuant:acuantcommon:11.5.1' - implementation 'com.acuant:acuantcamera:11.5.1' - implementation 'com.acuant:acuantimagepreparation:11.5.1' - implementation 'com.acuant:acuantdocumentprocessing:11.5.1' - implementation 'com.acuant:acuantechipreader:11.5.1' - implementation 'com.acuant:acuantipliveness:11.5.1' - implementation 'com.acuant:acuantfacematch:11.5.1' - implementation 'com.acuant:acuantfacecapture:11.5.1' - implementation 'com.acuant:acuantpassiveliveness:11.5.1' + implementation 'com.acuant:acuantcommon:11.5.2' + implementation 'com.acuant:acuantcamera:11.5.2' + implementation 'com.acuant:acuantimagepreparation:11.5.2' + implementation 'com.acuant:acuantdocumentprocessing:11.5.2' + implementation 'com.acuant:acuantechipreader:11.5.2' + implementation 'com.acuant:acuantipliveness:11.5.2' + implementation 'com.acuant:acuantfacematch:11.5.2' + implementation 'com.acuant:acuantfacecapture:11.5.2' + implementation 'com.acuant:acuantpassiveliveness:11.5.2' 1. Create an xml file with the following tags (If you plan to use bearer tokens to initialize, then username and password can be left blank): diff --git a/acuantcamera/build.gradle b/acuantcamera/build.gradle index bcc1ec9..85ce8ca 100644 --- a/acuantcamera/build.gradle +++ b/acuantcamera/build.gradle @@ -38,13 +38,11 @@ dependencies { // App compat and UI things implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - //noinspection GradleDependency - implementation 'androidx.window:window:1.0.0-alpha09' //newer versions changed the api, not updating yet // CameraX library - def camerax_version = '1.1.0-beta01' + def camerax_version = '1.1.0-beta02' implementation "androidx.camera:camera-core:$camerax_version" implementation "androidx.camera:camera-camera2:$camerax_version" implementation "androidx.camera:camera-lifecycle:$camerax_version" @@ -54,6 +52,6 @@ dependencies { implementation 'androidx.exifinterface:exifinterface:1.3.3' implementation 'com.google.mlkit:barcode-scanning:17.0.2' implementation 'com.rmtheis:tess-two:9.1.0' - implementation 'com.acuant:acuantcommon:11.5.1' - implementation 'com.acuant:acuantimagepreparation:11.5.1' + implementation 'com.acuant:acuantcommon:11.5.2' + implementation 'com.acuant:acuantimagepreparation:11.5.2' } diff --git a/acuantcamera/src/main/java/com/acuant/acuantcamera/camera/AcuantBaseCameraFragment.kt b/acuantcamera/src/main/java/com/acuant/acuantcamera/camera/AcuantBaseCameraFragment.kt index 8e8e296..a6d91a6 100644 --- a/acuantcamera/src/main/java/com/acuant/acuantcamera/camera/AcuantBaseCameraFragment.kt +++ b/acuantcamera/src/main/java/com/acuant/acuantcamera/camera/AcuantBaseCameraFragment.kt @@ -16,7 +16,6 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.exifinterface.media.ExifInterface import androidx.fragment.app.Fragment -import androidx.window.WindowManager import com.acuant.acuantcamera.R import com.acuant.acuantcamera.databinding.FragmentCameraBinding import com.acuant.acuantcamera.interfaces.IAcuantSavedImage @@ -42,7 +41,6 @@ abstract class AcuantBaseCameraFragment: Fragment() { private var orientationEventListener: OrientationEventListener? = null private var preview: Preview? = null private var failedToFocus: Boolean = false - private lateinit var windowManager: WindowManager protected var imageCapture: ImageCapture? = null protected var capturing: Boolean = false protected var fragmentCameraBinding: FragmentCameraBinding? = null @@ -140,9 +138,6 @@ abstract class AcuantBaseCameraFragment: Fragment() { // Initialize our background executor cameraExecutor = Executors.newSingleThreadExecutor() - //Initialize WindowManager to retrieve display metrics - windowManager = WindowManager(view.context) - // Wait for the views to be properly laid out fragmentCameraBinding?.viewFinder?.post { val binding = fragmentCameraBinding diff --git a/acuantfacecapture/build.gradle b/acuantfacecapture/build.gradle index 17acc7a..8c6282b 100644 --- a/acuantfacecapture/build.gradle +++ b/acuantfacecapture/build.gradle @@ -34,22 +34,20 @@ dependencies { // App compat and UI things implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - //noinspection GradleDependency - implementation 'androidx.window:window:1.0.0-alpha09' //newer versions changed the api, not updating yet // CameraX library - def camerax_version = '1.1.0-beta01' + def camerax_version = '1.1.0-beta02' implementation "androidx.camera:camera-core:$camerax_version" implementation "androidx.camera:camera-camera2:$camerax_version" implementation "androidx.camera:camera-lifecycle:$camerax_version" implementation "androidx.camera:camera-view:$camerax_version" //acuant specific stuff - implementation 'com.google.mlkit:face-detection:16.1.4' - implementation 'com.acuant:acuantcommon:11.5.1' - implementation 'com.acuant:acuantimagepreparation:11.5.1' + implementation 'com.google.mlkit:face-detection:16.1.5' + implementation 'com.acuant:acuantcommon:11.5.2' + implementation 'com.acuant:acuantimagepreparation:11.5.2' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' diff --git a/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/AcuantBaseFaceCameraFragment.kt b/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/AcuantBaseFaceCameraFragment.kt index a53ff2a..bcb279e 100644 --- a/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/AcuantBaseFaceCameraFragment.kt +++ b/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/AcuantBaseFaceCameraFragment.kt @@ -15,7 +15,6 @@ import androidx.camera.core.impl.utils.Exif import androidx.camera.lifecycle.ProcessCameraProvider import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment -import androidx.window.WindowManager import com.acuant.acuantcommon.model.AcuantError import com.acuant.acuantcommon.model.ErrorCodes import com.acuant.acuantcommon.model.ErrorDescriptions @@ -43,7 +42,6 @@ abstract class AcuantBaseFaceCameraFragment: Fragment() { private var camera: Camera? = null private var cameraProvider: ProcessCameraProvider? = null private var preview: Preview? = null - private lateinit var windowManager: WindowManager protected var capturing: Boolean = false protected var fragmentCameraBinding: FragmentFaceCameraBinding? = null protected var imageAnalyzer: ImageAnalysis? = null //set up by implementations @@ -108,9 +106,6 @@ abstract class AcuantBaseFaceCameraFragment: Fragment() { // Initialize our background executor cameraExecutor = Executors.newSingleThreadExecutor() - //Initialize WindowManager to retrieve display metrics - windowManager = WindowManager(view.context) - // Wait for the views to be properly laid out fragmentCameraBinding?.viewFinder?.post { val binding = fragmentCameraBinding @@ -171,9 +166,10 @@ abstract class AcuantBaseFaceCameraFragment: Fragment() { /** Declare and bind preview, capture and analysis use cases */ private fun bindCameraUseCases() { - val metrics = windowManager.getCurrentWindowMetrics().bounds + val width: Int = requireContext().resources.displayMetrics.widthPixels + val height: Int = requireContext().resources.displayMetrics.heightPixels - val screenAspectRatio = aspectRatio(metrics.width(), metrics.height()) + val screenAspectRatio = aspectRatio(width, height) val rotation = fragmentCameraBinding!!.viewFinder.display.rotation diff --git a/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/facecapture/AcuantFaceCaptureFragment.kt b/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/facecapture/AcuantFaceCaptureFragment.kt index 01e8972..8c296f7 100644 --- a/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/facecapture/AcuantFaceCaptureFragment.kt +++ b/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/camera/facecapture/AcuantFaceCaptureFragment.kt @@ -204,7 +204,7 @@ class AcuantFaceCaptureFragment: AcuantBaseFaceCameraFragment() { } companion object { - private const val MOVEMENT_THRESHOLD = 15 + private const val MOVEMENT_THRESHOLD = 22 private fun didFaceMove(facePosition: Rect?, lastFacePosition: Rect?): Boolean { if (facePosition == null || lastFacePosition == null) diff --git a/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/detector/FaceFrameAnalyzer.kt b/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/detector/FaceFrameAnalyzer.kt index 86b2740..4287466 100644 --- a/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/detector/FaceFrameAnalyzer.kt +++ b/acuantfacecapture/src/main/java/com/acuant/acuantfacecapture/detector/FaceFrameAnalyzer.kt @@ -95,7 +95,7 @@ class FaceFrameAnalyzer internal constructor(private val listener: FaceFrameList .build()) private const val TOO_CLOSE_THRESH = 0.815f - private const val TOO_FAR_THRESH = 0.685f + private const val TOO_FAR_THRESH = 0.635f private const val EYE_CLOSED_THRESHOLD = 0.3f private const val Y_ROT_ANGLE = 10 private const val Z_ROT_ANGLE = 15 diff --git a/app/build.gradle b/app/build.gradle index 12e8889..7ef9e17 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,17 +19,17 @@ dependencies { //If you do not plan to modify the camera code you can use these two regular maven dependencies // in place of the project ones. -// implementation 'com.acuant:acuantfacecapture:11.5.1' -// implementation 'com.acuant:acuantcamera:11.5.1' +// implementation 'com.acuant:acuantfacecapture:11.5.2' +// implementation 'com.acuant:acuantcamera:11.5.2' implementation project(path: ':acuantcamera') implementation project(path: ':acuantfacecapture') - implementation 'com.acuant:acuantcommon:11.5.1' - implementation 'com.acuant:acuantimagepreparation:11.5.1' - implementation 'com.acuant:acuantdocumentprocessing:11.5.1' - implementation 'com.acuant:acuantechipreader:11.5.1' - implementation 'com.acuant:acuantfacematch:11.5.1' - implementation 'com.acuant:acuantipliveness:11.5.1' - implementation 'com.acuant:acuantpassiveliveness:11.5.1' + implementation 'com.acuant:acuantcommon:11.5.2' + implementation 'com.acuant:acuantimagepreparation:11.5.2' + implementation 'com.acuant:acuantdocumentprocessing:11.5.2' + implementation 'com.acuant:acuantechipreader:11.5.2' + implementation 'com.acuant:acuantfacematch:11.5.2' + implementation 'com.acuant:acuantipliveness:11.5.2' + implementation 'com.acuant:acuantpassiveliveness:11.5.2' } android { compileSdkVersion 31