Range Map Files

This version of Rayshade can generate not only images, but also Range Maps (also known as Z Buffers). A Range Map is a two dimensional image, where each pixel is the floating point distance from the image plane[*]to the object in the scene. This is especially useful for generating synthetic data sets for use in Computer Vision research, e.g. depth from stereo and shape from shading. Those techniques all attempt to reconstruct 3D information from 2D images, and having the actual Range Map available makes a quantitative analysis of the accuracy of reconstruction possible.

Range Maps are rendered for single frames[*] from the same viewpoint used to generate images, with the same window size and resolution. To enable Range Map output, use the -z command line option:


\begin{defkey}{-z}{{\em filename}}
Generate a Range Map (i.e., Z buffer).
\end{defkey}

The format of the file is specified by the filename suffix. Three formats are available:

.hf
   Heightfield Format – The most compact format, see Appendix C for a complete description. This is the default output format.
.txt
   Text Format – After some opening comments, each line will correspond to a single row in the image. Pixel distances on each row are represented as text (e.g. 5.45454) and are separated by spaces.
.etxt
   Expanded Text Format – After some opening comments, each line will correspond to a single pixel:
integer X-coord      integer Y-coord      float Distance
Since each output line contains information on just one pixel, a blank line is inserted when the Y coordinate changes (i.e., when the data corresponds to a new scanline).
In all three formats, a distance of -1000 is used to represent the background; this value is unique since all visible objects will have a distance greater than zero.

Why three formats? Heightfield Format is useful because it's very compact and can also be used as input to Rayshade; Text Format is easier to process in shell scripts; and Expanded Text Format is just right for quick displays using the GNUPlot display tool.



Subsections