rotation matrix &reflection matrix

本文介绍了旋转矩阵(包括逆时针旋转和Givens变换),以及反射矩阵在图像处理中的应用,通过矩阵运算消元,达到简化计算的目的。
摘要由CSDN通过智能技术生成

1. rotation matrix

图像逆时针旋转 θ \theta θ的矩阵
Q r o t a t e = [ cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ] (1) Q_{rotate}=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}\tag1 Qrotate=[cosθsinθsinθcosθ](1)
在这里插入图片描述

  • 为了方便计算和表达,我们用 I I I单位矩阵进行分析
    I = [ 1 0 0 1 ] (2) I=\begin{bmatrix}1&0\\0&1\end{bmatrix}\tag2 I=[1001](2)
    可以得到两个点 Q=(1 , 0);Q=( 0, 1),我们将两个向量逆时针旋转 θ \theta θ角度后,可以得到此时的角度
    Q ′ [ 1 , 0 ] = [ cos ⁡ θ sin ⁡ θ ] (3) Q'[1,0]=\begin{bmatrix}\cos\theta\\\sin\theta\end{bmatrix}\tag3 Q[1,0]=[cosθsinθ](3)
    Q ′ [ 0 , 1 ] = [ − sin ⁡ θ cos ⁡ θ ] (4) Q'[0,1]=\begin{bmatrix}-\sin\theta\\\cos\theta\end{bmatrix}\tag4 Q[0,1]=[sinθcosθ](4)
    所以可以得到 I I I单位向量在逆时针旋转 θ \theta θ后的旋转矩阵如下

1.1 结论

Q a n t i c l o c k w i s e = [ cos ⁡ θ − sin ⁡ θ sin ⁡ θ cos ⁡ θ ] (5) Q_{anticlockwise}=\begin{bmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{bmatrix}\tag5 Qanticlockwise=[cosθsinθsinθcosθ](5)

2 Givens 变换

  • Givens 变换的作用是通过旋转,将制定的行上的系数变为0。
  • 定义单位矩阵I
    I = [ 1 0 0 1 ] (6) I=\begin{bmatrix}1&0\\0&1\end{bmatrix}\tag{6} I=[1001](6)
  • 单位矩阵I 可以在图像中用两个点表示 B 1 = [ 1 , 0 ] B_1=[1,0] B1=[1,0],变换后为 B 11 B_{11} B11; B 2 = [ 0 , 1 ] B_2=[0,1] B2=[0,1],变换后为 B 22 B_{22} B22
  • 定义点 A 1 = [ a 11 , a 12 ] A_1=[a_{11},a_{12}] A1=[a11,a12],经过旋转后得到的点为 A 11 = [ a 11 2 + a 12 2 , 0 ] A_{11}=[\sqrt{a_{11}^2+a_{12}^2},0] A11=[a112+a122 ,0]
    在这里插入图片描述
  • 从上图可得
    B 1 = [ 1 0 ] → B 11 = [ cos ⁡ ( θ ) − sin ⁡ ( θ ) ] (7) B_1=\begin{bmatrix}1\\\\0\end{bmatrix}\rightarrow B_{11}=\begin{bmatrix}\cos(\theta)\\\\-\sin(\theta)\end{bmatrix}\tag{7} B1= 10 B11= cos(θ)sin(θ) (7)
    B 2 = [ 0 1 ] → B 22 = [ sin ⁡ ( θ ) cos ⁡ ( θ ) ] (8) B_2=\begin{bmatrix}0\\\\1\end{bmatrix}\rightarrow B_{22}=\begin{bmatrix}\sin(\theta)\\\\\cos(\theta)\end{bmatrix}\tag{8} B2= 01 B22= sin(θ)cos(θ) (8)

2.2 总结

G i v e n s = Q c l o c k w i s e = [ cos ⁡ θ sin ⁡ θ − sin ⁡ θ cos ⁡ θ ] (9) Givens=Q_{clockwise}=\begin{bmatrix}\cos{\theta}&\sin{\theta}\\\\-\sin{\theta}&\cos{\theta}\end{bmatrix}\tag{9} Givens=Qclockwise= cosθsinθsinθcosθ (9)

3. reflection matrix

图像沿着直线 1 2 θ \frac{1}{2}\theta 21θ对称矩阵,反射矩阵

  • 为了方便计算和表达,我们用 I I I单位矩阵进行分析
    I = [ 1 0 0 1 ] (10) I=\begin{bmatrix}1&0\\0&1\end{bmatrix}\tag{10} I=[1001](10)
    可以得到两个点 Q=(1 , 0);Q=( 0, 1),我们将两个向量关于 1 2 θ \frac{1}{2}\theta 21θ直线对称后,可以得到此时的坐标
    在这里插入图片描述
    Q ′ [ 1 , 0 ] = [ cos ⁡ θ sin ⁡ θ ] (11) Q'[1,0]=\begin{bmatrix}\cos\theta\\\sin\theta\end{bmatrix}\tag{11} Q[1,0]=[cosθsinθ](11)
    在这里插入图片描述
    Q ′ [ 0 , 1 ] = [ sin ⁡ θ − cos ⁡ θ ] (12) Q'[0,1]=\begin{bmatrix}\sin\theta\\-\cos\theta\end{bmatrix}\tag{12} Q[0,1]=[sinθcosθ](12)

3.1 结论

Q r e f l e c t i o n = [ cos ⁡ θ sin ⁡ θ sin ⁡ θ − cos ⁡ θ ] (13) Q_{reflection}=\begin{bmatrix}\cos\theta&\sin\theta\\\sin\theta&-\cos\theta\end{bmatrix}\tag{13} Qreflection=[cosθsinθsinθcosθ](13)

4.0 小结

不管我们是通过那种旋转变换,都是为了消元准备,用数学表达如下
[ a b ] ⇒ [ c 0 ] (14) \begin{bmatrix}a\\\\b\end{bmatrix}\Rightarrow \begin{bmatrix}c\\\\0\end{bmatrix}\tag{14} ab c0 (14)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值