主要内容

PiecewiseLinearTransformation2D

二维分段线性几何变换

描述

一个PiecewiseLinearTransformation2D对象封装了一个二维分段线性几何变换。

创建

您可以创建PiecewiseLinearTransformation2D对象使用以下方法:

  • fitgeotrans函数,它估计在两个图像之间映射控制点对的几何变换。

  • images.geotrans.PiecewiseLinearTransformation2D这里描述的函数。此函数将创建PiecewiseLinearTransformation2D对象使用固定点和移动点的坐标。

描述

例子

tform = images.geotrans.PiecewiseLinearTransformation2D (movingPoints定点创建一个PiecewiseLinearTransformation2D对象给定控制点坐标在movingPoints定点,分别在移动图像和固定图像中定义匹配的控制点。

输入参数

全部展开

x- - -y-移动图像中控制点的坐标,指定为2矩阵。控制点的数量一定要大于等于n

数据类型:|

x- - -y-固定图像中控制点坐标,指定为2矩阵。控制点的数量一定要大于等于n

数据类型:|

属性

全部展开

输入点和输出点的几何变换的维数,指定值2。

对象的功能

outputLimits 找出给定输入空间限制的输出空间限制
transformPointsInverse 应用几何逆变换

例子

全部折叠

将分段线性变换拟合到一组固定和移动的控制点上,这些控制点实际上是通过一个全局仿射二维变换跨域关联起来的。

创建一个2D仿射变换。

θ= 10;tformAffine = affine2d([cosd(theta) -sind(theta) 0;信德(θ)cosd(θ)0;0 0 1])
tformAffine = affine2d with properties: T: [3x3 double

任意选择6对控制点。

fixedPoints = [10 20;10 5;2 3;0 5;5 3;-10 -20);

对不动点进行正向几何变换,获得通过某种几何变换关联的动点和动点的效果。

movingPoints = transformPointsForward (tformAffine定点)
movepoints = 13.3210 17.9597 10.7163 3.1876 2.4906 2.6071 0.8682 4.9240 -4.4031 3.8227 -13.3210 -17.9597

估计映射的分段线性变换movingPoints定点

tformPiecewiseLinear = images.geotrans.PiecewiseLinearTransformation2D (movingPoints定点)
tformpiecewiselineel = PiecewiseLinearTransformation2D与属性:维度:2

验证PiecewiseLinearTransformation2D对象在控制点。

movingPointsComputed = transformPointsInverse (tformPiecewiseLinear、定点);errorInFit =函数(movingPointsComputed (: 1) -movingPoints (: 1),...movingPointsComputed (:, 2) -movingPoints (:, 2))
0 0 0 0 0 0 0
介绍了R2013b