矩阵

图像变换

变换矩阵

  1. 缩放

T = ( a 0 0 b ) T = \left( \begin{matrix} a& 0 \\ 0&b \end{matrix} \right) T=(a00b)

  1. 翻转:
  • 关于x轴:

T x = ( 1 0 0 − 1 ) T_x = \left( \begin{matrix} 1&0\\0&-1 \end{matrix} \right) Tx=(1001)

  • 关于y轴:

T y = ( − 1 0 0 1 ) T_y = \left( \begin{matrix} -1 & 0\\0 & 1\end{matrix} \right) Ty=(1001)

  • 关于原点对称:

T = ( − 1 0 0 − 1 ) = T y ∗ T x T = \left( \begin{matrix} -1&0\\0 &-1 \end{matrix} \right) = T_y * T_x T=(1001)=TyTx

  1. 错切:
  • 沿x轴错切:y不变,x=x+ay

T = ( 1 a 0 1 ) T = \left( \begin{matrix} 1&a\\0&1 \end{matrix} \right) T=(10a1)

即对应方程组:

{ x ′ = 1 ∗ x + a ∗ y y ′ = 0 ∗ x + y \left\{ \begin{array}{lr}x' = 1*x + a*y\\y' = 0*x + y \end{array} \right. {x=1x+ayy=0x+y

  • 沿y轴错切:x不变,y=bx+y

T = ( 1 0 b a ) T = \left( \begin{matrix} 1&0\\b&a\end{matrix}\right) T=(1b0a)

  1. 旋转变换:

(x, y) 顺时针旋转 θ \theta θ度:

已知:
tan ⁡ α = y x \tan{\alpha} = \frac{y}{x} tanα=xy
x = cos ⁡ α ∗ d x = \cos{\alpha}*d x=cosαd
y = sin ⁡ α ∗ d y = \sin{\alpha}*d y=sinαd
↓ \downarrow
x ′ = d ∗ cos ⁡ ( α − θ ) = d ∗ ( cos ⁡ α cos ⁡ θ + sin ⁡ α sin ⁡ θ ) = cos ⁡ θ ∗ x + sin ⁡ θ ∗ y x' = d*\cos{(\alpha-\theta)}\\ = d*(\cos{\alpha}\cos{\theta}+\sin{\alpha}\sin{\theta}) \\=\cos{\theta}*x+\sin{\theta}*y x=dcos(αθ)=d(cosαcosθ+sinαsinθ)=cosθx+sinθy
同理:
y ′ = d ∗ sin ⁡ ( α − θ ) = cos ⁡ θ ∗ y − sin ⁡ θ ∗ x y' = d*\sin{(\alpha-\theta)} = \cos{\theta} * y - \sin{\theta}*x y=dsin(αθ)=cosθysinθx

整理得:
(x, y) --顺时针旋转 θ \theta θ度–> ( cos ⁡ θ ∗ x + sin ⁡ θ ∗ y \cos{\theta}*x+\sin{\theta}*y cosθx+sinθy, − sin ⁡ θ ∗ x + cos ⁡ θ ∗ y -\sin{\theta}*x + \cos{\theta} * y sinθx+cosθy)

TIPS:三角公式

  1. sin(α+β)=sinαcosβ+cosαsinβ
  2. cos(α+β)=cosαcosβ-sinαsinβ

T = ( cos ⁡ θ sin ⁡ θ − sin ⁡ θ cos ⁡ θ ) T = \left( \begin{matrix} \cos{\theta} & \sin{\theta}\\-\sin{\theta} & \cos{\theta} \end{matrix} \right) T=(cosθsinθsinθcosθ)

  • 平移:引入仿射变换

单位矩阵 I (Identity):

I 2 = ( 1 0 0 1 ) . . . I_2 = \left( \begin{matrix} 1 & 0 \\ 0 & 1\end{matrix}\right) ... I2=(1001)...

矩阵的逆

  • 定义:

AB = BA = I, 则称B是A的逆矩阵, B = A-1

A称为可逆矩阵(非奇异矩阵 non-singular)
不可逆矩阵(奇异矩阵 singular) 少

A0 = I
A-1 逆矩阵

BA = I ⇒ \Rightarrow B是A的左逆矩阵
AC = I ⇒ \Rightarrow C是A的右逆矩阵
如果A即存在B又存在C ⇒ \Rightarrow B = C

推论:A可逆矩阵一定是方阵

  • 性质:

(A-1)-1 = A
(BA)-1 = B-1A-1

看待矩阵的四个视角

一、二维数据:

每一行:样本

每一列: 特征

二、系统:

线性系统,方程组

三、向量的函数:

变换:输入向量,输出向量

仿射变换:任意变换 --> 矩阵参数求解

四、空间:

线性空间

坐标

图形变换:原图形放到新的空间中

由图形位置反推出空间矩阵

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值