-
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
The isetcam scene structure is a simplified description of the scene spectral radiance. The scene structure describes the spectral radiance at a set of points in the world. Each point may be at a different distance, and each point is assumed to emit light uniformly in all of the directions that reach the camera aperture.
We describe a scene by the spectral radiance distribution at each scene point. We store the spectral radiance in the scene structure using units of quanta/sec/sr/nm/m^2 (scene.data.photons). In almost all cases we store the spectral radiance distribution of the light source. In some cases we also store the spatial-spectral radiance distribution of the illumination. In many cases we also store the depth map - the distance from the observer to each point in the scene (scene.depthMap).
A simple scene representation is useful for many calculations. For example, a scene with all points at a distance or a planar scene of a test chart can be well-represented this way. These approximations suffices for simple 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 would describe all the rays arriving at the camera. At every point in the camera aperture we would know the intensity and direction of all the incident rays (light field). For simulations that account for the whole light field, isetcam uses the graphics rendering methods in the iset3d toolbox. This toolbox traces rays through a model of the camera optics. The 3D scene rendering methods in iset3d calculate this full set of rays so that the rendered image at the sensor correctly accounts for depth, occlusions, and related optics effects (e.g., depth of field).
The iset3d methods also extend the calculations to non-uniform emissions (bidirectional reflectance distribution functions) from each point and even retroreflective materials. These methods can also be used to simulate light field cameras based on microlens arrays.
When using iset3d with a pinhole model of the camera and diffraction turned off, we effectively calculat the scene spectral radiance. The iset3d code returns a scene structure only if the user specifies a pinhole camera.
When using iset3d with a lens model, then we are calulcating an optical image.
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.