Monday, February 9, 2009

Motion + Color

So I decided to hack around for a bit and combine motion and color detection to get a slow, moving fire-colored object detection algorithm. I'm sure there's an abundance of need for just this type of algorithm. Expect to see this in the top 100 best inventions of 2009.

Anyway, the algorithm simply uses frame differencing to detection motion in the video. The algorithm then tracks each pixel that has moved in k frames and runs color detection on those pixels. Fire colored moving pixels are then colored red for the pesky human operator to enjoy.

You can see the results of a 1 frame motion memory in a fire video sequence in the following photo album
njtrue/fire motion 1

You can see the results of a 5 frame motion memory in a fire video sequence in the following photo album
njtrue/fire motion 5

The algorithm works pretty well at 'ignoring' stationary fire colored objects. However, some spurious 'moving' fire colored pixels are detected. They could be removed using an eroding operation or some simple culling operation based on affinity values.

The most significant problem, other than moving fire-colored objects which are not fire, is that the color detector perceptron is still very slow for such a common operation. Each frame may get 10k-40k pixels that need to be run through the perceptron and that's expensive.

While I could create a specialized, 'fast' version of the perceptron classifier just for this problem, I don't think the speedup will be big enough to eliminate the problem. The solution has to be to reduce the number of pixels that are feed to the perceptron in the first place. At the very least I could thread different parts of the whole classification algorithm and only run the perceptron thread every m frames so that the actual detection is in real time.

No comments:

Post a Comment