Fix a position in a webcam video

Hello everyone,

What I want to do is the following. I want to draw an arrow in a webcam video. While the webcam is moving the arrow should get drawn at the right position relativly to the video (in the correct real world coords). The important part is to fix the position of a point in a moving video. Does anyone have some ideas how to achieve that?

edit retag close merge delete

Sort by ยป oldest newest most voted

I'm guessing you have two possibilities.

1 - Your scene shows a detectable object at which you want to arrow to be pointing at. You'll have to detect this object and then draw the arrow accordingly to its position

2 - There is no reference object, in which case your only option is to derive camera movement and keep compensating the arrow position (assuming that you know where the arrow is pointing at the beginning of the execution). In this case I'm not sure if you can do this only with a webcam, but I would try to compute optical flow, which gives you a measure of movement of the image, and this might be enough for you to draw this arrow according to your needs.

A 3rd fringe possibility is adding a gyroscope to your setup, which will give you the rotating movement of your camera and this would allow you to know how to draw the arrow.

more

Thanks for your answer. I think posibility 2 is what I need. I'm a total newbie so could you explain it in more detail. And could you also go a little bit more in detail for possiblity 3 which might also could work.

( 2015-01-20 01:50:37 -0500 )edit

Optical flow is an algorithm that uses two consecutive frames to calculate de difference between them, thus giving a measure of the movement of the scene. Now that I think about it a little deeper, I don't think that it will work for your case, because optical flow will not only give a measure of movement of your camera, but also of the movement of the objects in the scene.. and you will not be able to tell if it was the camera that moved or something in the scene, so I guess my answer is wrong.

A gyroscope is a little sensor that is on every computer/phone/tablet nowadays. It outputs the rotation on the 3 axis (roll, yaw and pitch). This will allow you to transform a virtual object on a real scene to make it look like it is really there. I've done that ...(more)

( 2015-01-20 04:58:08 -0500 )edit

There is plenty information about that online. 1 hour on google will put you up to speed.

( 2015-01-20 04:58:52 -0500 )edit

This is pretty much, what I'm looking for, but it needs to be optimized. I'm a total newbie, so it would be awesome if I could get some help.

( 2015-01-21 02:00:45 -0500 )edit