Catalyst.earth Logo
Catalyst.earth Logo

Historical Airphoto Processing (HAP)

This tutorial outlines how to process historical airphoto data in CATALYST Professional. Historical data can be used to create high-quality ortho-mosaics and elevation models using stereo overlap in the data. The CATALYST Historical Airphoto Processing (HAP) workflow enables users to convert historical imagery into a GIS-ready layer to perform further analysis, such as change detection and feature extraction.

Tutorial data:
The tutorial uses historical data over Saint John, New Brunswick, Canada, from 1967. You can download this data here: HAP_Tutorial

More information on each of the steps that are run in this tutorial is included in the CATALYST Professional Help documentation: https://catalyst.earth/customer-center/professional-help-docs/

1. Data Overview

The tutorial data package has the following folder structure:

  • Images
  • Metadata
  • Reference
  • Scripts
1.1. Images

Details on the images:

  • 18 images, from 3 overlapping flight lines
  • NAD83 Double Stereographic – converted to UTM for the tutorial
  • 60% forward overlap; 40% side overlap
    • Good amount of overlap to achieve a robust ortho-mosaic and elevation model from the stereo data.
1.2. Helpful Resources

PDF HAP Guide - C:\PCI Geomatics\CATALYST Professional\manuals\hap.pdf
HAP Udemy Course - https://www.udemy.com/course/historical-airphoto-processing-hap-with-pci-geomatics/
HAP Flow Charts - HAP_Flowcharts

2. Image Preparation And Getting Started

2.1. Setting up metadata

You must ensure that your metadata file contains at least the fields listed below to execute the HAP process.

  • Image basename
  • Focal length of camera
  • Dimensions of physical photo (height, width)
  • Flight altitude or scale
  • Scene-center coordinates (latitude, longitude)

The flying altitude can be calculated from any of the following combinations of information if it's not available.
[Focal length, paper length, image ground length] OR [Focal length, image scale]

You can find a template and sample of the metadata in the CATALYST Professional install folder:
C:\PCI Geomatics\CATALYST Professional\etc\HAP_Metadata_Example.txt
C:\PCI Geomatics\CATALYST Professional\etc\HAP_Condensed_Metadata_Example.txt

The metadata file is 43 columns of tab-delimited text (.txt). Of the fields in the file, the following must contain information you specify:

Metadata FieldDetails
Roll number Photo number or Image basenameThe Roll number Photo number or image basename must be identical to the corresponding file name on disk; however, do not include the file name extension in the metadata.
Focal length of camera
(FOCAL_LENS)
Focal length of the camera in millimetres.
Dimensions of physical photo
(HEIGHT_mm & WIDTH_mm)
The dimensions (height and width) of the physical printed photo in millimetres. Alternatively, if you are working with film, the dimensions of the photo frame on the physical roll of film.
Flight altitude or scale
(ALTITUDE / SCALE)
Approximate altitude of flight in feet.
If both fields are provided, HAP uses the flight altitude by default.
If you do not know the altitude, you can enter a value for SCALE and enter ALTITUDE as NULL.
When you enter only the scale, the altitude is calculated by HAP. Conversely, when you enter only the altitude, the scale is calculated by HAP. When you enter both, only the altitude is read by HAP.
Scene-center coordinates
(CENTER_LATITUDE & CENTER_LONGITUDE)
Must be provided in longitude and latitude (decimal degrees).
The coordinates must be referenced to the WGS84 datum (D000). If the coordinates are not referenced in the WGS84 datum, you must apply a datum shift to the points.
West and south coordinates must be accompanied by a negative sign (−)
2.2. Ingesting airphotos

To ingest the imagery:

  1. Open Historical Airphoto Processing from the CATALYST toolbar.
  2. In the HAP window, click Ingest.
  3. In the Raw images folder field, enter the path to the project's images folder
  4. In the Raw images metadata field, enter the path to the project's metadata file
  5. Leave the Fiducial options as corner
  6. Enter the path to the top folder as the Ingested images output folder
  7. Click Run
HAP Ingest fields

In OrthoEngine, load the created fid.prj project (found in Ingest folder), and open up the Project Overview window. Load the data to verify the scale and rotation of the images. Images can be rotated using the rotate icon in the tool. You can also change the image orientation in OrthoEngine by clicking Tools > Collection Viewer > North up.

2.3. Collecting fiducial points

Data Ingest & Fiducial Collection Flow Chart: 1_HAP_Workflow_Ingest

    To collect Fiducial Points

    1. Open up the OrthoEngine project (fid.prj) created in the Ingest folder
    2. In the Project processing step, select Set output and GCP projection:
    3. Change the output pixel and line spacing to 40 cm
      Output and GCP projection settings
    4. Change the Processing step to Data Input
    5. Select Collect fiducial info and open up the first image
    6. Locate the fiducial on the image and mark them:
      • Click the rough centre of the fiducial and click set on the appropriate corner in the Fiducial Mark Collection... window
        fiducial point marking
    7. Click Auto Fiducial Collection
      • Check off the Use Threshold field and specify 3 pixels as the Error Threshold
    8. Click Run
    9. Open up the fiducial.rpt file found in the ingest folder, and review the fiducials
      • If an image is missing a fiducial, open it and manually set the fiducial.
    10. Save the OrthoEngine project.

    2.4. Nominal georeferencing

    Nominal Georeferencing Flow Chart: 2_HAP_Workflow_Nominal_GeoRef

    This step is optional as it just allows the images to be viewed and aligned geographically in Focus. This view is also available in the Project Overview window in OrthoEngine

    1. In the HAP window, select Nominal georeferencing
    2. Specify the fiducial project made in the previous section
    3. Enter the DEM found in the Reference folder as the Reference DTM
    4. Create a folder in the project directory for the nominal georeferencing output.
    5. Click Run

    3. GCP/TP Collection

    GCP & TP Collection Flow Chart: 3_HAP_Workflow_Nominal_ManualGCPs

    3.1 GCP Collection

    Ground Control Points (GCPs) are essential for improving the accuracy of aerial imagery and helping to georeference aerial imagery. They serve as fixed reference locations with ground coordinates, anchoring and aligning the images to real-world positions. You want to ensure you collect as many GCPs as possible, as this helps increase the georeferencing accuracy.

    1. In OrthoEngine, open the fiducial project
    2. Navigate to the GCP/TP Collection processing step and select Display project overview
    3. Locate the corner images (top-left: 67009-88, top-right: 67009-92, bottom-right: 67009-24, bottom-left: 67009-19). These will be the images in which you collect the GCPs
    4. Select Collect GCPs manually in OrthoEngine
    5. Choose Geocoded image as the ground control source
    6. Enter the path to the reference image in the Filename field
      • Choose all 3 bands
      • Click Load & close
    7. Add the DEM file to its corresponding field
      GCP Collection window
    8. On the image window, select and open the image(s) from which you want to collect GCPs (e.g the corner images noted earlier)
    9. Locate corresponding points on the reference image to use as a GCP
      • Click the point on the images and click Use Point on both windows
      • On the GCP collection window, click Extract Elevation, and then Accept
      • Repeat for each GCP and image
    10. Once you have collected the GCPs, save the OrthoEngine project and close the open windows
    3.2 TP Collection

    Tie Points (TPs), similar to GCPs, also help improve the model. However, in this case, they align the images to themselves by identifying a reference point between them. They can be used to apply GCPs to areas where there are none

    1. In the GCP/TP Collection processing step, select Automatically collect tie points
    2. Choose FFTP: Fast Fourier Transform Phase as the Matching method. This method is best suited for HAP data and is one of our newer TP collection algorithms. You can learn more about the methods in the automatic tie points help document.
    3. Select DEM as the Input elevation parameter and navigate to the project's reference DEM
    4. Select Collect Tie Points
    tp collection

    4. Coarse Alignment

    Coarse & Fine Alignment Flow Chart: 4_HAP_Workflow_Coarse_Fine_Align

    The alignment steps are done to align the imagery with the reference data. To improve the model, coarse alignment can be run multiple times.

    1. In the HAP window, open up the Alignment panel
    2. Set the parameters as follows:
      • Alignment type = Coarse alignment
      • Input data folder = path to the ingest folder
      • Reference DTM = path to DEM file in the reference folder
      • Reference file = path to the reference image in the reference folder
      • Output data folder = path to Coarse alignment folder (you will need to create this folder)
    3. Click Run
    4.1 Inspecting coarse alignment and GCP model

    Once the coarse alignment is completed, the quality of the alignment needs to be assessed by looking at the GCP residuals

    1. Load the coarse alignment project into OrthoEngine (coarse alignment folder > stage1 > stage1Auto.prj
    2. With the GCP/TP Collection processing step open, select Residual report and compute the model
    3. Navigate to the Raw Image Summary Table in View
      • If the State of the images says 'Offline', you will need to change the directory of the images (Tools > Rename/Remove Images > Change Directory)
    4. Remove any poor GCPs with RMS above 20 pixels and high residuals
    5. Recompute the model
    6. To ensure a good distribution of GCPs/TPs across the images, open the Project Overview, select all the images, and display GCPs/TPs.
    7. Save the project
    bad gcp example
    Examples of some bad GCP residuals
    gcp distribution example
    Sample GCP distribution

    5. Fine alignment

    This is the final alignment step done to tighten up the match model prior to generating the DEMs and ortho images.

    1. In the HAP window, open up the Alignment panel
    2. Set the parameters as follows:
      • Alignment type = Fine alignment
      • Input data folder = path to the coarse alignment folder
      • Reference DTM = path to DEM file in the reference folder
      • Reference file = path to the reference image in the reference folder
      • GCPs collection Strategy > Search radius value = 100
      • GCPs collection Strategy > X max. error = 50
      • GCPs collection Strategy > Y max. error = 50
      • TPs collection Strategy > Search radius value = 100
      • TPs collection Strategy > X max. error = 50
      • TPs collection Strategy > Y max. error = 50
      • Output data folder = path to Coarse alignment folder
    3. Click Run
    5.1 Inspecting fine alignment and GCP model

    Here, you want to follow a similar procedure as in Section 4.1:

    1. Load the fine alignment project into OrthoEngine (coarse alignment folder > stage2 > stage2Auto.prj
    2. With the GCP/TP Collection processing step open, select Residual report and compute the model
    3. Open up the project overview and review the GCP and TP distribution
    4. Navigate to the Residual report
    5. For GCPs:
      • Under Automatic Point Selection, set the Points by residual to 100
      • Set the Maximum percent of points/image to 10
      • Use 10 as the lowest selectable residual
      • Click Select
      • Change the selection to Check Points in the dropdown underneath
    6. For TPs
      • Under Automatic Point Selection, set the Points by residual to 100
      • Set the Maximum percent of points/image to 10
      • Use 1 as the lowest selectable residual
      • Click Select and then Delete Point
    7. This should improve the project RMS
    8. If you wish to improve the accuracy to make higher-quality elevation models, you can continue fine-tuning the model
    9. Save the project and perform fine alignment again using the same parameters as earlier
    10. Load the new fine alignment project into OrthoEngine (coarse alignment folder > stage3 > stage3Auto.prj
    11. Fine-tune the GCPs once more. You can do this by deleting the points with residuals over 15 or repeating steps 5 and 6

    6. Generating Digital Elevation Model

    DEM Extraction Flow Chart: 5_HAP_Workflow_DEM_Generation

    1. With stage3Auto.prj still loaded in OrthoEngine, change the processing step to DEM From Stereo and select Create Epipolar Image
    2. Click Add Epipolar Pairs To Table and then Generate Pairs
      generate epipolar inputs
    3. Back in OrthoEngine, open the Automatic DEM Extraction window
    4. Select all the stereo pairs
    5. Under Geocoded DEM, check the Create Geocoded DEM box
    6. Enter the output filename within the stage folder (<coarse_alignment folder>\stage3\DSM.pix) and Extract DEM
    7. If you wish, you can perform any DEM editing on the result to correct any errors from the model (to create a DTM from the DSM)

    7. Generating Ortho Images

    Ortho & Mosaic Generation Flow Chart: 6_HAP_Workflow_OrthoGeneration_And_Mosaic

    1. Change the processing step to Ortho Generation and select Schedule Ortho Generation
    2. Select all images and move them to the Images to Process pane
    3. Create an ortho folder and use it as the location for the new file. Then double-click on one of the images in the Images To Process pane - the generated orthos will all now point to the folder
    4. Under Ortho Generation Options, select DEM file and put in the DTM that was created earlier
    5. Click Generate Orthos
    6. Load the orthos into Focus and ensure everything looks good

    8. Generating Mosaic

    1. Change the processing step to Mosaic and open the tool
    2. In the wizard, ensure all the images are in the source file list and click Next
    3. Define the output mosaic file
    4. Generate a mosaic preview and perform any necessary colour-balancing
    5. Finally, click Generate Mosaic

    Alternatively, you can do this using Python:

    1. Open mosprep.py (found in the Scripts folder) in an IDE and edit the parameters appropriately - see the MOSPREP help document
    2. Once you have all the parameters set, save and run the script
    3. Once the script has run and created the .XML file in your mosaic output folder,
    4. Close the OrthoEngine windows, open the Mosaic Tool and drag in the .XML file
    5. Review the images and perform any colour-balancing or cutline editing as needed
    6. Open mosdef.py and edit the parameters appropriately - see the MOSDEF help document
    7. Save and run the script
    8. Finally, open mosrun.py, edit the parameters (see the MOSRUN help document), save and run the script to create the mosaic
    9. Open the resulting mosaic and review it against the reference image and other reference files
    envelopephone-handsetcross