So I've been thinking about how to go about motion detection in my Android app and I'm just curious if anyone else here has tried it.
I know you can compare two images timed close together and check the colors and all that nonsense, but I was wondering if there's another more efficient method.
I'm not that far into Android programming yet, so I'm not sure how the phone would handle taking pictures that frequently then dumping the unused images and everything.
Anyone have any thoughts?
I've tried some motion detection stuff lately. What I did was I calculated the absolute value of the difference between the current and previous frame for each pixel. Then multiplied the result with some number like 10 to make the difference image really visible.
This method works fine for normal motion, but when something moves really slowly then it goes unnoticed which might be a problem. I don't know about more advanced methods though.
A solution for slow moving things may be checking each frame with 100 frames back or so
I keep an exponentially decaying moving average "reference frame" to compare against the current frame. At each iteration, the reference frame should be calculated as "reference = reference * (1 - alpha) + current * alpha", where alpha is a small value (positive, but much less than one) which determines how fast the filter responds to changes. Take the absolute difference between the reference and current frames "diff = |reference - current|", then threshold that and do blob detection.