2. Image processing actions can be grouped into three sub-areas (Prats-
Montalban et al. 2011):
Image compression, which reduces the memory requirements by removing
the redundancy present in the image, that is, the image information which is
not perceptible to the human eye.
Image preprocessing, which consists of improving the visual quality of the
image by reducing noise, pixel calibration and standardization, enhancing
the edge detection, and making the image analysis step more reliable based
on objective and well established criteria. The term image preprocessing, in
general, is referred to all manipulations on an image, each of which produces
a new image.
Image analysis, which usually returns numeric values and/or graphical
information about the image characteristics that are suited for classification,
defect detection, or prediction of some of the quality properties of the
imaged object. The term image analysis is used when the output is a number
or decision, not an image.
Image processing
2
3. Image: A reproduction or imitation of the form of a person or thing.
A 2D matrix of intensity (grey or color) values.
Images typically generated by illuminating a scene and absorbing
energy reflected by scene objects
Image & Pixel
3
Pixel: A pixel is generally thought of as the smallest single component of a digital image. In above
image, 1 small square represents an image pixel
4. A common type of solid-state detector
in current use is the charge coupled
device (CCD).
At a specific pixel location, the CCD
element is exposed to incident light
energy and it builds up an electric
charge proportional to the intensity of
the incident light.
The electric charge is subsequently
amplified and converted from analog
to digital form.
Image creation: Digital Imaging Device
4
5. An example of the process for creation of a digital image (B. Park, R. Lu , 2015)
Image creation
5
7. Common image formats include:
1 values per point/pixel (B&W or Grayscale)
3 values per point/pixel (Red, Green, and Blue)
4 values per point/pixel (Red, Green, Blue, + “Alpha” or Opacity)
Digital Image Format
8. What is light?
8
The visible portion of the electromagnetic (EM) spectrum. It occurs
between wavelengths of approximately 400 and 700 nanometers.
Electromagnetic (EM) Spectrum
10. The Visible Spectrum
The color of an object is defined by the color of the light that it
reflects . Thus a “blue” object is “blue” because it reflects blue
light.
Intermediate colors are formed when an object reflects two or
more of the additive primaries.
10
11. Radar imaging (radio waves)
Magnetic Resonance Imaging (MRI) (Radio waves)
Microwave imaging
Infrared imaging
Photographs
Ultraviolet imaging telescopes
X‐rays and Computed tomography
Positron emission tomography (gamma rays)
Ultrasound (not EM waves)
Images from EM spectrum
11
12. Basic Image Measurements
12
Spatial resolution-pixel per unit dimension
ppi, dpi, & lpi etc
Pixel bit depth or color depth or Intensity level resolution- number of
shades that can actually be represented by the amount of information saved
for each pixel
Saturation and noise
13. Spatial resolution is defined as the rate, or number of times, at which an
image is sampled during the acquisition or imaging process. More specifically,
it is the frequency of pixels used to capture sample shades in the space of the
object being digitized.
Generally, more pixels per unit dimension means a higher resolution, but the
overall image quality cannot be determined by spatial resolution alone.
Typical array sizes in pixels (or pixel resolution) in many imaging sensors vary
from 640x480 to 2,048x1,536 pixels or even higher.
For reference human vision is >100 million pixels.
Quantitatively, spatial resolution can be described as:(Gonzales and Woods
2008). ppi (pixels per inch), dpi (dots per inch), and lpi (line pairs per inch)
ppi is commonly used for images while dpi and lpi are considered printing
terms.
Resolution (spatial resolution)
13
16. Tone can be defined as each distinguishable variation from white to
black.
Color may be defined as each distinguishable variation on an image
produced by a multitude of combinations of hue (color), value
(lightness-intensity) and chroma (saturation-highest intensity).
If there is not sufficient contrast between an object and it's background
to permit, at least, detection there can be no identification.
While a human interpreter may only be able to distinguish between
ten and twenty shades of grey; interpreters can distinguish at least
100 times more variations of color on color photography than shades
of grey on black and white photography.
Tone/Color
16
17. Saturation: Highest intensity (shade) value above which color is washed out
Noise: grainy texture pattern
Saturation and noise
17
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
18. Pixel bit depth or color depth or Intensity level resolution
18
It is the number of intensity levels (shades) used to represent the image
The more intensity levels used, the finer the level of detail discernable in an
image.
Intensity level resolution usually given in terms of number of bits used to
store each intensity level
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
256 grey levels,
(8bit per pixel)
19. Pixel bit depth or color depth or Intensity level resolution
19
Computers work on a binary system; each bit of data is either 1 or 0.
Each pixel in a raster image is represented by a string of binary digits and
the number of digits is known as the bit depth. Hence, a one-bit image can
assign only one of two values to a single pixel: 0 or 1 (black or white).
An 8-bit (28) gray scale image can assign one of 256 colors to a single
pixel. A 24-bit (2(3x8) RGB image (8-bits each for red, green and blue color
channels) can assign one of 16.8 million colors to a single pixel.
The following formula can be used to calculate the shades using bit
depth
Number of Shades = 2x, where x = the bit depth
To achieve a desired bit depth without any data loss, it is necessary to
digitize a photograph at a higher bit depth and then scale down to the
desired bit depth after any image processing has occurred
20. Several different systems are used to represent color images. The most
common are:
RGB (additive color system),
CMYK (subtractive color system),
HSV and the
CIELAB color space.
The terms color space and color profile can often be used interchangeably,
since a profile is a description or numerical model of a specific color space.
There are two types of profiles: matrix-based and table-based.
Matrix-based profiles use mathematical formulas to describe the 3D color
spaces
Table-based profiles, as the name implies, use a large table of sample
points called a Look-Up Table or LUT to define the 3D color space
Color representation
20
21. RGB is a color model that uses the three primary (red, green, blue) additive
colors, which can be mixed to make all other colors
CMYK (CMY) is a color model based on subtracting light. The cyan (C),
magenta (M), yellow (Y) and key or black (k) are the basic colors for a
subtractive model, and represent the complements of the three primary colors
Color representation
21
23. File types are used to encode digital images, allowing for compression and
storage.
There are hundreds of image file formats. For examples
Tagged Image File Format (TIFF)
Graphics Interchange Format (GIF)
Portable Network Graphics (PNG)
JPEG, BMP, Portable Bitmap Format (PBM), etc
Image pixel values can be:
Grayscale: 0 – 255 range
Binary: 0 or 1
Color: RGB colors in 0‐255 range (or other color model)
File types
23
24. Binary Images: In a binary image,
each pixel assumes one of only two
discrete values: 1 or 0.
Indexed Images: An indexed image
consists of an array and a colormap
matrix.
Grayscale Images: A grayscale
image (also called gray-scale, gray
scale, or gray-level) is a data matrix
whose values represent intensities
within some range.
Truecolor Images: A truecolor image
is an image in which each pixel is
specified by three values — one each
for the red, blue, and green
components of the pixel's color.
Type of digital images
24
25. If a color image has to be converted into an intensity or grayscale image, the
following equations can be used. One alternative is the simple average of the
R, G, B color channels:
Another equation, which takes into account the luminance perception of the
human eye, is
Type of digital images
25
26. Image processing (or pre-processing)
Algorithms that alter an input image to create new image
It involves a series of image operations to enhance the quality of a digital
image so as to remove defects such as geometric distortion, improper focus,
repetitive noise, non-uniform lighting and camera motion.
26
27. Image processing ( or pre-processing)
An overview of the operational steps for a image processing (machine vision system)
(B. Park, R. Lu , 2015)
27
28. The operations that can be performed on digital images include:
point, local or neighborhood, and global operations.
Point operations transform pixels without regard to neighboring pixels. The
gray value of the output image at a particular pixel depends only on the
gray value of the same pixel in the input image.
A local or neighborhood operation or mask operation generates an output
pixel whose value depends on the pixel values in a neighborhood of the
corresponding input point.
An operation is a global operation if the output value at specific coordinate is
dependent on all the values in the input images.
Image processing ( or pre-processing)
28
29. Image enhancement is the process of improving the visual appearance of
digital images.
It is usually done by contrast enhancement or histogram manipulation.
Contrast adjustment remaps image intensity values to the full display range
of the data type. An image with good contrast has sharp differences between
black and white.
Image enhancement
29
To illustrate, the image on the left has poor contrast, with intensity values limited to
the middle portion of the range. The image on the right has higher contrast, with
intensity values that fill the entire intensity range [0, 255]. In the high contrast image,
highlights look brighter and shadows look darker (ref. https://www.mathworks.com/)
31. Histogram manipulation
Concept of an image histogram.
Mathematically, histogram is a graphical
presentation of the frequency count of the
occurrence of each intensity (brightness value)
in an image.
The brightness values (i.e. 0-255) are displayed
along the x-axis of the graph.
The frequency of occurrence of each of these
values in the image is shown on the y-axis
Image enhancement
31
There is no single enhancement procedure which is best
Best one is that which best displays the features of interest to the Analyst
32. Linear stretch: stretch using minimum
and maximum values.
Histogram equalization: stretch using a
nonlinear function derived from
distribution of intensities.
Density slicing (pseud coloring):
(Introducing color to a single-band
Image)
divide the range of values in a
single band by assigning each
interval into a color.
Image enhancement
Density slicing (pseud coloring)
Linear stretch
Histogram equalization
32
34. All arithmetic operations performed on matrices may be performed on
images. Arithmetic operations between images are array operations carried
out between corresponding pixel pairs. Hence, the images normally have to
be of the same size. These operators are frequently used for reducing noise
and image enhancement.
The four arithmetic operations are as follows:
Addition
Subtraction
Multiplication
Division
Arithmetic operations
34
35. Filtering is a process that selectively enhances or suppresses particular
frequency (wavelengths) within an image.
Two approaches to digitally filtering data:
Filtering in the spatial domain
Convolution, correlation etc
Filtering in the frequency domain
Edge detection and Enhancement
Fourier transform
Wavelet transform
Filtering Techniques
35
36. Low pass filters: e.g., Average (mean), median, and Gaussian filters
Removes high frequency. Low pass filtering causes blurring
High pass filters: e.g., Gradient and Laplacian kernels
Opposite of low pass filtering: eliminate low frequency values. High pass
filtering causes image sharpening
Filtering Techniques
36
Original Low pass High pass
37. With spatial image filtering technique, a window of finite size and shape is
scanned across the entire image, transforming the local intensities in the output
image. The window with its weights is called the convolution kernel or filter
mask.
Filtering Techniques: Spatial filtering
37
https://towardsdatascience.com/convolu
tion-vs-correlation-af868b6b4fb5
38. Two main linear spatial filtering methods are correlation and convolution.
Correlation is the process of moving a filter mask over the image and
computing the sum of products at each location
The mechanisms of convolution are the same, except that the filter is first
rotated by 180o
Correlation and convolution yield the same result when the filter mask is
symmetric. However, basic image processing techniques are mainly based on
convolution.
Filtering Techniques: Spatial filtering
38
39. All smoothing filters build a weighted average of the surrounding pixels, and
some of them also use the center pixel itself.
Averaging and Gaussian filters are linear filters often used for noise
reduction with their operation causing a smoothing in the image but having the
effect of blurring edges.
Filtering Techniques: Image smoothing and blurring
Examples of averaging filter using masks [3x3] and [9x9] (B. Park, R. Lu , 2015)
Examples of Gaussian filter using masks [3x3] and [9x9] (B. Park, R. Lu , 2015)
39
40. Sometimes, non-linear operations on neighborhoods yield better results. An
example is the use of a median filter to remove noise. Median filtering
replaces each pixel by the median in a neighborhood around the pixel.
Filtering Techniques: Image smoothing and blurring
Example of median filter using a kernel [33]: the input image (left) contains
Gaussian noise, and the noise is removed in the resultant image (right) after 33
median filtering (B. Park, R. Lu , 2015)
40
41. An edge is an area of an image characterized by sharp changes in gray-level
or brightness.
The process of edge detection attenuates high fluctuations in color, i.e., dramatic
change in intensity. In the frequency domain, this process refers to the
attenuation of high frequencies.
Filtering Techniques: Edge Detection and Enhancement
41
https://web.cs.wpi.edu/~emmanuel/courses/cs545/S14/
42. Among the families of edge detection filters are: Gradient filters, Laplacian,
and wavelet transform (Klinger 2003).
Both gradient and Laplacian kernels are of the high-pass filter, which operates
by differencing adjacent pixels, because the sharp edges can be described
by high frequencies.
Filtering Techniques: Edge Detection and Enhancement
Edge detection
42
43. Image segmentation is one of the most important steps in the entire image
processing technique, as subsequent extracted data are highly dependent on
the accuracy of this operation.
Its main aim is to divide an image into regions that have a strong correlation
with objects or area of interest (i.e., ROIs).
Segmentation can be achieved by three different techniques (Sonka et al.
1999; Sun, 2000):
Thresholding,
Edge-based segmentation, and
Region-based segmentation
Image segmentation
43
44. Threshold can be applied to an image to isolate a feature represented by
specific range of digital numbers (DN).
Image segmentation: Thresholding
To calculate the area of lakes, DNs not
representing water are a distraction
Highest DN for water is 35 and is used
as the threshold
All DNs > 35 are assigned 255
(saturated to white);
DNs<=35 are assigned zero
(black)
The lakes are much more prominent in
the image after
44
46. Digital image classification is the process of assigning pixels to classes.
Since, measured reflection values in an image depend on the local
characteristics of the object; in other words there is a relationship between
objects and measured reflection values.
Therefore, by comparing pixels each other, it is possible to assemble groups
of similar pixels into classes and pixels within the same class are spectrally
similar each other, however, in practice, they have some variability within
classes.
Digital image classification
46