Museum wall

Started by Dune, August 26, 2013, 03:21:28 AM

Previous topic - Next topic

bigben

Playing on the train.   
A 360deg cylindrical panorama with an image proportion of 78:10 has a vertical fov of 43.9deg with a camera potch of 0deg

For a cylindrical image with a vertical fov of 120deg you'd need 1,548deg horizontally. Difficult but not impossible (although a little repetitive).   ;)

Dune

I have to think very hard on this, Bigben (though I sometimes think too complicated, and in fact it's simple, but I just don't get it). I don't think a very large vertical fov will work. It would be nice of course to look down at your feet when walking along that wall, but it also gives some perspective issues, which are harder to stitch. I've done some testing again to show what I mean. When doing a single shot in the setup attached, the amount of ground at your feet/bottom end, measured with the measure tool, is approximately the number of meters of wall, sometimes a little less, sometimes more. If you point the cam down for the lower half render (when using 2 pitches), you see less grass/meter in the rendered stretch at your feet than if you have a 0 degrees pitch. When printed to a wall, that might look odd.

The main problem is that it's not a 78:10 wall, but 82:2.8. Very long. To not make it overly complicated I think I can get away with a single shot with a -2 degrees tilt, so the horizon will be at about 1.6 m on that wall of 2.8m high. Then I would have to turn the cam for every new section by about 60 degrees, a little less if I need the room to stitch. With a render ratio of 3:1, I will then have about 8.5 meters of wall in one shot, 8.5 in the next, etc. Meaning I need to turn about 560 degrees.
If I make the render aspect 4:1, I will have slightly more than 11m in one go, so a a bit more than 7 turns of 60 degrees = 420 degrees. That's not too bad. I might be able to change the terrain in the last turn, only keeping the previous to stitch by using a camera mask. Although the terrain will be so differently filled that the same hills won't harm.

I'll add a simple test tgd, so anyone can play with it, and maybe come up with a perfect solution.

I really appreciate your thoughts about this. 

bigben

OK, so now I've got the proportions right...

Your image has a vertical fov 21.8°.  I rendered out 45° square tiles for a complete 360° and loaded them into PTGui. The following screen grabs will show the 8 tiles with numbers in them, and copies of them without numbers to pad out the rest of the image.  For your vertical fov I get this:
[attach=1]

For a 45° vertical fov:
[attach=2]

To eliminate the need for stitching, render your images with 0° pitch.  Use something like Hugin/PTGui to remap the images to a cylindrical projection.  No stitching required, the images will just line up. 

To get a tilted view, render an image that is higher. e.g. you had a vertical fov of 21.8, -2° tilt so you need 2° added to top and bottom = 25.8. To get your final image, convert to cylindrical projection first, then just crop off the top of the image.

The only other thing you have to allow for is that the top/bottom of the image will become curved, so you have to add a little extra vertical fov to allow for the reduced height at the corners.
[attach=3]

It then depends on how they will be printed.   If they're going to be vertical strips you can render an image that will match the width of the print, which would probably be the simplest for the printer to manage. I'd set the vertical fov for your camera rather than the horizontal. This will let you change the width of your render if required without having to recalculate anything.

Dune

Thanks bigben. I think we're on the same line, if I understand you well. But I don't understand the preference for a vertical fov instead of a horizontal. Won't they be the same, depending on what kind of view I'd want in one render? Too much vertical degrees and you'll end up with more distortion at bottom and top between the parts. I see in your second 45 degree sample that you need a lot of frames and the camera goes around 4 times for the 1300+ degrees total. That means 'sun problems'. Though I might want to render with quite a high sun, and perhaps move it along with the turning camera, kind of lagging behind, if I won't get into stitching problems, that is.
Or just leave it at one point and not go round too many times, like in your first sample. The latter I just tested, and came up with this. There's some discrepancies, as I just turned the camera and I might need to do that more careful for each frame, even moving X and/or Z a wee bit. I can check each overlap with landmarks at the corners. The discrepancies were also probably caused by a turn mistake (silly miscalculation of degrees) or change in terrain fractal after the first round. I added another fractal's displacement in frame 7, blended by a (Z) distance shader perpendicular to the render cam at that point. But I might even leave that terrain change out. People won't recognize the same terrain 50 meters further along the wall, I guess. Different trees anyway.
I used the default horizontal fov of 60 degrees and a render ratio of 3:1 for each frame, ending up with 10 frames (going around about 575 degrees), which more or less filled the 82 x 2.8 meters. Either Stitcher Unlimited and Photoshop merge didn't do very well, so I placed them in Photoshop by hand. Your PTGUI might be the answer for that.

j meyer

There are some points missing in your considerations from my point of view.
It is a long wall,so it seems very likely that it will not be viewed as a whole.
Thus I think it's of relevance to know how far people will be away from the
wall while viewing it.And how far away is the furthest point/area people
can be while viewing.Furthermore I would take the fact that humans have
a pretty small field of focus into my consideration.
That leads to the question if it is really necessary/useful to choose an elongated
panorama approach,especially as it seems that your client wants to create sort
of an illusion effect,if I got you right.
I would look at some of Eschers techniques of combining perspective systems!
You have seven sections(if I counted correct),so you could use seven vanishing/
look at point systems and even them out via one skystrip for example or some
other trickery.(Maybe the gaps you were talking about could help with that)
With soft transitions the viewer could have a 'correct' impression of depth/perspective
for each area.
Just some musings,excuse me,if it's bullshit to you.

bigben

#20
That is a consideration that I was ignoring for now  ;-), but a valid one to consider.  It will partly depend on the amount of space in front of the wall. Is it a large open space or a long corridor?  It would be nice if the perspective of the ground in the image was a continuation of the floor when viewed from the most likely viewing distance by a person of average height.  If you don't mind how many revolutions are required, it would be a better basis for determining the fov of your render.

As for preferring a vertical fov.... I provide technical support for a living and the number one rule is to allow for change.  If you specify a vertical fov you can change the proportions of your render at any stage to meet requirements without having to calculate anything.  If you specify a horizontal fov and you then change the width or height of your render, you'd have to calculate a new fov to keep the same perspective.  e.g. you start planning to render strips for a 1.5m wide printer, but before you finalise the TGD they find someone who can print at 2m wide

And here are some images to demonstrate how the projections join up.   2 adjacent 45° renders, rectilinear and cylindrical project.

Does the spherical camera in TG3 support smaller fovs or is it designed just to render a full 360x180° image?  If it does allow for smaller fovs you could use this to do the renders as well since there is not that much difference between the projections at a smaller vertical fov so it would save an extra image processing step. [edit - you could always try cropped renders if the spherical camera is fixed at 360deg]

Dune

No bullshit at all (thanks for thinking along!), but I can't change what the client wants, Jochen, and he is quite specific; one continuous landscape. I would have preferred 6 or 7 huge billboards, each with its own era, lighting and atmosphere, but they want continuous. The wall extends along the outer long end and partly on a short end of a rectangular space of about 60x18m, so it can be viewed from quite a distance as well from very close by. Which makes it more difficult. I know about trompe l'oeil techniques, but I have to accommodate to both viewing distances, or find a reasonable average. Much easier to make something that can only be viewed from say 10m distance  :-\

I still don't get your point in the second paragraph, bigben; if I set a vertical fov of 21.8 degrees, and change the render's frame ratio from 3 to say 2, the whole perspective changes, same as when specifying a horizontal fov of 60 degrees. Am I so daft?

I think spherical cam won't work, and seems to be slow. I'd rather stick to what I know for now.

I did something wrong again in animating the render sequence for this trial, so there's gaps again. I had to take out the local clouds and objects for the second 'run' over 360 degrees, and forgot some animation keys in the additional displacements in that same second run. So the terrain slowly moved  >:(

So I had to add them together by hand, stitcher didn't recognize the right order. But we're slowly getting there....

bigben

#22
Quote from: Dune on August 30, 2013, 04:28:08 AM

I still don't get your point in the second paragraph, bigben; if I set a vertical fov of 21.8 degrees, and change the render's frame ratio from 3 to say 2, the whole perspective changes, same as when specifying a horizontal fov of 60 degrees. Am I so daft?


Maybe have a look at http://archive.bigben.id.au/tutorials/360/background/projections.html, taking particular not of the difference between rectilinear and cylindrical images.

I think you may be confusing rectilinear distortion with perspective. The perspective criteria for your image are the pitch angle to the horizon, and the pitch angle to the bottom of the image. i.e. the vertical fov of the image.  It doesn't matter what the width of the individual renders are if you convert them to cylindrical projection.

Your last image looks like your using rectilinear images, and if your camera was tilted slightly downwards it will be impossible to match them across the joins.

Compare the joins in your image with this 360° cylindrical panorama.
[attach=1]

Note that the top and bottom edges are curved, so you have to allow a little extra fov to avoid gaps in the corners of the renders. If you want a tilted camera, add the tilt angle to the vertical fov and render with a horizontal camera. To produce the downward tilt you just crop from the top of the image. e.g. your vfov is ~22, with a camera pitch of -3° tha puts the bottom edge of the image at -(22/2) - 3, or -14°, so you'd need to render with a vfov of 28°

The goal here is to reduce the possible technical issues and let you get on with the creative bits...

  • No stitching required, the images can simply be placed next to each other.
  • Complex parts of the scene can be rendered at narrower horizontal fovs to reduce memory requirements
  • Calculating camera rotation is simple

Here are my previous samples with the extra grids for reference.


Dune

There's something strange going on. I'm getting results I don't want.  >:(   :( :-\ While it looks alright in TG, the stitcher throws all numbers around.

bigben

#24
Luckily I know more about PTGui than TG   ;)
Firstly, it looks like you're trying to get PTGui to align the images for you.  The beauty with using CG renders is that you know what all of the numbers are. PTGui opens up in a simple mode by default, hiding the things you need. You want the Advanced mode.
[attach=1]

This opens up a lot of new panels of which you need only 4
Lens settings:
Set horizontal fov of the renders, lens type rectilinear (default)

Panorama settings:
Set the projection type. fov's aren't really required, there's an easier way to set those.

Image parameters:
This is the key one, where you set the camera positions for each of the renders

Create panorama:
Your output options.

A few notes of use:
PTGui has live links to the files. Change a render while PTGui is open and the image will change in PTGui.

You can combine images with different horizontal fovs, by ticking the boxes in the lens column under "Use individual parameters for:" on the Lens settings tab.  On the Image parameters tab you can then enter the fov for each of the images you ticked.

An easy way to set the dimensions of the output of the stitched result is to use the panorama editor (Tools > Panorama editor) and tell it to fit the output to the images (Edit > Fit panorama)

You can also crop the output image in the panorama editor by dragging from the edge of the image.

And now for the biggy...  You are going to end up with a VERY big image(s) and it will be impractical to try and do all of this in PTGui. For your final renders I'd recommend something like this:

  • Load images (you don't need to do them all at once)
  • Lens settings: set fov of renders
  • Image parameters: skip this!
  • Panorama settings: Choose projection
  • Panorama editor: Fit panorama and crop image vertically as required
    e.g. [attach=2]
  • Create Panorama: Width = width of input images, Layers = Individual layers only

This will give you separate images of each render that can simply be butted up against each other in Photoshop.  Attached a PTGui project file illustrating this. (just rename it to ".pts")

Once you have a project file set up I'd recommend saving it as a template (File > Save as Template). This makes it easy to re-use the settings. You just have to load some images and then File > Apply template. 

Having a play with your TGD.  The camera tilt is -3, I'll give you a demo of why it's better to use 0 and crop.

bigben

#25
OK, so what the hell was I rabbiting on about in my early replies.  Let's start with your sample file. 60° horizontal fov, -3° pitch. Mapped on to a cylinder correctly, you get this:
[attach=1]
Note the top and bottom are curved, and the sides are skewed (the panorama is wider than the image for demo purposes).  If you want the centre-bottom section of the render in the final image you will have to increase the vertical fov of your render.  The skewed sides create a whole range of complications, hence the recommendation to render with the camera tilt at 0°

Next: render the same scene with a camera tilt of 0, increasing the height of the render (I used 1200x700)
[attach=2]

Change the vertical fov using the scroll bar on the right to set the crop for the bottom edge.
[attach=3]
This is your target for rendering. To get the -3° tilt you just have to crop the image from the top.   Now you want to find the smallest TG render that will fit to this projection, allowing for the curved top and bottom of the remapped image. To do this, you need to decide on what horizontal fov you want to render. 
Wider fovs will require fewer renders, but slightly taller images (wider = more curvature at edges).
Wider fovs will have more interpolation of the image at the outer edges when remapped to cylindrical projection.

It's up to you but I'd suggest 45° or 30°. I'll use 30° for this example... so set the width of the panorama to this and create a "panorama".  To figure out what rectilinear image would be required to fit all of this image in, we create a new PTGui project using the image we just created as an input image (fov: 30°, lens type: cylindrical panorama).  Then go to the panorama editor and set the projection to rectilinear (probably is by default) and adjust the fov sliders so that it is cropped to show the entire image. 
[attach=4]
The final fov is shown in the lower left corner. As you can see in this example, to get a 30x27° cylindrical image, you need to render a 30x28° image in TG

Your final setup for remapping and cropping your images will then look something like this:
[attach=5]

Dune

#26
Thanks a million, Ben. I will study this and try to get it working the way you described. Meanwhile I did manage to get a panorama out of TG. Because I rotated the camera more than 360 degrees  without changing the terrain, it was a 'double' set, so PTGUI had some difficulties. So I combined 2 sets of PTGUI'd stitches in Photoshop. In the end I hope to have it set up so I have the minimum of rendering and stitching/deforming to do.

One more question for the time being: won't I have to rotate too many times in TG when using a 30 or 45 degrees horizontal fov? Too many rotations raises other difficulties, like changing the terrain.

Dune

#27
Slowly getting further, but I'm still not satisfied with the setup needed. In other words; I don't yet fully understand it. So I used your render ratio of 12:7, made a render of 1000x583 with vertical fov set at 26º. TG says that horizontal fov (grayed) is then 38.2022, and focal length 51.9777 (while film aperture is 36x24).
Imported this into PTGUI, set lens to rectilinear, set the horizontal fov to the (greyed in TG) value of 38.2022, and ended up with a focal length of 53.97. Which is different from that in TG. How come? Should I change the film aperture to the render ratio of 12:7?

After fitting the image in the panorama editor following your instructions (lining up the sides and bottom to fit) and a horizontal fov of 45º (instead of 30º, at least I think I did that), I get a final fov of 38ºx23º.  I saved it as a template and can indeed produce adjusted images for each render. Though these images don't exactly line up, there is still overlap, but Photoshop stitches these fast and without any problem.

Also; PTGUI gave a different optimal width for the panorama, slightly less than the 1000 image width (957). Or should I force the 1000?

But what do I do with this 38ºx23º ratio in TG? Should I set the render ratio to that value, i.e. 380x230 pixels or equivalent? Or the film aperture ratio? How many degrees should I turn the camera for each render? Arbitrary for some overlap, or an exact number of degrees to get exact line up? Can I already crop the top off here for the final render, or should I render and cut that off later after applying the PTGUI template?

With a fov of 45º I can turn the camera 8 times for one round of terrain, before I have to change the terrain. If I use the 12:7 render ratio I should theoretically end up with 4.8 meters width for every 2.8 meters height, a bit more if I cut the top off to allow for the downward tilt of 2º (which should be enough). So say 5 meters times 8 is 40 meters of wall. Thus, I have to make two 360º turns to cover the 78m of wall. That should work.

But I hope you can explain a PTGUI noob what my next steps should exactly be, Ben!

I added a slightly changed tgd, with a more suitable terrain.


bigben

#28
The 1200x700 render was just to increase the height of the image to make sure it filled the frame.  The original was 1200x400 in your sample. Both kept the same horizontal fov.  Changing the ratio meant unchecking lock aspect ratios in TG so as not to change the horizontal fov. In this particular case I was just trying to get an image that would extend beyond the remapped image regions so the height was going to be excessive to what was ultimately needed.

So we've determined that you need to render 28° vertically in TG and you want to use 45° sections.  What I'd do is go to PTGui and set up a panorama with those setting i.e. rectilinear, 45° x 28°. Go to the create panorama tab and enter the desired width of your render in pixels (1200 in this example, "link width and height" is checked).  This gives you a render size for TG of 1200 x 722 pixels.  Plug this into your render node in TG (uncheck lock aspect ratio first)  and then set the hfov of the camera to 45°.

I see you also have rotations of 55° for your camera (left over from 60° renders I guess)  You can change this to 45° as you won't need any overlap.

In PTGui, for your final output, you want a cylindrical projection with a vertical fov of 27° (and a width of 45° if you're just remapping individual images).

You can ignore any differences in calculated focal lengths between PTGui and TG, those numbers are not important. The crucial one is the measurement in degrees and all of the stitching I've done from TG has been pixel perfect in this regard.

The "optimum size" button in PTGui makes an allowance for interpolation where remapping makes considerable changes to the images e.g. circular fisheye to equirectangular, but it is a guide only. In this case, just ignore it and use the same width as the width of your render.

There was a slight flaw in my suggestion to fix the vfov.  Yes it does allow you to change the width of your render at will (with lock aspect ratio unchecked), but it does make rotating the camera harder to match the edges up exactly.  Sometimes the quality control on my ideas is a little slow ;)

You could always make up 2 templates, one with all image angles at 0,0,0 for remapping the images, and one with the images at yaw intervals of 45° to produce a stitched panorama.  You won't be able to stitch images beyond 360°

PTGui template for stitching a 360 panorama attached.

Dune

Thanks again, Ben.  I hope to get it fixed now.... still many obstacles to take, but this is crucial.