Hexagon Geospatial
MENU

Spatial Modeler Tutorials

Learn more about our products, find answers, get the latest updates, and connect with other Hexagon Geospatial product users, or get support from our professional service team.
Showing results for 
Search instead for 
Do you mean 

Orthorectify using Ground Control Points (GCPs)

by Technical Evangelist 2 weeks ago - edited 2 weeks ago (87 Views)

Download model (and sample data)

 

planetek_logo.png

Description:

This model can orthorectify images using Ground Control Points (GCPs) and the RPC sensor model supported by ERDAS IMAGINE. The output of the process is an orthorectified image.

 

Orthorectification is defined using a set of input Ground Control Points (GCPs), provided in JSON format, that are used to fine-tune the existing RPC model provided with the input data. 

 

This model was built by Planetek Italia, in collaboration with Hexagon Geospatial, for the 3DIMINT (Multisource 3D Imagery Intelligence) project. It was built using ERDAS IMAGINE and then published and executed in web applications built using M.App X and M.App Enterprise.  

 

The aim of the 3D IMINT project was to study, design, implement and test a computer system able to support the targeting activities of the Italian FFAA.  One of the key elements that characterized the 3D IMINT research project is to derive Ground Control Points (GCPs) from Satellite radar data (without using in situ measurements) in order to populate a global catalog of GCPs able to increase the geometric accuracy of geospatial information and, consequently, to improve the military operations accuracy.

 

The basic model is provided here as an example of how to use GCPs to orthorectify imagery using Spatial Modeler. 

 

Similar Spatial Models are deployed as Geoprocessing Services in Hexagon Geospatial's M.App X browser-based image exploitaiton product.

 

ortho_gcp_v16_5_0.gmdx
Ortho_GCP_Model.PNG
 
Read (Transformation) Model sub-model
Ortho_GCP_Sub_Model.PNG

 

Data Requirements (and Assumptions): 

 

  1. An input image with associated RPC information, such as most NITF data, or commercial satellite data from DigitalGobe and Airbus. 
  2. Ground Control Points (image file column / row coordinates with corresponding ground x, y, z coordinates) should be provided in JSON format. Please refer to the documentation on the Data Triangulation operator for details on how the JSON file should be structured. An example file (GCP_test_lapaz_05jun.json) is also bundled with the Spatial Model download zip file and is also shown below.
  3. It is assumed that the GCP JSON file will be created programmatically by some other custom program. If the points were being created in applications such as the ERDAS IMAGINE GCP Editor or AutoSync you might as well go ahead and perform the orthorectification there as well. 
  4. RPCs are generally associated with a Geographic Lat/Lon coordinate system and so this Spatial Model assumes that GCP ground coordinates are also provide in Lat/Lon. The output orthoimage will therefore be referenced to Geographic Lat/Lon. The Spatial Model could be easily modified to produce orthoimages in other coordinate systems by combining elements from Spatial Models such as https://community.hexagongeospatial.com/t5/Spatial-Modeler-Tutorials/Geodetic-Reprojection-of-Raster...
  5. The Triangulation Parameters Input File is another JSON file which provides parameters to control the Triangulation process. Again, the required structure is defined in the Data Triangulation operator Help. Unlike the GCP JSON file these parameters are not necessarily input image specific and so a single file could be re-used for similar orthorectification tasks (or the Spatial Model could be modified to provide user-input of these values or to hardcode them on the Data Triangulation operator). A sample file (triangulation_parameters_same_weighted_values.json) is bundled with the Spatial Model download zip file and is also shown below.

 

Input parameters: 

 

Input Image Filename: the filename of the image to be orthorectified

Input RPC Filename: This port allows the user to define the name of the RPC file associated with the Input Image; If the Input Image is a NITF (or similar format) with RPC information embedded then this field can be left blank and the associated information will be automatically discovered. If the PRC is an external file (such as a *.RPB) it should be selected here.

Sensor Name: A text string for the RPC sensor model name.

Input DEM (Optional): this port allows the user to define the raster Digital Elevation Model to use for the orthorectification process. The file is optional - if no DEM is provided a flat plane will be used for the correction process.

DEM Elevation Units: Specify Units used for the Height values in the Input DEM. If the raster DEM itself provides the elevation units, this port can be left empty.

Input GCPs in JSON format: Name of an input JSON file which contains ground coordinates and image coordinates of the control points. The ground coordinates of the GCPs present in the JSON are referenced in Geographic (Lat / Lon) using WGS 84 as the horizontal and vertical datum, degrees as the horizontal units.

Triangulation Parameters Input File: Name of an input JSON file containing parameters to control the Triangulation process

Orthoimage Output Filename: Name of the output orthorectifed image. This is required even if Previewing since the Triangulation process will produce necessary text files in the specified directory. These files are required to perform the geometric transformation in the Orthorectify operator.

 

 

ortho_gcp_run.png

   

JSON Examples: 

 

Example JSON GCP file (GCP_test_lapaz_05jun.json) with 3 GCPs

 

{

   "Type" : "IMAGINE.Dictionary",

   "Value" : [

      {

         "Key" : "GroundPointList",

         "Value" : {

            "Type" : "IMAGINE.FeatureSet",

            "Value" : {

               "type" : "FeatureCollection",

               "features" : [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-68.21100172,  -16.51294821, 3998.00]}, "properties": {"Description": "Generated by APM", "GroundID": 1, "PointType": "Full", "PointUsage": "Control", "StandardDeviationX": 0.776642, "StandardDeviationY": 0.776642, "StandardDeviationZ": 2.0}},{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-68.06671425, -16.47868875, 3756.00]}, "properties": {"Description": "Generated by APM", "GroundID": 4, "PointType": "Full", "PointUsage": "Control", "StandardDeviationX": 0.776642, "StandardDeviationY": 0.776642, "StandardDeviationZ": 2.0}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-68.13977144, -16.60531331, 3787.00]}, "properties": {"Description": "Generated by APM", "GroundID": 5, "PointType": "Full", "PointUsage": "Control", "StandardDeviationX": 0.776642, "StandardDeviationY": 0.776642, "StandardDeviationZ": 2.0}}],

               "attributeInfo" : {

                  "attributes" : [

                     {

                        "name" : "GroundID",

                        "type" : "long"

                     },

                     {

                        "length" : 20,

                        "name" : "Description",

                        "type" : "string"

                     },

                     {

                        "length" : 12,

                        "name" : "PointType",

                        "type" : "string"

                     },

                     {

                        "length" : 9,

                        "name" : "PointUsage",

                        "type" : "string"

                     },

                     {

                        "name" : "StandardDeviationX",

                        "type" : "float"

                     },

                     {

                        "name" : "StandardDeviationY",

                        "type" : "float"

                     },

                     {

                        "name" : "StandardDeviationZ",

                        "type" : "float"

                     }

                  ]

               },

               "crs" : {

                  "type" : "GeoKey Moniker",

                  "properties" : {

                     "code" : "1,1,0,9/1024,2/2048,32767/2050,6326/2062,0.0,0.0,0.0,0.0,0.0,0.0,0.0/4096,32767/4098,32767/4099,9001/61440,http%3a%2f%2fwww.intergraph.com~/62472,101~"

                  }

               },

               "geometryInfo" : {

                  "geometryType" : 0,

                  "numDimensions" : 3,

                  "coordinateReferenceSystemID" : {

                     "type" : "GeoKey Moniker",

                     "properties" : {

                        "code" : "1,1,0,9/1024,2/2048,32767/2050,6326/2062,0.0,0.0,0.0,0.0,0.0,0.0,0.0/4096,32767/4098,32767/4099,9001/61440,http%3a%2f%2fwww.intergraph.com~/62472,101~"

                     }

                  }

               }

            }

         }

      },

      {   "Key" : "ImageNameList",

         "Value" : {

            "Type" : "IMAGINE.FeatureSet",

            "Value" : {

               "type" : "FeatureCollection",

               "features" : [

                  {

                     "geometry" : "null",

                     "type" : "Feature",

                     "properties" : {

                        "ImageID" : 1,

                        "ImageName" : "H:/Demo Data/LaPaz/Images/05JUN11150241-P1BS-005519673030_01_P001.NTF"

                                         }

                  }

               ],

               "attributeInfo" : {

                  "attributes" : [

                     {

                        "name" : "ImageID",

                        "type" : "long"

                     },

                     {

                        "length" : 70,

                        "name" : "ImageName",

                        "type" : "string"

                     }

                  ]

               }

            }

         }

      },

      {

         "Key" : "ImagePointList",

         "Value" : {

            "Type" : "IMAGINE.FeatureSet",

            "Value" : {

               "type" : "FeatureCollection",

               "features" : [{"geometry": "null", "type": "Feature", "properties": {"GroundID": 1, "ImageID": 1, "ImageX": 633.737, "ImageY": 10788.309}},{"geometry": "null", "type": "Feature", "properties": {"GroundID": 4, "ImageID": 1, "ImageX": 25677.768, "ImageY": 4860.189}}, {"geometry": "null", "type": "Feature", "properties": {"GroundID": 5, "ImageID": 1, "ImageX": 12966.646, "ImageY": 27076.654}}],

               "attributeInfo" : {

                  "attributes" : [

                     {

                        "name" : "GroundID",

                        "type" : "long"

                     },

                     {

                        "name" : "ImageID",

                        "type" : "long"

                     },

                     {

                        "name" : "ImageX",

                        "type" : "double"

                     },

                     {

                        "name" : "ImageY",

                        "type" : "double"

                     }

                  ]

               }

            }

         }

      }

   ]

}

 

 

 

 

Example Triangulation Parameters Input File in JSON (triangulation_parameters_same_weighted_values.json)

 

{

     "Type": "IMAGINE.Dictionary",

     "Value": [{

                "Key": "PolynomialOrder",

                "Value": {

                     "Type": "IMAGINE.Int",

                     "Value": 0,

                     "Version": ""

                }

           },

           {

                "Key": "NumberOfIterations",

                "Value": {

                     "Type": "IMAGINE.Int",

                     "Value": 10,

                     "Version": ""

                }

           },

           {

                "Key": "GroundConvergenceValue",

                "Value": {

                     "Type": "IMAGINE.Double",

                     "Value": 1.0000000000000000e-004,

                     "Version": ""

                }

           },

           {

                "Key": "GroundControlValueType",

                "Value": {

                     "Type": "IMAGINE.String",

                     "Value": "Same weighted values",

                     "Version": ""

                }

           },

           {

                "Key": "StandardDeviationX",

                "Value": {

                     "Type": "IMAGINE.Double",

                     "Value": 1.0000000000000000e+000,

                     "Version": ""

                }

           },

           {

                "Key": "StandardDeviationY",

                "Value": {

                     "Type": "IMAGINE.Double",

                     "Value": 1.0000000000000000e+000,

                     "Version": ""

                }

           },

           {

                "Key": "StandardDeviationZ",

                "Value": {

                     "Type": "IMAGINE.Double",

                     "Value": 1.0000000000000000e+000,

                     "Version": ""

                }

           }

     ]

}

 

Courses
Contributors