Camera Mathing Tutorial in Blender 2.79

Introduction

In this tutorial we'll be modeling our scene basing on the photography found in the Internet. A good way to look for inspiration is to browse architecture based websites or blogs. There you can find hundreds of interesting projects and very often, authors publish both interior pictures and the floor plans. The project I've chosen to re-create in 3D is called "House Breukelen" and was designed by Zecc and BYTR Architects.

Comparison of the rendered image (left) and real photo (right):
Perspective Lines

To match the perspective in Blender, we first need to create some guiding lines in 2D application. I'll be using Photoshop but this can be also done in Gimp. We start by creating "horizon line" defining on what height was the camera placed while taking the photo. This line can be found by looking at the picture and finding all the horizontal lines (window mullions, and doorposts for example) going parallel to the picture upper and bottom edges.

1 The line is parallel both to bottom and upper picture edges, as well as to the elements like mullions on the left.

Now we'll extend floor, walls and ceiling edges so they cross the horizon line. They should always meet in one or two joint points. You can also try extending the lines of other elements like tables, doors and windows. Using different colors will help you not to get lost in all this line work later in Blender.

1 Green lines for floor and ceiling, pink for the walls and blue as additional guidelines from the table.

Importing line work to Blender

Create a new scene and in 3D view press N button. Find Background Images toolbar on the right panel that popped out. Check the box, click Add Image button and then Open button to add the background image. As image axis choose Camera.

Next, set the 3D view to Front Ortho (Num1 by default) and add camera by pressing Shift + A. Go to the Render options and change the camera's resolution to the exactly same one, as in the picture we've imported to the background. In our case, if you've downloaded the line work picture from this tutorial, the resolution would be: 960 x 640.

Camera placement

Now the hard part begins. Usually when matching 3D camera to photography you can check the exif data that camera leaves in graphic file. This data includes all the information about camera model,, lens, exposure etc. Unfortunately in our example we have to do everything manually...

Start with moving your camera slightly back and upwards from the scene center. Create a cube, scale it down and roughly check how it matches our default camera settings. Try editing the cube so its left and right faces would be roughly aligned to the green floor lines of the background picture. Copy the object and move it upwards trying to match the ceiling lines.

1 It doesn't look good but we've just started...

As you can see, our camera perspective looks totally different to the one from the background picture. Press dot on your keyboard and with your 3D cursor centered to the scene (Shift + C), select your camera and try rotating it slightly to the right..Edit your modified cubes so they look more aligned to the background.

1 Slowly matching to main perspective lines...

Important Note
This tutorial part might seemed a bit boring and troublesome as we had to roughly cover almost all aspects of Corona with no opportunity to describe them more carefully. If you got a bit confused I suggest just continuing forward and roughly getting through the entire tutorial. With more knowledge on all the aspects you need to know in order to render with Corona and Blender, I'm pretty sure the workflow will become clearer and more understandable.
Camera lens options

As you've probably noticed, there can't be much done just by rotating the camera and changing its position. Now we need to edit the focal lens and look for value that would work best in our example. I'd personally recommend sticking to some of the industry standard lens values like: 80, 50, 32, 28 or 24 as it gives us much bigger possibility of finding the correct one.

1 Still not there but I think that lens value of 24 is the best what we can use in this example.

After working with the scene for a few more moments I've reached another limitation - although adapting our 3D cameras lens to the one from the picture gets us closer, I have forgot about one, very important thing - architectural pictures are very often manipulated in 2D applications for correcting their perspective. For more explanation I suggest quickly going through this website.

As the shift lenses used for perspective correction are usually quite expensive, most photographers fix this issue in Photoshop. This makes our work even harder as we don't actually know how the original picture looked like. However, Blender gives us a cool tools to solve this problem. Select your camera and under the Focal Lens parameter you'll find Shift values. This enables us to remove both horizontal and vertical distortion.

1 The value I used was -0.100 fox X and then I've slightly moved and rotated my camera to the right
(this time rotate without using 3D cursor).

Countless attempts

Equipped with the tools, Blender provides, we now need to try many different camera shift value/position/rotation variants. It's actually easier said than to be done, but even for me it took over 30 minutes to get the result I was satisfied with. Keep in mind that you may need to add another pieces of geometry to gain more guide points for your camera. Eventually, the settings I've used for the camera lens were:

Focal Length: 24, Shift X: -0.130, Shift Y: 0.080

As you can see, I've not only added the cube in the place were table is located, but I've also cut the window openings and doorways. All of these newly created guides allow me to better match the perspective.

Important Note
Remember, you don't need to match your camera in 100% as long as it's only a still picture. Some minor differences will always occur and what matters is the final effect!
Conclusion

The process of matching 3D camera and photography was never an easy topic, but I'm sure you'll finally get there after practicing. For more insights, you can download a blend file ending this part of the tutorial. Just log in to your free, chocofur account in the upper navigation bar.