3

I am working on a face recognition app where the picture is taken and sent to server for recognition.

I have to add a validation that user should capture picture of real person and of another picture. I have tried a feature of eye blink and in which the camera waits for eye blink and captures as soon as eye is blinked, but that is not working out because it detects as eye blink if mobile is shaken during capture.

Would like to ask for help here, is there any way that we can detect if user is capturing picture of another picture. Any ideas would help.

I am using react native to build both Android and iOS apps.

Thanks in advance.

Saraz
  • 524
  • 7
  • 16
  • That's an interesting question. I'm no expert but at glance it seems that you can apply edge detection, and if all the edges moved at once it means that the device was shaken, and if only part of them moved, it means that something has moved in front of the device. So you need to wait for a movement of some of the edges but not all of them. – Arik Segal Nov 27 '19 at 08:17
  • you basically can't detect it (you can probably, but it worth way too much effort that makes it not worth trying). Think about other options, like use 2 recognitions - 1 face view, the other side view. – Vladyslav Matviienko Nov 27 '19 at 08:39
  • @ArikSegal: yeah seems like an option, let me try if I can implement it. – Saraz Nov 27 '19 at 08:51
  • @VladyslavMatviienko: you are right, need to look for some other ways. 2 recognitions cannot try because it will slow down the process you know. Each time two images to upload. – Saraz Nov 27 '19 at 08:52
  • very interesting question @Saraz – abhikumar22 Nov 27 '19 at 09:04
  • 1
    FYI: even google warns with face recognition that it can be bypassed with your photo. So I'd assume there is no way to overcome that, which worth trying. – Vladyslav Matviienko Nov 27 '19 at 09:07
  • I guess there is only a hard to achieve that. You can't rely on detecting pictures' edges, since I can have a picture that is big enough for your camera to cover all of it. Your problem is not only face recognition, but also movement detection. After all these requirements, I suggest that you should research on OpenCV to solve this. – Minh Dao Nov 27 '19 at 09:07

2 Answers2

1

Thanks for support.

I resolve it by the eye blink trick after all. Here is a little algorithm I used:

Open camera, click capture button:

Camera detects if any face is in the view and waits for eye blink. If eye blink probability is 90% for both the eyes, wait 200 milliseconds. Detect face again with eye open probability > 90% to verify if the face is still there, and capture the picture at the end.

That's a cheap trick but working out so far.

Regards

Saraz
  • 524
  • 7
  • 16
0

On some iPhones (iOS 11.1 upwards), there's a so-called trueDepthCamera that's used for Face ID. With it (or the back facing dual camea system) you can capture images along with depth maps. You could exploit that feature to see if the face is flat (captured from an image) or has normal facial contours. See here...

One would have to come up with a 3d face model to fool that.

It's limited to only a few iPhone models though and I don't know about Android.

Lutz
  • 1,734
  • 9
  • 18