Facial Recognition, Part 2

After my first attempt at facial recognition didn't really get the job done, I decided to give a camera designed specifically for the Raspberry Pi a shot.  The major difference is that there is a dedicated high-bandwidth connection on the Raspberry Pi for this.  The webcam I had tried before connected by USB, which shares its resources with anything else using USB.

I ordered this one:

SainSmart 5MP Camera for Raspberry Pi

It's actually a camera designed to see infrared light (sometimes called a No IR camera because it has no IR filter), common amongst security cameras, as it can see better in low light.  The downside to such a camera is that colours look weird and faded.  Here's an example of the difference:


For my purpose, this doesn't matter, since the facial recognition software works in black and white. Plus there is the added bonus that this camera should work better in dim lighting, such was what you normally have indoors.  I could even add IR lamps to the mirror to help illuminate the image.

In any case, the fact that it is a camera without an IR filter is not why I picked this one.  I picked it because of where the camera is located in relation to the mounting holes.  Compare below, SainSmart on the left, standard Raspberry Pi camera on the right:

It means I can use / make a more attractive enclosure for the camera, as opposed to the awful options that exist for the standard configuration, like this:


That said, it appears there are exactly zero options currently available for the SainSmart camera. Looks like I'll need to fabricate something myself.

As for the performance, things got much better with this camera.  Faces are recognized reliably, and instead of taking about 30 seconds, it works in about 5.  That said, it's still not great... while 5 seconds is significantly faster than what I previously had, it's still pretty slow.  And you need to keep pretty still for it to work at all.   I'm wondering if at this point the camera is no longer the bottleneck, but instead it's Raspberry Pi's computing power.  I can make the camera poll more frequently, but it doesn't seem to improve the amount if time it takes to actually recognize someone and display their profile on the screen.

I came across this post of someone who used a different install for their mirror that doesn't require PIXEL desktop on the Raspberry Pi. Could be worth trying out to see if it frees up some horsepower and video memory for image processing.

Looks like there's going to be a part three to this story...

Comments

Popular Posts