1

I'm doing some work with a camera and video stabilization with OpenCV.

Let's suppose I know exactly (in meters) how much my camera has moved from one frame to another and I want to use this to return the second frame where it should be.

I'm sure I have to do some math with this number before I make the translation matrix, but i'm a little lost with that... Any help?

Thanks.

EDIT:Ok I'll try to explain it better: I want to remove from a video the movement (shaking) of the camera and I know how much the camera has moved (and the direction) from one frame to another. So what I want to do is to move back the second frame where it should be using that information I have. I have to make a traslation matrix for each two frames and apply it to the second frame. But here is when I doubt: As the info I have is en meters and is the movement of the camera, and now I'm working with a image and pixels, I think I have to do some operations so the traslation is correct, but I'm not sure what they are exactly

1 Answers1

1

Knowing how much the camera has moved is not enough for creating a synthesized frame. For that you'll need the 3D model of the world as well, which I assume you don't have.

To demonstrate that assume the camera movement is pure translation and you are looking at two objects, one is very far - a few kilometers away and the other is very close - a few centimeters away. The very far object will hardly move in the new frame, while the very close one can move dramatically or even disappear from the field of view of the second frame, you need to know how much the viewing angle has changed for each point and for that you need the 3D model.

Having sensor information may help in the case of rotation but it is not as useful for translations.

Rosa Gronchi
  • 1,828
  • 15
  • 25
  • Ok thanks, just one more question...lets suppose I'm recording some object in particular and I know the distance form the camera to that object. I could use the data I have in order to restore the object where it should be? ( I don't mind if the rest of the image dont get stabilized ) Using Thales theorem or something? – user2987702 Jan 07 '14 at 18:03
  • It is not completely clear to me what exactly are you trying to achieve. If you want to stabilize a video such that a certain know object will stay in a specific location you can do that without 3D, but I guess I need a bit more input about your objectives. – Rosa Gronchi Jan 07 '14 at 20:51
  • I'm going to track and do some calcs with an object. If I want these cals to be ok I need to eliminate the apparent motion of the object produced by the camera so I can get the "true" movement of the object. – user2987702 Jan 08 '14 at 01:33