Somebody remind me that I forgot to share the project of my demo using the Marilena project (OpenCV port).
So here is the source code, nothing fancy, nothing complicated, just a real basic use, but I guess it will help some of you who are interested.
This code is compiled with free tools as Flex SDK, Flash Develop , the optimized version of Marilena by Mario Klingemann and the AS3 Tweenlite class. If you never setup this kind of IDE before I highly recommend this tutorial which will help you with all the settings !
I’m not a programmer so this code is way too simple and not optimized at all, so feel free to re-use it as you want
Related Link :
- Glasses demo : http://www.francois-tarlier.com/blog/?p=256
- Playing with Marilena : http://www.francois-tarlier.com/blog/?p=242
- Article talking about Marilena : http://www.francois-tarlier.com/blog/?tag=marilena

















[...] Source code here : http://www.francois-tarlier.com/blog/?p=408 [...]
[...] Source code here : http://www.francois-tarlier.com/blog/?p=408 [...]
HI Dear,
I have try the coding but got a error:[1046: Type was not found or was not a compile-time constant: ObjectDetectorEvent.]
may I know what am I missing? thanks a lot
Clongleung
Hum, that’s weird.
Are you using Flex SDK to compile it ? did you download all the library and stuff ?
which line is the error ?
Hi admin,
I have tried to setup Flash developer and setup the Flex DSK already. but still have a error with:
C:\Users\admin\Desktop\face\gs\ObjectDetectorEvent.as:1: 5001: The name of package ‘jp.maaash.ObjectDetection’ does not reflect the location of this file. Please change the package definition’s name inside this file, or move the file. C:\Users\admin\Desktop\face\gs\ObjectDetectorEvent.as
May I know how can I fix this error, many thanks =D
Sorry, my last question problem and error is [1067: Implicit coercion of a value of type flash.display:BitmapData to an unrelated type flash.display:Bitmap.]
thanks a lot.
clongleung
sorry I didn’t answer you before, I was busy, could if you find the solution though
[...] – Marilena. W tym celu warto zapoznać się z kodem z dema Mario Klingemanna albo z kodem z dema Francois [...]
This code is not full, its just one of the packeges. Need the gs packeg to run it as well as the main file
I am more then curious to know how you did that?
yes as I said, you have to download the AS3 Tweenlite here : http://blog.greensock.com/tweenliteas3/
@Ilya : what do you want to know ? the code is pretty simple. I’m just using functions of the Marilena Lib. I start it from Mario Klingemann examples (see the link above)
hi,
i am writing the same project but not using flash (opencv + C)
i detect face & eyes and put a jpeg image in detected eye
i encountered some problems: first the detection works with very low performance detection stops when i move my head
the second problem is eye detection work only when i look directly to CAM.
your program works even i dont look directly to CAM
how can i solve these problems pls help
what are you using ? which cascade file are you using ?
haarcascade_mcs_eyepair_big.xml for eyes (takes both eyes in one rect)
and haarcascade_frontalface_alt_tree2.xml for face
are you always looking for eyes or only when you get the face ?
Isn’t there another cascade file for just one eyes ? the issue you encounter is that if it just miss one eyes, then it won’t show any at all. But this is not exactly how it works.
Do you know how the cascade file is working ? it’s pretty much like a tree with patches. each time it valids a patch it goes to the next one, and so on. so first it looks for a big patch and go smaller and smaller, but if it miss one step, you restart from beginning. Still not exactly how it works but give you the big picture. (there is a nice scheme explanation about haar feature here : http://www.emeraldinsight.com/Insight/ViewContentServlet?Filename=Published/EmeraldFullTextArticle/Articles/0490340109.html)
but if you are using openCV and C, I recommand you take a look at ASM (active shape modeling) & AAM (active Apparence Model) which is so much better. (the approach of faceapi by the way)
yes i wrote an if statement if the eyes rect coordinates are not in face rect coordinates it wont continue
i also used eye cascade for detecting the eyes seperately it didnt change
i will take a look at ASM and AAM right now
if its ok for you can i asked my futher questions with email it wiil be easier
sure, use the form to contact me the first time, I’ll respond to your mail then
http://www.francois-tarlier.com/blog/index.php/contact/
soory
i cant see the picture and i cant download anything to this computer