PDA

View Full Version : Camera matching with 2d image



{MSX}
07-07-2005, 08:55 PM
Hi! let's say i have a 2d image of a place. I'd like to obtain the camera position that give that perspective, so that i can render 3d object over it.
Here's an example of this:
http://www.maxarea.com/modules.php?name=News&file=article&sid=897

Is there a math approach ? For example i give the (2d coors, 3d coords) couples and it tells me the campera pos/rot ?

Thanks!

Sly
07-07-2005, 10:33 PM
I'm fairly sure there would be a mathematical approach to it, matching the selected vertices on the model with the corresponding positions on the picture as was done in that example. As to what that mathematical approach would be, I have no idea. :)

Ok, some Google research led me from
"camera matching" http://www.complete-support.com/static/VIZ/Release+2/1402-Camera+Matching+Survival+Guide.html
to "photogrammetry" http://en.wikipedia.org/wiki/Photogrammetry
to "Levenberg-Marquardt algorithm" http://en.wikipedia.org/wiki/Levenberg-Marquardt_algorithm
of which there is an implementation in C at https://sourceforge.net/projects/lmfit/

Hope that helps.

{MSX}
08-07-2005, 04:53 PM
Umm it seems vay too difficoult. I'll search for a program or plugin..
I just need to obtain the camera at design time for some images..

bye!

{MSX}
08-07-2005, 05:16 PM
If anyone is interested here's a free Blender script that seems to work.
http://www.warpax.com/pytsai/