I am trying to write a program with C ++ and OpenCV that calculates the remaining time (frames) before colliding with an object. As an example of a video, I have a camera moving towards a board.
My approach to this is as follows:
- detect tracking functions (tried goodFeaturesToTrack () or setpoints "manually")
- calculate optical flow through calcOpticalFlowPyrLK ()
- calculate the fundamental matrix of previous and current found functions via findFundamentalMat ()
- check the correctness of the main matrix.
- calculate epipolar lines and epipolar - focus expansion in the video
Finally, I planned to use the time to contact the method to calculate the remaining frames before the collision.
So far, my biggest problem has been to find the right fundamental matrix and therefore the epipole. The calculated matrix seems to be irregular, as are the epipolar lines. Will my planned approach be right? Does anyone have a working example of getting FoE from a video or any kind of step-by-step instructions on what I should do?
I would be very happy for any help!
Thanks!
source share