Panoramas: fast or high quality? Both!

Hello!


The article will be for fans of photo panoramas. To shoot and glue panoramas is my hobby, a dusty, fascinating occupation and, importantly, with a spectacular result. I mean that when I demonstrate ready-made panoramas to my friends (non-specialists), then there is no one indifferent. Unlike, say, a hobby for philately, a classmate once showed a collection of “father's stamps”, the viewing experience was depressing: I did not like the funeral of faded pieces of paper between the sheets of the album with thick cardboard pages. Either the collection was not a fountain, or (more likely) the taste and color, we were far from comrades with the dad of my classmate.

Uh ... well, yes, panoramas. Hobby _in general_ , in my understanding, the activity is relaxing, rather a pleasant pastime, but _in_particular_after collecting the first trial series, the idea began to haunt me that although it was certainly nice, in my performance it looked more like killing this very time. (I want to draw your attention to these seemingly not noticeable words “in my performance”, all that will be described later will mainly concern my experience. If other normal people have sharply different results, give me link there, and I will be grateful to you.)

Handmade


For further reasoning, we need to arm ourselves with some initial data - for example, a spherical panorama requires about 96 frames with a 48mm lens, which stretches the shooting process for an hour or more. An hour of shooting can be quite fascinating - for example, a session for posters with the participation of nice-looking persons of the opposite sex, but as for panoramas, everything is completely different. Whoever tried to shoot a pan manually knows that this is a mechanical rather than a creative process. Indeed: you jump around the tripod with the camera as abnormal, fully concentrating on turning the device to the desired angle and pressing the button so as not to get a “stir”. And so 96 times. And this is for one panorama (and still manage not to forget to take a picture under a tripod - otherwise it will be far from camille). Why so much? Because it is necessary. Now I will explain on an example. It just so happened that I put the first experiments on a camera named after comrade Panasonic, with a 24mm lens with a crop of 2, which yielded 48 equivalent millimeters per full frame. With an equivalent focal length of 48mm, the lens sees 41.1 degrees horizontally and 28.1 degrees vertically (for a frame with a 3: 2 aspect ratio). To shoot a spherical panorama horizontally, you need to do (360 / 41.1) + 30% = 12 frames rounded. That is, every 30 degrees .. And vertically (180 / 28.1) + 30% = 9. Overlapping 30% of the height and width of neighboring frames was subtracted on the Internet, and is designed to facilitate the process of gluing panoramas. With an equivalent focal length of 48mm, the lens sees 41.1 degrees horizontally and 28.1 degrees vertically (for a frame with a 3: 2 aspect ratio). To shoot a spherical panorama horizontally, you need to do (360 / 41.1) + 30% = 12 frames rounded. That is, every 30 degrees .. And vertically (180 / 28.1) + 30% = 9. Overlapping 30% of the height and width of neighboring frames was subtracted on the Internet, and is designed to facilitate the process of gluing panoramas. With an equivalent focal length of 48mm, the lens sees 41.1 degrees horizontally and 28.1 degrees vertically (for a frame with a 3: 2 aspect ratio). To shoot a spherical panorama horizontally, you need to do (360 / 41.1) + 30% = 12 frames rounded. That is, every 30 degrees .. And vertically (180 / 28.1) + 30% = 9. Overlapping 30% of the height and width of neighboring frames was subtracted on the Internet, and is designed to facilitate the process of gluing panoramas.

Considering the fact that the “top floor” as well as the “bottom floor” is just one shot (you can take a picture of it 12 times with a daisy, of course, but no matter what the other time), it turns out that there are 7 floors of 12 plus anti-aircraft and nadir snapshots. Total 96 frames. Since it is impossible to “broaden” the existing lens in any way - the camera is alien, taken from the words “I will just look and give it right away”, and I wanted to reduce this wild 96 unbearably, there were few options, or rather one: 30% should be devalued. In fact, after all, 1.3 horizontally multiplied by 1.3 vertically gives an excess area of ​​69%, that is, out of 96 frames, most of them will be cropped when glued. Here I will omit the swearing details on shooting and gluing together tightly, but the meaning is as follows - math is good when pencil on paper, and merciless practice suggests that the decision to devalue the overlap was presumptuous and erroneous, therefore, leaving 96 frames did not work. Gluing these 96 frames according to the amount of pleasure corresponds to the hobbies of those strange monks who beat themselves with whips and sing songs.

To build panoramas I use the PTGui program - it has the most convenient interface for manual gluing. No matter how advertised, no matter how much the seasoned and not very manufacturers of software for panoramas boast, but so far I haven’t seen programs that can glue on the machine without complaints. Yes - there is an automatic mode, yes - it works, but the quality of such an assembly lies somewhere on the google-street level. Therefore, if we are talking about a good, solid panorama, then, alas, it is impossible to avoid manual work.

The idea of ​​the amount of work can be counted on the fingers: for each frame there are 4 sides that need to be glued together with the neighboring ones, in theory, 4-5 points should be put on each side, in fact about 10. Otherwise, with a high degree of probability, a reproduction of the imperishable Salvador Dali will result. How long does it take to set one pair of points on adjacent frames? If you “shoot” and click the mouse methodically like a robot, then I get about 3-4 seconds for a couple of points. All together gives about 3-4 hours to assemble one panorama. This is terrible.

How to live on?


In theory, the time spent in a process can be simplified as the product of the number of elementary operations and the speed of this elementary operation. So there are two ways to reduce the time spent:
  • fewer iterations
  • reduction of time for one operation

in the case of panoramas, this means that we must strive to reduce the number of images and to speed up the processing of each individual image. Oddly enough, but both tasks are defeated with the help of one technical solution - you need to shoot panoramas according to the template. Because if the geometry of one set is indistinguishable from the geometry of another set, then it’s enough to reduce only one control set of frames and all other panoramas are collected just by replacing the original images and do not require re-setting key points. And for this, during the shooting process you need to turn the camera always absolutely accurately. But man cannot do this. But then the robot can. Therefore, I began assembling the apparatus for shooting panoramas.

Materiel


The following parts were purchased for the device: an

Arduino
electronic toy for not very adults - Arduino

L298
compatible stepper motor control modules with it - 2 pieces

Stepper
three stepper motors (one of them is spare) a

Tchugunij
piece of aluminum (600x150x10mm) from which I have a man in school In my blue coat, I cut out preparations for the frame

Akku
, acid batteries 6V 4.5A

Olympes PEN E-P1
, an Olympus PEN E-P1 camera (somehow quite unexpectedly, the Panasonic owner remembered that the device must be returned) with a 14-42mm lens (28-84 in approximation to the full frame)

Knopka
and radio button to him

Hama
and so same dumb tripod.

After the aluminum billets according to my drawings
Schema
were ready, all that was left was to put everything together and program Arduin.
The design is simple as a lowing: two step motors are mounted on an aluminum L-shape. And in an absolutely shamelessly simple version - no gears, nothing. The axis of the lower engine coincides with (and in truth is) the vertical axis of rotation of the installation and is fixed tightly in a shoe specially made from stainless steel, which can be clamped in the head of a tripod. Thus, the entire mass of the device is loaded (I do not speak special terms from mechanical engineering, so excuse me if something is wrong) on ​​the lower motor. The axis of the upper engine is perpendicular to the axis of the lower one and carries the camera through an aluminum adapter (green in the diagram below). The intersection point of the axes of these motors is located inside the lens and coincides with the nodal point of the lens. Parallax, I'm not afraid of you anymore !!!
Plan
From the very beginning, everything was programmed as it should, I did not have any problems with the software for arduins, I don’t know why, therefore there is especially nothing to write about this. Next, Arduino connects to the motor controllers and is jointly mounted on the side surface of the frame (in the figure - on the left on the blue strip). The radio button transmitter was broken and now it is controlled by the same Arduna through relays hung on free ports. The picture is a bit inconsistent with reality in terms of those gray blocks that represent electronics and batteries. This happened mainly because I had no idea about their true size and missed on a scale of 10 times. Thus, the electronics turned out to be to the left of the blue vertical, the battery hangs to the right of the burgundy, and batteries for the radio button - between the bottom motor and the burgundy vertical, well, it also turned out that inside, and at times and outside everything is entangled with wires. Who would have thought…
All!

Result


Complete
The result is the following:
The camera is equipped with a 14mm lens with a crop of 2, which gives approximately 28mm in full frame equivalent. Accordingly, the angle that the camera captures in a single image is approximately 64 x 48 degrees (the aspect ratio of the frame in this line is not the usual 3: 2 but 4: 3, which is actually even more convenient for panoramas). Since the camera is portrait oriented, 360/48 = 7.5 frames per circle comes out. I don’t know how to shoot 7.5 frames, so I rounded up to 8 upwards and added a couple more for gluing. It turned out 10 frames per circle. Vertically (we omit the calculations), three floors came out: Horizon, +40 degrees above the Horizon, -40 degrees below the Horizon, 1 frame vertically up, 1 frame vertically down (which still has to be removed manually). Total 32 frames! Three times less than originally! It takes about 6 seconds to frame, that is, less than 4 minutes for the entire shooting! Hurrah!!! The same goes for panorama assembly. Since the area of ​​the fields that should overlap in the pictures is decently less than 30%, the assembly of the template project required a trip to a big hangar to my friend. The place was chosen so that there were as many details as possible throughout the room. There was no shortage of details in the hangar with openwork farms, a bunch of equipment, suspension walkways and other furniture. I collected the first project for a very long and dreary - almost the whole day, until I decided that the file generated by the stitcher does not require retouching in Photoshop. Now the process is as follows - shooting 4 minutes, copying to a computer 1 minute, correcting geometric distortions in Bubble5 for 2 minutes, assembling HDR images in Photomatix for 3 minutes (I forgot to say that there was practically nothing to catch in the panorama without HDR, either one hemisphere is white or the other black), scaling in XnView 1 minute, stitching in PTGui - 3 minutes. A total of 14 minutes per panorama, the main work for the operator in the field: press the button and run away, and in the studio: copy files and run programs, the brain does not need to be turned on at all, so while the routine is running, you can safely scroll through the mind something more important. 14 minutes is better than 4 hours, just the case when the size (of the time spent) matters. therefore, while the routine lasts, you can quietly scroll through the mind something more important. 14 minutes is better than 4 hours, just the case when the size (of the time spent) matters. therefore, while the routine lasts, you can quietly scroll through the mind something more important. 14 minutes is better than 4 hours, just the case when the size (of the time spent) matters.

You can see how it finally looks like here:

sergej-hof.de/panotest
projektinarbeit.de/oldenburg

What for?


The simple answer is to quickly. The honest answer is that I wanted to make a service for the real estate market in this way, I thought that to see a photograph of the interior is convenient and useful, and to see the panorama of the room you are interested in is generally space. But I miscalculated in something. Brokers are numb, praise, but do not rush to order such projects for money. I suspect the problem is that I am a bad manager, but I have not yet found a good one. As for the above, ask questions, I will try to answer them. I understand that in general the essay is confused and sketchy, as it turned out - if each stage is described more thoroughly, it will turn out to be "multibooked", but if you are interested, I will write separately about the details that interest you.

Also popular now: