Module 1 Chapter 3 CV
Module 1 Chapter 3 CV
●
The simplest kinds of image processing transforms are point operators, where each
output pixel’s value depends on only the corresponding input pixel value.
●
Examples of such operators include brightness and contrast adjustments as well as
color correction and transformations.
●
Point operators are also called as pixel transforms.
●
A general image processing operator is a function that takes an input image and produces an
output image.
●
In the continuous domain, this can be denoted as:
g(x) = h(f(x))
●
where x is in the dimension of the input and output functions f and g (2D in case of images).
●
For discrete images, the domain consists of a finite number of pixel locations, x = (i, j), and we
can write as:
g(i, j) = h(f(i, j))
Common types include:
1. Gamma Correction - Adjusts brightness using a power-law function.
2. Contrast Stretching - Expands pixel intensity range for better visibility.
3. Thresholding- Converts an image to binary by setting pixels above a threshold to 255 and others to 0.
4. Log Transform- Enhances dark regions by applying a logarithmic function.
5. Negative Transformation - Inverts pixel values to create a negative image.
1. Multiplication and addition with a constant.
●
Two commonly used point processes are multiplication and addition with a constants:
g(x) = a*f(x) + b
●
The parameters a > 0 and b are often called the gain and bias parameters;
●
Sometimes these parameters are said to control contrast and brightness, respectively.
●
The bias and gain parameters can also be spatially varying,
g(x) = a(x)*f (x) + b(x)
2. Dyadic (two-input) operator
●
Another commonly used dyadic (two-input) operator is the linear blend operator.
g(x) = (1 − α)f0(x) + αf1(x).
●
By varying α from 0 → 1, this operator can be used to perform a temporal cross-dissolve
between two images or videos, as seen in slide shows and film production, or as a
component of image morphing algorithms.
3. Gamma Correction (power law):
●
Gamma correction is a nonlinear process that adjusts the brightness of images to match how
humans perceive light.
●
Gamma correction applies a power function to each pixel value in an image.
●
The relationship between the input signal brightness Y and the transmitted signal Y ` is
given by Y ` = Y1/γ. or
g(x) = [f(x)]1/γ
●
Gamma values less than 1 make the image darker.
●
Gamma values greater than 1 make the image lighter.
●
A gamma value of 1 has no effect on the input image.
●
where a gamma value of γ ≈ 2.2 is a reasonable fit for most digital cameras.
Color transforms: Image composition and
matting
●Image matting is a technique that separates an object from its background by estimating the
transparency of each pixel in an image.
●
It's a key technique in image processing and is used in many image and video editing applications.
● Formally, matting techniques take as input in image F, which is assumed to be a convex
combination of a foreground image and a background image B as:
C = (1 − α)B + αF
●
where α is the pixel's foreground opacity or matte.
Image Histogram:
●
Image histogram shows frequency of pixel intensity values.
●
x axis shows the gray level intensities
●
y axis shows the frequency of intensities.
Histogram equalization
●
Histogram equalization is used for enhancing the contrast of the images.
●
The first two steps are calculating the PDF andC D F .
●
All pixel values of the image will be equalized.
Step-1: Find the frequencies of
each pixel
Image details
Frequency of pixel
Step-2 Estimate CDF of each pixel
intensity
Step-3 Compute h(v) for each pixel
intensity
●
Min = 52
•cdfMaxis =the
154minimum
●
min non-zero value of the cumulative
distribution function (in this case 1), M × N gives the image's number
of pixels (for the example above 64, where M is width and N the
height) and L is the number of grey levels used (in most cases, like
this one, 256).
Histogram
equalization
New min. value = 0, old min. value 52
New max. value = 255, old max. value
154
Original Equalized
Neighborhood or Area-based operation
□Neighborhood operations involves manipulating the values of a given pixel based on
the values of its neighboring pixels.
□These operations use a local region, or pixels surrounding in the pixel to compute
its new value.
□Neighborhood operators can be used to filter images to add soft blur, sharpen details,
accentuate edges, or remove noise.
●
The entries in the weight kernel or mask h(k, l) are often called the filter coefficients.
●
The above correlation operator can be more
compactly notated as g = f⊗h.
Neighborhood filtering
(65x0.1)+(98x0.1)+(123x0.1)+(65x0.1)+(96x0.2)+(115x0.1)+(63x0.1)+(91x0.1)+(107x0.1) = 92
Convolution filtering
●
A common variant of linear filter is convolution
operator.
●
where the sign of the offsets in f has been reversed, This is called the convolution operator
g = f∗h,
●
and h is then called the impulse response function.
Separable Filtering
●
The process of performing a convolution requires K 2 (multiply-add) operations per
pixel, where K is the size (width or height) of the convolution kernel.
●
This operation can be significantly speed up by first performing a 1D horizontal
convolution followed by a 1D vertical convolution, which requires a total of 2K
operations per pixel.
●
A convolution kernel for which this is possible is said to be separable.
Separable Filtering
Example Filters
1)Moving average or box filter:
Averages the pixel values in a K × K
window.
2) Bilinear (Bartlett) filter: A smoother image can be obtained by separably convolving
the image with a piecewise linear “tent” function.
●
A 3x3 version of bilinear filter is shown below.
4) Sobel filter: Linear filtering can also be used as a pre-processing stage to edge
extraction and interest point detection.
●
A 3x3 version of Sobel filter is shown below.
5) Corner detector: The simple corner detector looks for simultaneous horizontal and
vertical second derivatives.
●
A 3x3 version of Corner detector is shown below.
Band-pass and steerable filters
●
More sophisticated kernels can be created by first
smoothing the image with a Gaussian filter.
●
Such filters are known collectively as band-pass filters, since they filter out both
low and high frequencies.
●
The (undirected) second derivative of a two- dimensional image,
●
This is known as the Laplacian operator.
●
Blurring an image with a Gaussian and then taking its Laplacian is equivalent to
convolving directly with the Laplacian of Gaussian (LoG) filter.