仿射变换与透视变换
仿射变换是指在几何中,一个向量空间进行一次线性变换并接上一个平移,变换为另一个向量空间。 基本的图像变换就是二维坐标的变换:从一个二维坐标 $(x, y)$ 到另一个二维坐标 $(u, v)$ 的线性变换: $$ \begin{split} u = a_{1}x+b_{1}y+c_{1} \newline v = a_{2}x+b_{2}y+c_{2} \end{split} $$ 写成矩阵的形式: $$\begin{bmatrix} u \newline v \end{bmatrix} = \begin{bmatrix} a_{1} & b_{1} \newline a_{2} & b_{2} \end{bmatrix} \begin{bmatrix} x \newline y \end{bmatrix} + \begin{bmatrix} c_{1} \newline c_{2} \end{bmatrix}$$ $$R=\begin{bmatrix} a_{1} & b_{1} \newline a_{2} & b_{2} \end{bmatrix},t=\begin{bmatrix} c_{1} \newline c_{2} \end{bmatrix},T=\begin{bmatrix} R & t \end{bmatrix}$$ 矩阵 $T$ 就是仿射变换的变换矩阵,$R$ 为线性变换矩阵,$t$ 为平移矩阵,简单来说,仿射变换就是线性变换+平移。变换后直线依然是直线,平行线依然是平行线,直线间的相对位置关系不变,因此非共线的三个对应点便可确定唯一的一个仿射变换,线性变换 4 个自由度 + 平移 2 个自由度 →仿射变换自由度为 6。 ...
刚体变换
三维空间坐标的刚体变换可分为旋转和平移两个步骤,用 $R_{A}^{B} = \begin{bmatrix} u_{x} & v_{x} & w_{x} \newline u_{y} & v_{y} & w_{y} \newline u_{z} & v_{z} & w_{z} \end{bmatrix}$ 表示旋转矩阵,用 $t_{A}^{B} = \begin{bmatrix} t_{x} \newline t_{y} \newline t_{z} \end{bmatrix}$ 表示平移矩阵。 坐标系A到B刚体变换形式为: $$\begin{bmatrix} x^{’} \newline y^{’} \newline z^{’} \end{bmatrix} = R_{A}^{B} \ast \begin{bmatrix} x \newline y \newline z \end{bmatrix} + t_{A}^{B}$$ 用齐次变换矩阵 $T_{A}^{B}$ 的表示形式为: $$\begin{bmatrix} x_{’} \newline y_{’} \newline z_{’} \newline 1 \end{bmatrix} = T_{A}^{B} \ast \begin{bmatrix} x \newline y \newline z \newline 1 \end{bmatrix} = \begin{bmatrix} R_{A}^{B} & t_{A}^{B} \newline 0 & 1 \end{bmatrix} \ast \begin{bmatrix} x \newline y \newline z \newline 1 \end{bmatrix}$$ ...
WSL导入导出
默认情况WSL会安装在C盘,可以将其迁移到其他盘,这里使用WSL提供的导入和导出命令。 关闭所有的WSL,查询要导出的名称: wsl --shutdown wsl -l -v NAME STATE VERSION Ubuntu-22.04 Stopped 2 将要导出的WSL保存到D盘: wsl --export Ubuntu-22.04 D:\Ubuntu-22.04.tar 注销原有的WSL: wsl --unregister Ubuntu-22.04 在D盘安装WSL: wsl --import Ubuntu-22.04 D:\WSL\Ubuntu-22.04 D:\Ubuntu-22.04.tar
Use tldraw in Vite
Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects. Is consists of two major parts: A dev server that provides rich feature enhancements over native ES modules, for example extremly fast Hot Module Replacement(HMR). A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production. tldraw is a library for creating infinite canvas experiences in React. ...
Build Emacs From Source
Windows 11 features built-in support for running Linux GUI applications. Emacs 29 has became a real GTK application, gone with the blurry fonts problem. Firstly, install essential packages in WSL2 Ubuntu 24.04. Native compilation support is enabled by default with Emacs 30, install libgccjit0 and libgccjit-xx-dev to build this feature. apt-get update apt-get install build-essential libgtk-3-dev libgnutls28-dev libtiff5-dev libgif-dev libjpeg-dev libpng-dev libxpm-dev libncurses-dev texinfo sqlite3 libsqlite3-dev libjansson4 libjansson-dev autoconf apt-get install libgccjit0 libgccjit-13-dev And in Emacs 29, tree-sitter support is built-in. Now build tree-sitter from source code, tree-sitter library will be installed into /usr/local/lib. ...