KH-9 pre-processing steps

There are a number of necessary pre-processing steps when working with KH-9 imagery. Distortions in the film, caused by storage and other conditions, must be corrected to be able to accurately process the images. After resampling, it is also possible to remove the Reseau marks from the images, in order to improve the final results. Finally, because of the size of the film (approx. 9”x18”), the images are scanned in two halves that must be joined together. And finally, it can also be helpful to improve contrast in the images, in order to help improve the final results.

reseau field

To help correct some of the distortion in the images caused by film storage, spymicmac.image() includes a routine to automatically find the Reseau markers in the image and use their locations to resample the images using ReSampFid. In the images below, you can see the difference between the expected location of each Reseau marker and the automatically detected locations:

a KH-9 image with the Reseau field warping shown a KH-9 image with the Reseau field warping shown

To run the routine, use either spymicmac.image.find_reseau_grid() or find_reseau_grid. This will produce a MeasuresIm file that will be read by ReSampFid.

Note

Before running ReSampFid, you will also need to run generate_micmac_measures in order to generate the MeasuresCamera.xml file needed.

cross removal

Once you have found the Reseau marks in each image half, you can “remove” the Reseau marks using either spymicmac.image.remove_crosses() or remove_crosses.

an image showing a Reseau mark on the left, and the Reseau mark erased on the right.

After this step, you can use resample_hexagon.sh, or call mm3d ReSampFid directly, to re-sample the images before joining the two halves together.

image joining

Because of the large size of the film, USGS scans the images in two halves with a small amount of overlap, as shown in the example below.

../../_images/half_a.png ../../_images/half_b.png

In spymicmac, the function to join the images is spymicmac.image.join_hexagon(). Normally, the scans are labelled ‘a’ and ‘b’, with ‘a’ corresponding to the left-hand scan, and ‘b’ corresponding to the right-hand scan. This is what spymicmac.image.join_hexagon() is expecting - that the overlap between the two halves is the right-hand side of image ‘a’, and the left-hand side of image ‘b’.

Once the images have been re-sampled using resample_hexagon.sh, the border will be removed, and the images will overlap by 2 mm:

../../_images/resamp_half_a.png ../../_images/resamp_half_b.png

After calling spymicmac.image.join_hexagon(), the image should look something like this:

a re-sampled and joined KH-9 image showing Hofsjökull, Iceland

As there is sometimes a difference in brightness between the two halves, spymicmac.image.join_hexagon() has the option to blend the two halves over the overlap by averaging the values from the two halves, starting from 100% of the value of image ‘a’, linearly increasing to 100% of the value of image ‘b’ at the end of the overlapping part.

contrast enhancement

Most of the scanned KH-9 images provided by USGS do not have issues with striping. However, they can still be low contrast, and it can help to use either of spymicmac.image.stretch_image() or spymicmac.image.contrast_enhance() for this. For examples of these functions applied to a historical aerial image, see contrast enhancement.