nav2 [ parameter=value ] [ inputfile ]
Parameters are: expr_vars, expression, poly_size, min_good, box_file, coast_file, max_coast_pts, max_line_shift, max_samp_shift, min_good_boxes, fix_attitude, reset_sat, use_time, use_roll, use_pitch, use_yaw, use_shift, method, min_coast_pts, min_edge_diff, min_edge_perc, min_corr, interp_corr, min_feature, fixed_thresh, threshold, stdev_units, num_bins, estimate_range, range_minmax,
Given an image from an input dataset, nav2 adjusts earth location parameters in order to achieve the best land/water boundary fit with a user-specified list of subset boxes. Normally these boxes are selected automatically by navbox2 or manually via xvu select locations.
For each given subset box, a reference mask is derived from a user-specified land/water boundary database. Normally, this database is one of the files from the directory $REFDATA/coast, e.g., wdb2.cil. The land/water boundary is drawn within the mask, and land/water regions are determined using area fill techniques.
For each given box, nav2 attempts to determine the (line, sample) offsets that give the best fit between the input image and the reference mask.
+------------------+ | | | +----------+ | +----------+ | | | | | | | | | | |cccccccc | | | | <---------> | c | |ccccccccc | | | c | | | c | | | c | | +----c-----+ | +----------+ | c | +------------------+ Inner box is the subset box. Grid derived from coast Grid is shifted up/down and database is same size as left/right to find best fit subset box. with image. Upper/lower margins are max_line_shift pixels high. Left/right margins are max_samp_shift pixels wide.
The input image can be any mathematical combination of variables from the input dataset. Any expression allowed by emath is supported by nav2. Aggregate functions are supported, but the box size for one argument aggregate functions is fixed at 3x3. The angles supported by emathp are also supported by nav2.
There are two different methods for determining best fit between the input image and reference land/water mask: image correlation and edge matching. Either or both methods can be used. In the case of both, edge matching is attempted first.
Image Correlation
Within a given subset box, image pixels are classified as land or water either by using a user-specified threshold, or by using a threshold determined by histogram splitting. In either case, both of the following two cases are considered:
Missing values are not classified as either land or water. The user can specify a valid range for image pixel values; values outside this range are considered missing.
Line/sample offsets are determined as follows:
for line_offset in [-max_line_offset, max_line_offset], and for samp_offset in [-max_samp_offset, max_samp_offset]. find line_offset and samp_offset that maximize N = +++ +++ (image[i+line_offset][j+samp_offset] == mask[i][j]) ? 1 : 0 i j
max_line_shift and max_samp_shift are user-specified parameters. The user can also specify a minimum percentage of matching values (min_corr) required to validate the computed line and sample offsets.
Histogram Splitting
Histogram splitting is used to automatically determine thresholds on a per box basis. Ideally, if an image subset contains both land and water, then that subset will have a bi-modal distribution (i.e., its histogram will consist of two fairly distinct humps). The threshold between the two populations is determined as follows:
Let [u1(t), s1(t)] and [u2(t), s2(t)] be the means and standard deviations of the data below and above the threshold t. Select t that maximizes
D = min( (t - u1(t))/s1(t), (t - u2(t))/s2(t) )
D is really distance computed in standard deviation units. The user can specify a minimum acceptable distance in order for the computed threshold to be considered valid.
^ - ---------------+-------+-----------------+------------------------ u1(t) t u2(t) <- d1 -> <------ d2 ------> d1(t) = (t - u1(t))/s1(t) d2(t) = (u2(t) - t)/s2(t)
Edge Matching
Edge matching is based on looking at differences between image value across boundary pixels. Differences are considered matching is they are greater than or equal to a user specified threshold min_edge_diff. Two directions of differences are considered:
Line/sample offsets are determined as follows:
for line_offset in [-max_line_offset, max_line_offset], and for samp_offset in [-max_samp_offset, max_samp_offset]. find line_offset and samp_offset that maximize N = max(N1, N2) each edge N1 = +++ (image value on land side of E - pixel E image value on water side of E] < min_edge_diff) ? 0 : 1 each edge N2 = +++ (image value on water side of E - pixel E image value on land side of E] < min_edge_diff) ? 0 : 1
Differences that cannot be computed because of missing data are considered non-matching. max_line_shift, max_samp_shift, and min_edge_diff are user-specified parameters. The user can also specify a minimum percentage of matching values (min_edge_perc) required to validate the computed line and sample offsets.
Adjusting Earth Location
Earth location parameters are adjusted according to one of the two following schemes:
i<N +++ ( line_error[i]^2 + sample_error[i]^2 ) i=0 where line_error = line_offset - (Dline/Dparam1)*dparam1 ... - (Dline/DparamJ)*dparamJ and sample_error = samp_offset - (Dsamp/Dparam1)*dparam1 ... - (Dsamp/DparamJ)*dparamJ
N is the number of boxes for which (line,sample) offsets can be determined. The dparamJ are the parameter adjustments; the (Dline/DparamJ) and (Dsamp/DparamJ) are derivatives approximated for each box.
The following example shows a typical sequence for navigating a daytime AVHRR dataset. The navigation image is simply AVHRR channel 2. Thresholds between land/water pixel values are determined automatically.
% navbox2 n7.84191.2316 tmpbox variable : char( 31) ? [] avhrr_ch2 coast_file : char(255) ? [wdb2.cil] box_height : int ? [100] 50 box_width : int ? [50] 50 min_cross_dev : int ? [2.5] min_feature : int ? [15] max_regions : int ? [4] min_region_perc: int ? [10] min_coast_pts : int ? [50] min_good_boxes : int ? [1] n7.84191.2316: Looking for boxes in the LS area [1 377] x [1 628] n7.84191.2316: 7 boxes selected % nav3 n7.84191.2316 expr_vars : char(255) ? avhrr_ch2 expression : char(255) ? x1 box_file : char(255) ? tmpbox coast_file : char(255) ? [wdb2.cil] max_line_shift : int ? [10] max_samp_shift : int ? [10] min_good_boxes : int ? [1] fix_attitude : char( 3) ? [yes] reset_sat : char( 3) ? [yes] method : char( 9) ? [correlate] min_corr : real ? [95] interp_corr : char( 3) ? [yes] min_feature : int ? [5] fixed_thresh : char( 3) ? [no] stdev_units : real ? [2] num_bins : int ? [100] estimate_range : char( 3) ? [yes] n7.84191.2316: Old Attitude: (0.00 0.00 0.00), Time Adj: 0.00 Box 1: [ 5, 54] x [ 27, 76] 98.3% corr, thresh 3.82, units 3.66 Offset ( 2.50 0.82) Box 2: [ 30, 79] x [ 27, 76] 99.7% corr, thresh 2.77, units 4.36 Offset ( 2.83 -0.17) Box 3: [ 130, 179] x [ 102, 151] 99.3% corr, thresh 3.95, units 5.53 Offset ( 3.85 0.06) Box 4: [ 155, 204] x [ 152, 201] 99.8% corr, thresh 3.18, units 4.43 Offset ( 4.21 0.70) Box 5: [ 230, 279] x [ 327, 376] 100.0% corr, thresh 3.05, units 3.82 Offset ( 3.34 -1.96) Box 6: [ 280, 329] x [ 327, 376] 99.6% corr, thresh 3.35, units 4.12 Offset ( 2.25 -2.68) Box 7: [ 305, 354] x [ 352, 401] 99.7% corr, thresh 4.13, units 3.52 Offset ( 2.40 -2.46) n7.84191.2316: 7 out of 7 boxes used ... Mean Square Error: Old (3.14 1.55), New (0.68 1.37) n7.84191.2316: Roll/Pitch/Yaw : (-0.04 0.00 0.00) n7.84191.2316: Time Adjustment: 0.51
For AVHRR data, adjusting satellite time and roll is equivalent to adjusting sensor start line/sample respectively. This is not true for OLS data, which has a sinusoidal across-track scanning scheme. Satellite time is linearly related to sensor line number, but satellite roll is not linearly related to sensor sample number.
Last Update: $Date: 1998/05/29 18:42:38 $