Woolz Image Processing  Version 1.7.5
WlzRegistration

Files

file  WlzAutoCor.c
 Functions to compute the autocorrelation of an object.
 
file  WlzPrinicipalAngle.c
 Calculates the angle which the long principal axis makes with the given object. The functions are based on a combination of methods by Rees and Hibbard. (D.W.A. Rees, Mechanics of Solids and Structures).
 
file  WlzRegCCor.c
 Functions to register two objects using frequency domain cross correlation.
 

Data Structures

struct  _WlzFeatureVector
 Finite element warping feature vector. Typedef: WlzFeatureVector. More...
 
struct  _WlzFeatValueLine
 A line of finite element warping feature vectors. Typedef: WlzFeatValueLine. More...
 
struct  _WlzFeatValues
 A ragged rectangular feature value table. Typedef: WlzFeatValues. More...
 
struct  _WlzRectFeatValues
 A rectangular feature value table. Typedef: WlzRectFeatValues. More...
 
struct  _WlzFMatchPoint
 Finite element warping feature match point. Typedef: WlzFMatchPoint. More...
 
struct  _WlzFMatchObj
 A finite element warping feature match, interesting points object. Typedef: WlzFMatchObj. More...
 
struct  _Wlz3DWarpTrans
 A plane-wise 3D finite element warping transform. Typedef: Wlz3DWarpTrans. More...
 

Enumerations

enum  _WlzMatchType {
  WLZ_DISCARD_POINT = -1,
  WLZ_NODE_ATTACH = 0,
  WLZ_ELEMENT_ATTACH = 1
}
 Finite element warping match types. Typedef: WlzMatchType. More...
 

Functions

WlzObjectWlzAutoCor (WlzObject *gObj, WlzErrorNum *dstErr)
 Computes the autocorrelation of the given object. The autocorrelation object will have double values, an origin of (0,0) and a column and line sizes which are the integer power of two greater than or equal to those of the given object. See AlgAutoCorrelate2D() for the organisation of the autocorrelation data. More...
 
double WlzPrincipalAngle (WlzObject *srcObj, WlzDVertex2 cMass, int binObjFlag, WlzErrorNum *dstErrNum)
 Calculates the angle which the long principal axis makes with the x-axis in the given object.

\[ \theta = \frac{1}{2} \arctan{(2 \frac{I_{xy}}{I_{yy}-I_{xx}})} \]

where

\[ I_{xx} = \sum_y \sum_x ((y - C_y) (y - C_y) G(x, y)) \]

\[ I_{yy} = \sum_y \sum_x ((x - C_x) (x - C_x) G(x, y)) \]

\[ I_{xy} = - \sum_y \sum_x (((x - C x) (y - C_y) G(x, y)) \]

and \((C_x, C_y)\) are the coordinates of the centre of mass. More...

 
WlzAffineTransformWlzRegCCorObjs (WlzObject *tObj, WlzObject *sObj, WlzAffineTransform *initTr, WlzTransformType trType, WlzDVertex2 maxTran, double maxRot, int maxItr, WlzWindowFnType winFn, int noise, int inv, int *dstConv, double *dstCCor, WlzErrorNum *dstErr)
 Registers the two given objects using a frequency domain cross correlation. More...
 

Detailed Description

Enumeration Type Documentation

Finite element warping match types. Typedef: WlzMatchType.

Enumerator
WLZ_DISCARD_POINT 
WLZ_NODE_ATTACH 
WLZ_ELEMENT_ATTACH 

Function Documentation

WlzObject* WlzAutoCor ( WlzObject gObj,
WlzErrorNum dstErr 
)

Computes the autocorrelation of the given object. The autocorrelation object will have double values, an origin of (0,0) and a column and line sizes which are the integer power of two greater than or equal to those of the given object. See AlgAutoCorrelate2D() for the organisation of the autocorrelation data.

Returns
Autocorrelated object or NULL on error.
Parameters
gObjGiven object.
dstErrDestination error pointer, may be NULL.

References Alc2Free(), ALC_ER_NONE, AlcDouble2Malloc(), AlgAutoCorrelate2D(), AlgBitNextPowerOfTwo(), _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzObject::type, _WlzObject::values, _WlzIVertex2::vtX, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WlzBoundingBox2I(), WlzFreeObj(), WlzFromArray2D(), WlzToArray2D(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.

Referenced by WlzRegCCorObjs().

double WlzPrincipalAngle ( WlzObject srcObj,
WlzDVertex2  cMass,
int  binObjFlag,
WlzErrorNum dstErrNum 
)

Calculates the angle which the long principal axis makes with the x-axis in the given object.

\[ \theta = \frac{1}{2} \arctan{(2 \frac{I_{xy}}{I_{yy}-I_{xx}})} \]

where

\[ I_{xx} = \sum_y \sum_x ((y - C_y) (y - C_y) G(x, y)) \]

\[ I_{yy} = \sum_y \sum_x ((x - C_x) (x - C_x) G(x, y)) \]

\[ I_{xy} = - \sum_y \sum_x (((x - C x) (y - C_y) G(x, y)) \]

and \((C_x, C_y)\) are the coordinates of the centre of mass.

Returns
Angle in radians.
Parameters
srcObjGiven object.
cMassCenter of mass of given object.
binObjFlagGiven object is binary if non zero.
dstErrNumDestination pointer for error number, may be NULL if not required.

References _WlzValues::core, _WlzDomain::core, _WlzGreyP::dbp, _WlzObject::domain, _WlzGreyP::flp, _WlzGreyP::inp, _WlzIntervalWSpace::lftpos, _WlzIntervalWSpace::linpos, _WlzGreyWSpace::pixeltype, _WlzGreyP::rgbp, _WlzIntervalWSpace::rgtpos, _WlzGreyP::shp, _WlzObject::type, _WlzCoreDomain::type, _WlzCoreValues::type, _WlzGreyWSpace::u_grintptr, _WlzGreyP::ubp, _WlzObject::values, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_ABS, WLZ_DBG, WLZ_DBG_LVL_1, WLZ_DBG_LVL_FN, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_INTERVALDOMAIN_INTVL, WLZ_INTERVALDOMAIN_RECT, WLZ_M_PI_2, WLZ_RASTERDIR_ILIC, WLZ_RGBA_MODULUS, WlzEndGreyScan(), WlzInitGreyScan(), WlzInitRasterScan(), WlzNextGreyInterval(), and WlzNextInterval().

WlzAffineTransform* WlzRegCCorObjs ( WlzObject tObj,
WlzObject sObj,
WlzAffineTransform initTr,
WlzTransformType  trType,
WlzDVertex2  maxTran,
double  maxRot,
int  maxItr,
WlzWindowFnType  winFn,
int  noise,
int  inv,
int *  dstConv,
double *  dstCCor,
WlzErrorNum dstErr 
)

Registers the two given objects using a frequency domain cross correlation.

Returns
Affine transform which brings the two objects into register.
    Registers the two given objects using a frequency domain
          cross correlation.  An affine transform is computed,
          which when applied to the source object takes it into
    register with the target object.
    Because frequency domain cross correlation (which relies on
    the FFT) is used the objects are padded out to arrays which
    are an integer power of two in size. This padding introduces
    significant influence of the objects boundaries and in many
    cases the registration will be dominated by the boundaries.
    To avoid the boundary problem, two methods are available -
    using a window function and adding Gaussian noise.
    The window functions apply a weight to objects values
    which is high at the objects centre of mass and decays
    towards the object boundary. Gaussian noise is added by
    placing the object on an array filled with with random
    values that have the same mean and varience as the object's
    values.

    The objects are assumed to have high foreground values and
    low background values. If this is no the case the invert
    grey values parameter should be set.
Parameters
tObjThe target object.
sObjThe source object to be registered with target object.
initTrInitial affine transform to be applied to the source object prior to registration. May be NULL.
trTypeRequired transform type.
maxTranMaximum translation.
maxRotMaximum rotation.
maxItrMaximum number of iterations, if \(\leq\) 0 then infinite iterations are allowed.
winFnThe window function to use.
noiseUse Gaussian noise if non-zero.
dstConvDestination ptr for the convergence flag (non zero on convergence), may be NULL.
invInvert values of both objects if non-zero.
dstCCorDestination ptr for the cross correlation value, may be NULL.
dstErrDestination error pointer, may be NULL.

References AlcCalloc(), AlcDouble2Free(), AlcFree(), AlcMalloc(), AlgBitNextPowerOfTwo(), AlgCrossCorrelate2D(), AlgCrossCorrPeakXY(), _WlzValues::core, _WlzDomain::core, _WlzGreyV::dbv, _WlzObject::domain, _WlzGreyV::inv, _WlzAffineTransformPrim::theta, _WlzAffineTransformPrim::tx, _WlzAffineTransformPrim::ty, _WlzPixelV::type, _WlzObject::type, _WlzGreyV::ubv, _WlzPixelV::v, _WlzObject::values, _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex3::vtX, _WlzIVertex2::vtY, _WlzDVertex2::vtY, _WlzIVertex3::vtY, WLZ_2D_DOMAINOBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_ERR_VALUES_NULL, WLZ_GREY_DOUBLE, WLZ_GREY_INT, WLZ_GREY_UBYTE, WLZ_INTERPOLATION_NEAREST, WLZ_M_PI, WLZ_MAX, WLZ_MIN, WLZ_NINT, WLZ_SAMPLEFN_GAUSS, WLZ_TRANSFORM_2D_AFFINE, WLZ_TRANSFORM_2D_TRANS, WLZ_WINDOWFN_NONE, WlzAffineTransformFromPrimVal(), WlzAffineTransformIsIdentity(), WlzAffineTransformObj(), WlzAffineTransformPrimGet(), WlzAffineTransformProduct(), WlzArrayStats2D(), WlzAssignObject(), WlzAutoCor(), WlzBoundingBox2I(), WlzCopyObject(), WlzFreeAffineTransform(), WlzFreeObj(), WlzFromArray2D(), WlzGreySetRange(), WlzGreyStats(), WlzPolarSample(), WlzSampleObj(), WlzSetBackground(), WlzToArray2D(), WlzValueConvertPixel(), WlzWindow(), WlzWriteObj(), _WlzIBox2::xMax, _WlzIBox2::xMin, _WlzIBox2::yMax, and _WlzIBox2::yMin.