-
Notifications
You must be signed in to change notification settings - Fork 51
Scene radiance
We have collected and posted online tutorials and scripts that illustrate how to create scenes
scene = sceneCreate;
scene = sceneCreate('slanted bar');
The isetcam scene structure is a simplified description of the scene spectral radiance. The scene structure includes all of the parameters necessary to describe the spectral radiance at a set of points in the world. Each point may be at a different distance. The model is simplified because each point is assumed to emit light uniformly in all of the directions that reach the camera aperture.
We store the spectral radiance of each point in the scene structure using units of quanta/sec/sr/nm/m^2 (scene.data.photons). In almost all cases we further store the spectral radiance distribution of the light source. In some cases we store a space-varying representation of the illuminant spectral radiance distribution. In general cases we store the depth map as well - the distance from the observer to each point in the scene (scene.depthMap), or the distance from the observer to the central point in a planar scene (scene.distance).
This level of scene representation is useful for many calculations. For example, a scene whose points are all far away, or a planar scene of a test chart can be well-represented this way. These approximations suffice for many simple but important scenes used in image quality metrics and camera evaluation. Many users never need more than this basic structure.
A more complete and accurate representation of a 3D scene describes all the rays arriving at the camera aperture. At every point in the aperture we represent the intensity and direction of the incident rays (light field). For simulations that account for the light field, isetcam uses graphics rendering methods iset3d toolbox. This toolbox traces rays from the scene through a model of the camera optics. The iset3d calculation accounts for multi-element optics and diffraction. The rendering accounts for occlusions and depth of field depth (bokeh) effects.
The iset3d methods are constantly being expanded. At present they account for various types of bidirectional reflectance distribution functions, transparency and even retroreflective materials. We recently added fluorescence modeling. The iset3d package also simulates light field cameras with microlens arrays. When using iset3d with a lens model, we return an optical image.
A special case arises when we use iset3d with a pinhole model of the camera and diffraction turned off. In that case the iset3d code returns a scene structure.
Like other ISETCAM structures, the scene has these basic methods
- sceneCreate - Method that produces many different types of scenes for testing
- sceneSet - Set scene parameters (e.g., field of view, or mean luminance)
- sceneGet - Get scene parameters
- scenePlot - Plot scene functions and parameters
- sceneWindow - Open up the scene graphical user interface (GUI), which can hold a collection of scenes
More information about the scene parameters and programming with scenes can be found in the scene programming wiki pages, and in the scene Scripts and tutorials.
In addition to the many test functions implemented in sceneCreate, the ISETCAM function sceneFromFile
can read an RGB image and return a scene radiance structure. This enables you to test camera features using almost any image as an input to the simulation.
The scene returned from an RGB image is not a physically precise description of the scene; it is just a useful way to produce a rough approximation. The algorithm implemented in sceneFromFile
creates the scene spectral radiance that one would measure if (a) the RGB data are displayed on a monitor, and (b) the scene illumination is the monitor white point. Hence, factors that depend on the true scene spectral radiance or on depth will not be properly represented in the scene.
Spatial patterns, light levels, and related effects will be represented.
Here is the sceneFromFile
code in action.
d = displayCreate('LCD-Apple');
meanLuminance = 100;
scene = sceneFromFile('eagle.jpg','rgb',meanLuminance,d);
ieAddObject(scene); sceneWindow;
Notice that the scene depends on the display model, and these can differ substantially. Here is a comparison between two different displays.
d = displayCreate('LCD-Apple'); meanLuminance = 100;
scene = sceneFromFile('eagle.jpg','rgb',meanLuminance,d);
rgb1 = sceneGet(scene,'rgb'); imshow(rgb1);
d = displayCreate('CRT-Dell');
scene = sceneFromFile('eagle.jpg','rgb',meanLuminance,d);
rgb2 = sceneGet(scene,'rgb'); imshow(rgb2);
ISETcam development is led by Brian Wandell's Vistalab group at Stanford University and supported by contributors from other research institutions and industry.