Generate a three-dimensional image
Generates a three-dimensional image from elevation and reflectance images. It combines a single-band image containing elevation data and a single- or three-band reflectance image, constructing a three-dimensional image of the area. (If unfamiliar with the processing of PERSPEC, see User Note 4.)Reference: B. Fishman and B. Schachter, "Computer Display of Height Fields," Computers and Graphics, Vol. 5, pp. 53-60, 1980.
- IN1
- First input image. A single-band image containing elevation data. The term "elevation" is used loosely. Although input to IN1 is primarily elevation data, it may be any image containing data to be used as height data or Z-value data in an X, Y, Z coordinate system. Window options may be specified. The allowable size of IN1 depends on the amount of memory available on the system at run time. IN1 is allowed to be any one of the four standard data type; if it is not INTEGER*2 before processing starts, it is converted to INTEGER*2.
- IN2
- Second input image. The single- or three-band image containing reflectance data. Window and band options may be specified. The allowable size of IN2 depends on the amount of memory available on the system at run time. The size of IN1 and IN2 must be equal. IN2 is allowed to be any one of the four standard data types.
- OUT
- Output image. The output data type is determined by ODTYPE. The output image size is determined by the parameter OUTWIND and has the same number of bands as IN2.
- OUTWIND(--)
- Output window specification. This is the size of the output image. If a null value is used, the output image size is the same as the input image size.
This parameter is used when a smaller output image is needed, while the detail of the larger input images is also needed to be kept. When the input images are windowed, some of the detail that lies outside of the window is lost.
This parameter may also be used when a wide field of view is needed. The wider the field of view, the more data that is compressed into the output image. Using a value for OUTWIND that is larger than the input image will prevent the compressing of output data into too small of image.
Specifying an output image that is nonsquare, may create unpredicable results. (See User Note 1.)
- PIXSIZ(--)
- Pixel size. The ground dimension of each pixel. This is the size of each elevation image pixel in elevation units (meters, feet). When PIXSIZ has a null value, the pixel size is retrieved from IN1. When retrieved from the input DDR, the pixel size must be the same in both the line and sample direction.
- ROTFLG(YES)
- Rotation flag. Flag indicating if output image is to be rotated 90 degrees. Processing time can be reduced if the image is not rotated until the final run when the user is certain the input parameters produce the desired output image.
= YES: Rotate 90 degrees = NO: No rotation
- VIEWLOC(0,256,200)
- Viewer location. The Y, X, Z location on the input image (IN1) from which the perspective view is generated. The user must specify the line, sample, and height above the terrain of the viewing location. The height above the terrain is in units of the elevation image. (See Figure 1.) When windowing, the Y,X coordinates must be referenced according to the entire image.
If the Y, X location is within the IN1, the viewer's height is the sum of the Z value (VIEWLOC(3)) and the value of IN1 which is at location Y, X. (See Figure 4.) If the location of Y, X is not within the image of IN1, the viewer's height is the Z value (VIEWLOC(3)) only.
- VIEWDIR(180.)
- View direction. The direction the viewer is looking from the VIEWLOC position. The view direction, in degrees, is measured clockwise from north or the positive Y-axis. North is considered to be at the top of the output image. (See Figure 2.)
- FOVIEW(20.0)
- Field of view. The field of view measured in degrees. The greater the field of view, the more of the input image that is compressed into the output image. (See Figure 3.) The value for FOVIEW should be the field of view that is needed divided by two.
- VERTSCAL(1.0)
- Vertical scaling constant. A multiplicative constant applied to the values of IN1 to exaggerate relief.
- HORIZLIN(256)
- Horizon line. The location of the horizon line in the output image. The value specified is approximately equal to the number of lines measured from the bottom of the output image. (See User Note 5.)
- SKYVAL(0,0,0)
- Sky value. The value for the area in the output image defined to be sky. A value must be given for each band in the output image.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as IN2 = BYTE: BYTE (8-bit unsigned integer) = I*2: INTEGER*2 (16-bit signed integer) = I*4: INTEGER*4 (32-bit signed integer) = R*4: REAL*4 (32-bit signed real)
The elevation image TALL.DEM and the reflectance image BANDS3.REF are processed to create the three-dimensional image OUT3D. The image in OUT3D would appear to be taken from a 60 degree angle, and the background or "sky" would be a value of 0. The output data type will be the same as the input reflectance band.
The image is examined in straight lines from the viewpoint location (VIEWLOC) into the field of view (FOVIEW) at an angle of VIEWDIR. Across these lines, the perspective image is produced by comparing each pixel in that line, using the following rule for hidden surface elimination:
A reflectance point is displayed if--and only if--its transformed elevation point is greater than the largest point displayed on that line so far.This process causes the image to be rotated counterclockwise 90 degrees. Using an algorithm presented in Digital Processing of Remotely Sensed Images, a bilinear smoothing is performed next. If specified by ROTFLG, the perspective image is rotated back so that the final output image is in the correct position.
Reference: Johannes G. Moik, Digital Processing of Remotely Sensed Images, National Aeronautics and Space Administration, Washington, D.C., 1980, p. 111.
A nonfatal error was encountered during processing. Processing is NOT terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.
An error was encountered while trying to allocate dynamic memory. Use smaller input images or see the System Manager.
A fatal error was encountered during processing. Processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.
Even though IN2 can have multiple bands, all the bands must be contained within one image. Use COPY to place all the bands into one image.
Rerun the program using one band of elevation data.
Rerun the program using the correct number of image bands.
The projection distance in the line and sample directions of the input images are not equal. Enter the correct pixel size in the parameter PIXSIZ.
The image size (or window size, if specified) of the reflectance image(s) must be equal to the size (or window) of the elevation image.
The projection distance of one of the input images is not valid. Either enter a value in the PIXSIZ parameter or place a valid projection distance in the input image DDR.
Horizon line must be a positive number.
Decreasing the value of HORIZLIN will lower the actual image data within the frame of the output image, and increasing the value of HORIZLIN will raise the actual image data within the frame of the output image. (See Figure 4)
z | / y | / | / | / |/ x --------------+----------------- / / / / / Figure 1. VIEWLOC (Y,X,Z). Y=line direction, X=sample direction, Z=height above terrain.
1,1 1,x ------------------------------------------------------- | | | 0 | | | | | | | | | | | | VIEWLOC | | | / | | | / | | |/ | | 270 ------------------+--------------------- 90 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 180 | | | ------------------------------------------------------- y,1 y,x Figure 2. Measurement of VIEWDIR.
\\ / \\ / \ <----40-----> / \\ / \\ / \\ / \\ / \\ / \\ / x,y FOVIEW = 20 Figure 3. Field of view (FOVIEW).
VIEWLOC = (0,256,200) /\\ ................................../ \\ | . (view direction) / \\ Z = . / \\ 200 . / \\ | . / \\ ........(height of VIEWLOC) / \\ /\\ / \\ / \\ / \\ ----/ \\----------------/ \\ SIDE VIEW ----------------------------------------------- | | | /\\ | ......|................................./..\\........| | | (HORIZLIN = 600) / \\ | | | / \\ | 600 | / \\ | Lines | / \\ | | | / \\ | | | / \\ | | | / \\ | | | / \ | ----------------------------------------------- Figure 4. Horizon line.