Skip to content

3. Script Descriptions: B_gcpSelection

burritobrittany edited this page Jul 17, 2020 · 8 revisions
  • B_gcpSelection

    • Description:

    This function initializes the GCP structure for a given camera. The user will load a distorted image, click on GCPs, and the function will save the distorted UVd coordinates and image metadata for a given camera.

    How to use clicking mechanism: The user can zoom and move the image how they please and then hit 'Enter' to begin clicking mode. A left click will select a point, a right click will delete the nearest point to the click. After a left click, the user will be asked to enter a GCP number to identify the GCP in the command window. The user can then zoom again until hitting enter to select the next point. To end the collection, hit enter to enter clicking mode (the cross hairs) and click below the image where it says 'Click Here to End Collection.' Be sure to be zoomed out completely when ending a collection. The user can click GCPs in any order they would like.

    For the uasDemoData, the first image is has been modified to provide GCP suggestions. Users should click on targets and provide the same numbering to work with the rest of the demonstration workflow. Figure 2 shows what the final window for the uasDemoData progression should be.


Figure 2: Example GCP click window with specified GCP numbers in B_gcpSelection for uasDemoData

    This function is to be run second in the progression for each camera in a multi-camera fixed station or UAS flight (or if a recording mode was changed midflight). GCP calibration should occur any time a camera has moved for a fixed station, the first frame in a new UAS collect, or intrinsics have changed.
    • Input:

    Input is entered by user into the script in Sections 1 and 2. Users will then enter information by clicking GCPs and entering an identifying number in the command window.

    Section 1: Saving Information

    Variable Description
    oname Output string for the basename for the GCP mat files to be saved under.
    odir Output filepath where the GCP mat file will be saved.

    Section 2: GCP Image

    Variable Description
    imagePath Filepath of the saved image for clicking. For UAS processing this should be the first image of the collection. For fixed station, it should be any frame where GCPs are visible.
    • Output:

    A .mat file saved as oname_gcpUVdInitial.mat in odir. Will contain following variables.

Variable Description
gcp A structure with each entry corresponding to a GCP. Note, the index entry in the structure may not correspond with the GCP identifying number. Fields of structure are:
UVd [1 x 2] Vector of distorted Image coordinates of GCP
num Identifying GCP number entered by user.
imagePath String of filepath of image used for GCP clicking. Same as imagepath in Section 2.
    • Required Core Sub-Functions:

    None.

Clone this wiki locally