Creating a Face-recognising Security Cam With a Raspberry Pi Part 1


of 5

Please download to get full document.

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Through the Interface September 1 2, 201 2 Creating a face-recognising security cam with a Raspberry Pi – Part 1 This series of posts builds upon the mini-series on building a motion-detecting security cam based around the Raspberry Pi. Once y ou hav e y our motion detecting security cam up and running, y ou should be able to mov e on to the nex t stage: enabling that sy stem to recognize faces that it has been trained against. My specific project (which I’m calling the Facecam, although I hav
  Through the Interface September 12, 2012 Creating a face-recognising security cam with a Raspberry Pi – Part 1 This series of posts builds upon the mini-series on building a motion-detecting security cam based around theRaspberry Pi. Once you have your motion detecting security cam up and running, you should be able to moveon tothe next stage: enabling that system to recognize faces that it has been trained against.My specific project (which I’m calling the Facecam, although I haven’t applied for a trademark ;-) pulls datadow n from Facebook and uses that to train the face recognition system, but that’s far from being a requirement:it’s also very possible to train the database in other ways. We’llgo into detail on the various parts over the coming weeks (probably once a week, as I want to continue blogging about other topics, too), but let’s start by introducing the project and the system architecture.Here’s the elevator pitch: Facecam is a security camera that recognises a resident’s Facebook friends when they come to their front door and allows for tailored communication both to the resident and the visitor.This would basically mean that instead of the resident receiving a notification email saying “You have a visitor”(as inthe case of the motion-detection system we saw previously), the email would read “JohnSmith visited you”. And John could potentially receive a customized “we’re out” message while standing at the door and evena post on his Facebook wall thanking him for the visit. A lot of this is clearly contingent on the accuracy of the facial recognition system – something we’ll look at muchmore closely later on. In case the accuracy isn’t adequate, it would be nice at least to provide some feedback tothe visitor, saying “Welcome, John!” (even if it’s actually Megan at the door ;-).Right, now let’s dive into the system architecture. Here’s a quick diagram of the Facecam system:Here’s a look at the new components (in addition to the “Motion detection” box we saw previously): 1. A component to download information on the resident’s Facebook friends (.NET desktopapplication) This component will build a “friend” database (stored in a file named  facedata.xml  ) to be used at runtime by thesecurity cam. The database will be trained with the friends’ photos as downloaded from Facebook. So thecomponent will need to access – for each friend – both their names and the photos in which they have been  Creating a face-recognisingsecurity cam with aRaspberry ...Creating a motion-detecting securitycam with aRaspberry ...Creating a motion-detecting securitycam with aRaspberry ...Creating a face-recognisingsecurity cam with aRaspberry ... tagged (as well as the tag information, of course).Using the tag information, the component will use OpenCV to attempt to extract the friend’s face (by checkingthe list of detected faces against the tag location, to get the closest match), and – if it finds it – it will resize, cropand equalize the greyscale intensity of the image before saving it to disk for later use in the database trainingprocess.This is ultimately an offline, CPU-intensive operation – we will simply need the database transferred across tothe Raspberry Pi from time to time – so the approach we’ll take is to create a .NET desktop application thatperforms this task on a higher-powered device. 2. A component to analyse frames saved by the motion-detection system, checking for friends(face recognition) This is the guts of the system: the runtime component that will again use OpenCV to process images capturedfrom the webcam, detect faces and then check the results against the facial recognition database on theRaspberry Pi. This needs to be pretty efficient – as the feedback should be in close to real-time – which may be achallenge: given the relatively low power of the Raspberry Pi CPU, we’ll have to jump through some interestinghoops to get this working well enough. 3. A component to provide feedback to the visitor (LED messaging) If we’re going to tell the visitor that they have been recognised (or in some way warn unwanted visitors thattheir photo has been sent to the property’s residents), then we’re going to need some kind of screen. TheRaspberry Pi has both HDMI and component video outputs, but I’ve decided to go the way of a USB-poweredLED message-board. More on this in due course.Right, that’s it for this introductory post. We’ll look in more detail at each of these components over the coming weeks, starting with the .NET desktop application to download friend information.  You might also like: LinkWithin Posted at 07:45 AM in Raspberry Pi | Permalink  Comments Jeremy Tammik dijo...Hi Kean,Sounds neat and clear and interesting.  I really wonder what kind of data is going to go into the face data XML file. I would not put pixel data there, butstore that in external individual image files, and reference those.Some of my friends boycott internet-based social networking and thus hopefully cannot be identified by facebook, so I would enable private non-facebook photos from the local system to be used as well.Cheers, Jeremy.Responder September 12, 2012 at 09:11 AMKean Walmsley dijo en respuesta a Jeremy Tammik...Hi Jeremy, We'll of course talk about the XML format (although it's something this project has inherited), which uses analgorithm called Eigenfaces to greatly reduce the amount of data stored. And yes - I'm probably not even going to share the Facebook-specific code (for once), but will certainly explainmore about the file/folder structure you'd need to build to train the database in some other way.Cheers,KeanResponder September 12, 2012 at 09:15 AM AlexFielder dijo...Hi Kean,This looks really interesting! An API I'm not familiar with (but which I believe might prove useful here) is the Google Picasa Web API; As Isay, I only know there exists an API from Google which (in some way) ties in with the Picasa Web offering fromthe big G.In case you aren't aware, Picasa (the desktop application) offers you the ability to tag faces of the people it finds within your picture library, and will (with your permission) sync them to your Picasa Web Photos albums. I'vetagged all my family with it, so if it's possible to use this API instead of Facebook, that might be another avenuethat would likely get around the friends-not-tagged-on-Facebook issue that Jeremy mentions.Here is the best link I could find that will be of help:Retrieving face tag data from the Picasa Web API (which in turn links to this page: Google Groups Picasa issuespageCheers, Alex.Responder September 12, 2012 at 04:52 PMKean Walmsley dijo en respuesta a AlexFielder...Hi Alex,That's interesting... it should certainly be possible to swap out the Facebook-oriented piece to pull down data  from Picasa.I'll be describing the process I've used to isolate and extract faces to train the database next week.Cheers,KeanResponder September 12, 2012 at 04:56 PMPhilipp Wagner dijo...This will probably help you: September 12, 2012 at 10:39 PMPhilipp Wagner dijo en respuesta a Philipp Wagner...Especially the part on Face Recognition in Videos might be interesting to you:* September 12, 2012 at 10:45 PMKean Walmsley dijo en respuesta a Philipp Wagner...Thanks, Philipp - that's very helpful.I'm pretty much done with that side of things, but I'll certainly revisit the code once I've looked at the tutorialmore closely.KeanResponder September 12, 2012 at 10:58 PMHälytin dijo...That was an interesting thing,security camera purpose is really a lot specially on giving a security a shop andhome.In Finland country many of people are still having doubt on putting security cameras however most of thealready did.Anyway this is really excellent one.Responder November 07, 2012 at 10:27 AMPyryl dijo...Hi Kean, hope you are still following this thread. I'm wondering whether to start a face recognition project. My concept would be based on linkedin profile pics, thus only 1 reference pic per face.Based on your experience is recognizing a face with only one reference pic available from a photo by any chancepossible? Did you encounter in your experiment cases where the user had only one pic in fb?Responder March 25, 2013 at 03:22 PM
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks