| |
- bigoptimize.EvaluableProblem
-
- SpringRegularizedWarpingProblem
- WarpingProblem(bigoptimize.EvaluableProblem, ZeroRegularizer)
- bigoptimize.SplineReducer(bigoptimize.SimpleReducer)
-
- MultigridableWarpingProblem
- SpringProblem
- WarpableImage
- WarpingRegularizer
- ZeroRegularizer
-
- WarpingProblem(bigoptimize.EvaluableProblem, ZeroRegularizer)
class MultigridableWarpingProblem(bigoptimize.SplineReducer) |
|
Generate a multigriddable variant of the WarpingProblem.
An instance is generated given a reference and test pyramids,
a class of the WarpingProblem, the size of the control grid,
and degrees of splines to interpolate the deformation and
the image. |
| - __init__(self, refp, testp, xshape=None, degf=3, degc=3, wp=<class bigregister.WarpingProblem>, level=0, reducedimg=0, alpha=0.0, verbose=0, mask=None)
- canReduce(self)
- canReduceC(self)
- canReduceImg(self)
- denormalizeC(self, c)
- expand(self, x, targetlen=None) from bigoptimize.SplineReducer
- expandexceptfirst(self, x, targetlen=None) from bigoptimize.SimpleReducer
- getE(self, c, visualize=0, gnupl=None)
- getEg(self, c)
- getEgDh(self, c)
- getEgH(self, c)
- getInitialX(self)
- getReduced(self, c)
- gets a reduced version of the problem. Here, the strategy is
to alternatively reduce the size of the images and of the control
points
- getReducedMask(self, mask)
- Given a bitmap mask, reduce it to half the size
- getsplinedegree(self) from bigoptimize.SplineReducer
- reduce(self, x) from bigoptimize.SplineReducer
- reduceX(self, x)
- reduceexceptfirst(self, x) from bigoptimize.SimpleReducer
- simpleexpand(self, x, targetlen=None) from bigoptimize.SimpleReducer
- simplereduce(self, x) from bigoptimize.SimpleReducer
- updateFine(self, xf, xc0, xc1)
|
class SpringProblem |
|
This serves as a regularizer for the WarpingProblem.
It evaluates
Es=sum_q omega_q | g(x_i)/N-z_i |^2
(where N is the number of pixels in the specific direction)
and its derivatives with respect to c(describing g).
x and z should have values between 0..1, x will be later
multiplied by the image size in the given direction and
converted to integer pixel coordinates to improve performance.
For the moment it only works in 2D. |
| - __init__(self, wp, x, z, omega)
- Takes as parameters: the asociated WarpingProblem(wp),
and the parameters (x,z,omega) of the springs
- getE(self, cc)
- getEg(self, cc)
|
class SpringRegularizedWarpingProblem(bigoptimize.EvaluableProblem) |
|
Combines WarpingProblem and SpringProblem |
| - __init__(self, refimg, testimgc, csize=None, degf=3, degc=3, alpha=0.0, verbose=0, mask=None, springx=array([ [ 0., 0.]]), springz=array([ [ 0., 0.]]), springomega=array([ 0.]))
- dHerr(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
- denormalizeC(self, c)
- gerr(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
- getE(self, cc, visualize=0, gnupl=None)
- getEg(self, cc)
- getEgDh(self, x) from bigoptimize.EvaluableProblem
- getInitialX(self)
- normalizeC(self, c)
- numDh(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
- numg(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
|
class WarpableImage |
|
contains an n-dimensional image which can be warped
if mask is defined, only pixels set in the mask will be considered |
| - __init__(self, image, degf=3, degc=2, imageiscoefs=0, verbose=0, mask=None)
- getC(self)
- returns a reference to the c coefficient matrix describing
the deformation. The matrix should not be modified
- getDeformation(self)
- getDeformationDerivative(self, flag=0)
- getDisplacementAtPoint(self, point, flag=0)
- Gets displacement at 'point'
- getDisplacementAtPoints(self, points, flag=0)
- Gets displacement at multiple 'points' of size (n,dim),
(which is the transpose of what interpoldef wants)
It returns the diplacements in the same format (n,dim)
- getWarped(self)
- interpoldef(self, i, m, flag=0)
- setC(self, c)
- remembers the reference to a matrix c, which should not be
modified while needed.
- setDeformation(self, tbl)
- setIdentity(self, shape)
- initializes deformation as identity with a given shape
the shape should be (n,x1,x2,..,xn)
|
class WarpingProblem(bigoptimize.EvaluableProblem, ZeroRegularizer) |
|
Accepts two images, reference and test, the test image in the
form of its B-spline coefficients, as well as the suggested size
of the coefficients c describing the deformation and the degree
of B-splines to represent the deformation. Evaluates the SSD
criterion and its first and second derivatives.
Alpha is the factor in the regularization part E=Ed+alpha Er
where Er is whatever is returned by WarpingRegularizer
The coefficients c are normalized, i.e. multiplied by the size of the
image in the specific direction. This way, even if the image size
changes, the appropriate c coefficients will not.
If mask is defined, only pixels in the mask will be taken into account
implements the interface of EvaluableProblem |
| - __init__(self, refimg, testimgc, csize=None, degf=3, degc=3, alpha=0.0, verbose=0, mask=None)
- dHerr(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
- denormalizeC(self, c)
- Multiply components of c responsible for movements with respect
to each axis by the number of pixels in this axis. Also usable for
gradient and Hessian diagonal normalization
- gerr(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
- getDerivatives(self)
- get first derivatives of the image described by coefs
self.w.b along the coordinate axis
- getE(self, cc, visualize=0, gnupl=None)
- getEg(self, cc)
- getEgC(self, cc)
- The fast version of getEgPython, using a C implementation.
Limitation: only works in 2D
- getEgDh(self, cc)
- getEgDhr(self, c) from ZeroRegularizer
- getEgH(self, cc)
- evaluate the criterion, gradient, and the true Hessian
slow implementation for the moment. Does not support
regularization.
- getEgPython(self, cc)
- getEgr(self, c) from ZeroRegularizer
- getEr(self, c) from ZeroRegularizer
- getInitialX(self)
- getSecondDerivatives(self)
- get second derivatives of the image described by coefs
self.w.b along the coordinate axis
- initRegularizer(self) from ZeroRegularizer
- normalizeC(self, c)
- Inverse of denormalizeC
- numDh(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
- numg(self, x, h=9.9999999999999995e-07) from bigoptimize.EvaluableProblem
|
|