PSGIMAG

Image Perspective Scene Generation


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Related

Back to top

Description


Generates a three-dimensional perspective rendering, using input imagery and elevation data.
Note: This program uses a large amount of RAM memory; see the Memory Usage section for more information.
Back to top

Parameters


Name Type Length Value range
Input: Input BW or RGB layer(s) * Raster port 1 - 3  
InputElevation: Input elevation layer(s) Raster port 0 - 1  
DBIC * Integer 1 - 3  
DBEC * Integer 1 - 1  
Elevation Float 0 - 2 scale, offset
Default: 1,0
Output: Output file name * Raster port 1 - 3  
Background Color Integer 0 - 3 0,0,0 - 255,255,255
Default: 0,0,0
Edge Color Integer 0 - 3 0,0,0 - 255,255,255
Viewpoint Integer 0 - 1024 0 &= x &= 8192
Default: 
Height above sea level Integer 0 - 1024 x &= x -1000.0
Default: 
Height above surface Integer 0 - 1024 x &= x -0.0
Default: 
Field of View Float 0 - 1 0 - 170
Default: 0
View Direction Real 0 - 2 0,0 - 360
Default: 180
View Inclination Real 0 - 2 0,0 - 90.0
Default: 30.0
Number of Front Pixels * Float 1 - 1 1 -
InputVector: Input vector segment(s) Raster port 0 - 6 0,0,0,0,0,0 -
Background Elevation Value Float 0 - 1  

* Required parameter
Back to top

Parameter descriptions

Input: Input BW or RGB layer(s)

Specifies the name of the file that contains the black and white (BW) or red, green, and blue (RGB) layers to be used as input imagery.

Note: Input imagery should be pre-enhanced and be in 8-bit layers.

InputElevation: Input elevation layer(s)

Specifies the name of the file that contains the elevation data.

DBIC

Specifies 1 to 3 channels to use as input imagery.

If a single channel is specified, input is Black and White.

If three channels are specified, input is RGB (red, green, blue).

Notes:

Input imagery should be pre-enhanced and be in 8-bit channels.

DBEC

Specifies the channel containing elevation data.

Elevation

Optionally specifies the scale and offset to apply to the elevation values in the elevation channel (DBEC) to convert values to meters.

If unspecified, scale defaults to 1, and offset defaults to 0.

The equation for the conversion is:

elevation in meters = scale * (value + offset)

For example, to convert elevation values from feet to meters, where a value of 0 represents 1000 feet:

0.3048,1000        : meters = 0.3048 * (value + 1000)

Notes:

It is possible to exaggerate the effect of elevation by using a larger scale value.

It is critical that the ground size of pixels be properly set. This is done when the file is created (for example, CIM function); alternatively, it can be set directly using the APS function.

Output: Output file name

Specifies the name of PCIDSK file to which the generated perspective scene layer(s) will be transferred.

Background Color

Specifies the background (sky) color for the generated perspective scene.

Each background color is in the range of 0-255.

A color can be specified for each channel in the output scene. If no colors are specified, the default is 0. If only one color is specified, that color is used for all other unspecified channels. If more colors are specified than there are channels in the output file, only as many colors as channels are used.

Background color is typically set to 0,0,0 (black), or variations of light blue (for example, 0,160,255) to simulate the sky.

Edge Color

Optionally specifies colors for the sides of the generated perspective scene. By default, no color is applies to the scene edges.

Each background color is in the range of 0-255.

A color can be specified for each channel in the output scene. If no colors are specified, the default is 0. If only one color is specified, that color is used for all other unspecified channels. If more colors are specified than there are channels in the output file, only as many colors as channels are used.

Edge color is typically set to the same as BACKCOL (Background Color), or variations of gray (for example, 80,80,80).

Viewpoint

Specifies the pixel (X) and line (Y) coordinates for the viewing position of the observer.

Height above sea level

Specifies the height (Zpos) of the observer's viewing position, in meters above sea level.

Note: If Zrel is specified, Zpos is ignored; otherwise Zpos is used.

Height above surface

Specifies the height (Zrel) of the observer's viewing position, in meters above the surface at Xpos,Ypos.

Note: If Zpos is specified, Zrel is ignored.

Field of View

Specifies the angle of the field of view (viewing cone) in the scene, in degrees from 0 to 170.

The field of view is comparable to camera focal length in photogrammetry; it defines the perspective for the generated scene.

For example:

To specify a value, type into the field, or select one of the pre-set angles.

View Direction

Specifies the angle for the viewing direction.

The direction angle is expressed in degrees from 0 to 360. A value of 0 provides a view from bottom of the image towards the top; a value of 270 provides a view from the right of the image looking left. THe default value is 180.

To specify a value, type into the field, or select one of the pre-set angles.

View Inclination

Specifies the angle for the viewing inclination.

The inclination value is expressed in degrees from 0 to 90 and specifies the angle for tilting the earth. This is useful for viewing objects positioned behind others, and provides a greater feeling of depth. A value of 0 provides a profile, 90 offers a straight-down view, and 30 provides a 'human eye' view. The default value is 30.

To specify a value, type into the field, or select one of the pre-set angles.

Number of Front Pixels

Specifies the number of foreground pixels that are represented across the front of the output window.

Note: If the viewpoint of the perspective scene is high above ground level, the foreground may appear to have many more pixels than specified by this parameter, due to perspective. Using a very small or very large value may generate a poor result.

InputVector: Input vector segment(s)

Specifies the name of the file that contains the input vector segments to be draped on the generated perspective. The input vector segement consists of sets of vectors (type VEC:116); up to 6 sets of vectors can be connected.

Vector sets are colored: red, green, blue, yellow, black, white. In BW perspectives, all vectors are colored white (except black).

Vectors typically represent elements such as roads, rivers and streams, contours, etc.

Vectors are always drawn 1 pixel wide, regardless of the perspective or foreground zooming.

Background Elevation Value

Optionally specifies a value which is used as a background (undefined or unknown) elevation. If specified, pixels in the elevation channel with this value are ignored and not rendered. If defaulted, no background value is defined and all pixel are valid.

Back to top

Details

PSGIMAG generates a three-dimensional perspective rendering using imagery and elevation data.

Most imagery in remote sensing applications is taken from high altitudes looking straight down. It is occasionally useful, however, to simulate the view an observer would have if he were standing on the ground looking out over the image at an oblique angle. This is generally known as "Perspective Scene Generation" and requires that elevation data be available for each pixel in the input imagery.

The Input, InputElevation, and InputVec ports specify where the input imagery and elevation data are obtained.

The parameter ESCALE (Elevation) describes how to convert the elevation values in the input channel into meters.

The Output port defines the output for the generated scene.

The parameters BACKCOL (Background Color) and EDGECOL (Edge Color) describe how to color the background and scene edges for best effect.

The parameters VPOINT (Viewpoint), VFIELD (Field of View), and VANGLE (Direction/Inclination) all describe the imaginary observer's viewpoint.

The parameter FRONTPIX (Front Pixels) defines the magnification level of the pixels rendered in the output window.

The parameter DBVS optionally specifies sets of vectors, held in vector segments, to drape over the rendered perspective. Vectors are drawn 1 pixel wide, regardless of distance or perspective. The first set of vectors is always drawn in red, the second in green, third in blue, fourth in yellow, fifth in black, and sixth in white. Because vector segments can be duplicated in DBVS, a specific color can be obtained by specifying a particular segment multiple times. For example, if segment 26 contains rivers and streams, these could be shown in blue by specifying segment 26, three times.

PSGIMAG will write segment 26 in red, then in green, and then in blue. Because blue was written last, only blue would be visible. Keep this overlapping feature in mind when you list these channels; the most important vector should be listed last so that it is not overlapped by other vector data.

If a single channel perspective is being generated (for example, b&w), all vectors are drawn in white except the fifth set, which is still drawn in black.

Occasionally, the elevation in some areas of the input data (DBEC) is unknown or not relevant. This elevation should be set to a specific background value. This value, passed to PSGIMAG using the BACKELEV (Background Elevation Value) parameter, specifies that pixels of that color will not be rendered. If BACKELEV is not specified, all elevation data is considered valid.

Note: BACKELEV can be useful for generating a rendering of an arbitrarily shaped region. For example, a bitmap mask of unwanted areas is generated and a background value is burned into the areas under the mask (using the MAP function, for example).

The many parameters in PSGIMAG, combined with the concepts of perspective geometry, angles and position can make PSGIMAG initially difficult to use. Sketching out the extent of the database and carefully determining the view point (VPOINT) and viewing angles (VANGLE) can make PSGIMAG much simpler to understand.

PSGIMAG versus PSG

Although PSGIMAG is similar to PSG, the following differences exist:

In general, PSGIMAG is a more versatile function and generates better images than PSG, but it requires more memory and is slower.

PSGIMAG is capable of generating perspectives similar in quality and look to the interactive fly-through application FLY!.

Memory usage

PSGIMAG is CPU- and memory-intensive.

Memory is allocated dynamically, depending on the dimensions of the input data and the output scene generated. Using very large data sets can easily overload the available RAM on the host computer system, which can result in extremely poor performance or even function failure.

The amount of RAM required can be calculated as the sum of a through c, as shown below:

    a) to hold input imagery =  7 * fileXsize * fileYsize
    b) to hold output scene  =  7 * DBOW(3)   * DBOW(4)
    c) to hold the largest (optional) vector segment
       (sizes here can be difficult to determine)
    Input Imagery       Output Scene      Total RAM Used

    7*( 512 *  512)  +  7*( 512 *  512)  =    3.5 Mbytes
    7*(1024 * 1024)  +  7*( 512 *  512)  =    8.7 Mbytes
    7*(2048 * 2048)  +  7*( 512 *  512)  =   30.0 Mbytes
    7*(4096 * 4096)  +  7*(1024 * 2048)  =  126.0 Mbytes

Camera notes

This section provides background information about the camera model used to generate the perspective.

The view point (VPOINT) used in PSGIMAG is not the actual eye point, but the center of the bottom edge of the camera image plane. The actual eye point is some distance behind the camera image plane. This distance is determined by a calculation based on the field of view (VFIELD) and the number of foreground pixels (FRONTPIX).

Known issues

PSGIMAG is internally quite complex and there are a number of situations which could generate unexpected or poor results:

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.