I need help.. I have about 30 seconds of helicopter footage of a building site. I have managed to write a program that will track points in the video as x and y screen coords but need to convert this to x,y,z and locate the camera at each frame. I tried to triangulate by using the focal length (27.5mm) but get huge errors for each frame. Is there a way to remove the error and get an approximation of the cameras position and a x,y,z position of the tracked points. Any help at all would be greatly appreciated as I have exhausted all avenues. I know I must be missing something in my triangulation. It works fine for just two frames but adding more just does not work.
Gee that does not help... I know how to program Ive been doing it for about 20 years, my problem is the math. How to reduce the errors of triangulation over many frames with about 100 tracked points per frame. It does not need to be real time. The problem is that the resolution of each frame does not allow for triangulation, i am assuming that this error can be reduced over many frames. I just don't know how.
If the math holds up for one or two frames, abandon the focal length and instead get the position of the object being videotaped at frame 1. then use the change in distance at frame 3 to get the change in the cameras position. Im not sure if this will work as math is not my forte, but its worth a shot.
I just cant seem to get my head around it.. At the first frame project a set of lines from the focal plane, then at the second frame I do the same. Then I try to move the camera so that all the lines intercect the line from the first frame with a arbatary error, but each susequent frame i have to expand the error so that the lines from the camera interset all the line from the first and second frame and so on. I end up with spheres of approimate intersection that keeps on expanding with each frame. In the end I end up with a set of spheres around each point. I need to get the best fit for each frame. Currently I guess the camera movement and iterate so that the total volume of all spheres are at a minimum, but this method just does not work. My camera moves wildly, and when I match it up to a 3D scene it just looks wrong...
Thanks for the hint.. Ill use this to help me weed out bad pixel projections, and use it to refine the camera fit iterations. I have refined the pixel matching and the lens projection and have reduced the error greatly, almost usable.
So, let me get this straight, you have a footage taken from a helicopter, and you wish to determine the path the camera took through the scene while shooting the footage? i.e. that of the helicopter.