Fast Blob Tracking Multitouch
Algorithm
The concept is easy. An image is represented as a matrix with a certain number of pixels on a certain number of lines. When the image is grayscale, every one of those pixels has a value which indicates the brightness of the image at that point. When you (virtually) convert this grayscale image to a black and white image, where every pixel above a certain threshold is white and under that threshold is black, you have generated a black and white image with the white area's being the blobs. With that in mind you can run the following sequence of actions:
Check the first line of the image and find groups of one or more white pixels. These are the blobs on a certain line, called lineblobs. Number each of these groups. Repeat this sequence on the next line. While you are collecting the lineblobs, you check the lineblobs on the line you have checked before this current line and see if these blobs overlap each other. If so, you merge these lineblobs as one blob ie. give the current lineblob the same number or id as the lineblob(s) on the other line. Repeat this for every line and you have a collection of blobs.
@FKeel1 @FKeel1 lol cool... you should take a look at my blog
lynxz3 1 year ago
and tada: I have learned something new about image processing. nice. thanks you.
FKeel1 1 year ago