Add design shear

This commit is contained in:
PinkR1ver 2024-03-22 11:30:02 +08:00
parent bf19f32af6
commit c180ec2af4
5 changed files with 86 additions and 0 deletions

View File

@ -32,6 +32,8 @@ date: 2024-02-28
* [Code Framework Learn](computer_sci/code_frame_learn/MOC.md)
* [Design](design/design_moc.md)
🦺 I also need some tool to help me:
* [Git](toolkit/git/git_MOC.md)

View File

@ -0,0 +1,10 @@
---
title: Design - MOC
tags:
- MOC
- design
date: 2024-03-22
---
# Transform
* [Shear](design/transform/shear.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

View File

@ -0,0 +1,74 @@
---
title: Shear
tags:
- basic
- "#design"
date: 2024-03-22
---
# Detail
在二维图像处理中shear操作是指将图像沿水平或垂直方向进行**错切**从而改变图像的形状。shear操作可以用仿射变换矩阵来表示如下所示为一个Horizontal Shear
$$
\begin{bmatrix}
1 & \tan(\theta) \\
0 & 1
\end{bmatrix}
$$
$$
\begin{bmatrix}
x' \\
y'
\end{bmatrix} =
\begin{bmatrix}
x + my \\
y
\end{bmatrix} =
\begin{bmatrix}
1 & m \\
0 & 1 \\
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
$$
上述矩阵的效果如图:
![](design/transform/attachments/Pasted%20image%2020240322111022.png)
同时还有Vertical Shear
$$
\begin{bmatrix}
1 & 0 \\
\tan(\theta) & 1
\end{bmatrix}
$$
$$
\begin{bmatrix}
x' \\
y'
\end{bmatrix} =
\begin{bmatrix}
x \\
mx + y
\end{bmatrix} =
\begin{bmatrix}
1 & 0 \\
m & 1 \\
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
$$
![](design/transform/attachments/Pasted%20image%2020240322111458.png)
# Reference
* https://en.wikipedia.org/wiki/Shear_mapping