Linear Algebra For Image Processing
Linear Algebra For Image Processing
2
.
Linear algebra is a power-full tool. It comprises of
algorithms/methods which helps a lot in the real world specially in
the study and manipulation of images. Images are one of the highly
used medium of communication in today’s digital and social world.
We all share thousands of images, memes etc. to our known ones. But when it comes
to sharing large image files we need to compress it such that the size of image got
reduced significantly keeping the image quality and content as good as possible.
Images are represented as 3 dimensional(2 for height and width and 1 for channel)
array/matrix of pixels, and we all know whenever matrix is coined linear algebra
appears automatically.
3
How computer perceive images
The most common and the simplest way to represent the image is in the form
of a matrix. Basically an image is a matrix of pixels.
Representing a part of the image as a matrix (Image credit: IIT, Madras, NPTEL Deep Learning for Computer Vision)
4
5
What is image processing ?
Image processing is the process of transforming an image into a
digital form and performing certain operations to transform,
enhance, and extract some useful information from it.
It involves the use of algorithms, software, and
hardware to process digital images typically obtained from
sources like cameras, satellites, medical devices, or digital
sensors.
At the heart lies the Linear algebra that provides the essential
mathematical foundation for a wide range of image processing
techniques.
6
Digital image processing
7
• Linear algebra provides a powerful framework for representing and solving
mathematical problems in image processing. It's a versatile tool that can handle a
wide variety of tasks, from basic operations to more complex operations, with a high
degree of efficiency and elegance.
8
Convolution and Filtering:
Linear filters, which are widely used in
image processing for tasks like blurring,
sharpening, and edge detection, can be
expressed as convolution operations,
which are inherently linear
Principal Component Analysis
Low-Rank Approximations:
(PCA): PCA is a linear algebra Methods like singular value
technique used for dimensionality
reduction and feature extraction in decomposition (SVD) are used for
image analysis. It identifies the most approximating images with
significant directions of variation in an Geometric Transformations: reduced dimensions while
image dataset. Transformations like affine preserving essential features.
transformations (including
rotation, scaling, and
translation), which are
fundamental in image
Image Registration: Aligning registration and correction, are
and matching two images, linear operations .
Image Restoration: Techniques
which is vital in medical for removing noise and restoring
images often involve solving linear
imaging, remote sensing, and systems of equations, which can be
computer vision, often relies described using linear algebra.
on linear transformations.
Wavelet Transform: The
discrete wavelet transform (DWT)
is a linear operation used for image
compression and multi-resolution
analysis.
9
GEOMETRIC TRANSFORMATIONS
• LINEAR TRANSFORMATION
10
In practice A linear transformation is used as a matrix –vector product.
11
• Zero vector is always mapped to zero vector on applying linear transformation
• Parallel lines remain parallel.
• Linear transformations preserve lines and ratios of lengths over each line.
• Linear transformations may not preserve angles and length.
• It is quite useful in performing following operations:
• Image rotations
• Image shear
• Image scaling
• Image flip
12
• AFFINE TRANSFORMATIONS
An affine transformation consists of two parts: a linear transformation and a
translation.
13
• Affine transformations may even change the origin.
• Affine transformations preserve lines and ratios of lengths over each line.
• Affine transformations may not preserve angles and length.
• Parallel lines remain parallel.
14
When we move from cartesian to homogenous
coordinates 2D image is moved to z=1 plane in
3D .
Embedding 2D image in 3D is useful to perform
linear transformation
16
SVD
18
Rank analysis
19
Kernels CONVOLUTION
https://en.wikipedia.org/wiki/Kernel_(image_processing)
20
The emboss kernel givens
An outline kernel is used to highlight the illusion of depth by
The blur kernel large differences in pixel values. A emphasizing the differences
de-emphasizes pixel next to neighbor pixels with of pixels in a given
differences in close to the same intensity will direction. In this case, in a
adjacent pixel appear black in the new image while direction along a line from
values one next to neighbor pixels that the top left to the bottom
differ strongly will appear white. right.
21
Original Emboss Outline Blur
22
Convolution plays a
key role in
enhancing,
analyzing, and
transforming images
for various
applications,
including computer
vision, image
enhancement, and
deep learning.
23
PCA
24
Step 1: Calculate Mean of each features
25
Image Compression Using PCA
26
• Image Inpainting:
• 3D Reconstruction:
Reconstructing a Filling in missing or
three-dimensional corrupted parts of
scene from a set of 2D an image with
images. It's applied in plausible content.
fields like computer Object Recognition and It's used for image
Image Compression:
vision, cultural Tracking: Detecting and
More advanced • restoration and
tracking objects within
heritage compression algorithms
images or video streams • editing.
preservation, like JPEG 2000 and HEVC
is a complex operation.
and virtual (H.265) involve complex
It's fundamental in
mathematical operations
reality. surveillance, robotics,
to reduce data size while
and autonomous
preserving image quality
vehicles
30
• https://medium.com/analytics-vidhya/compressing-images-using-linear-algebra-
bdac64c5e7ef
• Kernels / Convolution / Image Filtering | Computer Vision (wordpress.com)
31