The input rasters are first converted to equivalent matrices. The function
then divides the domain up into sub-grids of size factv1 X facth1, which are
vertical and horizontal sub-grid dimensions.
If restricted is set to FALSE (the default), the function computes
cross-covariance between each sub-grid of the first input raster and the
entirety of the second input raster and then uses the location of maximum
cross-covariance to estimate displacement in the vertical and horizontal
directions from the centre of each sub-grid.
If restricted is set to TRUE, the function uses cross-covariance between each
sub-grid in the first input raster and the equivalent sub-grid in the second
input raster to estimate vertical and horizontal displacement.
Reference coordinates and cell size are extracted from the first input raster
such that the locations from whence displacement is estimated as well as
displacement estimates can be expressed in the units of the projected
coordinates.
The coordinates are assumed to increase vertically and horizontally from the
lower left corner of the two-dimensional domain.
Caution is warranted when defining the sub-grid dimensions because the
function can produce erroneous results when sub-grids are too small.