Selected Topics in Computer Science Ch2
Selected Topics in Computer Science Ch2
Selected Topics in Computer Science Ch2
Computer Science
Image Restoration and Enhancement #2
Gera
2020
1
Fundamental Steps in Digital Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
2
Fundamental Steps in Digital Image Processing
3
Fundamental Steps in Digital Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
5
Fundamental Steps in Digital Image Processing
Image Morphological
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Example: Remove
Image Noise
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
8
Fundamental Steps in Digital Image Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
10
Fundamental Steps in Digital Image Processing
11
Fundamental Steps in Digital Image Processing
Divide image into
Image Morphological
constituent parts
Restoration Processing
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
12
Fundamental Steps in Digital Image Processing
• Segmentation procedures partition an image into its constituent
parts or objects.
• In general, autonomous segmentation is one of the most difficult
tasks in digital image processing.
• A rugged segmentation procedure brings the process a long way
toward successful solution of imaging problems that require
objects to be identified individually.
• On the other hand, weak or erratic segmentation algorithms
almost always guarantee eventual failure.
• In general, the more accurate the segmentation, the more likely
recognition is to succeed.
13
Fundamental Steps in Digital Image Processing
Image regions
Image Morphological
transformed
Restoration Processing
suitable for
computer
Image processing
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
14
Fundamental Steps in Digital Image Processing
• Representation and description almost always follow the output of a segmentation stage, which
usually is raw pixel data, constituting either the boundary of a region (i.e., the set of pixels separating
one image region from another) or all the points in the region itself.
• In either case, converting the data to a form suitable for computer processing is necessary.
• The first decision that must be made is whether the data should be represented as a boundary or as a
complete region.
• Boundary representation is appropriate when the focus is on external shape characteristics, such as
corners and inflections.
• Regional representation is appropriate when the focus is on internal properties, such as texture or
skeletal shape.
• In some applications, these representations complement each other.
• Choosing a representation is only part of the solution for transforming raw data into a form suitable for
subsequent computer processing.
• A method must also be specified for describing the data so that features of interest are highlighted.
• Description, also called feature selection, deals with extracting attributes that result in some
quantitative information of interest or are basic for differ entiating one class of objects from another.
15
Fundamental Steps in Digital Image Processing
Finds & Labels
Image Morphological
objects in scene
Restoration Processing
(e.g. motorbike)
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
16
Fundamental Steps in Digital Image Processing
• Recognition is the process that assigns a label (e.g., “vehicle”) to an object based on its
descriptors.
• So far we have said nothing about the need for prior knowledge or about the interaction between
the knowledge base and the processing modules.
• Knowledge about a problem domain is coded into an image processing system in the form of a
knowledge database.
• This knowledge may be as simple as detailing regions of an image where the information of
interest is known to be located, thus limiting the search that has to be conducted in seeking that
information.
• The knowledge base also can be quite complex, such as an interrelated list of all major possible
defects in a materials inspection problem or an image database containing high-resolution
satellite images of a region in connection with change-detection applications.
• In addition to guiding the operation of each processing module, the knowledge base also controls
the interaction between modules.
17
Fundamental Steps in Digital Image Processing
Reduce image size
Image Morphological
Restoration Processing (e.g. JPEG)
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
18
Fundamental Steps in Digital Image Processing
• Compression, as the name implies, deals with techniques for reducing
the storage required to save an image, or the bandwidth required to
transmit it.
• Although storage technology has improved significantly over the past
decade, the same cannot be said for transmission capacity.
• This is true particularly in uses of the Internet, which are
characterized by significant pictorial content.
• Image compression is familiar (perhaps inadvertently) to most users
of computers in the form of image file extensions, such as the jpg file
extension used in the JPEG (Joint Photographic Experts Group) image
compression standard.
19
Fundamental Steps in Digital Image Processing
Consider color
Image Morphological
images (color
Restoration Processing
models, etc)
Image
Segmentation
Enhancement
Image Representation
Acquisition & Description
Object
Problem Domain Recognition
Colour Image Image
Processing Compression
20
Fundamental Steps in Digital Image Processing
21
Image Restoration
• As in image enhancement, the principal goal of restoration
techniques is to improve an image in some predefined sense.
• Although there are areas of overlap, image enhancement is
largely a subjective process, while image restoration is for the
most part an objective process.
• Restoration attempts to recover an image that has been
degraded by using a priori knowledge of the degradation
phenomenon.
• Thus, restoration techniques are oriented toward modeling the
degradation and applying the inverse process in order to
recover the original image.
22
A Model of the Image Degradation
23
A Model of the Image Degradation
27
Spatial Filtering
• A common filtering procedure involves moving a 'window' of a few pixels
in dimension (e.g. 3x3, 5x5, etc.) over each pixel in the image, applying a
mathematical calculation using the pixel values under that window, and
replacing the central pixel with the new value.
• The window is moved along in both the row and column dimensions
one pixel at a time and the calculation is repeated until the entire image
has been filtered and a "new" image has been generated.
• By varying the calculation performed and the weightings of the
individual pixels in the filter window, filters can be designed to enhance
or suppress different types of features.
28
Spatial Filtering
• The term spatial domain refers to the image plane itself, and
image processing methods in this category are based on direct
manipulation of pixels in an image.
• Filtering is a technique for modifying or enhancing an image.
• Spatial filtering encompasses a set of digital processing
functions which are used to enhance the appearance of an
image.
• Spatial filters are designed to highlight or suppress specific
features in an image based on their spatial frequency.
29
Spatial Filtering…
• A low-pass filter is designed to emphasize larger, homogeneous
areas of similar tone and reduce the smaller detail in an image.
• Thus, low-pass filters generally serve to smooth the
appearance of an image.
• Average and median filters are examples of low-pass filters.
• High-pass filters do the opposite and serve to sharpen the
appearance of fine detail in an image.
• One implementation of a high-pass filter first applies a low-
pass filter to an image and then subtracts the result from the
original, leaving behind only the high spatial frequency
information.
30
Noise Filtering Techniques
• Minimum filtering: current pixel will be replaced by minimum pixel
value of its neighboring pixels
• Maximum filtering: current pixel will be replaced by maximum pixel
value of its neighboring pixels
• Mean filtering: current pixel will be replaced by average of its
neighboring pixel values
• Median filtering: current pixel will be replaced by median or middle
pixel value of its neighboring pixels
• New generated filtering: current pixel will be replaced by arithmetic
mean of mid-1, mid, mid+1 of its neighboring pixels
31
Median Filtering
• In signal processing, it is often desirable to be able to perform some kind of noise
reduction on an image or signal. Median filtering is very widely used in digital
image processing because it preserves edges while removing noise.
• The median filter is a sliding-window spatial filter.
• It replaces the value of the center pixel with the median of the intensity values in the
neighborhood of that pixel.
• Median filtering is a nonlinear operation often used in image processing to reduce
"salt and pepper" noise because of its appearance as white and black dots
superimposed on an image.
• A median filter is more effective than convolution when the goal is to simultaneously
reduce noise and preserve edges.
• For every pixel, a 3x3 neighborhood with the pixel as center is considered. In median
filtering, the value of the pixel is replaced by the median of the pixel values in the 3x3
neighborhood.
32
Median Filtering…
33
Median Filtering…
Exercise 1
1.What is the value of the yellow box after
median filtering?
Answers: a) 7 b) 1 c) 3 d) 9
34
Median Filtering…
Exercise 2
• What are the values of yellow boxes after median filtering?
Answers:
a) b) c)
35
Median Filtering…
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 0 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 0 0 0 0 0 0 0
0 0 90 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
36
Image Enhancement
• Image enhancement techniques can be divided into two broad
categories:
• Spatial domain methods, which operate directly on pixels
• Frequency domain methods, which operate on the Fourier
transform of an image.
• Unfortunately, there is no general theory for determining what is
`good' image enhancement when it comes to human perception. If it
looks good, it is good!
• However, when image enhancement techniques are used as pre-
processing tools for other image processing techniques, then
quantitative measures can determine which techniques are most
appropriate.
37
Image Enhancement
Neighbourhood operations -1 -1 -1 1 1 1
-1 9 -1 1 1 1
Sharpening / blurring -1 -1 -1 1 1 1
Edge detection Result
1 0 -1 1 1 1
1 0 -1 0 0 0
1 0 -1 -1 -1 -1
Image
• Contract enhancement
• Thresholding
38
• Histogram equalisation
Morphological Processing
• Morphology is a broad set of image processing operations that
process images based on shapes. Morphological operations apply a
structuring element to an input image, creating an output image of
the same size.
• In a morphological operation, the value of each pixel in the output
image is based on a comparison of the corresponding pixel in the
input image with its neighbors. By choosing the size and shape of
the neighborhood, you can construct a morphological operation
that is sensitive to specific shapes in the input image.
• The most basic morphological operations are dilation and erosion.
• Dilation adds pixels to the boundaries of objects in an image, while
erosion removes pixels on object boundaries.
• The number of pixels added or removed from the objects in an
image depends on the size and shape of the structuring
element used to process the image.
39
Morphological Processing
• Morphological operators often take a binary image and a structuring
element as input and combine them using a set operator (intersection,
union, inclusion, complement).
• The structuring element is shifted over the image and at each pixel of the
image its elements are compared with the set of the underlying pixels.
• If the two sets of elements match the condition defined by the set
operator (e.g. if set of pixels in the structuring element is a subset of
the underlying image pixels), the pixel underneath the origin of the
structuring element is set to a pre-defined value (0 or 1 for binary
images).
• A morphological operator is therefore defined by its structuring
element and the applied set operator.
40
Morphological Processing (Application)
• Image pre-processing: noise filtering, shape simplification
• Enhancing object structures: skeletonization, thinning, convex hull, object
marking
• Segmentation of the object from background
• Morphological operations are used as a step in image processing and
analysis.
• It is used to modify the shape of objects in an image, by using local
operations.
• It can be used to remove unwanted effects in segmentation post-
processing
• Remove small objects (that is assumed to be noise)
• Smooth the edges of larger objects
• Fill holes in objects
• Link objects together
41
Morphological Processing
• In the morphological dilation and erosion operations, the state of any given pixel
in the output image is determined by applying a rule to the corresponding pixel
and its neighbors in the input image.
• The rule used to process the pixels defines the operation as a dilation or an
erosion. This table lists the rules for both dilation and erosion.