OK, this is much simplar then you think. The 3d studio max plugin that does it for you is pretty cool, but has trouble with wide angle lenses. Anyways, tis much faster to do it manually anyway.
All you have to do is stick to a few basic rules of the thumb. Firstly, know your lens, secondly assume things you get from data visually extracted from the image plate, watch for perspective, and line the camera to geometry, not geometry to camera.
Heres how to do it....:
Say you have a simple scene in a back-alley with two walls adjacent to eachother (at right angles). These walls are made of brick. In the middle of the scene you have a cube of approximately 1 metre in all dimensions. You don't need to know the exact dimensions, it doesn't even have to be a metre, I'm just getting you started.
Now, what data can we extract from the image, and what can we assume. Well, we are pretty sure that the walls are at right angles...so lets start with that. We are also pretty sure that the lines between bricks are parallel as well as vertical lines. We can assume the same with the cube. So, how do we start to line up the camera, with this in mind.....:
1) Create tha floor and walls....poly floor (use poly's cos we are going to want to snap things to vertexs in a mo), just create a poly plane, don't move or rotate it, scale it up a little, just roughly so that it ain't a silly size like 1 cm across. Make it have a reasonable ammount of divisions...so it looks kinda like a tileed floor. This will help us place the cube later. Now create the walls...create a poly plane, rotate it 90 and 90 or vice versa until you have essentially formed 3 poly planes all adjacent to eachother. Now the divisions on the walls are gonna be fairly precise eventually. For now, just have it at maybe 10 in horizontal and vertical. This will represent the perspective of the bricks.
2) Next, create a camera with the correct apperture and lens to match your imageplane. Set the overscan to 1.3 so we can see what we are doing, and move the far clip plane back a few zeros. Now tare-off the perspective view, which we will use to manipulate the camera, and enlarge the camera view.
3) So, to begin, move the camera roughly (in the perspective window) until the camera view has lined up one corner of one hypothetical brick with the a brick corner in the background. Using the bottom corner where the two walls meet would be best, but we can't see it, cos the cube is in the way in the image. SO, we have one single point of geometry roughly matched to the camera by eye. Now the idea is to use that point as a pivot. So, group the camera to itself, and snap the pivot of the group to that vertex of geometry you matched up. Now all we do is rotate the group around this point until the lines of the two walls geometry line up properly with the lines of the bricks in the picture. Now the scale is obviously gonna play a part in this, as you may currently have two Huge walls. So, just scale the group up (you may want to type in the scale factors bit by bit), which is in effect, dollying the camera. Now eventually, you will have a good line up. Keep a good eye on the floor perspective, it will show you if you are far off. Now you can place a cube and scale it to match, as you know that its position is somewhere on the surface of the floor plane.
4) Now if you are having trouble with the perspective, try altering the lens and re-alligning, and again and again until you have it looking right. If you don't know the lens to start with, take a guess. Using this procedure you will also find out the lens. To those of us with a lot of practice, this is a very quick thing to do, and you get used to guessing pretty close to correct lenses. So practice makes perfect.
5) If you have survey data, i.e. the size of the bricks, the exact position of the cube, etc, then great. In such circumstances, you will better off pivoting the camera around a corner of the cube.
6) Don't worry if you have chosen the wrong brick corner to begin with, if you have the perspective nearly right, you can just slide the other wall along until the corner is in the right place.
This is all a little hard to explain in just text, maybe I will post an HTML tutorial. Anyways, if you have any questions just ask.
~Pootang~