
|
|
|
|
|
|
Camera callibration and estimating focal length for architectural reconstruction
In this study I want to show how it is possible to make a camera callibration from a still and estimating the camera focal length from a 2d background photograph.
Please consider, that you shoud know the basics of photography about shutter speed, F-Stop, Focal Lenght and the relation to the field of view.
Please get sure, that you correct your image or video with the distortion tool I described in my other study. Without this very important point YOU WILL NOT GET a correct result.
Please also notice, that YOU HAVE TO KNOW THE RIGHT CCD CHIP from your digital camera. And that you will choose the right settings for your camera parameters, I describe below.
WITHOUT CHOOSING THE CORRECT CCD CHIP IT WILL NOT WORK !!!!!!!!!!!!!!!!!!!!!!!!!!
At first, make sure that you will choose the right position for your shot and save your original photo without any editing in some software packages. The reason why you should not edit your original footage is to save the very important datas from your digital camera.
As instance, I made a photo from my parents garden. It shows the house from the backside. It is a very nice example for callibrating and getting the right focal length in your 3d camera.

For calibrating and estimating the focal lenght you can choose different software packages. I decided to use ICARUS, because it´s free for non commercial use.
If you made your image, your digital camera shows you all the information you need to know.
Right mouseclick on your image, choose properties.
|
|
 |
As you can see, we already know everything about the image. The shutter speed is 1/1002 second, the F-Stop is
F 4.5 and the Focal Length is 5mm.
Well, now we could ask: Why we should try to calculate the Focal Lenght of this shot for our 3d camera, if we already know all these datas ?
Well, this alone is not enough to simulate the right position, the angle and the field of view in our 3d camera. And consider, that the focal length is always in relation with the field of view.
You can try to get the right camera in your 3d environment with hand, but if you want to work profession and for production you can´t allow to work without a real callibration.
On the data you can also see the resolution, dpi and the camera type the image was recorded.
In this case a very cheap and easy Canon digital camera. |
|
| Start Icarus Callibration and make a new project. |
|
 |
|
If you load your image, a popup window will ask you a few questions about your camera parameters. It´s very important to understand what it is, so let me describe a little bit.
|
|
 |
In the camera parameters are two options we have to choose exactly. And we have to know what it is.
1. Fixed Focal
This is the fixed focal lenght from your photo. In this case 5mm.
2. Aperture Height
This is the type of your digital chip or objectiv. It is very important to know the CCD Chip of your camera typ. You should find it in your manual or on the companies website of your product.
In the pixel aspect you can choose the format from your output. |
|
With these settings, we are ready to coordinate the frame. Go to the Coordinate Frame Folder and choose at first your X-Axis. In Icarus it is very easy to draw the lines on your image. Just select under the coordinate frame the red marked x-axis. Be sure that you are in the feature mode and that you have in the view the axis on, or you can´t see what you draw.
Now we need to search for two lines on our image we could choose for our x-axis. In my case, I took two lines from the window, like shown in the image below. |
|
 |
|
|
|
After setting the X-Axis, make the same with the Y-axis and the Z-Axis. If you have done this, you need to set the Origin Point. This is where you want to have the gizmo from your grid.
If you have drawn all your axis and set your Origin Point you can make the first calculation to get the focal length. To do this, go under the menu, choose camera, estimate focal length (ctrl+e).
Now you will get from Icarus a estimated focal length. If the focal length is not the same you made the background image, you have to worry about the lines from the axis you have drawn in the viewport. Refine the lines, and try to get as close as possible to the Focal Length from the real camera.
In my case, we know the Focal Length is 5mm. And if your settings about the camera parameters and the lines for the axis are correct, you should get the same result in calculating the estimated focal length: The result is 5mm. The image below shos the result from my file. |
|
 |
Well done. Now you are ready to export your callibrated 3d camera to your 3d software. To do this choose Project, Export 3D Motion and choose the type of export.
For 3dsmax, you have to export a .ms file, and run this file as MaxScript. |
|
|
In the next chapter you will find a study about the reconstruction in a 3d environment. The challenge is to get the right dimension of your units setup. You have to imagine: You built your architecture from a plan from AutoCad you have imported, and you model does have the right dimension.
But now, you want to fit the callibrated camera to the right dimension of your 3d model and the reconstructed buildings from your background shot. How to do that, you will find in my next paper |
|
|
|
|
|
|
|
|
|
|
|
|
|