I have a script that accesses my webcam and displays the captured video on the screen. I can also very easily draw a circle (a rectangle, it doesn't matter) over the video.
When I move the camera physically, the video also "moves". My webcam is attached to the top left corner of my monitor. So when I slide the camera across the monitor to the right, the video itself, and so all obejcts in it move left. But, it's obvious, that the drawn circle stays unmoved.
Now I want the circle be moved when the camera moves.
G1. When the circle contains an object (as in pic1), the goal can be reached using the object tracking algorithms. (I am working with python and using openCV lib, and there are several builtin algorithms (Boosting, MedianFlow, MIL), also the meanshift algorithm, etc.)
G2. There can be cases, when the circle doesn't contain an object (doesn't have any underlying object, as in pic2). In these cases the object tracking algorithms don't work.
I hope I managed to explain the problem. Now I have 2 questions:
Q1. Is there a better way to achieve the Goal1?
Q2. How can I achieve the Goal2? (Maybe there is a way to determine that the video and objects (the wall watch in pic2) moved left, and move the circle proportionally.)
Any help would be appreciated.
P. S. I'm new to Stack Exchange platform, so if the current topic isn't the right place for my question (problem), please tell me where should I post it.