Tag Archives: Flash

Faster Array Sort in Javascript

Introduction :

Based on Eugene(inspirit) post about Faster Array Sort function in Flash, I ported his test code into javascript.
First of all, I’m mainly using JS for scripting into Adobe After Effects, Photoshop, … but not so much for web anyway. That being said I’m not a javascript guru, so bare with me if I did mistake, I took his code and just changed it a little bit so it would work in JS.

I still can’t make the “Flash Sort” (which seems to be the fastest one on AS) to work w/ JS. I don’t know what I’m doing wrong, if anyone has an idea ?

[UPDATE] Thx to MrDoob, “Flash Sort” works now !! I also add the check function and it seems some sorting still not working quite well.


Download Source Code :



Stats


Firefox

*******************************************
*******************************************
INFO
10 000 elements
User-agent header: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729; .NET4.0E)
——————————————————————–

JS BUILD IN SORT
Time : 18 ms
Sorting is OK
——————————————————————–

QUICK SORT + INSERTION SORT
Time : 9 ms
Sorting is wrong
——————————————————————–

3 WAY QUICK SORT
Time : 11 ms
Sorting is wrong
——————————————————————–

NON RECURSIVE QUICK SORT
Time : 15 ms
Sorting is OK
——————————————————————–

OPTIMIZED NON RECURSIVE QUICK SORT
Time : 16 ms
Sorting is OK
——————————————————————–

NON RECURSIVE QUICK SORT 2
Time : 13 ms
Sorting is OK
——————————————————————–

FLASH SORT
Time : 6 ms
Sorting is OK
——————————————————————–

IE 8

*******************************************
*******************************************
INFO
10 000 elements
User-agent header: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Tablet PC 2.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
——————————————————————–

JS BUILD IN SORT
Time : 88 ms
Sorting is OK
——————————————————————–

QUICK SORT + INSERTION SORT
Time : 34 ms
Sorting is wrong
——————————————————————–

3 WAY QUICK SORT
Time : 47 ms
Sorting is wrong
——————————————————————–

NON RECURSIVE QUICK SORT
Time : 49 ms
Sorting is OK
——————————————————————–

OPTIMIZED NON RECURSIVE QUICK SORT
Time : 42 ms
Sorting is OK
——————————————————————–

NON RECURSIVE QUICK SORT 2
Time : 49 ms
Sorting is OK
——————————————————————–

FLASH SORT
Time : 30 ms
Sorting is OK
——————————————————————–

Chrome

*******************************************
*******************************************
INFO
10 000 elements
User-agent header: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3
——————————————————————–

JS BUILD IN SORT
Time : 13 ms
Sorting is OK
——————————————————————–

QUICK SORT + INSERTION SORT
Time : 4 ms
Sorting is wrong
——————————————————————–

3 WAY QUICK SORT
Time : 3 ms
Sorting is wrong
——————————————————————–

NON RECURSIVE QUICK SORT
Time : 3 ms
Sorting is OK
——————————————————————–

OPTIMIZED NON RECURSIVE QUICK SORT
Time : 3 ms
Sorting is OK
——————————————————————–

NON RECURSIVE QUICK SORT 2
Time : 3 ms
Sorting is OK
——————————————————————–

FLASH SORT
Time : 3 ms
Sorting is OK
——————————————————————–

Adobe After Effects

*******************************************
*******************************************
INFO
10 000 elements
OS : Windows Vista 6.0 Service Pack 2
——————————————————————–
JS BUILD IN SORT
Time : 291 ms
Sorting is OK
——————————————————————–
QUICK SORT + INSERTION SORT
Time : 237 ms
Sorting is wrong
——————————————————————–
3 WAY QUICK SORT
Time : 251 ms
Sorting is wrong
——————————————————————–
NON RECURSIVE QUICK SORT
Time : 287 ms
Sorting is wrong
——————————————————————–
OPTIMIZED NON RECURSIVE QUICK SORT
Time : 250 ms
Sorting is wrong
——————————————————————–
NON RECURSIVE QUICK SORT 2
Time : 298 ms
Sorting is OK
——————————————————————–
FLASH SORT
Time : 281 ms
Sorting is wrong
——————————————————————–

HalloweenPic : Facebook App based on the Marilena (opencv port to flash) face detection into Flash

halloweenpic-screenshot

Juan Bermudez did a cool facebook app called HalloweenPic based on the small Flash application I did a while ago.

I’m really happy (and proud 🙂 ) that sharing the sources could help someone creating some cool stuff.

That said, just go and test it here : http://apps.facebook.com/halloweenpic

Reblog this post [with Zemanta]

Adobe Flash on Iphone – Flash Pro cs5 can compile flash movie for Iphone !

iphone flash

Finally it was about time!!!! now I’m might get an iphone !

Adobe now makes it possible to create applications for the Apple iPhone using the Adobe Flash Platform. You heard right: We’re really excited to bring this new capability to Flash designers and developers—the ability to target the iPhone with ActionScript 3 projects. You will be able to test this functionality in the forthcoming beta release of Adobe Flash Professional CS5 on Adobe Labs.

via Developping for the Iphone with Adobe Flash

Flash Professional CS5 will enable you to build applications for iPhone and iPod touch using ActionScript 3. These applications can be delivered to iPhone and iPod touch users through the Apple App Store.*

  • Demonstration Video
  • Example Applications
  • Additional Resources

via Adobe Labs – Adobe Flash Professional CS5: Applications for iPhone.


***
Sign Up for Beta here : https://www.adobe.com/cfusion/mmform/index.cfm?name=fpcs5_notify

KLT feature detection port to AS3

A few weeks ago I found an old project which is a port of KLT features detection port to Flash AS3 Class (more information about KLT features here)It’s running really slow, and the project seams to be discontinue, but I tried to recompile it with FlashDevelop and FlexSDK based on the previous test I did with Marilena :

This is what I come up with :

using KLT on webcam
using KLT on webcam

Try the Demo Here

Marilena : source code of the Glasses Demo

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 🙂

[iframe http://www.pasteall.org/5725/actionscript/embedded 600 320]


Related Link :

[iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=0596516134 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=3836499320 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=1934356034 120 240]

Demo of Adobe Flash Face Recognition using the openCV port to AS3

Click on the picture to try it
Click on the picture to try it

see also the previous posts here : http://www.francois-tarlier.com/blog/?tag=marilena

Source code here : http://www.francois-tarlier.com/blog/?p=408


[iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=0596516134 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=3836499320 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=1934356034 120 240]

nice review about Marilena on *drawlogic

*drawlogic » AS3 Version of OpenCV for Facial Detection, Web Cam Object Detection, Head Tracking, 3D Library Integration and more with Open Computer Vision Library for Flash – interactive and game development technologies for the web – flash, flex, unity3d, silverlight, javascript [ draw.logic ] » AS3 Version of OpenCV for Facial Detection, Web Cam Object Detection, Head Tracking, 3D Library Integration and more with Open Computer Vision Library for Flash » AS3 Version of OpenCV for Facial Detection, Web Cam Object Detection, Head Tracking, 3D Library Integration and more with Open Computer Vision Library for Flash.

Playing with Marilena

this is my first try with OpenCV port to Adobe Flash (Marilena). Meaning the entire face recognition has been done with Flash/ActionScript

For you who doesn’t know yet about Marliena, please have a look at my previous post “MariLena : OpenCV port to ActionScript 3 (AS3 / Flash)”

Source code here : http://www.francois-tarlier.com/blog/?p=408


Marilena : OpenCV for Flash on Vimeo.

Playing around with the port of OpenCV face recognition to ActionScript 3. In this test I did use Mario Klingemann’s optimized version of Marilena (code name of the port).

Would be great to have this kind of feature on Glasses seller website 🙂

next step try to get the Roll rotation 🙂

Mario Klingemann’s Marlena version could be download here : http://www.quasimondo.com/archives/000687.php#000687

see my post about Marilena : http://www.francois-tarlier.com/blog/?p=235

[iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=0596516134 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=3836499320 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=1934356034 120 240]

Reblog this post [with Zemanta]

Deface : AS3 Face Detection BASED on OpenCV

As my previous post about MariLena (openCV port to AS3), I made more research about it and found this project Deface, which is pretty much the same as MariLena, except that this is not a port of openCV, as the developer says “it’s written from scratch”. so far it’s using Haar cascade file as OpenCV.

I haven’t tried it that much, here is an example : LiveExample
It seems to be a bit slower that MariLena, but I wouldn’t be sure at all

MariLena : OpenCV port to ActionScript 3 (AS3 / Flash)

I dreamed about it, they finally did it ^^.

A crazy guy named Ohtsuka Masakazu have ported the face detection part of OpenCV to AS3 and added the source code named Marilena to the Spark Project a few weeks ago (can’t believe I haven’t notice before today)

Mario Klingemann from Quasimondo.com already made some optimization (see his blog)

I made some test today with a stupid texture, starting from Mario’s webcam example and that’s just fun !!! Well yes, it’s still slow (15 fps on a good computer), but this is just the beginning as I believe that a lot of optimization can still be done, and so what anyway ? It’s flash, it’s everywhere, nothing to install, the fun is there without downloading anything. I really believe in it ! Now with this and FLARToolKit (ARToolKit port to AS3), augmented reality and computer vision is really getting into Flash for sure, and it’s going to give to the community some great opportunity !! I’m looking forward about it

Please, have a test at Mario’s example here

and take also a look at what they did at Squidder.com


Realtime Face Detection in Flash from squidder on Vimeo.

For more info, check out http://www.squidder.com/2009/02/26/realtime-face-detection-in-flash/

[iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=0596516134 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=3836499320 120 240] [iframe http://rcm.amazon.com/e/cm?lt1=_blank&bc1=FFFFFF&IS2=1&bg1=FFFFFF&fc1=3F3636&lc1=E6005C&t=francoi-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=1934356034 120 240]

Reblog this post [with Zemanta]