Answer the question
In order to leave comments, you need to log in
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
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question