>  Docs Center  >  ENVI API  >  Processing  >  ENVIGenerateGCPsFromReferenceImageTask

ENVIGenerateGCPsFromReferenceImageTask

ENVIGenerateGCPsFromReferenceImageTask

This task generates ground control points (GCPs) for an input raster by matching and using the geographic coordinates of a reference image. The elevation values of GCPs are calculated from a DEM raster. The input raster must have an RPC spatial reference.

You can use the resulting GCPs in ENVI applications such as RPC Orthorectification, Image-to-Map Registration, DEM Extraction, and Rigorous Orthorectification.

Note: Use ENVIRPCOrthorectificationUsingReferenceImageTask to generate GCPs and to perform refined RPC Orthorectification in one step.

Example


This example uses sample images from the RPC Orthorectification tutorial. Tutorial files are available from our website. On the ENVI Tutorials page, click the link to "ENVI Tutorial Data" to download all tutorial data. Files for this tutorial are in the rpc_ortho directory. Copy the files to your local drive, then change the paths in the code example to match the locations of the files on disk.

; Start the application
e = ENVI()
 
; Open the input raster
inputFile = 'OrbViewSubset.dat'
inputRaster = e.OpenRaster(inputFile)
 
; For a reference image, use NAIP 
; orthorectified dataset with one-meter 
; ground sample distance
referenceFile = 'NAIPReferenceImage.dat'
referenceRaster = e.OpenRaster(referenceFile)
 
; For DEM, use NED 1/9-arc second resolution
DEMFile = 'DEM.dat'
DEMRaster = e.OpenRaster(DEMFile)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('GenerateGCPsFromReferenceImage')
 
; Define inputs
Task.INPUT_RASTER = inputRaster
Task.INPUT_REFERENCE_RASTER = referenceRaster
Task.INPUT_DEM_RASTER = DEMRaster
 
; Run the task
Task.Execute
 
; Print the list of auto-generated GCPs
Print, Task.OUTPUT_GCPS

The GCPs are written to a .pts file in your system's temporary directory.

Syntax


Result = ENVITask('GenerateGCPsFromReferenceImage')

Input properties (Set, Get): DEM_IS_HEIGHT_ABOVE_ELLIPSOID, INPUT_DEM_RASTER, INPUT_RASTER, INPUT_REFERENCE_RASTER, OUTPUT_GCPS_URI, REQUESTED_NUMBER_OF_GCPS, SEARCH_WINDOW

Output properties (Get only): OUTPUT_GCPS

Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.

Methods


This task inherits the following methods from ENVITask:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

DEM_IS_HEIGHT_ABOVE_ELLIPSOID (optional)

Set this property to true if the DEM is already expressed as the height above the ellipsoid and no geoid correction is required. Most DEM data contain orthometric heights, which are elevations above mean sea level (for example, GMTED2010 or National Elevation Dataset, NED). In these cases, keep the default selection of false.

INPUT_DEM_RASTER (required)

Specify a digital elevation model (DEM) raster. The elevation values of GCPs are calculated using the DEM raster. If you do not have a DEM file readily available, you can use the Global Multi-resolution Terrain Elevation Data 2010 (GMTED2010) DEM named GMTED2010.jp2 that is provided with your ENVI installation under the Harris\ENVIxx\Data folder. The GMTED2010 dataset has a mean resolution of 30 arc seconds. A 7.5-arc second version is also available from our website. For best results, you should use a DEM raster with a higher resolution than GMTED2010. Many DEM products are available from the U.S. Geological Survey National Map and Download Platform or EarthExplorer.

INPUT_RASTER (required)

Specify a raster on which to generate GCPs.

INPUT_REFERENCE_RASTER (required)

Specify a reference image from which to match and find the geographic coordinates of the GCPs. The reference raster should be a true orthorectified image with the same or slightly higher spatial resolution than the input raster. Try to choose a reference image that is close to the year and season of the input raster. Automatic GCP generation is based on image matching between the reference image and source image, so the scene contents should not be vastly different. Automatic GCP generation is more robust if the reference image and input image have similar resolution. If the reference image has a much higher resolution than the input image (i.e., the ratio is greater than 2.5), consider down-sampling the reference image first.

OUTPUT_GCPS

This is a reference to the output ENVIGCPSet associated with the input raster.

OUTPUT_GCPS_URI (optional)

Specify a string with the fully qualified path and filename for OUTPUT_GCPS.

REQUESTED_NUMBER_OF_GCPS (optional)

Specify the requested number of GCPs. The default value is 25. After ENVI generates and filters tie points (used to create GCPs) for radiometric and geometric criteria, the actual number of generated GCPs may be less than requested.

SEARCH_WINDOW (optional)

Specify the search window size. Increase the value if there is a big misalignment between the input raster and the reference raster.

Version History


ENVI 5.3, Service Pack 1

Introduced

ENVI 5.4, Service Pack 2

Added the SEARCH_WINDOW property

API Version


3.3

See Also


ENVITask, ENVITask::Parameter, ENVIGenerateGCPsFromTiePointsTask, ENVIRPCOrthorectificationUsingReferenceImageTask, ENVIGCPSet, ENVITiePointSet, ENVIRPCOrthorectificationTask



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us