I see requests related to opencv motion detection, but my requirement is much simpler, so I ask the question again. I would like to analyze the video frames and see if something has changed in the frame. Any kind of movement occurring in the frame is recognized. I just want to be notified if something happens. I do not need to track / draw outlines.
Attempts :
1) Pattern matching using OpenCV (TM_CCORR_NORMED).
I get a similarity index using cvMinMaxLoc &
if( sim_index > threshold ) "Nothing chnged" else "Changed
Problem with :
I could not find a way to decide how to set the thresholds. The meanings of false coincidence and perfection were very close.
2) Method 2
a) Make a medium medium b) Take the abs. the difference between the current frame and the moving average.
c) The threshold is what made it binary
d) Count the number of non-zero values
Iβm stuck again in how to generate it, because I get a large number of non-zero values ββeven for very similar frames.
Please give me advice on what approach I should take. I am going in the right direction using the above two methods or is there a simple method that can work in all the most common scenarios.
source share