Keywords:

Summary

The BasicPlatform plugin is typically used to simulate cameras that can be modeled using a pinhole camera approximation that are focused at inifinity. This demo shows how to specify a finite focus distance in a camera modeled by the plugin, which triggers an advanced sampling of the user-defined aperture. The camera is placed at a slant angle and the focus distance is set to focus on objects in the center of the image frame. Due to the low F-number of the camera (f/1.1), the depth of focus is very small, resulting in objects in the foreground and background being out of focus.

The following demos, manuals and tutorials can provide additional information about the topics at the focus of this demo:

  • Related Demos

    • N/A

  • Related Manuals

  • Related Tutorials

    • N/A

Details

This camera system modeled in this demo is a Canon EOS 5D Mark IV with an 80 mm lens at f/1.1. The scene is the same scene used in the Brdf1 demo, which features a set of cylinders, spheres and boxes on a checkboard background. The average size of these objects is 20 cm across.

Important Files

This section highlights key files important to the simulation.

Platform File

The variable that enables this feature is the <focusdistance> in the instrument’s <properties> element. In order to enable this feature, the <aperturediameter> must also be defined. The camera being modeled has a 80 mm lens and a 72 mm diameter aperture.

The focus distance and aperture diameter in the instrument properties.
        <instrument name="RGB Instrument" type="generic">
          <properties>
            <focallength>80</focallength>
            <focusdistance>1.9</focusdistance>
            <aperturediameter>0.072</aperturediameter>
          </properties>
Note
The <focallength> parameter is in millimeters, but the <focusdistance> and <aperturediameter> is in meters.

The Canon 5D Mark IV features a 6720 x 4480 array of 5.36 micron pixels.

Configuration of the detector array to emulate the camera.
            <detectorarray spatialunits="microns">
              <clock temporalunits="hertz" type="independent">
                <rate>10</rate>
                <offset>0</offset>
              </clock>
              <xelementcount>6720</xelementcount>
              <yelementcount>4480</yelementcount>
              <xelementsize>5.360000</xelementsize>
              <yelementsize>5.360000</yelementsize>
              <xelementspacing>5.360000</xelementspacing>
              <yelementspacing>5.360000</yelementspacing>
              <xarrayoffset>0.000000</xarrayoffset>
              <yarrayoffset>0.000000</yarrayoffset>
              <xflipaxis>0</xflipaxis>
              <yflipaxis>1</yflipaxis>
            </detectorarray>

Simulations and Results

Run the demo.jsim file using DIRSIG5 with a higher convergence setup to account for the extended area sampling and glints:

$ dirsig5 --convergence=500,2500,1e-6 --scale_resolution=0.1 demo.jsim
Each capture message will include the focus distance.
Starting capture: Task #1, Capture #1, Event #1 of 1
    Date/Time = 2009-09-01T08:10:00.0000-05:00, relative time = 0.000000e+00
    RGB Instrument
        F# = 1.111 (focal length = 0.080 m, aperture diameter = 0.072 m)
        Focus distance = 1.9 m
    RGB Instrument -> RGB Focal Plane
        Bandpass = 0.400000 - 0.700000 @ 0.010000 microns (31 samples)
        Array size = 672 x 448
        Q = 0.011

Load the resulting demo-t0000-c000.img radiance file in the DIRSIG image viewer and display the RGB bands using the 2% range scaling option (due to the extreme dynamic range of the image, due to the glints). Alternatively, the image_tool command-line tool can be used to scale using the 2% range scaling option:

$ image_tool convert --percent 2 demo-t0000-c0000.img
The RGB output image scaled using the 2% scaling.

demo