Skip to content
This repository was archived by the owner on May 18, 2022. It is now read-only.

User Inputs

Allison Penko edited this page Mar 23, 2017 · 14 revisions

STEP 1) Edit the user inputs for your collection

The following are the required inputs for an analysis. Edit the inputs in the script titled demoInputFile.m. It is currently designed to work for the example demo data.

% Demo input file for UAV processing.
% The user is responsible for correcting content for each new analysis

% 1.  Paths, names and time stamp info:
inputs.stationStr = 'Aerielle';  
inputs.dateVect = [2015 10 1 19+4 29 0];       % date/time of first frame
inputs.dt = 0.5/(24*3600);           % delta t (s) converted to datenums
inputs.frameFn = 'demoClip';            % root of frames folder name
inputs.gcpFn = [pwd, filesep, 'demoGCPFile.mat'];
inputs.instsFn = [pwd, filesep,'demoInstsFile'];            % instrument m-file location

% 2.  Geometry solution Inputs:
% The six extrinsic variables, the camera location and viewing angles
% in the order [ xCam yCam zCam Azimuth Tilt Roll].
% Some may be known and some unknown.  Enter 1 in knownFlags for known
% variable.  For example, knownFlags = [1 1 0 0 0 1] means that camX and
% camY and roll are known so should not be solved for.  
% Enter values for all parameters below.  If the variable is known, the
% routine will use this data.  If not, this will be the seed for the
% nonlinear search.
inputs.knownFlags = [0 0 0 0 0 0];
inputs.xyCam = [0 600];
inputs.zCam = 100;             % based on last data run                
inputs.azTilt = [95 60] / 180*pi;          % first guess
inputs.roll = 0 / 180*pi; 

% 3.  GCP info
% the length of gcpList and value of nRefs must be >= length(beta0)/2
inputs.gcpList = [1 2 3 6 7];      % use these gcps for init beta soln
inputs.nRefs = 4;                    % number of ref points for stabilization
inputs.zRefs = 7;                    % assumed z level of ref points

% 4.  Processing parameters
inputs.doImageProducts = 1;                    % usually 1.
inputs.showFoundRefPoints = 0;                 % to display ref points as check
inputs.rectxy = [50 0.5 500 400 0.5 1000];     % rectification specs
inputs.rectz = 0;                              % rectification z-level

% residual calculations - NO USER INPUT HERE
inputs = makeUAVPn(inputs);             % make the path to find init-file
inputs.dn0 = datenum(inputs.dateVect);
bs = [inputs.xyCam inputs.zCam inputs.azTilt inputs.roll];  % fullvector
inputs.beta0 = bs(find(~inputs.knownFlags));
inputs.knowns = bs(find(inputs.knownFlags));

The inputs are in four categories.

  1. Paths, names and time stamps. StationStr is the name of the particular UAV while dateVect is a 1x6 vector of [yyyy mm dd hh mm ss] where the hour is forced to GMT (in this example from Duck, NC, during summer, this is a 4 hour correction), consistent with Argus standards of recording times in GMT (an option you may not want to use). dt is the frame sampling interval (1/2 second here, expressed as a matlab datenum). FrameFn is the filename of the folder in which the individual frames are stored. Our current standard is to append the numbers 1 or 2 to this root to specify the first and second half of split MP4 movies. The user must also specify gcpFn, a gcp file, and instsFn, a file creating the pixel instruments. Examples are included in Appendices A and B.

  2. Geometry solution inputs. This section defines which of the six extrinsic camera parameters [xCam yCam zCam azimuth tilt roll] are known a priori and defines those values as well as initial guesses at the unknown parameters. In this case xyCam is defined using lat-long measurments from exiftool of the snapshot. These are then converted to Argus coordinates using ll2Argus (you will need an alternate routine). For this case, only the roll is assumed to be known (set to value 0°). The other variables are just initial values for the nonlinear search. In this case I have guessed that the azimuth and tilt are 0° (looking along the +y axis) and 70° (20° below horizontal). All angles must be converted to radians (hence the /180*pi).

  3. GCP Info. This section would be better handled by a gui, if someone wanted to build one. As it is, you need to look at the first frame (or an equivalent snapshot) independently and decide which GCPs you can see. The vector gcpList refers to the selected GCPs by their number in the gcp structure. In this case I am using four GCPs (so I can solve for all six geometry variables if I want). The user must also identify a number of reference points that he will establish in the initialization process. Reference points are just virtual GCPs whose effective location is found by finding their image location then converting to an equivalent xyz location assuming the vertical location is defined by the variable zRefs. In this example I use a vertical level of 7 m, roughly the height of the pier and dune. Results are insensitive to this choice (as long as it is closer to the correct ground location that it is to the zCam).

  4. Processing Parameters. This section allows you to choose to do image products (timex, brightest and darkest) and whether to show how well the reference point identification is working (for possible debugging). It also defines the rectification box in x and y (rectxy=[xmin dx xmax ymin dy ymax]) and the vertical level for rectification (usually mean sea level).

The final input group requires no user input, with one exception. makeUAVPn.m is a script that creates standard path and folder names for CIL processing standards. These include 1) dayFn (an Argus standard day filename, for example ‘274_Oct.01’ where all cx data for that day will be stored), 2) pnIn, the pathname for the input png image frames (the folder in which frameFn resides), and 3) pncx, the standard CIL pathname for storing cx results. The names you wish to use will likely be different from our default names so you may need to modify these routines.

Next: Initialization

Clone this wiki locally