简单几何变换

    xiaoxiao2024-01-10  151

    简单几何变换

    几何表示2D几何变换translation 平移rotation+transform (平移+旋转)刚性变换Similarity相似变换(旋转+按比缩放+平移)Affine放射变换projective 投影影变换(透视变换、同态映射) 3D几何变换 几何变换就是空间变换,是图形学的基础算法,在计算机视觉中应用也比较广泛。本文就简单介绍集中基础几何变换

    几何表示

    2D几何变换

    “名场面”如下图:2D 平面基本变换

    translation 平移

    x ′ = x + t x x^{'} = x+t_{x} x=x+tx x ′ = x + t y x^{'} = x+t_{y} x=x+ty 矩阵形式: [ x ′ y ′ 1 ] = [ 1 0 t x 0 1 t y 0 0 1 ] [ x y 1 ] \left[ \begin{matrix} x^{'} \\ y^{'} \\ 1 \end{matrix} \right] = \left[ \begin{matrix} 1 & 0 & t_x \\ 0 & 1 & t_y \\ 0 & 0 & 1 \end{matrix} \right] \left[ \begin{matrix} x \\ y \\ 1 \end{matrix} \right] xy1=100010txty1xy1

    rotation+transform (平移+旋转)刚性变换

    x ′ = x c o s θ − y s i n θ + t x x^{'}=x cos\theta-ysin\theta+t_x x=xcosθysinθ+tx y ′ = x c o s θ + y s i n θ + t y y^{'}=x cos\theta+ysin\theta+t_y y=xcosθ+ysinθ+ty 矩阵形式: [ x ′ y ′ 1 ] = [ c o s θ − s i n θ t x s i n θ c o s θ t y 0 0 1 ] [ x y 1 ] \left[ \begin{matrix} x^{'} \\ y^{'} \\ 1 \end{matrix} \right] = \left[ \begin{matrix} cos\theta & -sin\theta & t_x\\ sin\theta & cos\theta & t_y \\ 0 & 0 & 1 \end{matrix} \right] \left[ \begin{matrix} x \\ y \\ 1 \end{matrix} \right] xy1=cosθsinθ0sinθcosθ0txty1xy1 进一步可表示为: [ P ′ 1 ] = [ R t 0 T 1 ] = [ P 1 ] \left[ \begin{matrix} P^{'} \\ 1 \end{matrix} \right ] = \left[ \begin{matrix} R & t \\ 0^T & 1 \end{matrix} \right ] = \left[ \begin{matrix} P \\ 1 \end{matrix} \right ] [P1]=[R0Tt1]=[P1] 由上式子可得,改变换共有3个自由度

    Similarity相似变换(旋转+按比缩放+平移)

    x ′ = s x c o s θ − s y s i n θ + t x x^{'}=sx cos\theta-sysin\theta+t_x x=sxcosθsysinθ+tx y ′ = s x c o s θ + s y s i n θ + t y y^{'}=sx cos\theta+sysin\theta+t_y y=sxcosθ+sysinθ+ty 矩阵形式: [ P ′ 1 ] = [ s R t 0 T 1 ] = [ P 1 ] \left[ \begin{matrix} P^{'} \\ 1 \end{matrix} \right ] = \left[ \begin{matrix} sR & t \\ 0^T & 1 \end{matrix} \right ] = \left[ \begin{matrix} P \\ 1 \end{matrix} \right ] [P1]=[sR0Tt1]=[P1] 相似变换保持夹角不变 改变换共有,4个自由度

    Affine放射变换

    基本性质保持不变:

    共线性平行性共线比例不变性凸性 矩阵形式: [ x ′ y ′ 1 ] = [ a 1 a 2 t x a 3 a 4 t y 0 0 1 ] [ x y 1 ] \left[ \begin{matrix} x^{'} \\ y^{'} \\ 1 \end{matrix} \right] = \left[ \begin{matrix} a_1 & a_2 & t_x\\ a_3 & a_4 & t_y \\ 0 & 0 & 1 \end{matrix} \right] \left[ \begin{matrix} x \\ y \\ 1 \end{matrix} \right] xy1=a1a30a2a40txty1xy1 共有6个自由度

    projective 投影影变换(透视变换、同态映射)

    8个自由度,保持共线性 [ x ′ y ′ w ] = [ h 00 h 01 h 02 h 10 h 11 h 12 h 20 h 21 1 ] [ x y 1 ] \left[ \begin{matrix} x^{'} \\ y^{'} \\ w \end{matrix} \right] = \left[ \begin{matrix} h_{00} & h_{01} & h_{02}\\ h_{10} & h_{11} & h_{12} \\ h_{20} & h_{21} & 1 \end{matrix} \right] \left[ \begin{matrix} x \\ y \\ 1 \end{matrix} \right] xyw=h00h10h20h01h11h21h02h121xy1 x ′ = x ′ w x^{'} =\frac{x^{'}}{w} x=wx y ′ = y ′ w y^{'} =\frac{y^{'}}{w} y=wy

    变换矩阵自由度不变性平移[I | t]2方向刚性[R | t]3长度相似[sR | t]4夹角仿射[A]6平行性投影[H]8直线型

    3D几何变换

    变换矩阵自由度不变性平移[I | t]3方向刚性[R | t]6长度相似[sR | t]7夹角仿射[A]12平行性投影[H]15直线型
    最新回复(0)