Real Time Edge Detection in Flash
Over the last few weeks I've been working on some image processing in Flash. Heres the first post in what could be a series.
The program above shows 3 types of edge detection:
- Good approximation of Sobel
- A much better approximation of Sobel creating a gradient magnitude image
- Non Maxima Suppression
They vary in complexity, the basic sobel algorithm takes advantage of ActionScript 3's built in convolution filter and bitmapdata thresholding function (its not a true sobel edge but close).
The next option combines the two Sobel edges more precisely to create a Gradient Magnitude image. Each pixel is iterated over to combined using their absolute values.
For a tutorial of how to create the gradient magnitude image see this more recent post.
For non-maixima suppression
Non-maxima suppression creates 1 pixel thick edges very useful for other types of image processing (such as the Hough transform to find circles).
The code for the last two is based on an excellent tutorial on image processing here.
Thanks for reading.
Labels: flash, image processing


10 Comments:
Awesome work!
looking good, i never felt so zombified,
good job!
can you post the source code and the .fla?
Hey Luke,
You posted in the kirupa forum that my code inspired you... well your code has now inspired me to try to get the NMS implementation to work.
However, I haven't been able to get it to work as performant as yours or as clean (the edges on mine aren't as singular).
Mind sending me your source for the NMS stuff?
Thanks,
Alex
alex.petrescu@gmail.com
Hey there,
awesome work. I'm very interested in what kind of optimizations you made in order to make this run so smoothly. Im experimenting with some image processing in flash right now and everything is very choppy. Source code or just any important lessons would be much appreciated!
theo @t kingcow d0t com
This post has been removed by the author.
Hi Theo, thanks! I keep meaning to write a post with the complete source. I finished the project a few months ago and it includes a very crude eye tracker. Hopefully will post it up soon, if anyone's interested
Since I last posted, I have built a real-time face tracker completely in AS3. Check it out HERE. I will be releasing an open-source object-detection toolkit based on the project soon.
Just checked out your face tracker. WOW! impressive, can't wait to see the source
Woowww... Simply awesome..
We did a hardware edge detection project. Great to see stuff like this
Post a Comment
<< Home