Zdjęcia bez atrybutu ALT

Ranking:

Alexa Traffic

Majestic SEO

Text on page:

marijn speelman face detection using flash and c++, revisited march 6th, 2008 over the past few months i’ve been asked several times for the code for face detection in flash. so i’ve taken some time to make a short demo application, grabbed from my original virtual mirror game (see my two previous blogs). here’s what it does: flash grabs the webcam image every 60ms, and sends it using a socket connection to a separate c++ server that runs on your localhost. the server uses the opencv software library to detect faces, using a haar classifier cascade. when it detects one or more faces it sends the result (coordinates) back to flash. there, flash draws a transparent box or image at the coordinates of the face, like this: what makes this cool is that you can perform quite complex image analysis (at least something you can’t easily do in flash), and use this data on a platform that is highly suitable for multimedia development (animation, sound, nice graphics, etc). the demo only handles one face now, but this could be easily expanded. download: binary (1,18 mb) source (904 kb) at the moment there are no installation instructions included. if you need help you can contact me, or wait untill i create the instructions (which i will) :) a few quick pointers to get you past some obstacles: binary: you probably have to add the folder you run the .swf from as trusted directory in your flash settings. otherwise you get a security / sandbox violation error. binary: start the server before starting the .swf (client). the .swf tries to connect to the server when it starts. binary: the needed opencv dll’s and .xml file for face detection are included in the same folder. source: (server) if i remember correctly, only pthread is a required dependency. upx is a file packer for releasing, visual leak detector can be turned off if you don’t want to use it. source: (server) additional dependencies you should include when compiling/linking: wsock32.lib cv.lib cxcore.lib highgui.lib last note: this was both my first as3 and c++ project, i’m always open to suggestions, improvements and cool new ideas. also, when you find this code useful, i would appreciate it if you’d drop me a line. posted in actionscript 3.0 | 122 comments » as3 font anti-aliasing in air and browser august 3rd, 2007 first of all, i’m a noob on fonts in as3. just posting some differences between air (adobe integrated runtime) and the browser i noticed while developing. font anti-aliasing is done automatically in the browser when you don’t add any effects to it like a glowfilter. when running air the font is not anti-aliased: verdana, not embedded, browser verdana, not embedded, air if you want to do effects like alpha and rotation on fonts, you have to embed them into your swf. this also results in anti-aliasing when you run your application as air file: verdana, embedded, browser verdana, embedded, air though the strange thing is the 0 (zero) and o (o) are missing a bit on the top right. posted in actionscript 3.0, air | 1 comment » face tracking, adding virtual objects in flash july 12th, 2007 in a previous blog i talked about using flash and c++ for face detection. i’m going to use face detection to determine if the player of the game has the right distance to the webcam and is standing in the middle of the screen. but it’s also lots of fun to attach virtual objects to the face (like done in the more expensive logitech webcam series), or to put filters and effects on the facial area. here is a quick example. the jason voorhees hockey mask moves along with my head in real time (about 60ms delay). the size of the sprite also changes as you move back and forward. edit: or go on a killing spree in style ;) posted in actionscript 3.0 | 15 comments » we feel fine & universe july 11th, 2007 i came across an interesting ted talk by jonathan harris. he talked about a few of the applications he has been working on. one of those is we feel fine in which new blog posts are scanned every few hours to collect the feelings of the blogger. each time someone says ‘i feel’ (or i’m feeling, i felt, …) the emotion is logged, next to the gender, age and location. this data is then used in some really pretty visualizations. especially the photo’s attached to some of the ‘i feel’ sentences can be quite impressive. you can play around with it at their website. the other application that really interested me is called universe. the idea behind it is to draw / write the persons, events, etc on the virtual sky. it’s hard to describe it correctly, so you just have to watch the video below, or check out jonathan harris’ website. posted in information visualisation | no comments » face detection using flash and c++ june 24th, 2007 as you could read in a previous blog, i’m trying to create a small webcam game in flash that supports ‘physical input’ using a webcam. the frames are processed by a c++ server that uses existing computer vision libraries. this way it should be fairly easy to build in cool features like face detection. now i’ve finally managed to get some things working on my flash / c++ computer vision project. zoran (my project advisor at the university of amsterdam) helped me a lot on the c++ computer vision part. using the opencv library we’ve managed to put face detection in a flash application! input from the webcam is sent via a socket to a light weight server running localhost. when a face is detected, a message is sent back to flash. the boundaries of the face in the image are also known. i just have to think of some kind of protocol to send and retrieve different kinds (and sizes) of data. the result of the image detection from opencv (using the red color channel here): read the rest of this entry » posted in actionscript 3.0 | 303 comments » about june 19th, 2007 i’m a 24 year old software engineer at one of the biggest websites in the netherlands. i’m a former information science student at the university of amsterdam and a large part of the articles on this website are related to my master thesis there. this is my humble blog, where i post some interesting stuff now and then. for the world to see it and to support my own memories. you can contact me at: marijn @ [the url of this website]. posted in uncategorized | 5 comments » khronos – time based photo browser may 30th, 2007 together with my team mate meindert, i’ve created a cool photo browser for the information visualisation course given at the university of amsterdam. a screenshot is displayed below with the end result. the photos are being placed around the time line, based on the moment they are taken. you can slide through the timeline and zoom in to the level of displaying seconds. the positioning of the photo’s is done using a so called force based algorithm, which is often used in graph drawing. the photo’s are being attracted to the position on the timeline that corresponds with the time the photo was created. also, the photo’s repulse each other. these two forces result in the intuitive positioning of the images. the more you zoom, the more clear you can see where the photo should really be. used technologies: java jogl (opengl for java) force based algoritme for the positioning of the images. my teacher and assistent were also happy with the result: we won the ‘first price’ and the ‘ogl wisselbeker’ screensaver code is available on request. posted in information visualisation, java | 4 comments » zinc dll interface = slow? april 30th, 2007 at the moment i’m working on a webcam game as part of my master thesis research. there are many computer vision libraries available in c/c++ (for example with optical flow implementations or face detection), but c++ isn’t very suited for rapid prototyping in respect to interface and game graphics. flash is very useful for this. also, reading the webcam input is a lot easier in flash than in c. so, what’s the idea: flash reads the webcam, sends the image data to c++. then the c++ application sends back the meta information about the images / frames, which flash uses to draw the game graphics and execute actions in the game. zinc my plan was to use zinc. with zinc you can convert a .swf file (flash) to a .exe (executable). zinc is actually a container like a browser, using an integrated flash player. what’s nice about zinc is that you can shape the window of your application like you want, and they provide additional api functionality. with the extra api calls you can access low level system commands like rebooting the pc, or information like the cpu speed. it also provides database connectivity with mysql and access. using the zinc api you can also access external dll’s. so, what i tried to do was use this dll access to analyse the webcam data in an external c++ application that uses existing computer vision libraries. to test the dll connection, i wrote tiny test dll (source). it consists of two functies, init and process. init is a pure dummy function, process returns a small test string. flash calling the external dll in flash (as3): // create the bitmap var bmd:bitmapdata = new bitmapdata(30, 30, false); var rect:rectangle = new rectangle(0, 0, 30, 30); var bytes:bytearray = bmd.getpixels(rect); // dll var mydll:dll = new dll("testdll.dll"); parameterindex = mydll.addparameter("integer", "120"); parameterindex = mydll.addparameter("integer", "120"); mydll.call("none", "init"); mydll.clear(); // send data to dll parameterindex = mydll.addparameter("unsigned char*", bytes); var result:string = mydll.call("unsigned char*", "process"); mydll.clear(); mydll.close(); result and we’re done! you would say… unfortunately, some time profiling shows even the init dummy function takes 30ms to execute. sending a 120×120 bitmap takes 180ms. as 10fps can be considered a minimum you want for analysis, we can conclude this is too slow to be useful. the next and final attempt (because of time constraints) is to use a c++ server and use a socket to communicate between flash and the server. posted in actionscript 3.0 | 25 comments » author a little something about you, the author. nothing lengthy, just an overview. --> archives march 2008 august 2007 july 2007 june 2007 may 2007 april 2007 categories actionscript 3.0 (5) air (1) information visualisation (2) java (1) uncategorized (1) bookmarks mocking.net net-force meta log in valid xhtml xfn wordpress marijn speelman is proudly powered by wordpress entries (rss) and comments (rss).

Here you find all texts from your page as Google (googlebot) and others search engines seen it.