What is the goal of this post?
- I plan to put together a Journal entry on deviantart that gives a summary how computer graphics software simulate cameras.
- I believe that many people are in the same position as I am and make a lot of assumptions how things work in computer graphics based on their knowledge off photography
- I know it is a lot to read trough but if you can provide any insight into those points I am still confused about that would help tremendously.
- Please correct me if you notice that I am asuming things that are not true.
- - -
The shorter version:
Roeland, thank you so much for taking the time to answer.
The short answer is that now it seems clear how it works the way it does.
But I am still a bit puzzled about the WHY:
Why are the aspect ratios entered in the formula for angle of view?
α = 2 arctan d/2f
Source:
http://en.wikipedia.org/wiki/Angle_of_view
In photography the reference system is a 35mm film camera with 2x3 aspect ratio sensor with 36mm width and 24mm height.
We use
d = 36 mm for horizontal FoV
d = 24 mm for vertical FoV
The lenght of the side (unit mm) we want to measure is put in relationship to the focal lenght (unit mm).
Source:
http://en.wikipedia.org/wiki/Crop_factor
- - -
But in Computer Graphic Camera Systems this very formula seems to be used different:
α = 2 arctan d/2f
Example:
A computer graphics camera with aspect ratio 1x5
d = 1 for horizontal FoV
d = 5 for vertical FoV
On a more practical note:
If you have an aspect ratio of 3x2
are you using d = 3 and d = 2 or are you using d = 1.5 and d = 1?
The Focal lenght f is still measured in mm but what is the unit of the aspect ratios?
After everything I figured out so far I still do not understand why different units are mixed together when we use a value for one side of the aspect ratio d and put that in relationship to the focal lenght in mm.
What I always asumed when someone was posting the formula is that we would keep using the standard 35mm 3x2 aspect ratio and would keep entering 36mm and 24mm for d.
I asumed that the aspect ratio of the viewport would only be used to crop inside a simulated image field of the sensor.
But as it turned out this is not the case:
The distortions you see are an artefact of using a perspective camera with an very wide field of view.
This leads me to the question:
Based on which asumption are we using this adjusted formula for angle of view in computer graphics?
Update / Edit:
On a more practical note:
If you have an aspect ratio of 3x2
are you using d = 3 and d = 2 or are you using d = 1.5 and d = 1?
- - -
The very long version
I write the following as feedback so you may get an impression where users have difficulties in understanding how the whole camera system in OctaneRender works with field of view.
I also would like to provide other users with all the information they would probably need to follow this topic.
I have a background in video and photography and am used to working with different lenses and different image sensors like 35mm full frame and APS-C.
Therefore I am mostly used to working with focal lenght. Field of view was a parameter that I had heared of but was never directly relevant.
For reference, photographers consider an 18mm lens on a 35mm film camera a very wide angle lens. The resulting field of view for this combination is 90°×67°.
So far I was able to follow the example and got the same results when using the formula.
α = 2 arctan d/2f
The reference system is a 35mm film camera with 2x3 aspect ratio sensor with 36mm width and 24mm height.
We use
d = 36 mm for horizontal FoV
d = 24 mm for vertical FoV
or
I could just have used the Angular Field of View Calculator
http://www.tawbaware.com/maxlyons/calc. ... calculator
Focal lenght multiplier: 1 (because it is a 35mm standard lens)
Width / Height Image Ratio: 3x2
- - -
So far so good.
But now it got tricky very quickly.
In order to keep following the example I had to read up on:
Angle of view:
http://en.wikipedia.org/wiki/Angle_of_view
Trigonometry:
http://en.wikipedia.org/wiki/Trigonometry
Inverse Functions:
http://en.wikipedia.org/wiki/Inverse_function
and
http://en.wikipedia.org/wiki/Inverse_tr ... _functions
Suppose you're rendering with a 1:5 aspect ratio (portrait orientation).
You could pick a field of view of 45° along the horizontal axis, which corresponds to a field of view axis of 128° along the vertical axis. A field of view this wide will result in a lot of distortion in the top and bottom of the image. This shows a disadvantage to using the horizontal field of view angle as in octane: with aspect ratios like this the vertical field of view can be surprisingly wide for a setting which otherwise looks normal.
This section completly puzzled me.
At first I just could not figure out how the value of 128° along the vertical axis was calculated.
Based on the formula I got α = 30.87°.
I still asumed that the field of view would be calculated based on a 35mm sensor as in photography.
α = 2 arctan d/2f
Example:
35mm film camera with 2x3 aspect ratio sensor with 36mm width and 24mm height.
d = 36 mm for horizontal FoV
d = 24 mm for vertical FoV
The Horizontal Field of View is 45°.
Goal: Find out the Vertical Field of View based on a known Horizontal Field of View.
Step 1: We are first calculating the Focal Length f.
f= ?
Because of the horizontal FoV we take d = 36 and α = 45.
45 = 2 arctan 36/2f
45 /2 = arctan 36 / 2f
Because y = arctan x is per definition x = tan y we get
36 / 2f = tan 45 /2
f = 18 / tan 22.5
f = 43.46 mm
Step 2: Now we can calculate the Vertical Field of View
Focal Length f= 43.46
Because of the Vertical Field of View we take d = 24mm
α = 2 arctan 24 / (2 * 43.46)
α = 30.87
I also double checked with the Angular Field of View Calculator.
http://www.tawbaware.com/maxlyons/calc. ... calculator
Then suddenly I got the idea that maybe for some weird reason the aspect ratio of 1x5 was used in the formula in computer graphics to calculate field of view.
α = 2 arctan d/2f
Example 3:
A computer graphics camera with aspect ratio 1x5
d = 1 for horizontal FoV
d = 5 for vertical FoV
The Horizontal Field of View is 45°.
Goal: Find out the Vertical Field of View based on a known Horizontal Field of View.
Step 1: We are first calculating the Focal Length f.
f= ?
Because of the horizontal FoV we take d = 1 and α = 45.
45 = 2 arctan 1/2f
45 /2 = arctan 1 / 2f
Because y = arctan x is per definition x = tan y we get
1 / 2f = tan 45 /2
f = 1 / (2* tan 22.5)
f = 1.21
Step 2: Now we can calculate the Vertical Field of View
Focal Length f= 1.21
Because of the Vertical Field of View we take d = 5
α = 2 arctan 5 / (2 * 1.21)
α = 128.45
Now that I understood how to do the math it was more quick to get to the same result as in the next example as well:
Or you can pick a field of view of 45° along the vertical axis, which corresponds to a field of view axis or as 9.5° along the horizontal axis. This image won't have much distortion. But this lack of distortion is just because you picked a more narrow field of view, not because you use a different way to choose this field of view.
Are there simpler ways to calculate Field of View?
Is there a simpler way to calculate horizontal field of view if you allready know vertical field of view?
Is there a simpler way to calculate vertical field of view if you allready know horizontal field of view?
Unfortunately for those cases I was not able to use the Angular Field of View Calculator.
http://www.tawbaware.com/maxlyons/calc. ... calculator
There are only templates for default sensor aspect ratios like 3x2 and 4x3.
In addtion that calculator only works in one direction. If you know focal lenght you can get field of view but not the other way around.
Does anyone know of an online source that offers the options to
- enter different aspect ratios
- calculate Focal lenght based on Field of View
- calculate horizontal Field of View based on Vertical Field of View
- calculate vertical Field of View based on Horizontal Field of View
I guess here the questions related to this topic end.
Thank you very much if you read so far allready!
- - -
- - -
I now add some off topic ideas that came to mind while trying to figure out how Field of View and Cameras work in OctaneRender. Maybe they are of some use to developers who are looking for user feedback. But this section will not add any more understanding how OctaneRender cameras work.
Offtopic:
Feature Suggestions for OctaneRender cameras
Without changing the existing camera presets
- Thin Lense Camera
- Panoramic Camera
add
- a camera preset that works exactly like the Thin Lense Camera but uses Vertical Field of View
- a camera preset that simulates Focal Lenght and the corresponding depth of field.
-
The goal for users is to pick a field of view which gives a pleasing image composition, or for interiors they may need to pick a field of view which shows almost the entire room.
I understand that for most users it will certainly be enough to adjust a field of view slider and trust the eye that the field of view they see is what they creatively need.
Still for me it was important to actually be able to understand why an image in onc computer graphics software looks so completly different than an image in another computer graphics software.
In addition I plan to use a lot of different OctaneRender Render plugins in the future and am interested in trying to composite images that match across many different software.
Because of that it is very important for me to understand the differences of the camera system in various software.
If we change the system they just need to enter a different number to get the same field of view, with the same distortion.
As far as I understand OctaneRender standalone works the way it does maybe exactly so a lot of different plugins can send their data to the standalone and later on to the CloudRender edition.
Therefore it is important to use a system that is compatible with a lot of different software.
Still some things come to mind.
In general I find it very important not to change existing systems.
Instead it seems more useful to add features that work independent of the existing system.
There will always be users who prefer to keep things as they are and backwards compatibility is necessary for longer projects.
For some users it could be helpful to add additional camera presets to the existing ones.
Currently we have
- Thin Lense Camera
- Panoramic Camera
Why not add a camera that calculates field of view based on a vertical aspect ratio?
Those advanced users that know what benefit that has when rendering vertical web banners might find it useful.
In addtion one could argue that traditionaly monitors with horizontal aspect ratios were more commonly used in the past. But with the arrival of internet browsing on mobile phones and tablets the vertical aspect ratio has once again become more frequent.
Why not add a camera preset that gives the user the possibility to work with focal length?
Because many different software send data to the standalone it may be very important that camera values are not linked by default. It is also a very creative way to work if you can create your own depth of field that may not be possible in real life.
Especially for new users who do not understand how depth of field and field of view are connected it might be simpler to work with focal lenght.
Users can adjust focal lenght with a slider and depht of field is automatically calculated based on
- a specific lens
- a specific sensor size
- Existing values like aperture and field of fiew are automatically updated when the users moves the focal lenght slider.
- There could also be an option to unlink focal lenght similar like it is possible to toggle on and off autofocus.
- - -
If you read so far thank you for all your patience and your help!