Procedure to search in input directory for images and create a GPS file for image stitching software to use. The resulting GPS file will be created in the directory specified by INPUTDIR
and the exact file name will be images.gps
.
Note that this procedure will look for roll, pitch, and yaw in the image exif metadata and it will be set to all 0’s if not present. Below are a few examples of how you can use this routine to process data.
This first example illustrates how to create a GPS file from a single directory of MicaSense imagery:
inputdir = 'C:\Users\username\images' generate_gps_file,$ INPUTDIR = inputdir,$ FILE_IDENTIFIERS = ['_1.tif', '_2.tif', '_3.tif', '_5.tif', '_4.tif']
This second example is what is used in the BandAlignmentTask
to procedurally generate a GPS file and place it in the location specified by OUTPUTDIR
. The images found in OUTPUTDIR
will be compared against all of the images found in INPUTDIR
. Doing this eliminates any chance that a GPS file will have an image listed that has not actually been processed. This example is working with Parrot Sequoia data:
inputdir = 'C:\Users\Traininglead\Desktop\tradeshowData\sequoia\data' outputdir = inputdir + '_out' generate_gps_file,$ INPUTDIR = flightdir,$ FILE_IDENTIFIERS = ['_GRE.TIF', '_RED.TIF', '_REG.TIF', '_NIR.TIF'],$ OUTPUTDIR = flightdir + '_out'
generate_gps_file, FILE_IDENTIFIERS = stringarr, [ ORIENTATION = int ]
INPUTDIR : in, type=string This required input is the directory that will be searched for images.
in, required, type=stringarr
Specify the unique file idetifiers that represent the seeparate files that belog to a single image group for processing. Some examples of what this looks like can be found above.
in, optional, type=int
This optional keyword represents the orientation of the camera on the UAV. This parameter is used by OneButton and you can learn more information about the different camera orientations by reading the OneButton user manual.
If you know this parameter, then setting it correctly will improve the image registration process because the images will be that much closer to their actual location. TPUTDIR : in, optional, type=string Specify this keyword to the location of the multi-page TIFFs of the band-stacked versions of the images in INPUTDIR
. This will make the procedure search for corresponding files between INPUTDIR
and OUTPUTDIR for the GPS file creation. This will also make the GPS file be created in the directory specified by OUTPUTDIR.
Zachary Norman - Github: znorman-harris
Copyright © 2019 Harris Geospatial Solutions, Inc.
Licensed under MIT. See LICENSE.txt for additional details and information.