Skip to content

3. Script Descriptions: E_scpSelection

burritobrittany edited this page Jul 17, 2020 · 3 revisions
  • E_scpSelection

    • Description:

    This function initializes the SCP (stabilization control points) structure for a given camera for use in the toolbox. The user will load a given DISTORTED image for where the IOEO has been calculated already using C_singleExtrinsicSolution and then select at least 4 bright or dark points that will be used to stabilize the image (i.e. they must be in the frame throughout the collection). Additional parameters such as expected movement radius and intensity threshold will also be entered.

    The clicking mechanism works similar to B_gcpSelection. The user can zoom and move the image until they hit enter to go into clicking mode (cross-hairs). Note, the click does not have to be as precise as B_gcpSelection. The user should click a bright (dark) target that is brighter (darker) than what is around it and does not move. The bright target should not be in the water with breaking waves rushing past. The user will enter a SCP number, and radius (in pixels) to search for the point. It is best to be as small as possible and not include bright (dark) pixels of other objects. For example, if on a pier, the radius should be small enough to exclude any water pixels. The radius should appear in the figure after entry in red. Hit enter with an empty input when done. An example SCP Click and Radius is in Figure 6.


Figure 6: Example SCP click and radius (red) in E_scpSelection for uasDemoData

    Then the user will enter a threshold value in the command window deliminating bright points from dark points, it is the center of the bright (dark) points that will be considered the SCP point. Ultimately, any points above this threshold in the search radius will be considered good and below not; then the center of area of the good points will be considered the SCP. This will be updated in anew figure to show the estimated SCP center; an example of which is in Figure 7. If the threshold is very high, it is probably not a good SCP point and may error if any slight changes in pixel value (>245). Hit enter with an empty value when complete. When done with selection go in to clicking mode and click below the X axis.

    The user should pick at least 4 points. Note, if GCPs are selected, SCP and GCP point numbers do not have to match. For uasDemoData, suggested thresholds, numbers, and radii are suggested in the image frame.

    Note: SCP 1 for uasDemoData is small and slightly difficult to see. However it is important to get a spread in SCPs across the image just like GCPs. This is why it is selected.


Figure 7: Panel displaying pixel intensity values within search radius of SCP 1 and resultant center of area calculations (white dot) when applying binary threshold in E_scpSelection for uasDemoData

    • Input:

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

    Section 1: Saving Information

    Variable Description
    oname String for the basename for the SCP mat files to be saved under.
    odir Filepath where the SCP mat file will be saved.

    Section 2: SCP Image

    Variable Description
    imagePath Filepath of the saved image for clicking. For UAS processing this should be the first image of the collection used in C-SingelExtrinsicSolution and B_gcpSelection (imagePath). For fixed station, it should be any frame where SCPs are visible and the previously known solution is viable.
    brightFlag String of either ‘bright’ or ‘dark’ to identify whether bright or dark SCPs will be identified. White objects on dark backgrounds should be ‘bright’ where dark objects on light backgrounds should be ‘dark’.
    • Output:

    A .mat file saved as oname_scpUVdInitial.mat in odir. Will contain following variables; variables left blank are defined in the user input.

Variable Description
scp A structure with each entry corresponding to a SCP. Note, the index entry in the structure may not correspond with the SCP identifying number. Fields of structure are:
UVd [1 x 2] Vector of distorted Image coordinates of SCP
num Identifying SCP number entered by user.
R Search Radius in Pixels (expected movement)
T Threshold pixel intensity value for determining Center of Area for Bright Pixels (value 0-254).
imagePath
brightFlag
    • Required Core Sub-Functions:

      • thresholdCenter
Clone this wiki locally