AUTODEM

Extract DEM from epipolar pairs


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: References :: Related

Back to top

Description


AUTODEM creates digital elevation models (DEM) from epipolar image pairs generated from optical and SAR sensors.
Back to top

Parameters


Name Type Caption Length Value range
MFILE * String Input file or folder name, or text file 1 - 192
DBIC Integer Input raster channel 0 - 1  
DBIW Integer Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
MINMAXEL Float Minimum and maximum elevations 0 - 2  
FAILVALU Integer DEM-extraction failure value 0 - 1 Default: -100
BACKELEV Float Background value 0 - 1  
DEMDET String DEM level of detail 0 - 16 XHIGH | HIGH | MEDIUM | LOW
Default: HIGH
TERTYPE String Type of terrain 0 - 5 HILLY | FLAT | MOUNT
Default: HILLY
DATATYPE String Output raster data type 0 - 3 16S | 32R
Default: 32R
EXTINTER Integer DEM-extraction interval 0 - 1 1 -
Default: 2
DEMEDIT String Edit DEM 0 - 10 Default: YES,LOW
SCORCHAN String Generate correlation score channel 0 - 3 YES | NO
Default: NO
WALLIS String Apply Wallis filter before DEM extraction 0 - 3 YES | NO
Default: NO
TFILE String Output text file name 0 - 192  
OUTDIR String Output folder 0 - 192  
FILEDEM String Output geocoded DEM 0 - 192  
DEMCLIP String DEM Clip 0 - 16
MAPUNITS String Output projection units 0 - 192
UPLEFT Float Output image upper-left coordinate 0 - 2  
LORIGHT Float Output image lower-right coordinate 0 - 2  
PXSZOUT Float Output pixel size 0 - 2  
MERGEOPT String DEM-merge option 0 - 7 LAST | AVERAGE | SCORE | BLEND
Default: BLEND
REPORT String Report mode 0 - 192 Quick links

* Required parameter
Back to top

Parameter descriptions

MFILE

The name of a folder, image or text file that contains the input epipolar images to process. If necessary, you can use the aterisk (*) as a wildcard.

You must specify at least two image files (a single stereopair) as input.

You can also specify an MFILE with any of the following options:
When you specify your input as a text file of multiple files and different parameter values, the following general rules apply:
When the MFILE specifies a folder or the name of an image file by using wildcards, the image files to process must be named according to the following conventions:

The values specified for the DBIC and MMSEG parameters are used in processing all of the input images

If the MFILE specifies a text file, each line in the text file must contain the path and file name of the files that contain the left and right images of a stereopair, in that order, separated by a semicolon.

For example:

/data/project1/left1250.pix; /data/project1/right1250.pix
/data/project1/left1251.pix; /data/project1/right1251.pix

The two preceding lines specify two stereo pairs. Note that the naming conventions for image files required by other types of MFILE are not required here, and that wildcards are not used in the text file. The first file name is interpreted as the file containing the left image of the stereopair.

Each line of the text file can also contain values that specify one or both of the input image-channel numbers and the math-model segment number, in that order. When you specify the input image-channel number, any value specified for the DBIC parameter is ignored. When the math-model segment number is not specified, the algorithm will still run, provided the input file contains exactly one math-model segment.

For example:

/data/project1/left_1250.pix; /data/project1/right_1250.pix; 3; 2
/data/project1/left_1251.pix; /data/project1/right_1251.pix;  ; 1

In the preceding first line, the values 3 and 2 represent the input image channel and the math-model segment, respectively. In the second line, a value of 1 specifies the math-model segment; for the corresponding stereo pair, the value of the DBIC parameter specifies the input channel number.

Finally, a line in the text file can also contain the path and file name of the output file to which to write the epipolar-image result. This file name overrides the output file generated automatically.

For example:

/data/project1/left_1250.pix; /data/project1/right_1250.pix; 3; 2
/data/project1/left_1251.pix; /data/project1/right_1251.pix; ; 1; /results/project1/demo.pix

The output file that corresponds to the first line is automatically named (see the TFILE parameter). The output file that corresponds to the second line will be named C:\results\project1\demo.pix, as specified in the text file.

DBIC

The channel that contains the input-epipolar images to process.

When you specify a text file that contains input channel information on each line for the MFILE parameter, this parameter (DBIC) is ignored.

DBIW

The raster window, in pixel and line coordinates, that is read from the input epipolar images. If no value is specified for this parameter, the entire layer is used by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. X-size is the number of pixels that define the window width. Y-size is the number of lines that define the window height.

When you specify a value for the Upper Left Coordinate (UPLEFT) and Lower Right Coordinate (LORIGHT) parameters, this parameter is ignored.

MINMAXEL

The minimum and maximum elevation bounds within the area of interest (AOI). The units are either meters or feet, depending on the projection of the model. If no value is specified for this parameter, AUTODEM extracts the DEM range from the global elevation model.

Note: If the geometric models stored with the input image data do not allow the bounds of the overlap area to be estimated as latitude and longitude coordinates, AUTODEM cannot refer to the global elevation model. In this case, both values for this parameter are required.

FAILVALU

The value given to pixels for which the generation of elevation values failed. This value should be outside the range of valid elevation values. The failure value identifies the areas that can be interpolated and filled.

BACKELEV

The background-elevation (NoData) value of the input and output DEM.

When the empty DEM file is first created, the function fills the entire DEM channel with the specified background-elevation value. In the final DEM file, this value indicates areas that have no stereo images from which to extract elevation values.

Select a value that is different from that specified for the Elevation Failure Value (FAILVALU) parameter and that is not a valid extracted elevation value for the area. For example, avoid setting this parameter to 0 in, for example, a coastal area, because a valid extracted elevation can match this value.

If this parameter is not specified, the function uses the default value of -32768.

DEMDET

The level of detail of the generated DEM. A higher level of detail requires more computation time.

Available options are:

TERTYPE

The types of terrain in the scenes.

Available options are:

DATATYPE

The type of data of the output image channel.

Supported types are:

EXTINTER

The number of image pixels between the image locations at which to compute an elevation value in both the along-row and along-column dimensions. The DEM-cell dimension will be approximately the ground-projected pixel dimension of the image data times this value.

Although a greater value for this parameter will cause the DEM to have a larger cell dimension and a lower level of detail, this computes the DEM more quickly.

Note: With SAR DEMs, only intervals 1 and 2 are supported, and 2 is recommended.

DEMEDIT

Whether to automatically edit the DEM.

Supported options are:

SCORCHAN

Whether to generate a correlation-score channel.

Note: With SAR DEMs, the score channel is always created.
Available options are:

WALLIS

The Wallis filter can be useful with desert data or areas with significant shadows, such as mountainous areas or urban scenes.

Available options are:
Note: The Wallis filter is not recommended for use with SAR images.

TFILE

The name of the output text file containing information about the storage of the computed epipolar DEMs. If a value for this parameter is specified, the text file is generated automatically.

The text file contains a separate line for each epipolar DEM, in the following form:

[FILE];[DBEC];[MMSEG_LEFT];[MMSEG_RIGHT];[SCORECHAN]
where:

When the input files for a stereo pair are named according to the standard described for the MFILE parameter, the output file base name will be the common part of the input file base names after the leading el_ or er_, preceded by dem_.

The folder part of the file name for each output file will be the same as the first input file, as specified in the first line of the text file input for the MFILE parameter.

For example, if the base names of the left and right image are el_S188_S189 and er_S188_S189, the base name of the output file will be dem_S188_S189. The output PCIDSK file will have a .pix file name extension.

Any file with a file name that matches the value of this parameter will be overwritten.

If no value is specified for the FILEDEM parameter, this parameter is ignored and the geocoded DEM output files are not created.

If the input files for a stereo pair are not named according to the standard described for the MFILE parameter, the output file base name will be the left base name of the file that contains the left image, followed by the base name of the file that contains the right image, all preceded with dem, with the file name sections separated by underscore characters.

For example, if the left and right image base names are left1250 and right1250, the base name of the output file will be dem_left1250_right1250. The output PCIDSK file will have a .pix file name extension.

This parameter is optional.

OUTDIR

The name of the folder to which to write the output files. If no value is specified for this parameter, the files are written to the current working folder.

This parameter is optional.

FILEDEM

The name of the file to which to write the output geocoded DEM. This is an optional parameter to directly create a geocoded DEM of all generated epipolar DEMs.

If a value is specified for this parameter, a composite geocoded DEM is generated from the epipolar DEMs computed individually. The geocoded DEM is written to the specified PCIDSK file.

If no value is specified for this parameter, the epipolar DEMs are generated, but no geocoded DEM is written as output. To geocode the epipolar DEMs after running AUTODEM, run the GEOCODEDEM algorithm.

This parameter is optional.

DEMCLIP

The amount of data to clip from the epipolar DEMs before merging and geocoding.

The value you specify for this parameter is the amount of the actual image data to clip. You can specify the value as either the number of pixels or as a percentage of the image size.

You can enter one number or two as the value:

For example, specifying a value of 5,10 clips five pixels from the left and right edges and 10 pixels from the top and bottom edges.

When you specify a single value, clipping applies to all edges of the image. For example, specifying a value of 5 clips five pixels from all four edges.

To clip based on a percentage of the image size, type a percent sign (%) after the value. For example, a value of 5%,7% clips five percent from the left and right edges and seven percent from the top and bottom edges.

The default is blank, which means no clipping occurs. The maximum percentage value you can apply is 49 percent.

To apply this option, a value must be specified for the FILEDEM parameter.

MAPUNITS

The projection string for the output DEM. If no value is specified, the map units are determined automatically.

The standard definitions are as follows:

If METER or FEET is specified, the math model and DEM must be METER or FEET.

If a regular, Earth-referenced projection is specified, the math model and DEM must also use a regular projection (not necessarily the same one); METER and FEET are not allowed.

You can also specify the label of a projection you have defined, if the projection exists in the userproj.txt file; otherwise, the projection parameter information must be provided as a string separated by a vertical bar (|). The projection parameter string defines 18 parameters delimited by spaces, including Dearth, RefLong, RefLat, StdParallel1, StdParallel2, FalseEasting, FalseNorthing, Scale, Height, Long1, Lat1, Long2, Lat2, Azimuth, LandsatNum, LandsatPath and UnitsCode. For example, the projection named 'France93' can be specified as:
LCC D350 | 0 0 3.0 46.5 44.0 49.0 700000 6600000 0 0 0 0 0 0 0 0 0 -1

This parameter can specify the UTM-zone number and row, and Earth model, as follows:

UTM [mm] [r] [Ennn]

where:

The Earth model can be specified for LONG/LAT (and other units except METER or FEET), as follows:

LONG/LAT [Ennn]

This parameter can specify the SPCS-zone number and Earth model as follows:

SPCS [mmmm] [Ennn]

where [mmmm] is the four-digit zone number.

If the Earth model is not specified, it is assumed to be E000 (Clarke 1866).

If no value is specified for Map projection (MAPUNITS) is not specified, the logic for determining a default ortho-coordinate system is as follows:

UPLEFT

The upper-left ground x and y coordinates, in map units, for the output epipolar or geocoded DEMs.

If no value is specified for this parameter, AUTODEM calculates and uses the upper-left corner coordinate from the input images.

This parameter is optional.

LORIGHT

The lower-right ground x and y coordinate, in map units, for the output epipolar or geocoded DEMs.

If no value is specified for this parameter, AUTODEM calculates and uses the lower-right corner coordinate from the input images.

This parameter is optional.

PXSZOUT

The resolution, in meters or feet, of the generated pixels. If no value is specified for this parameter and the Map projection (MAPUNITS) parameter, the resolution is determined automatically from the input files.

This parameter is optional.

MERGEOPT

The DEM-merging option to use when multiple epipolar DEMs are geocoded and added to the output DEM file.

When a new geocoded DEM is added to the file and it overlaps an existing geocoded DEM, you must specify the method by which to determine the pixel value to use.

Valid methods are:

This parameter is optional.

REPORT

Specifies where to direct the generated report.

Available options are:

Back to top

Details

AUTODEM generates a digital elevation model (DEM) from epipolar image pairs generated from optical or SAR sensors. The input digital images can be accompanied by any type of geometric model other than polynomial or thin-plate spline.

Matching points in a left and right input image are found using image correlation. The image disparity for the point pair is computed and this value, combined with the geometric model for each image, is used to compute the scene elevation for the corresponding scene point.

The image correlation is performed on an image pyramid that is constructed for each of the input images. The base level of an image pyramid is the original image, the next highest level is the original image resampled to a coarser spatial resolution, the level after that is the previous level resampled to a coarser spatial resolution, and so on. The location in one image that matches the current point in the other is first found at the coarsest resolution level for both images. This location is then used as the starting point for finding the match at the second coarsest resolution, and so on until the match is found in the original images.

This multi-resolution approach to image matching is faster than searching for matches in only the full-resolution images, and results in fewer false matches.

The search radius at the initial (coarsest) resolution is determined from the elevation range within the scene, provided by the Minimum, maximum elevation (MINMAXEL) parameter or extracted automatically. If the range is too narrow, some of the matches may not be found, resulting in failed values. If the range is too wide, some invalid matches may be accepted, lowering the quality of the DEM. Moreover, with SAR images, some pixels at the image-overlap-area margins may not be matched; therefore, the specified minimum and maximum elevations should be close to the expected elevation range within the scene. Notice that the automatically extracted elevation range can be too wide, particularly in scenes close to areas with large changes in elevations.

SAR DEMs

AUTODEM extracts SAR DEMs by using separate code, based on the paper cited under References.

The image matcher uses the normalized cross-correlation between a pair of epipolar SAR mages. Both images of the pair should be acquired from the same side; that is, either two descending orbit images or two ascending orbit images, preferably at the same resolution. The optimum separations with SAR images depend on the terrain type; flat or gently rolling terrain requires the largest available separations, while mountain scenes should be processed with smaller separations (but not less than 5 degrees). Scenes where separation is too small may match well, but the elevations will be highly inaccurate. Scenes with very large separation may show a large number of failed matches due to image dissimilarity.

The images are processed in horizontal strips, derived, and written sequentially to the epipolar DEM file. The height of the strips (number of lines) depends on the available memory, the selected processing window, and the level of detail specified for the DEM detail (DEMDET) parameter. The successive strips overlap, and the elevations are linearly ramped at strip margins.

The SAR DEM extractor always produces the score channel (the second channel in the epipolar DEM file), which contains an 8-bit flag describing the elevation value stored in the third channel:

The pyramiding scheme (applied within each strip) is different than that used for optical DEMs, and uses up to eight resolution levels. The raw matches are analyzed locally and smoothed according to the properties of the correlation surface in their neighborhood. The smallest holes are always filled, but the larger ones are processed according to the level of detail specified for the DEM detail (DEMDET) parameter.

With SAR data, it is not recommended that you derive full-resolution DEMs, due to a higher level of noise in such DEMs. AUTODEM uses large matching windows, which result in a certain degree of terrain surface-smoothing. In most cases, this smoothing effect will not be eliminated by extracting elevations at every pixel; therefore, an extraction interval of 2 and a DEM-detail setting of MEDIUM or LOW are recommended.

With high-resolution images, the extracted DEM may contain unwanted noise and have interior holes filled with background (as opposed to failed) values. In such cases, it is recommended that you regenerate the DEM with a higher extraction interval, a lower DEM-detail level, and a higher degree of DEM editing. If these measures still do not produce the desired result, try regenerating the epipolar pairs at a higher sampling interval than the value used initially. This will lower the resolution of the final DEM and, in most cases, improve its appearance.

The elevation datum is determined automatically based on the input data. The output elevation datum is determined by the math model. The following table shows the relationship between the output datum and the type of math model. The only math model that can have mean sea level (MSL) or ellipsoid (ELL) as output is the airphoto math model, with which the datum is controlled by the input exterior orientation.

      Math model    
Output datum RPC Toutin Airphoto SAR
MSL  
ELL  

After AUTODEM finishes processing you can, if necessary, convert elevation values between MSL and ELL by running the DEMZREF algorithm. For more information, follow the link to DEMZREF under Related functions.

AUTODEM generates a report depicting the elevation sensitivity to parallax, allocated memory, and the individual strip elevations and dimensions. The parallax sensitivity corresponds roughly to the RMS error of elevations extracted from well-matching pixels, although larger localized errors are common.

Back to top

Example

Generate the DEM for all the files that fall into the e*.pix format and generate a geocoded DEM output file named GEOCODED_DEM.PIX.

Pairs of files are chosen according to the base portion of the filenames. Each file is either a left-epipolar image or a right-epipolar image; this is determined by first two characters in the filename: el or er.

Each pair generates a separate output DEM, which is named automatically with the base portion of the filename, prefixed by dem_.

EASI>MFILE = "e*.pix"                   ! Process all PIX files with prefix 'e'
EASI>DBIC = 1                           ! Use segment 1
EASI>DBIW = 1000,1000,3000, 3000        ! Offset is 1000 and size is 3000
EASI>MINMAXEL = 100, 300                ! Limit DEM-extraction range to 100 - 300
EASI>FAILVALU = -100                    ! If DEM cannot be extracted, use elevation value of -100
EASI>BACKELEV = -150                    ! Use background value of -150
EASI>DEMDET = "HIGH"                    ! Continue the process until correlation is
                                           ! performed on images at full-resolution
EASI>TERTYPE = "HILLY"                  ! terrain is hilly
EASI>DATATYPE = "16s"                   ! Output DEM channel in 16S type
EASI>EXTINTER = 4                       ! Sampling interval is 4
EASI>DEMEDIT = "YES"                    ! Fill all the holes, if any
EASI>SCORCHAN = "YES"                   ! Create score channel
EASI>WALLIS = "NO"                   ! Do not apply Wallis filter
EASI>TFILE = "EPIPOLAR_DEM_OUTPUT.txt"  ! Output text file name
EASI>OUTIDIR =		! Use current working folder
EASI>FILEDEM = "GEOCODED_DEM.pix"       ! Output DEM file name
EASI>DEMCLIP = "10%,10%"                ! Clip 10 percent from all edges before geocoding
EASI>MAPUNITS = "UTM 11 D0"             ! Output DEM file mapunit
EASI>UPLEFT =                           ! Upper-left coordinate of the geocoded DEM
EASI>LORIGHT =                          ! Lower-right coordinate of the geocoded DEM
EASI>PXSZOUT = 1.2, 1.2                 ! Pixel/line resolution is 1.2 meters
EASI>MERGEOPT = "LAST"                  ! Use last value to replace the pixel values in the overlap area

EASI>run AUTODEM
Back to top

References

Frankot, R. F., S. Hensley and S. Shafer, 1994. "Noise resistant estimation techniques for SAR image registration and stereo matching". IGARSS, California Institute of Technology, Pasadena, CA, 3 pp.

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