warper: Image Warp

View source: R/warper.R

warperR Documentation

Image Warp

Description

Estimate an image warp

Usage

warper(Im0, Im1, p0, init, s, imethod = "bicubic", lossfun = "Q", 
    lossfun.args = list(beta = 0, Cmat = NULL), grlossfun = "defaultQ", 
    lower, upper, verbose = FALSE, ...)

Arguments

Im0, Im1

Numeric matrices giving the zero- and one-energy images. The Im1 image is ultimately warped into the Im0 image.

p0

nc by 2 matrix giving the zero-energy control points.

init

nc by 2 matrix giving an initial estimate of the one-energy control points.

s

Two-column matrix giving the full set of locations. Works best if these are integer-valued coordinate indices.

imethod

character giving he interpolation method to use. May be one of "round", "bilinear" or "bicubic".

lossfun

Function giving the loss function over which to optimize the warp. Default is Q, see args{Q} to see the required arguments for this function.

lossfun.args

A list giving optional arguments to lossfun.

grlossfun

(optional) function giving the gradient of the loss function given by lossfun.

lower, upper

(optional) arguments to the nlminb function which is used to optimize the loss function.

verbose

logical, should progress information be printed to the screen?

...

Optional arguments to nlminb.

Details

A pair-of-thin-plate-splines image warp is estimated by optimizing a loss function using nlminb. It can be very difficult to get a good estimate. It is suggested, therefore, to obtain good initial estimates for the one-energy control points. The function iwarper can be useful in this context.

Value

A list object of class “warped” is returned with components:

Im0, Im1, Im1.def

Matrices giving the zero- and one-energy images and the deformed one-energy image, resp.

p0, p1

zero- and one-energy control points, resp.

sigma

Estimated standard error of the mean difference between the zero-energy and deformed one-energy images.

"warped.locations" "init"

s, imethod, lossfun, lossfun.args

Same as input arguments.

theta

The matrices defining the image warp, L, iL and B, where the last is the bending energy, and the first two are nc + 3 by nc + 3 matrices describing the control points and inverse control-point matrices.

arguments

Any arguments passed via ...

fit

The output from nlminb.

proc.time

The process time.

Author(s)

Eric Gilleland

References

Dryden, I. L. and K. V. Mardia (1998) Statistical Shape Analysis. Wiley, New York, NY, 347pp.

See Also

iwarper


SpatialVx documentation built on May 29, 2024, 9:31 a.m.