Any face detection example

dr_casey's picture

Hello i am new to QC, has anybody shared a face detect composition. I am using haar detect but structure count is always 0 Can someone help me for the trick :)

thanks

dust's picture
Re: Any face detection example

here is a classic face recognition cascade. it should recognize your face and follow you. the trick is to run the haar detect through the optical flow.

PreviewAttachmentSize
haarkit.zip109.94 KB

dr_casey's picture
Re: Any face detection example

Thanks a lot,

Can i ask a few questions,

do i always have to use it with Optical Flow PYR, it kind of works with direct rectangle structure out, but i think it is getting smaller patterns rather than my whole face when i do it. And it is quite unconsistent.

Is this the standart haar XML which comes with OpenCV, are there other XMLs that i can use?

Frame rate goes terrible with my machine when video is 400-300 and larger. I know that Face detection forces the machine but i have seen some openFRMWRKS examples with better framerate and better consistency, in less powerfull machines than my laptop (15inch macbookpro 2.8ghz 4g ram)

thank you again, great community and sorry for my terrible english, i am not a native speaker :)

cwright's picture
Re: Any face detection example

You normally don't need to use optical flow -- however, there's a bug in the face detection patch that makes it usually not work (I've got it fixed on my local build, but I haven't done enough testing to make a release of it yet... no time :/ )

You can use any XML you'd like -- I've only tested with the included xmls though.

Framerates suck because of 2 things: 1) Reading QC Images is exceedingly slow (they normally love in VRAM, so transferring to system ram takes a lot of time) 2) OpenCV is a mess of cobbled-together college projects intended to work just enough to get a TA or professor to sign off on. They're not particularly well optimized, well-thought-out, or consistent. OpenFrameworks, on the other hand, is a different code-base with different design goals, directives, and developers.

dr_casey's picture
Re: Any face detection example

Thanks, your face detect comp here (this is you right :) ?) http://www.vimeo.com/5459458 works kind'a fine, possiblty to share or any advice on that?

and you use some maths formula for the iteration patch, are there any place where i can learn more on that book, forum, site etc.?

thnx.

cwright's picture
Re: Any face detection example

Yep, that's me (man, I need to lose some weight...) - it works because my build there fixed the bug that's in the current beta, and has some optimizations applied that the current beta does not. I usually spend some time cleaning up/optimizing patches I'll be using for demonstrations, and this was one such case.

Iteration is pretty simple -- I believe there are some good demos on this site/linked to from this site, but unfortunately you'll have to search a while for them :/ Perhaps some other posters can chime in with their resources?

dr_casey's picture
Re: Any face detection example

Thanks a lot More questions to come, be sure about it :)

dust's picture
Re: Any face detection example

yeah i forgot to mention the bug you can get structure right out of haar detect, which is the structure you want but its really jittery so i ran it through the optical flow to smooth out the structure.

dust's picture
Re: Any face detection example

i have a kit for building haar cascades or the xml files that you would need or want to expand this example. or well it works with all opencv stuff so processing opencv and stuff can read the same haar cascade. i have been meaning to get around and record my hand to do hand tracking. i have found i can play video games with head tracking though.

basically i use the bounding box to control a 3rd person game character with just my head. i've got forward, backward, left right, and jump mapped out right now. oh and not moving. you see the bounding box that denotes your face can infer a sudo z depth with very simple math. so basically i use some logic to figure out what direction the head is moving and then you can use it to control another head or person or in this case alien.

http://cordova.asap.um.maine.edu/~oconnord/gameFaceHD.mp4

dust's picture
Re: Any face detection example

i have the same computer you do, i like to use the processing opencv port alot because it is slimmed down but not as slim as openframworks. the good thing about open frameworks is that it is c++ and the native environment of opencv is c++ so there is less converting to do if you want to use opencv libraries with open frameworks.

dr_casey's picture
Re: Any face detection example

Thanks you, that will help a lot :)

dr_casey's picture
Re: Any face detection example

i mean 'thank you' :D