Many real-world materials have noticeable texture. For instance, looking closely at a grass field reveals multiple shades of green. To achieve this texture effect in DIRSIG, we need a way of spatially varying the emissivity curve used for a given material. Texture maps do this, driving the curve selection based on the relative intensity of digital counts from a texture image.
The image below, collected over 0.4 to 0.7 microns, is of a grass field. We can drape this over DIRSIG scene geometry using the maps mechanism.
When we hit a scene location associated with a relatively bright digital count in the texture image, we would like to select an emissivity curve with a relatively low average value (meaning high reflectance) in the range of 0.4 to 0.7 microns. With this scheme, the closest-fitting available emissivity curve will be chosen at each location.
The plot below illustrates why specifying the spectral coverage of the texture image is important. If we used the same image, but specified the coverage to be 1.0 to 1.1 microns (instead of 0.4 to 0.7), the assignment of grass1 and grass2 to spatial locations would be flipped. A DIRSIG output rendered at 0.4 to 0.7 microns would now show a contrast reversal compared to the real-world imagery.
Also note that if we are trying to reproduce the real-world location which supplied the texture image, the best fit in the 0.4 to 0.7 micron range may not necessarily be the best match when additional parts of the spectrum are taken in to account. Therefore, DIRSIG allows multiple texture images to be supplied, each covering a different part of the spectrum. The texturing algorithm will attempt to choose a curve which has the best overall match for the spectral regions.
The actual texturing algorithm does not use absolute digital counts or emissivity curve values (over the specified spectral regions). Rather it computes the standard deviation and generates z-scores for each pixel and associated spectral region for each emissivity curve. Thus it's the distance from the mean, in standard deviations, that drives the actual selection. With multiple texture images, DIRSIG minimizes the sum of the z-score differences between the pixels and the curve regions.
To be usable by DIRSIG, texture images must be converted to the PGM format. This simple image specification uses single-byte integer values to represent digital counts. A full description of the format is available at http://netpbm.sourceforge.net/doc/pgm.html.
Many publically available programs, such as Adobe Photoshop and GIMP can output directly to PGM images. The netpbm toolkit (http://netpbm.sourceforge.net/), distributed as free software, provides a series of command line utilities useful for converting to and manipulating PGM images.
ENVI does not supply an option to save as PGM. (However, this can be done using the WRITE_PPM function in the IDL command prompt). One approach is to load the desired image band to a display, and select File->Save Image As->Image File, choose BMP as the Output File Type. This BMP file can then be loaded in Adobe Photoshop or GIMP and then saved to a PGM.
While DIRSIG supports both binary and ASCII PGMs, the binary format will load significantly faster. This can noticeably reduce scene load times when using large images. Furthermore, DIRSIG currently only supports the single byte PGM format. Images using the double byte format must be quantized down to single bytes; this can be done using the pamdepth utility which comes with netpbm distribution.
Texture maps are defined in the .cfg file:
TEXTURE_MAP {
IMAGE_FILENAME = foo.pgm
MATERIAL_ID = 8048
MINIMUM_WAVELENGTH = 0.4000
MAXIMUM_WAVELENGTH = 0.7000
INSERT_POINT = 5.5440, 1171.3630, 0.0000
GSD = 0.150000
}
The IMAGE_FILENAME points to the PGM image being used to drive the texturing algorithm.
The MATERIAL_ID indicates the material database (.mat) entry which is being textured. DIRSIG4 materials must use the ClassicEmissivity property. (Material entries in the DIRSIG3 format will automatically use this property).
The MINIMUM_WAVELENGTH and MAXIMUM_WAVELENGTH indicate the spectral coverage of the texture image. These values indicate which regions of the emissivity curves will be matched.
The INSERT_POINT and the GSD give physical dimensions to the PGM image, so that it can be draped over the scene geometry.
Multiple texture maps, covering different parts of the spectrum, can be assigned to improve the performance of the texturing algorithm. This is called the Multiple-Bandpass Model (MBP), as opposed to the Single-Bandpass Model (SBP) shown above. The following syntax is used:
TEXTURE_MAP {
MATERIAL_ID = 8048
INSERT_POINT = 5.5440, 1171.3630, 0.0000
GSD = 0.150000
IMAGE_FILENAME1 = foo.pgm
MINIMUM_WAVELENGTH1 = 0.4000
MAXIMUM_WAVELENGTH1 = 0.7000
IMAGE_FILENAME2 = bar.pgm
MINIMUM_WAVELENGTH2 = 1.0000
MAXIMUM_WAVELENGTH2 = 1.1000
IMAGE_FILENAME3 = baz.pgm
MINIMUM_WAVELENGTH3 = 2.0000
MAXIMUM_WAVELENGTH3 = 2.4000
}
With multiple texture maps on a single material, DIRSIG currently requires that all images have the same insertion point and GSD.
To texture a material, multiple curves must be present in the emissivity (.ems) file. The syntax is supplied in the File Formats section of the manual.
Typically, there is significantly less lab-measured data available than there is texture in the scene. For instance, while the grass field image may have sixty unique digital counts, only four grass emissivity measurements may be available.
The DIRSIG distribution includes a tool, expand_emissivity_file, which generates synthetic curves using a small initial set as a base. These generated curves will have the same spectral statistics as the real measurements. The details of this synthesizing process are in Section 6.2.1.1 of the manual.
This tool was used in Megascene1 to generate an emissivity file with 42 curves for grass.
Section 6.2.2.2 and Section 6.3.6 describe the texturing algorithm in detail.
An in-depth study of texturing was completed by Neil Scanlan, an RIT Masters student, in 2003. The thesis explains how various texturing techniques work and evaluates their performance in DIRSIG:
Neil Scanlan (MS), August 2003. "Comparative performance analysis of texture characterization models in DIRSIG".
It can be downloaded at http://www.cis.rit.edu/~cnspci/docs/masters/scanlan.pdf.
To expand the number of emissivity curves in a material's emissivity database, the DIRSIG distribution comes with a support utility called expand_emissivity_file. This utility can take a base set of emissivity curves (commonly 3-5) and produce a larger set (user defined) with the same multi-spectral statistics (i.e. mean and spectral covariance).
The session below demonstrates the usage of this utility program. The input or base file (desert_wash_base.ems) is a Spectral Emissivity File with a small set of curves that are assumed to capture the spectral mean, variance and covariance of the material. The generated output file (desert_wash_texture.ems) will contain 100 emissivity curves that will have the same spectral mean, variance and covariance of the original/base curve set.
prompt> expand_emissivity_file
DIRSIG - Digital Imaging and Remote Sensing Synthetic Image Generation Model
Texture Support Utilities
Reflectance/Emissivity Library Expansion Tool
Base Emissivity Filename: desert_wash_base.ems
Output Correlated Emissivity Filename: desert_wash_texture.ems
Number of curves in expanded file: 100
Reading base reflectance/emissivity file ... done (5 curves in file)
Computing multivariate stats for base curve set:
Computing the mean vector ... done.
Computing the covariance matrix ... done.
Computing the eigen matrix and eigen vector ... done.
Computing eigen matrix determinant ... done.
Matrix is NOT singular, inverting ... done.
Generating new curves ... done.
Computing multivariate stats for expanded curve set:
Computing the mean vector ... done.
Computing the covariance matrix ... done.
Computing difference in mean vector of curve sets ... done.
Average difference in mean vectors = 0.003627
Computing difference in covariance of curve sets ... done.
Average difference in covariance matrices = 0.000508
prompt>
The last lines output by the program includes the difference between mean spectral vectors and spectral covariance matrices. These values are in emissivity fraction units (the difference 0.003627 is the relative difference from an average emissivity of 0.88 for this material).
In some cases, the base curve set features characteristics that make this process impossible to perform because the curves do not form a linearly independent data set. In this case, the problem can usually be resolved by removing one or more of the base curves.