[Behavior] Face Detection

0 favourites
From the Asset Store
Detects any kind of ad blocker. Very easy implementation into already existing projects
  • Update v1.1 : now minification works properly !

    The plugin : https://dl.dropbox.com/u/1412774/FaceDetectDemo2/pode_facedetect.1.1.zip

    Here's a new behavior, allowing you to detect a face in the Sprite it's attached to. You can get the (X,Y) of the found face, its width and height, the confidence (only the first found face is reported).

    <img src="https://dl.dropbox.com/u/1412774/FaceDetectDemo/demo1.png" border="0">

    As you can see in the screenshot, there's also the possibility to retrieve a cropped version of the found face (you can give the margin you want to add around the original found face, since the bounding box can be a bit "tight"). The cropped image is given as a base64 string that you can load in a regular Sprite.

    <img src="https://dl.dropbox.com/u/1412774/FaceDetectDemo/demo2.png" border="0">

    The whole thing was made using the helpful jQuery FaceDetection plugin : http://facedetection.jaysalvat.com/

    The demo : https://dl.dropbox.com/u/1412774/FaceDetectDemo/index.html

    The plugin : https://dl.dropbox.com/u/1412774/FaceDetectDemo/pode_facedetect.1.0.zip

    The .capx : https://dl.dropbox.com/u/1412774/FaceDetectDemo/FaceDetectDemo.capx

    (The whole detection thing is using the Viola-Jones algorithm, implemented first in OpenCV, and reimplemented back in Javascript by liu liu in ccv.js : https://github.com/liuliu/ccv & http://liuliu.me/ccv/js/nss/. It's a fast algorithm - that's why it's viable in JS, relatively simple, but you can get some (few) false positives, and sometimes no detection, although you know there's a face in the image !)

    I'm planning to add several face detection in the same image in a future release.

  • Nice

    Whats next facial recognition?

  • newt : <img src="smileys/smiley2.gif" border="0" align="middle" />.

    Facial recognition isn't doable in Javascript, you need a native language to do that. It's based on various things, like Eigenfaces, and for that you need to capability to invert and resolve big matrices really fast (PCA, SVD and the like.).

  • Yeah, I figured that might be a bit much jscript atm.

    Well who knows, the way things are going, it shouldn't be too long till its doable.

  • newt : I really would like to have that, too !

    There's a bit of a solution with Actionscript, I think. Yesterday, Adobe released the version 2 of Alchemy, their compiler allowing to recompile C++ as Flash code, allowing the use of direct memory access and special opcode acceleration. With that, you can gain a huge boost, especially when crunching numbers (like what's needed for face identification).

    I used the first build of Alchemy inside the code used for my Mic plugin (to accelerate mp3 and ogg encoding). Without that, it would have been impossible to encode audio in a browser...

    Edit : by the way, I'm asking myself the question if I should do a post each time I create a new plugin inside the "Creation" section of C2, because I think that there is a lot of user "afraid" to go inside the "develope section".

  • I think you could make a topic in the "Your creation" forums as well, get more visibility for your plugins and behaviors, but please, keep posting them in that forum, it's easier for me to keep listing them.

  • Pode : u always did nice plugs but this one is really impressive...good job indeed ^^

  • This is incredibly cool!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Cool plugin but the demo is giving an error in Firefox.

    TypeError: jQuery("#" + b.id).kl is not a function

  • ramones : ah yes, I forgot that when minified, I can have that kind of surprise. For the moment, that means it's only working when non-minified. I'll supply a new build with that corrected.

  • Pode,

    How much time to finish the "working" for the faces, because when I try here, with FF, Chrome and Opera, it stays "working" and do not stop.

  • NRABrazil : what build of FF ?

    Are you using the test demo, or your images ?

  • FF 14.0.1

    <img src="https://dl.dropbox.com/u/18104402/pode.jpg" border="0" />

    I just enter in your Demo site and test it

  • NRABrazil : it's because of the same bug as the one pointed out by ramones. If you open the capx and test on a non-minified version, it works.

  • Excuse me pode I do not saw the ramones reply.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)