Keywords: telecentric basic platform focusdistance

Summary

This demo shows how to enable the telecentric lens mode of the Basic Platform Plugin

Details

The scenario uses two diffuse spheres at various distances from the camera. The left sphere is 0.5m away, the right sphere is 1.0m away. Under a nominal pinhole configuration, the further away sphere would appear smaller. With the telecentric lens enabled, both spheres appear the same size. Also, the sphere that is futher away from the focusdistance of the lens will appear out of focus due to depth of field.

Important Files

Platform

The platform file now supports the use of telecenticity and magnification. The telecentricity is in degrees and it is the maximum allowable angle that paths can be cast from the aperture away from straight out. The magnification is just a multiplier from obect space to image space. In this example, the spheres are 10mm diamter, but appear 20mm diameter as measured from image pixels due to the magnification being set to 2.0.

Note
Both these variables are not suppor1yyted in the GUI and will be wiped away if you save a platform file from the GUI
          <properties>
            <focallength>500.0</focallength>
            <focusdistance>0.5</focusdistance>
            <magnification>2.0</magnification>
            <telecentricity>0.05</telecentricity>
          </properties>

Setup

To run the simulation, perform the following steps:

  1. Compile the scene by scene2hdf.exe demo.jsim

  2. Render the image by dirsig5 demo.jsim

  3. Load the resulting demo.img file in the image viewer.

Note
To replicate the example image a higher convergence is needed. dirsig5 --convergence=2500,2500,0 demo.jsim

Results

The output of simulation is shown below in the built-in image viewer using the Use percentage of input range of 96% and Gamma of 2.0.

telecentric 2x
Figure 1. Telecentric 2x mag.
          <properties>
            <focallength>500.0</focallength>
            <focusdistance>0.5</focusdistance>
            <magnification>2.0</magnification>
            <telecentricity>0.05</telecentricity>
          </properties>
Note
To generate this png image_tool.exe convert --gains=1454.88,1454.88,1454.88 --biases=-0.11145,-0.111145,-0.111145 demo.img
telecentric 1x
Figure 2. Telecentric 1x mag.
          <properties>
            <focallength>500.0</focallength>
            <focusdistance>0.5</focusdistance>
            <magnification>1.0</magnification>
            <telecentricity>0.05</telecentricity>
          </properties>
Note
To generate this png image_tool.exe convert --gains=1454.88,1454.88,1454.88 --biases=-0.11145,-0.111145,-0.111145 demo.img
non telecentric
Figure 3. Non-Telecentric (Aperture w/ Focus Distance).
          <properties>
            <focallength>500.0</focallength>
            <focusdistance>0.5</focusdistance>
            <aperturediameter>0.025</aperturediameter>
          </properties>
Note
To generate this png image_tool.exe convert --gains=514949,514949,514949 --biases=-0.038597,-0.038597,-0.038597 demo.img
pinhole
Figure 4. Pinhole.
          <properties>
            <focallength>500.0</focallength>
          </properties>
Note
To generate this png image_tool.exe convert --gains=1454.88,1454.88,1454.88 --biases=-0.11145,-0.111145,-0.111145 demo.img