Bookstein Shape Coordinates

Shape Coordinates用以描述Object剔除掉Euclidean Similarity Transformation(移动、旋转和缩放)变量后的Shape属性。本文介绍Bookstein Shape Coordinates在二维和三维数据中的应用。

Bookstein-type coordinates for 2D data

Definition 1: Let ( x j , y j ) , j = 1 , … , k , (x_{j},y_{j}),j=1,\dots,k, (xj,yj),j=1,,k, be k ≥ 3 k\ge3 k3 landmarks in a plane (m = 2 dimensions). Bookstein coordinates ( x j B , y j B ) T , j = 3 , … , k (x_{j}^{B},y_{j}^{B})^{T},j=3,\dots,k (xjB,yjB)T,j=3,,k, are the remaining coordinates of an object after translating, rotating and rescaling the baseline to ( − 1 2 , 0 ) (-\frac{1}{2},0) (21,0) and ( 1 2 , 0 ) (\frac{1}{2},0) (21,0) so that
x j B = [ ( x 2 − x 1 ) ( x j − x 1 ) + ( y 2 − y 1 ) ( y j − y 1 ) ] / D 12 2 − 1 2 , y j B = [ ( x 2 − x 1 ) ( y j − y 1 ) + ( y 2 − y 1 ) ( x j − x 1 ) ] / D 12 2 , \begin{aligned} & x_{j}^{B} = [(x_{2}-x_{1})(x_{j}-x_{1}) + (y_{2}-y_{1})(y_{j}-y_{1})]/D_{12}^{2} -\frac{1}{2}, \\ & y_{j}^{B} = [(x_{2}-x_{1})(y_{j}-y_{1}) + (y_{2}-y_{1})(x_{j}-x_{1})]/D_{12}^{2}, \end{aligned} xjB=[(x2x1)(xjx1)+(y2y1)(yjy1)]/D12221,yjB=[(x2x1)(yjy1)+(y2y1)(xjx1)]/D122,

where j = 3 , … , k j = 3,\dots,k j=3,,k, D 12 2 = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 &gt; 0 D_{12}^{2} = (x_{2}-x_{1})^{2} +(y_{2}-y_{1})^2 \gt 0 D122=(x2x1)2+(y2y1)2>0 and − ∞ &lt; x j B , y j B &lt; ∞ -\infty \lt x_{j}^{B},y_{j}^{B} \lt \infty <xjB,yjB<.

推导:
Step 1: Translating(将 ( x 1 , y 1 ) T (x_{1},y_{1})^{T} (x1,y1)T移动到 ( x 1 B , y 1 B ) T = ( 0 , 0 ) T (x_{1}^{B},y_{1}^{B})^{T}=(0,0)^{T} (x1B,y1B)T=(0,0)T,得到所有landmarks坐标的平移向量)
[ 0 0 ] − [ x 1 y 1 ] = [ − x 1 − y 1 ] \begin{bmatrix} 0 \\ 0 \end{bmatrix} - \begin{bmatrix} x_{1} \\ y_{1} \end{bmatrix} = \begin{bmatrix} -x_{1} \\ -y_{1} \end{bmatrix} [00][x1y1]=[x1y1]

Step 2: Rotation(借助旋转矩阵Rotation Matrix,将 ( x 2 , y 2 ) T (x_{2},y_{2})^{T} (x2,y2)T移动到X轴上 ( x 2 ′ , 0 ) T (x_{2}^{\prime},0)^{T} (x2,0)T
关于原点逆时针旋转 θ \theta θ的矩阵是:
[ cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ] \begin{bmatrix} \cos\theta &amp; -\sin\theta \\ \sin\theta &amp; \cos\theta \end{bmatrix} [cosθsinθsinθcosθ]

那么关于原点顺时针旋转 θ \theta θ的矩阵是:
[ cos ⁡ ( − θ ) − sin ⁡ ( − θ ) sin ⁡ ( − θ ) cos ⁡ ( − θ ) ] = [ cos ⁡ θ sin ⁡ θ − sin ⁡ θ cos ⁡ θ ] \begin{bmatrix} \cos(-\theta) &amp; -\sin(-\theta) \\ \sin(-\theta) &amp; \cos(-\theta) \end{bmatrix} = \begin{bmatrix} \cos\theta &amp; \sin\theta \\ -\sin\theta &amp; \cos\theta \end{bmatrix} [cos(θ)sin(θ)sin(θ)cos(θ)]=[cosθsinθsinθcosθ]

tan ⁡ θ = y 2 − y 1 x 2 − x 1 \tan\theta = \frac{y_{2}-y_{1}}{x_{2}-x_{1}} tanθ=x2x1y2y1。因此,得到Bookstein coordinates的旋转矩阵:
[ cos ⁡ θ sin ⁡ θ − sin ⁡ θ cos ⁡ θ ] = [ x 2 − x 1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 y 2 − y 1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 y 1 − y 2 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 x 2 − x 1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 ] = 1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 [ x 2 − x 1 y 2 − y 1 y 1 − y 2 x 2 − x 1 ] \begin{aligned} &amp; \begin{bmatrix} \cos\theta &amp; \sin\theta \\ -\sin\theta &amp; \cos\theta \end{bmatrix} = \begin{bmatrix} \frac{x_{2}-x_{1}}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2}} &amp; \frac{y_{2}-y_{1}}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2}} \\ \frac{y_{1}-y_{2}}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2}} &amp; \frac{x_{2}-x_{1}}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2}} \end{bmatrix} \\ &amp; = \frac{1}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2}} \begin{bmatrix} x_{2}-x_{1} &amp; y_{2}-y_{1} \\ y_{1}-y_{2} &amp; x_{2}-x_{1} \end{bmatrix} \end{aligned} [cosθsinθsinθcosθ]=(x2x1)2+(y2y1)2 x2x1(x2x1)2+(y2y1)2 y1y2(x2x1)2+(y2y1)2 y2y1(x2x1)2+(y2y1)2 x2x1=(x2x1)2+(y2y1)2 1[x2x1y1y2y2y1x2x1]

Step 3: Scaling(将 ( x 2 ′ , 0 ) T (x_{2}^{\prime},0)^{T} (x2,0)T移动到 ( x 2 B , y 2 B ) T = ( 1 , 0 ) T (x_{2}^{B},y_{2}^{B})^{T}=(1,0)^{T} (x2B,y2B)T=(1,0)T,使 ( x 1 B , y 1 B ) T (x_{1}^{B},y_{1}^{B})^{T} (x1B,y1B)T ( x 2 B , y 2 B ) T (x_{2}^{B},y_{2}^{B})^{T} (x2B,y2B)T的距离为1)
1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 \frac{1}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2}} (x2x1)2+(y2y1)2 1

因此,
[ x j B y j B ] = S c a l i n g ∘ R o t a t i o n ∘ T r a n s l a t i n g ( [ x j y j ] ) = 1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 [ x 2 − x 1 y 2 − y 1 y 1 − y 2 x 2 − x 1 ] ( [ x j y j ] + [ − x 1 − y 1 ] ) = 1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 [ ( x 2 − x 1 ) ( x j − x 1 ) + ( y 2 − y 1 ) ( y j − y 1 ) ( y 1 − y 2 ) ( x j − x 1 ) + ( x 2 − x 1 ) ( y j − y 1 ) ] \begin{aligned} &amp; \begin{bmatrix} x_{j}^{B} \\ y_{j}^{B} \end{bmatrix} = Scaling \circ Rotation \circ Translating( \begin{bmatrix} x_{j} \\ y_{j} \end{bmatrix} ) \\ &amp; = \frac{1}{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2} \begin{bmatrix} x_{2}-x_{1} &amp; y_{2}-y_{1} \\ y_{1}-y_{2} &amp; x_{2}-x_{1} \end{bmatrix} (\begin{bmatrix} x_{j} \\ y_{j} \end{bmatrix} + \begin{bmatrix} -x_{1} \\ -y_{1} \end{bmatrix}) \\ &amp; = \frac{1}{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2} \begin{bmatrix} (x_{2}-x_{1})(x_{j}-x_{1}) + (y_{2}-y_{1})(y_{j}-y_{1}) \\ (y_{1}-y_{2})(x_{j}-x_{1}) + (x_{2}-x_{1})(y_{j}-y_{1}) \end{bmatrix} \end{aligned} [xjByjB]=ScalingRotationTranslating([xjyj])=(x2x1)2+(y2y1)21[x2x1y1y2y2y1x2x1]([xjyj]+[x1y1])=(x2x1)2+(y2y1)21[(x2x1)(xjx1)+(y2y1)(yjy1)(y1y2)(xjx1)+(x2x1)(yjy1)]

Step 4: 为了对称性,可将 ( x j B , y j B ) T (x_{j}^{B},y_{j}^{B})^{T} (xjB,yjB)T左移 1 2 \frac{1}{2} 21


Bookstein-type coordinates for 3D data

Step 1: Translating(将 ( x 1 , y 1 , z 1 ) T (x_{1},y_{1},z_{1})^{T} (x1,y1,z1)T移动到 ( x 1 B , y 1 B , z 1 B ) T = ( 0 , 0 , 0 ) T (x_{1}^{B},y_{1}^{B},z_{1}^{B})^{T}=(0,0,0)^{T} (x1B,y1B,z1B)T=(0,0,0)T,得到所有landmarks坐标的平移向量)
[ 0 0 0 ] − [ x 1 y 1 z 1 ] = [ − x 1 − y 1 − z 1 ] \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} - \begin{bmatrix} x_{1} \\ y_{1} \\ z_{1} \end{bmatrix} = \begin{bmatrix} -x_{1} \\ -y_{1} \\ -z_{1} \end{bmatrix} 000x1y1z1=x1y1z1

Step 2: Rotation(借助旋转矩阵Rotation Matrix,将 ( x 2 , y 2 , z 2 ) T (x_{2},y_{2},z_{2})^{T} (x2,y2,z2)T移动到X轴上 ( x 2 ′ , 0 , 0 ) T (x_{2}^{\prime},0,0)^{T} (x2,0,0)T,并将 ( x 3 , y 3 , z 3 ) T (x_{3},y_{3},z_{3})^{T} (x3,y3,z3)T移动到 X − Y X-Y XY平面上 ( x 3 ′ , y 3 ′ , 0 ) T (x_{3}^{\prime},y_{3}^{\prime},0)^{T} (x3,y3,0)T

在这里插入图片描述

( x 2 − x 1 , y 2 − y 1 , z 2 − z 1 ) T (x2-x1,y2-y1,z2-z1)^T (x2x1,y2y1,z2z1)T X X X轴(在 Y − Z Y-Z YZ平面)顺时针旋转:
R x ( θ x ) = [ 1 0 0 0 cos ⁡ θ x sin ⁡ θ x 0 − sin ⁡ θ x cos ⁡ θ x ] R_{x}(\theta_{x}) = \begin{bmatrix} 1 &amp; 0 &amp; 0 \\ 0 &amp; \cos{\theta_{x}} &amp; \sin{\theta_{x}} \\ 0 &amp; -\sin{\theta_{x}} &amp; \cos{\theta_{x}} \end{bmatrix} Rx(θx)=1000cosθxsinθx0sinθxcosθx

( x 2 − x 1 , y 2 − y 1 , z 2 − z 1 ) T (x2-x1,y2-y1,z2-z1)^T (x2x1,y2y1,z2z1)T Y Y Y轴(在 X − Z X-Z XZ平面)顺时针旋转:
R y ( θ y ) = [ cos ⁡ θ y 0 − sin ⁡ θ y 0 1 0 sin ⁡ θ y 0 cos ⁡ θ y ] R_{y}(\theta_{y}) = \begin{bmatrix} \cos{\theta_{y}} &amp; 0 &amp; -\sin{\theta_{y}} \\ 0 &amp; 1 &amp; 0 \\ \sin{\theta_{y}} &amp; 0 &amp; \cos{\theta_{y}} \end{bmatrix} Ry(θy)=cosθy0sinθy010sinθy0cosθy

( x 2 − x 1 , y 2 − y 1 , z 2 − z 1 ) T (x2-x1,y2-y1,z2-z1)^T (x2x1,y2y1,z2z1)T Z Z Z轴(在 X − Y X-Y XY平面)顺时针旋转:
R z ( θ z ) = [ cos ⁡ θ z sin ⁡ θ z 0 − sin ⁡ θ z cos ⁡ θ z 0 0 0 1 ] R_{z}(\theta_{z}) = \begin{bmatrix} \cos{\theta_{z}} &amp; \sin{\theta_{z}} &amp; 0 \\ -\sin{\theta_{z}} &amp; \cos{\theta_{z}} &amp; 0 \\ 0 &amp; 0 &amp; 1 \end{bmatrix} Rz(θz)=cosθzsinθz0sinθzcosθz0001

Step 3: Scaling(将 ( x 2 ′ , 0 , 0 ) T (x_{2}^{\prime},0,0)^{T} (x2,0,0)T移动到 ( x 2 B , y 2 B , z 2 B ) T = ( 1 , 0 , 0 ) T (x_{2}^{B},y_{2}^{B},z_{2}^{B})^{T}=(1,0,0)^{T} (x2B,y2B,z2B)T=(1,0,0)T,使 ( x 1 B , y 1 B , z 1 B ) T (x_{1}^{B},y_{1}^{B},z_{1}^{B})^{T} (x1B,y1B,z1B)T ( x 2 B , y 2 B , z 2 B ) T (x_{2}^{B},y_{2}^{B},z_{2}^{B})^{T} (x2B,y2B,z2B)T的距离为1)

1 ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 + ( z 2 − z 1 ) 2 \frac{1}{\sqrt{(x_{2}-x_{1})^{2} + (y_{2}-y_{1})^2 + (z_{2}-z_{1})^2}} (x2x1)2+(y2y1)2+(z2z1)2 1

因此,
[ x j B y j B z j B ] = S c a l i n g ∘ R x ( θ x ) ∘ R y ( θ y ) ∘ R z ( θ z ) ∘ T r a n s l a t i n g ( [ x j y j z j ] ) \begin{bmatrix} x_{j}^{B} \\ y_{j}^{B} \\ z_{j}^{B} \end{bmatrix} = Scaling \circ R_{x}(\theta_{x}) \circ R_{y}(\theta_{y}) \circ R_{z}(\theta_{z}) \circ Translating( \begin{bmatrix} x_{j} \\ y_{j} \\ z_{j} \end{bmatrix} ) xjByjBzjB=ScalingRx(θx)Ry(θy)Rz(θz)Translating(xjyjzj)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值