nav2 - Generic automatic navigation

SYNOPSIS

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,

DESCRIPTION

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:

(1)
if x > threshold, then x is land, else x is water
(2)
if x > threshold, then x is water, else x is land

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:

(1)
Starting on the land side of the boundary.
(2)
Starting on the water side of the boundary.

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:

(1)
Adjust any or all of (start time, satellite roll/pitch/yaw, sensor start line/sample) to minimize

         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.

(2)
Determine the average line and sample offsets and apply directly to the sensor start line/sample encoded in the et_affine attribute. Unlike (1), this does not use least squares.

PARAMETERS

expr_vars
List of variables to use in the expression for the input image. Wildcards * and ? are allowed, provided that each wildcard term matches exactly one variable. This restriction forces the user to unambiguously specify variables in order. There is no default.
expression
Expression used to compute the input image. Any expression supported by emath can be used. There is no default. If the input image is simply one of the input dataset variables, then the expression is simply x1.
poly_size
Used only if the above expression involves satellite/solar angles. nav2 speeds up the computation process by using piecewise polynomial interpolation. The input image is divided up into nearly square regions, each of which is covered by its biquadratic polynomial. A region's polynomials are determined by computing angles exactly from satellite ephemeris at 9 points in the region.
poly_size is the width of these regions in kilometers. Valid range is [>= 1]. The default is 100.
min_good
The minimum number of good values required by nav2 to compute an aggregate statistic. The same value of min_good applies to all one argument and three argument aggregates. The default is 1. Note that the box size for all one-argument aggregate functions is 3x3.
box_file
Name of the dataset containing the list of boxes that determine subsets within the input image. This dataset must contain the following variables: latitude, longitude, delta_lat, delta_lon. There is no default. Normally this dataset is the output of navbox2 or xvu select locations.
coast_file
The name of the coastline file from which to select land/water boundary points. Coastline files are normally located in the directory $REFDATA/coast. The default is wdb2.cil, which is a good choice because it includes islands and lakes as well as continental boundaries. If navbox2 was used to generate the box_file, then the coast_file used by navbox2 should also be used here.
max_coast_pts
OPTIONAL. The maximum number of land/water boundary points that can be extracted from the database for a given box. The valid range is [1, 50000]. The default is 10000.
max_line_shift
The maximum absolute line offset allowed when trying to achieve the best fit. The valid range is [1, 100]. The default is 10 lines.
max_samp_shift
The maximum absolute sample offset allowed when trying to achieve the best fit. The valid range is [1, 100]. The default is 10 samples.
min_good_boxes
The minimum number of boxes for which valid line/sample offsets need to be computed before earth location parameter changes can be made. If line/sample offsets cannot be computed for enough boxes, nav2 will fail.
fix_attitude
If yes, use the least squares technique for estimating changes to satellite attitude, satellite clock, and sensor start line/sample. If no, then simply adjust the sensor start line/sample encoded in the et_affine attribute using the average line/sample offsets.
reset_sat
Whether or not to reset the satellite attitude and time adjustment to zero prior to computing line/sample offsets for the various boxes. Used only if fix_attitude=yes. The default is yes
use_time
OPTIONAL. Whether or not to adjust satellite time (e.g., set the time_adjust attribute). Used only if fix_attitude=yes. The default is yes.
use_roll
OPTIONAL. Whether or not to adjust satellite roll. Used only if fix_attitude=yes. The default is yes.
use_pitch
OPTIONAL. Whether or not to adjust satellite pitch. Used only if fix_attitude=yes. The default is no.
use_yaw
OPTIONAL. Whether or not to adjust satellite yaw. Used only if fix_attitude=yes. The default is no.
use_shift
OPTIONAL. Whether or not to adjust sensor start line and sample (encoded in the et_affine attribute). Used only if fix_attitude=yes. The default is no.
method
Method for matching image data against land/water boundary. Valid choices are [correlate, edge]. Either or both methods can be used. In the case of both, edge matching is attempted first. The default is correlate.
min_coast_pts
Used only when method=edge. The minimum number of edge (boundary) pixels needed for a given box. The valid range is [10, inf]. The default is 50 edge pixels.
min_edge_diff
Used only when method=edge. The minimum matching difference in image values across each edge pixel. The valid range if [0, inf]. There is no default.
min_edge_perc
Used only when method=edge. The minimum percentage of edge pixels with matching differences within a given box required before accepting the line/sample offsets computed for that box. The valid range is [0, 100]. The default value is 95 percent.
min_corr
Used only when method=correlate. The minimum percentage of matching pixels within a given box required before accepting the line/sample offsets computed for that box. The valid range is [0, 100]. The default value is 95.
interp_corr
Used only when method=correlate. Indicates whether or not to use interpolation to improve the line/sample offsets. This allows fractional line/sample offsets. Valid responses are [yes, no]. The default is yes.
min_feature
Used only when method=correlate. The minimum percentage of land and the minimum percentage of water required for a given box. For a given box, if either of these percentages is less than min_feature, then the box is not used. These percentages are computed based on the mask derived from the land/water boundary database. The valid range is [1, 99]. The default is 5 percent.
fixed_thresh
Used only when method=correlate. Whether or not to use a user-specified threshold to separate land and water pixel values. Valid responses are yes and no. The default is no. If fixed_thresh=no, then histogram splitting will be used to automatically determine thresholds for each separate box.
threshold
Used only when fixed_thresh=yes. User specified threshold value. The valid range if [-inf, inf]. There is no default.
stdev_units
Used only when fixed_thresh=no. Minimum acceptable distance from the means of the split distribution to the threshold, measured in standard deviation units. If no acceptable threshold can be determined, the box is skipped. The valid range is [0, inf]. The default is 2.
num_bins
Used only when fixed_thresh=no. The number of bins used in the histogram-splitting process. The valid range is [2, 256]. The default is 100.
estimate_range
Used only when fixed_thresh=no. Whether or not to estimate the valid range of input image values. Values outside this range are classified as neither land nor water. Valid responses are yes and no. The default is yes.
range_minmax
Used only when estimate_range=no. Pair of numbers defining the valid range for input image values. Used only if estimate_range=yes. The valid range is [-inf, inf]. There is no default.

EXAMPLES

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

FILES

coastfile

SEE ALSO

navbox2, navigate

NOTES

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 $