Woolz Image Processing  Version 1.7.5
WlzAffineTransformLSq.c File Reference

Functions for computing Woolz affine transforms that give the best fit, in a least squares sense, when used to transform one set of vertices to another. More...

Functions

WlzAffineTransformWlzAffineTransformLSq (WlzVertexType vType, int nVT, WlzVertexP vT, int nVS, WlzVertexP vS, int nVW, double *vW, WlzTransformType trType, WlzErrorNum *dstErr)
 Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. The weights are optional but if givn must correspond to the vertices. This function calls either WlzAffineTransformLSq2D() or WlzAffineTransformLSq3D() depending on the given vertex type, see these functions of greater detail. More...
 
WlzAffineTransformWlzAffineTransformLSq2D (int nVT, WlzDVertex2 *vT, int nVTS, WlzDVertex2 *vS, int nVW, double *vW, WlzTransformType trType, WlzErrorNum *dstErr)
 Computes the affine transform which gives the best (least squares) fit when used to transform the 2D source vertices onto the target vertices. This function calls the appropriate 2D least squares affine transform function: More...
 
WlzAffineTransformWlzAffineTransformLSq3D (int nVT, WlzDVertex3 *vT, int nVS, WlzDVertex3 *vS, int nVW, double *vW, WlzTransformType trType, WlzErrorNum *dstErr)
 Computes the affine transform which gives the best (least squares) fit when used to transform the 3D source vertices onto the target vertices. This function calls the appropriate 3D least squares affine transform function: More...
 
WlzAffineTransformWlzAffineTransformLSqTrans2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nV, WlzErrorNum *dstErr)
 Computes the 2D translation transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. More...
 
WlzAffineTransformWlzAffineTransformLSqTrans3D (WlzDVertex3 *vT, WlzDVertex3 *vS, double *vW, int nV, WlzErrorNum *dstErr)
 Computes the 3D translation transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. More...
 
WlzAffineTransformWlzAffineTransformLSqGen2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nV, WlzErrorNum *dstErr)
 Computes the general 2D affine transform which gives the best (least squares) fit when used to transform the target vertices onto the source vertices. More...
 
WlzAffineTransformWlzAffineTransformLSqGen3D (WlzDVertex3 *vT, WlzDVertex3 *vS, double *vW, int nV, WlzErrorNum *dstErr)
 Computes the general 3D affine transform which gives the best (least squares) fit when used to transform the target vertices onto the source vertices. More...
 
WlzAffineTransformWlzAffineTransformLSqReg2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nVtx, WlzErrorNum *dstErr)
 Computes the 2D registration transform which gives the best (weighted least squares) fit when used to transform the first set of vertices onto the second using the given match weights. The transform is constrained to rotation and translation only. The algorithm has been addapted from the algorithm: Arun K.S., Huang T.T. and Blostein S.D. "Least-Squares Fitting of Two 3-D Point Sets" PAMI 9(5), 698-700, 1987, by transforming the problem to a 2D space, including vertex weights and computing the translation component of the transform using

\[ \mathbf{T} = \frac{\sum_{i=0}^{N-1}{w_i^2 \mathbf{x}_i}} {\sum_{i=0}^{N-1}{w_i^2}} \]

\[ \mathbf{x}_i = {\mathbf{p}_i}' - \mathbf{R}\mathbf{p}_i \]

where \(w_i\) are the weights, \({\mathbf{p}_i}'\) are the target vertices, \(\mathbf{p}_i\) are the source vertices and \(\mathbf{R}\) is the rotation matrix. More...

 
WlzAffineTransformWlzAffineTransformLSqScale2D (WlzDVertex2 *vT, WlzDVertex2 *vS, double *vW, int nVtx, WlzErrorNum *dstErr)
 Computes the 2D transform to rescale the source vertices. The assumption is that the source vertices have a different "spread" to the target and this re-scaling transform can be used in conjunction with the rigid-body (registration) tansform to determine a re-scaled shape-preserving transform i.e. no-shear. It is called by WlzAffineTransformLSq2D when transform type WLZ_TRANSFORM_2D_NOSHEAR is requested. The algorithm compares the mean distance from the centroid of each set of vertices. More...
 
WlzAffineTransformWlzAffineTransformLSqReg3D (WlzDVertex3 *vT, WlzDVertex3 *vS, double *vW, int nV, WlzErrorNum *dstErr)
 Computes the Woolz 3D registration transform which gives the best (weighted least squares) fit when used to transform the first set of vertices onto the second using the given match weights. The transform is constrained to rotation and translation only. The algorithm has been addapted from the algorithm: Arun K.S., Huang T.T. and Blostein S.D. "Least-Squares Fitting of Two 3-D Point Sets" PAMI 9(5), 698-700, 1987, by including vertex weights and computing the translation component of the transform using

\[ \mathbf{T} = \frac{\sum_{i=0}^{N-1}{w_i^2 \mathbf{x}_i}} {\sum_{i=0}^{N-1}{w_i^2}} \]

\[ \mathbf{x}_i = {\mathbf{p}_i}' - \mathbf{R}\mathbf{p}_i \]

where \(w_i\) are the weights, \({\mathbf{p}_i}'\) are the target vertices, \(\mathbf{p}_i\) are the source vertices and \(\mathbf{R}\) is the rotation matrix. More...

 
WlzAffineTransformWlzAffineTransformLSqRegWlz2D (WlzDVertex2 *vT, WlzDVertex2 *vS, int nV, WlzErrorNum *dstErr)
 Computes the Woolz 2D registration transform which gives the best (least squares) fit when used to transform the source vertices onto the target vertices. This is an old function which should not be used in new code, use WlzAffineTransformLSqReg2D() instead. More...
 
WlzAffineTransformWlzAffineTransformLSqDQ2D (int nV, double *vW, WlzDVertex2 *vT, WlzDVertex2 *vS, int nN, double *nW, WlzDVertex2 *nT, WlzDVertex2 *nS, WlzErrorNum *dstErr)
 Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the first set of vertices and normals onto the second set. The vertex and normal weighting factors must be in the range [0-1]. See WlzAffineTransformLSqDQ3D() from which this function has been derived. This algorithm may be less stable than the SVD algorithm particularly when the data are co–linear, use WlzAffineTransformLSq2D() instead. More...
 
WlzAffineTransformWlzAffineTransformLSqDQ3D (int nV, double *vW, WlzDVertex3 *vT, WlzDVertex3 *vS, int nN, double *nW, WlzDVertex3 *nT, WlzDVertex3 *nS, WlzErrorNum *dstErr)
 Computes the Woolz affine transform which gives the best (least squares) fit when used to transform the source vertices and normals onto the target vertices. The vertex and normal weighting factors must be in the range [0-1]. This algorithm may be less stable than the SVD algorithm particularly when the data are co–linear, use WlzAffineTransformLSq3D() instead. More...
 

Detailed Description

Functions for computing Woolz affine transforms that give the best fit, in a least squares sense, when used to transform one set of vertices to another.

Author
Bill Hill, Richard Baldock
Date
March 1999
Version
Id
e1e091f42ba1d89b01cf4e1c57b8683c40cd8f0b
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.