Z
Z
ZlodeiBaal2011-12-20 00:24:24
OpenCV
ZlodeiBaal, 2011-12-20 00:24:24

Spatio-temporal filtering (regression analysis) in OpenCV

There was such a question, which I can not immediately enter, but maybe someone here knows. There was a need to quickly implement a regression analysis of a video stream to identify objects moving relative to the background in it. The background itself is non-stationary, but constant: the camera kicks back and forth with a step of the order of a dozen pixels. In principle, this problem is almost ideally solved if there is a regression analysis procedure. But at hand in the language in which I write it is not. Write from scratch - broke, it's big. It would be desirable to solve through OpenCV. The optical flow (LK) functions are not suitable - they unfortunately have low accuracy, too much high noise after subtraction. Functions from the “UpdateMotionHistory” category are not suitable, all the more so - there is a stationary background.
Isn't there a function in OpenCV that subtracts two images from each other looking for the optimal shift and rotation, maximizing the correlation?? Or am I using one of the above incorrectly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Akson87, 2011-12-20
@Akson87

Well, sort of Lucas-Kanade does exactly what you described, looking for a correlation in the window for a few good points. Look again towards the optical flow, for this task it should give quite good accuracy. Perhaps when you experimented with it, you chose the points unsuccessfully or the parameters. Once you find the movement of all points, you can try to find a movement that matches the background.

V
Victor, 2015-02-10
@victor1234

If it’s still relevant for you, I’ll note that OpenCV has functions for highlighting the background, which are just adapted for those cases when it changes periodically.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question