Loading...
Loading...
Linear Algebra for Machine Learning · Axiom Academy
Matrix Operations in Digital Media Digital images are stored as matrices of pixel values. In grayscale, each entry represents intensity (0=black, 255=white). Color images use matrices for each color channel (Red, Green, Blue). To rotate an image by angle θ, we apply the rotation matrix to each pixel coordinate: For 90° clockwise rotation (θ = -90°), the matrix is: Each pixel (x, y) maps to its rotated position (x', y'). The entire image rotates around the center. With sx = sy = 0.5, the image shrinks to half size. With sx = sy = 2, it doubles. A simple blur is a 3×3 kernel (small matrix) convolved with the image. Each pixel becomes the average of itself and neighbors: Apply this to every 3×3 patch of the image to blur it. The Sobel filter detects edges by computing gradients: This kernel highlights vertical edges. Use a 90° rotated version for horizontal edges. Brightness: Add a constant to all pixels Contrast: Multiply all pixels by a constant Photoshop/GIMP: All filters are matrix operations Instagram Filters: Combinations of rotation, scaling, and convolution Medical Imaging: CT scans use matrix transformations for reconstruction Computer Vision: Feature detection uses convolution matrices Face Recognition: Images converted to vectors, compared with matrices Modern GPUs are optimized for matrix operations, which is why image processing is so fast. A single GPU can perform millions of matrix operations per second, enabling real-time video processing.
This is the written version of the interactive lesson above. See the full Linear Algebra for Machine Learning course.