I wonder if we can use the front camera to analyze facial expression (at least detect landmark points) and record video (of the face) at the same time with Affdex SDK for Android?
Asked
Active
Viewed 154 times
2
-
1The complexity here really has nothing to do with the Affdex SDK itself; it has to do with creating a video from the camera preview frames. There is some potentially useful sample code at https://github.com/google/grafika, but it's fairly complicated and rough around the edges. – Andy Dennie Jan 01 '17 at 21:46
-
Thanks @AndyDennie, the provided github code is quite complicated for an application level as I am doing. I guess my current problem is the front camera and a correspondent surface view has been controlled by Affdex SDK. Using normal method such as MediaRecorder still requires control over the camera and a (possibly another) surface view. This seems to be impossible. – user3720656 Jan 02 '17 at 03:17
-
I wonder if there are any straightforward approaches integrating video recording into existing Affdex's infrastructure. What I need now is simply displaying landmarks point (using a custom Drawing Canvas as the sample Affdex Android app) and recording the front camera preview simultanuously – user3720656 Jan 02 '17 at 03:21
-
Thanks @AndyDennie, I am able to do the task by combining the "Show + capture camera" code from grafika to redirect the GLSurfaceView to both video encoder and extracting a Bitmap. Then apply Affdex's PhotoDetector for facial analysis. – user3720656 Jan 06 '17 at 15:09
-
2glad it worked for you. I'd recommend using the Affdex FrameDetector rather than PhotoDetector, though. The FrameDetector should give you better performance, as it is optimized for video frames, while PhotoDetector is designed for independent, unrelated images. – Andy Dennie Jan 06 '17 at 18:49
-
that's great, @AndyDennie, I change to use the Frame.BitmapFrame and can process the image in-memory, which is better for my case. Thanks a lot – user3720656 Jan 06 '17 at 21:02