Tag Archive for 'flash'

Viola-Jones object detection [updated]

Face detection example

Recently I was playing with face detection demos done using ported from OpenCV Marilena Lib by Ohtsuka Masakazu and optimized one by Mario Klingemann. I have an idea of using it with my ASSURF project but as far as ASSURF uses lots of CPU resources I cant merge it with Face detection. So I decided to revisit the implementation with more simple and fast solution. Taking into account the speed of Linked Lists and also using TDSI memory optimizer I was able to produce a lot more faster version. I also decided not to hardcode haar cascades XML files into the lib but allow to load it. Currently library supports simple Stump based cascades and Tree based. I wouldn’t recommend using Tree based cascades cause they are significantly slower. This is because we have to use recursion while analyzing image with Tree based cascades.

Update: Added Canny Edge Detector to skip low edged areas of image that result in some nice performance boost. (this will be added to repository soon)

You will find some usage info at wiki page
Download Library SWC
Try demo application (recognizing faces, eyes and mouth) (make sure that u are not using debug player)

Fast Fourier Transform for Flash

FFT simple usage example

There is smth new I would like to share with Flash community: ASFFT Project. Well project is too loud name as far as it is only small library that allows users to decompose images using Fast Fourier Transform in to Real and Imaginary parts. But if you dig more in to the title you will find lots of amazing possibilities it brings to you. The problem is that it is pretty slow and can’t be used on processing video frames for example but it is fast enough to do different image manipulations without freezing Flash Player.

The lib will contain 2 classes “FFT2D” and “FFT”. First one is to work with two dimensional data mostly presented as images. The second one is for streaming (or not) one dimensional data. Usually used in sound signal manipulations/transformation.
At this very moment only FFT2D class available. I will add one dimensional FFT class in near future.

Simple demo example of FFT usage
Project page at Google Code

FlashSURF -> ASSURF

The shortest blog post of mine.
I’ve received a mail from the Group Product Manager of Adobe Flash Player:
“I’m writing to you because the current name of the library misuses the Flash brand. As you know, Flash® is a well-known trademark of Adobe registered in many countries, and in order for us to protect it we need to be diligent about the proper use of the mark… etc.”

As you may understand Adobe asked me to change the Lib name. I’ve no chance to debate on the subject as far as they are right here and they do what they should do. So after not long conversation new name has been chosen ASSURF. (thanx to Mario Klingemann and Jon Howard for the idea)

So if you have any bookmarks update it:
ASSURF Wiki page
ASSURF SWC Lib development project
ASSURF usage examples project

FlashSURF – moving further

FlashSURF

Past couple of weeks I was working on FlashSURF project updates. More likely cosmetic updates: refactoring, adding methods, etc. I’ve screen-casted several videos showing up some usage possibilities.
Project SVN repo was divided in to 2 separate projects: one for FlashSURF SWC Lib development only and another for example projects. Now FlashSURF become really easy to use as far you don’t have to compile and process it with TDSI every time you testing your project. Provided SWC lib already processed, all you need is to include it in your project.

As I’ve already mentioned I’ve screen-casted some videos. All this features are presented in Examples project and can be easily reproduced.

This one demonstrates multiple image tracking/searching in input video stream. I’ve precalculated several images and store them as references for future tracking. Then we just loops through references to search each on the screen.




Here I’ve implemented selection tool and with the help of it I can easily select regions on the screen to store it as references. I was experimenting with playing cards and as you see it works pretty well.

You will find more examples in the repository with demonstration of panoramic stitching, finding Homography matrix between reference and tracked object on the screen, saving and loading references as local binary files etc.

I do realize there is a lot to add and improve in the project. I kindly ask everyone who is interested in using it to take a part by submitting features/methods requests and sharing improvements that can be done to existing methods. Just submit an issue in Code repo or simply drop me a line.

FluidSolver 3D | first steps

FluidSolver in 3D

Well finally I got some time to finish Flash based demo application for the FluidSolver in 3D experiment project. This project is based on my previous fluid solver classes and heavily use Joa’s TDSI tool. This is my first try to implement this simulation if flash and decided to start from Alchemy based Memory usage approach. In plans to try Pixel Bender combined with Alchemy… All calculations made in Flash using ByteArray read/write with TDSI to handle data. Particle engine is based on dynamically growing/reducing LinkedList.
During building this demo I’ve lots of test versions, I’ve tried to use Processing to see the performance difference (you will find links to this screencasts later) also finally discovered the great power of GLSL in Java etc. Mostly because of my Processing results I decided to try Pixel Bender/Alchemy approach in near future. I truly belive it can be done faster in Flash.

Sources can be found in my Google repo at FluidSolver3D branch (be careful it is not well organized cause still in heavy development)

OK, here we have Flash demo application that supports different option changes via Right Click menu. You can choose live mode by selecting any local mp3 file to visualize or to switch to manual mode. There is also an option to turn on/off Sparkles on particles.

Fluids Solver in 3D demo application
See screencasted video on Akira Kiteshi – Pinball composition

Here is some Processing based demos:
Fluids 3D | Processing progress
Cube Fluids | fully GLSL based approach

Faster Array Sort

During my last experiments I tried to optimize my code at every line and dig into sort algorithms to find the fastest solution. As you may know Flash itself is using one of Quick Sort implementations. It is one of the fastest algorithms.
But I’ve tried different implementations and found some better solutions.
Continue reading ‘Faster Array Sort’

Ribbon paintings | video

Steering Behaviors in Augmented reality

Steering Behaviors in 3D: Flocking and 1st Person View

Steering Behaviors in 3D | Flocking

Flocking behavior combined with Obstacle Avoid. You can switch to fire-bird movement and back by clicking on stage. It worth trying!

Steering Behaviors in 3D | 1st Person View

This is leader follower combined behaviors from the previous post. But now you can control camera following each Vehicle. Use arrows to switch from one to another. You can switch to snake style movement mode and back by clicking on stage.

Click on image above to launch application (you will need Flash Player 10)

Steering Behaviors in 3D part 2

Steering Behaviors in 3D

In addition to previous post this example shows combined Separation, Arrival, Wander, Seek and Obstacle Avoid behaviors for 150 vehicles. You can switch between different movement modes by clicking on stage. It worth trying!
This one is used my custom 3D rendering engine. It is very simple and light weight (only 5Kb). But it produces really fast and accurate results – that’s all I need for experimenting.

Click on image above to launch application (you will need Flash Player 10)