I’m a novice to anything video related. I have a need to analyze video frames from a camera that points at the ground, to detect movement of the camera over the ground. I am not looking for motion other than the whole frame itself, up to about 1/4 of the whole frame scrolls away for each frame.
From this, my basic need is to understand how to go about analyzing the frames to detect how far the camera has moved. I am not really looking for discrete examples, but if someone can tell me some algorithm names or concepts to search on, I’d be grateful!
As it is now, almost all of the web searches return information about tracking an object against a static background, but in my case there’s no objects to track, but rather, the entire frame/background.
On a separate angle I will indeed look for certain features within a frame but first i need to track the frame movement.
Any help appreciated!!!
You can’t track the camera. You can only track what it sees and from that figure out if the camera has moved and then somehow calculate how much.
don’t be so vague. be concrete. show pictures instead of writing text.
- the “scene” is flat, like an optical mouse looking at a desk
- image plane is parallel to ground plane
optical flow. dense or sparse. start with “DIS” optical flow, in OpenCV. you get motion vectors. some simple statistics (mean) give you translation… between frames.
if you want stable results, you’ll need some logic that calculates differences to a reference frame, as long as they’re small, and only changes the reference frame when distance has become large enough to require using a new one.
check out How to determine average x + y motion of keypoints in video?
I wish I could share images but I’m unable, sorry.
The scene is not quite flat but the image plane is parallel to the ground plane. There’ll be roughly 12" x 8" ROI on the ground plane from around 28" from lens to ground plane. The vertical variation within a frame will be up to a few inches but always parallel, minus a bit of parallax.
Since I’m exploring this with just general ideas and no processing experience (other than masking color ranges in another project), I’m thinking to find some rough points of interest; eg, a rock or clump or bit of debris, something that pops out in a frame for which I can find something in the next frame that’s similar enough to judge a distance the frame ‘moved’.
So I was thinking if I can mask out some things that have enough edges to pop out of one frame and find a close approximation in a subsequent frame, then I can establish the translation vector; then use that ROI and some others to move on to the next frame, discarding some close to leaving the frame as to not waste time looking for something I don’t expect to find.
Again – I’m mostly trying to find some concepts to read about and understand better what I’m looking to do from established algorithms.
Your reference to optical flow, dense/sparse, DIS - this is what I was hoping for – so, thank you!
motion templates might be helpful to find global motion of the camera