Notes on computer vision, from image representation, filtering, and local features to neural networks, generative models, attention, and multimodal learning. The final pages cover OpenCV image dimensions and a notebook sketch. A column vector has n rows and one column: v\in\mathbb R^{n\times1},\qquad v=[v_1,\ldots,v_n]^T Its transpose is a row vector: v^T\in\mathbb R^{1\times n} Uses of Vectors Represents offsets in 2D/3D space, vector point is just a vector from origin Pixel, gradients can be stored as vectors to compute distance calculations A\in\mathbb R^{m\times n},\qquad A=\begin{bmatrix}a_{11}&\cdots&a_{1n}\\\vdots&\ddots&\vdots\\a_{m1}&\cdots&a_{mn}\end{bmatrix} Square matrix: n x n dimensions Grayscale images are stored as an mxn matrix where each entry represents pixel brightness. Upper left corner in these matrices is [y, x] = [0, 0] Color images are stored as mxnx3 matrix (RGB) Three color channels form an image tensor Norm A norm measures vector magnitude and obeys the following properties. Norm properties: Non negativity: for all x∈R^{n},\,f\left( x \right)≥0 Definiteness: f(x)=0\,iff\,x=0 Homogeneity: f\left( tx \right)=\left| t \right|f\left( x \right) for any scalar t Triangle inequality: f\left( x+y \right)≤f\left( x \right)+f\left( y \right) for all x, y Vector Norms L2 Norm (Euclidean Norm) \left\| x \right\|_{2}=\sqrt{\sum\nolimits_{i=1}^{n} x_{i}^{2}} L1 Norm (Manhattan Norm) \left\| x \right\|_{1}=\sum\nolimits_{i=1}^{n} {|x_{i}|} Lp Norm (Generalized Norm) \left\| x \right\|_{p}=\left( \sum\nolimits_{i=1}^{n} {{|x_{i}|}^{p}\,} \right)^{\frac{1}{p}} L-infinity Norm (Maximum Norm) \left\| x \right\|_{∞}=\underset{i}{\operatorname{max}}{|x_{i}|} Vector operations Inner product (Dot Product) x^T y=\sum_{i=1}^{n}x_i y_i\in\mathbb{R} x^Ty=\begin{bmatrix}x_1&\cdots&x_n\end{bmatrix}\begin{bmatrix}y_1\\\vdots\\y_n\end{bmatrix}=x_1y_1+\cdots+x_ny_n A row vector multiplied by a column vector produces one scalar. If B is a unit vector, A⋅B gives the projection of A in the direction of B, A⋅B tells you how much of vector A points in the direction of B, when B has length 1. Projection of one vector onto another Matrix Operations Matrix multiplication If A: m×n, B: n×p, then C=A.B: m×p C=AB,\qquad C_{ij}=a_i^T b_j=\sum_k A_{ik}B_{kj} Each output entry is the dot product of a row of A with a column of B. A=\begin{bmatrix}a_1^T\\\vdots\\a_m^T\end{bmatrix},\quad B=\begin{bmatrix}b_1&\cdots&b_p\end{bmatrix} AB=\begin{bmatrix}a_1^Tb_1&\cdots&a_1^Tb_p\\\vdots&\ddots&\vdots\\a_m^Tb_1&\cdots&a_m^Tb_p\end{bmatrix} Addition \left[ \begin{matrix} a & b \\ c & d \end{matrix} \right]+\left[ \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix} \right]=\left[ \begin{matrix} a+1 & b+2 \\ c+3 & d+4 \end{matrix} \right] \left[ \begin{matrix} a & b \\ c & d \end{matrix} \right]+7=\left[ \begin{matrix} a+7 & b+7 \\ c+7 & d+7 \end{matrix} \right] Scaling \left[ \begin{matrix} a & b \\ c & d \end{matrix} \right]x\,3=\left[ \begin{matrix} 3a & 3b \\ 3c & 3d \end{matrix} \right] Matrix Transpose A=\begin{bmatrix}0&1\\2&3\\4&5\end{bmatrix},\qquad A^T=\begin{bmatrix}0&2&4\\1&3&5\end{bmatrix} Trace Trace(A) = sum of diagonal elements \operatorname{tr}\begin{bmatrix}1&3\\5&7\end{bmatrix}=1+7=8 Trace properties \operatorname{tr}(AB)=\operatorname{tr}(BA) \operatorname{tr}(A+B)=\operatorname{tr}(A)+\operatorname{tr}(B) \operatorname{tr}(ABC)=\operatorname{tr}(BCA)=\operatorname{tr}(CAB) Determinant \det\begin{bmatrix}a&b\\c&d\end{bmatrix}=ad-bc Determinant properties det(AB)=det(A)det(B) det(AB)=det(BA) det(A^{−1})=\frac{1}{det(A)} det(A^{T})=det(A) A square matrix is singular exactly when its determinant is zero. Matrix properties Associative: (AB)C = A(BC) Distributive: A(B+C) = AB+AC Not Commutative: AB≠BA Powers: A^{2}=A×A,\, A^{3}=A×A×A only for square matrices Identity matrix: I_3=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix} Diagonal matrix: D=\operatorname{diag}(3,7,2.5) All off-diagonal entries of a diagonal matrix are zero. Symmetric matrix: A^T=A,\qquad A=\begin{bmatrix}1&2&5\\2&1&7\\5&7&1\end{bmatrix} Skew-symmetric matrix: A^T=-A,\qquad A=\begin{bmatrix}0&2&5\\-2&0&7\\-5&-7&0\end{bmatrix} Matrix Norms Frobenius norm \|A\|_F=\sqrt{\sum_{i=1}^{m}\sum_{j=1}^{n}A_{ij}^{2}}=\sqrt{\operatorname{tr}(A^TA)} Matrix inverse \begin{bmatrix}2&0\\0&3\end{bmatrix}^{-1}=\begin{bmatrix}1/2&0\\0&1/3\end{bmatrix} Inverse properties AA^{−1}=A^{−1}A= Identity\,matrix If inverse exists, \operatorname{det}\left( A \right)≠0 If inverse doesn’t exists, \operatorname{det}\left( A \right)=0 \left( A^{−1} \right)^{−1}=A \left( AB \right)^{−1}=B^{−1}A^{−1} \left( A^{T} \right)^{−1}=\left( A^{−1} \right)^{T} Matrix Rank col-rank(A) - Maximum number of linearly independent column vectors in A row-rank(A) - Maximum number of linearly independent row vectors in A Linear Independence Vectors are linearly independent when no vector can be written as a linear combination of the others; equivalently, only the all-zero coefficients give a zero linear…