Camera Calibration using Perspective Views of Rectangles

Hi Marcor, thank you for the great work on this add on, it has come in handy for me many times. Do you have any advice on dealing with photos that have been stitched together in ptgui to create a panorama? I know my camera settings from each individual image, but I’m having trouble matching my model to my background photo using the standard panoramic camera in Blender. Anyone else feel free to chime in too if you have any answers. Thanks!

@ Irga, this is a very late response. I was looking over your example and i sort of understand all till the part where you introduce the green circle. How did you set the size of the green circle, that part i dont understand? I dont see a logic behind that :slight_smile:

I also dont understand the placement you use for the solve +Y solution. Is that shape you draw having its vanishing points where the green circle touches the yellow horizon line?

Ow i seen now, the green is where it touches the blue circle with the vertical one, correct?

WOOP WOOP i got it man!!! wow this trick is nice man!!! Will this work on any image provided that having some proper reverence angles?

Attachments


What always helps when asking a question, is posting an image. An image tells us more than 1000 words :wink:
You do have the camera ratio the same as you image right?

Hi, yeah, eventually, I want to try and get a “full” room. I will be trying to create the models myself, so that slows me down. Been away from it for a while as had “real world” stuff to do. :wink:

YEp thats life… Your keeping the hard ones till the end i guess.

Here’s my new adjsusted scene with very low settings. Im beta doing a different plugin so last today was busy on different project.

Attachments


I’ll likely just tackle them as I focus on that part of the room, try to keep myself from wandering off. I suffer a bit with keeping attention on things at the moment.

Just tried this addon, I think it is a quicker set up than BLAM, I really like it, so simple to use.

@rombout, thank you for your late response. I’m very happy with it. Because you found it out by yourself now, you will understand even more. For me the pdf from Erich Hartmann is very helpful. Also the perspective pages from artist Bruce MacEvoy are useful. He has much information about one-point-perspective. I used his information for your “problem” here above with the turned chair. The rotated chair ‘determines’ the angle of view.

I know you use also Sketchup. On the Sketchup forum I was active here. I think you will find this discussion interesting. Michael_S has much things to say there, that maybe also can be used in a workflow with Blender?

@djwaterman, BLAM and this add-on are both great. Both have advantages and disadvantages. BLAM can be used when you cannot find rectangles but can find clear perspective lines.

I took me some minutes to study the image and see why the circles had that shape. Eventually i noticed the intersecting parts. Than it was sort of easy to recreate.

Thanks for those links. I think i need to do some reading :wink:
Im not sure i will completly understand the German version, but that English version will help i think.

@rombout,

If you know the ratio of a rectangle in an image, you can find the perspective with it. Also different rotations from known angles from corners of objects can give perspective. In a lot of situations, there are square formed objects. If you can find a square, you can find also the perspective.

For example: A building with identical sized windows on the same level on both planes/sides. With these windows width, you can find a square (parallel to the ground) . Then you can find the perspective.



(example image: square from three windows on each side. Green border is extended canvas. You can solve this with Solve Focal+Y, When solving with BLAM, you need to extend the canvas also in Y- direction. Green dot, the found principal point, must then be center of image. Third image shows descriptive geometry to find principle point.)

If you know something is circular, then you can draw a square around the circle. in perspective a circle often projects as an elips. Here you can draw a rectangle around the elips. The rectangle represents a square. Now you can find the perspective.

Another example, more difficult: only two sides/planes of the famous Pentagon Building visible. Same sized windows:
Here also you can find the perspective. Here are no squares, but you can work with known ratios and angles.

I will give drawn examples of this “problems” as soon as possible.

Attachments


@robout,

In your image I drew a green circle, after the blue circle. This green circle is the 90 degrees angle of view. This green circle intersects the horizon. These intersections are the vanishing points I used to create my “help rectangles” to use the add-on. I’m happy you found it out.

If the chair was not rotated and the chair was in the same orientation as the other furniture, then it wasn’t possible to find a proper solution without known ratios.

I don’t suppose there is an English version of that pdf?

@colkai,

If you don’t know the German language, you can still try to understand these images. The problem is that I couln’t find comparable free, clear and up-to-date information in The English language about how to find the principal point.

In this pdf, you can find exercises about how to find the principal point (Hauptpunkt: H)) in one-point-perspective, two-point-perspective and three-point-perspective.
The exercises ( Aufgaben) are:

  • Aufgabe 5.22 on page 124, solution on page 180
  • Aufgabe 5.23 on page 126, solution on page 181
  • Aufgabe 5.24 on page 127, solution on page 182

(copy from my Sketchup post).

This was the best information I could find @colkai.

@rombout and @colkai, if I can help with a new (test/demonstration) image/photo, to find the principal point and if needed, to extend the image canvas, I will do my best. I see it as a puzzle.

Thank you. :slight_smile:

Thanks, Perhaps that one ii posted earlier. The one with the pool, i think i got it quite good. BUt like to see you approach, for you they are puzzles :slight_smile: So that means fun!

I think the one with the pool has a distorted perspective, maybe it is a panoramic projection or a composition or the “bar”-structure doesn’t have right angles or a combination of these possibilities?


The green lines show difference in perspective. Cyan and magenta lines are vanishing lines.


The vanishing lines of both objects don’t match. If it was only a rotation of the one building in relation to the other building, then the rotated viewpoint circle would cross with the other viewpoint circle. Now the one viewpoint circle lies totally within the other viewpoint circle. Perhaps there is no exact solution here.

So I think your scene is optimal with the tools/add-ons that we have here. :wink:

Well this shot is a render and it was bugging me a lot. I first tried BLAM on this shot and after done i tried manually adjusting it to get the best position as in the short. Im not sure i tried it with this addon. I did want to remodel everything :slight_smile:

First i thought you had some other calculation process, but you simple draw all lines to view the vanishing points. This show the image is quite weird. I even got the feeling its a montage of different shots. Because i could get one building (big right one) sort of the same. But that fitness place would be completly out of line and scale. The angle of the roof where freaking me out. But you drawing shows exactly why.

Thanks for!