androidface-detectionopentoktokboxvideochat

Need to detect face during video call. Using OpenTok or TockBox video calling


I'm using opentok SDK for video calling in app. Need to detect if face is present in front during call. Please help me in this regard.

Opentok library used:

implementation 'com.opentok.android:opentok-android-sdk:2.13.0'

Solution

  • To detect faces you need to use a third party library. One approach could be using new MLKit library from Google: https://developers.google.com/vision/

    MLKit face detection will need to feed it with camera images, when using opentok, the best approach is to build you own video capturer. That video capturer will capture images from the camera and will also feed them to the library to detect faces.

    We wrote a blog post about this topic that also had a sample application. This app is for iOS and used MLKit, the approach is similar to what you would take for Android.