| registerBand | R Documentation |
Hyperspectral image acquisition normaly causes spatial misalignment between the spectral bands (layers) due to both equipment (such as band-to-band recording delay) and external factors (e.g. sensor vibrations). In this case, a geometric correction is necessary for remote sensing applications such as combining/merging spectral bands. This function uses the HOG (Histogram of Oriented Gradient) descriptor in order to find the optimal translation (xy shift) on a 'slave' band to be spatially align with a 'master' (reference) band.
registerBand(slave, master, ncells = 24, orient = 8)
slave |
An object of class |
master |
An object of class |
ncells |
An integer giving the number of cells to compute the oriented
gradients of the HOG descriptor. Default is 24. See |
orient |
An integer giving the number of orientations to compute the
oriented gradients of the HOG descriptor. Default is 8. See |
The affine parameters are estimated using a general
optimization algorithm. This function only estimates translation parameters.
To register bands also with rotation fixes, please check registerBand3().
But this should be used carefully, as rotation affects the spatial dimensions.
An object of the same classe as the input slave, with
the fixed extent. An additional attribute called 'affine_pars' is
stored, containing the shift in x and y, in the same unit as the spatial
extent of the image.
OpenImageR::HOG(), registerBrick(), registerBand3()
# load an image
path <- system.file('exdata', 'obory.dat', package = 'hyperbrick')
dpath <- system.file('exdata', 'obory_dark.dat', package = 'hyperbrick')
im <- buildBrick(path, hFOV = 36.8, vFOV = 36.8, height = 45,
ref_layer = 35, spectral_feature = 'radiance',
dark_path = dpath)
print(im)
# check bands 11 (550 nm) and 35 (670 nm)
plot(im[[35]], col = gray.colors(20), asp = 0)
plot(im[[11]], add = TRUE, legend = FALSE,
col = adjustcolor(heat.colors(20), 0.3))
# register band 11 to band 35
new11 <- registerBand(slave = im[[11]], master = im[[35]])
plot(im[[35]], col = gray.colors(20), asp = 0)
plot(new11, add = TRUE, legend = FALSE,
col = adjustcolor(heat.colors(20), 0.3))
# see the xy shift on band 11
attr(new11, "affine_pars")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.