Maker Faire New York 2013 Electronics Stage: Face Detection in Ten Minutes with BeagleBone Black

Maker Faire New York 2013 Electronics Stage: Face Detection in Ten Minutes with BeagleBone Black

Hi, this is Wayne again with a topic “Maker Faire New York 2013 Electronics Stage: Face Detection in Ten Minutes with BeagleBone Black”.
So the beaglebone black is an open computing platform uh for makers uh. That’S that’s targeting bringing the web to the world so connecting up the physical world and um and interacting with things in your environment and using linux, to connect those things up to everything else that you, you experience um, so here we’re targeting everybody from like you know. First, learning how to to programs, like i just say, kindergarten to kickstarter right so, if you’re, just learning to program, um you’re, just starting to play around or if you’re ready to actually go and make something uh real make a real product. We try to get out of people’s ways, there’s no no barriers to go. Do that and we see a lot of people have success. I know there’s at least half a dozen projects i’ve seen around here today. I know there’s a couple over here in the corner: that’ll beaglebone, the open, rov ninja blocks lots of people using them, but basically it’s a one: gigahertz linux computer um with a lot of features with usbn out and a whole lot of physical interfaces. But the usb is the and the video out or the mains ones that i want to show you today, because you want to do some some vision um. So this is something that’s actually pretty darn easy to get started with all the tools that you need to start doing. The development actually ship with the board. So if you, if you buy a board and you and you plug it into your computer, you’ll, actually be able to to start developing in five minutes.

Maker Faire New York 2013 Electronics Stage: Face Detection in Ten Minutes with BeagleBone Black

If it’s a windows, linux or mac computer, all the drivers are included right there on the board so that you don’t have to go and and search the web to go, try to find those things and also all the things i’m showing you uh for for doing Development of the the facial recognition doing object russian recognition. If you want to do line following with the web camera or follow red balls – or you know, chase the cat around the house um, that’s something that the all that base software, all the libraries, the c compiler the make tools are all right there ready for you. So you can go and and follow all the demos and instructions that are out there um on the web. So the one i want to point out to you is the face detection algorithm. So this is all done with the opencv library, so that is an open source, computer vision, library, it’s a collection of hundreds of different algorithms that can be used to to take images and detect objects in them to manipulate them and to to to it’s a it’s.

Maker Faire New York 2013 Electronics Stage: Face Detection in Ten Minutes with BeagleBone Black

A c c plus library and there’s a huge set of examples that you can find up on this, this willow garage wiki, so one of them that i’ve just just pulled down is this: this face detection one and of course we can do c and c plus, Plus development, they also have python bindings um and of course, you can do all the development on your on your windows, pc your mac pc and then move it over to uh the beaglebone later um. So so i mentioned that all the tools that you need – um ship with it, but the first thing you kind of have to figure out from your computer. This is kind of that.

Maker Faire New York 2013 Electronics Stage: Face Detection in Ten Minutes with BeagleBone Black

First, big step is now. I want to actually log into my board and uh and start using that, so i’m going to just show you real simple: if you’ve got a mac, i haven’t installed anything i’m special here on the mac, but if i want to go and do that, i can Just show you some code here where i’m going to go and log into the board this this usb cable that i’m going to connect up to my board uh. That actually gets me a network connection. So it’s a it’s a this acts as a virtual network connection between the boards. I could do the same thing if this thing goes out on a wi-fi network and i wanted to have a robot drive around or if i just stuck this out on the ethernet. I get that connection and i use this tool called ssh.

You can get that for for windows. It comes with linux and mac already and now i’m actually logged in here on the board itself um. So i’ve got the this this one example um. So i downloaded first uh hello world, so the the hello world of opencv um is is this and if i run it, um well, first of all, um well, first i’ll come back and show you slides of how to build it um. But but it’s just as simple as going to the the willow garage wiki page and starting to download and look at all these examples. It’S the same way that you’d use a development in a desktop environment, but here you’re able to take it with you with you on the go.

One thing you do want to point out is: if you don’t have a a monitor connected up to your board, so you can just hook up a keyboard hook up a mouse hook up an lcd display. We do have hdmi output on here, so you can just use it like a desktop computer and work with that that exact same way but um. But if you, but if you want you could just do that – that that essay section you want to use this dash x.

So that allows me to use the display. That’S actually here on my mac, instead of using the one on the board, there’s also a little hint. If you want to start up a script that runs without you having a login.

Normally, a lot of these graphical applications expect you to be logged in on the board. So if you want to do it remotely here’s this one other little trick that you need to do with this this x authority – and i was – i was mentioning that you need to do the the the compilation. It’S really really simple, because we’ve got the package config tool, that’s going to go, find all the libraries for you. You don’t have to deal with a lot of complications there.

So let me show you some more code. Somebody actually compile that example. Now, switching screen seems to really slow it down um. So i need to tell it where the the libraries are.

I mean sorry the header files and then i just use the the package config tool, and then i tell it the name of the application that i want to build, which is helloworld.cxx. And i tell where to output that and again without installing anything extra. Except for this um, this one hello world example that i pulled off the web. Everything else here is what um just is just what ships with the board.

So that’s the only thing that i’ve had to go out and get, and that’s all being compiled here directly on the the beaglebone that i have um being run off of the the usb on my board. And now, if i run uh, if i run the hello world um, we can see that i’m actually getting the the output now on my own x, display um and for now. Now, if i want to go beyond just the the hello world – and i actually want to start doing some vision – things i’m going to go – have to go out and get a webcam so for for this one portable demo, all i did was go out and get A playstation 3i um, so this is about a 20 dollar webcam. You can get really chip cheap just about anywhere.

I’Ve also got hooked up here, a little bit more expensive one. This is a logitech c920, but because we’re just running linux – and we have a great usb stack – you can just connect up any webcam and it’s if it works with linux. It’S going to work with the board um and you can. You can go from there but uh, but i’m going to show you working from from these and if i’m going to go back here and run the uh um, so i’ve um, switching back and forth really really derails this all right. Let me finish the slides first and i’ll: go back to the demo at the end. How about that um so um, so i took the the face detection application! Well, all right! So in addition, if you want to try to make something, that’s not just something! That’S like uh you’re sitting here connected up to my computer, but actually want a display to go on the go with me. There are a bunch of lcd capes of different sizes. Three inch four inch, seven inch, um, there’s even 10 inch displays, or i connect up an actual hdmi monitor to this, and i can i can.

I can work from that. Let me just kind of give you a little better picture here, real quick, so this here is a three inch lcd monitor that i’ve connected up here to the the beaglebone, and this is just running off – of a standard uh, usb cell phone charger um. So you just need something: that’s got that that five volt usb out in order to power the board and then again i’ve got the that playstation 3i and now i’m able to actually take stuff on the go.

And what i’ve done here is i’ve taken the the standard face, detection algorithm off of the opencv website, and i did one little change to it, which is when i detect the face. I actually add a mustache to that and let me try to show you that working right now there we go there, you go so it’s a a portable, mustache, mustache cam um, and this was the this – is all that was really needed to do this um. So i needed to to take a a a a graphical image of what i wanted that that mustache to look like um, i set the region of interest uh on on the face. I’Ve detected the face where i want to apply that mustache to i scale the mustache image to fit that, and then i i apply that mustache right there in the region of interest and then, of course, i spent a whole lot of time. Doing some really heavy industrial design work um with a um, i didn’t have an exacto knife, so i used a pen um, so you can see here my um, my my fantastic uh construction quality here. So this is. This was literally um like about a three hour project um that i did um. I actually did half of this in a meeting at work, while other people are talking about other things, so i i do encourage you to to come up afterwards and take a look. Um at yourself in the in the mustache cam um, if you’re, if you’re, looking uh for more information, you want to get the the code with the changes applied um for the mustache.

You can go here to uh beagleboard.org project stash and then i’ll give you all the instructions that you need to kind of gather up and and build this yourself. It’S a it’s a really, really fun project, i’m not too involved. Like i said you don’t even have to uh, you don’t even have to go and get this lcd display. You can actually just kind of play with this, with just your your webcam and your computer as i’m gon na. Well, it believe me, this is easier to work with in the the the display up to the uh, the presentation here um, but you can actually use that that that x display back to your to your computer. So here, if i want to run um stash um on my um on my board, there we go so so here it’s actually the the all the um, the mustache um.

The algorithm is all running here on the beaglebone, but then i’m just remoting the display back onto my computer. So this makes it a really nice way for you to do really quick development before you go and try to spend a lot of time on your heavy industrial design work so um. I hope you appreciated that and please come up and take your pictures with uh. The with the mustache cam and we’ve got some some cards that you can take to go, find the url and more information about the boards they’re being sold in the maker shed.

And if you see, there’s there’s projects everywhere throughout the um. Throughout the the fair of people doing things with beaglebone um, please stop and ask them what their experiences were. We really really try to keep our community happy and um and i hope that you’ll join the community. Thank you very much. .