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


4 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
Post a Comment
<< Home