IPT Module 4
IPT Module 4
Input image is represented by using the notation f(x,y), noise term can be represented as η(x,y).
If we are given g(x,y), some knowledge about the degradation function H or J and some knowledge
about the additive noise teem η(x,y), the objective of restoration is to obtain an estimate f'(x,y) of the
original image.
The more we know about h and η, the closer f(x,y) will be to f'(x,y).
If it is a linear position invariant process, then degraded image is given in the spatial domain by
g(x,y)=f(x,y)*h(x,y)+η(x,y)
The terms in the capital letters are the Fourier Transform of the corresponding terms in the spatial
domain.
TRACE KTU
NOISE MODELS
The principal source of noise in digital images arises during image acquisition and /or transmission.
The performance of imaging sensors is affected by a variety of factors, such as environmental conditions
during image acquisition and by the quality of the sensing elements themselves.
Images are corrupted during transmission principally due to interference in the channels used for
transmission.
Since main sources of noise presented in digital images are resulted from atmospheric disturbance and
image sensor circuitry, following assumptions can be made i.e. the noise model is spatial invariant
(independent of spatial location).
b. Spatial Correlation: Noise can exhibit spatial correlation, meaning that neighboring pixels have
similar noise characteristics. This can result in patterns or structures in the noise, such as stripes or
bands.
c. Clustering: In some cases, noise may exhibit clustering behavior, where noise values tend to
concentrate in specific regions of an image. This can result in localized patches or clusters of noise.
d. Impulsiveness: Impulsive noise, such as salt-and-pepper noise, appears as isolated bright or dark
pixels scattered randomly throughout the image.
Frequency Properties: Frequency properties of noise refer to the distribution of noise energy across
different frequencies in the frequency domain. Some common frequency properties of noise include:
a. High-Frequency Noise: Noise that has a significant amount of energy in high-frequency components
appears as fine-grained or granular noise. High-frequency noise can result in a loss of fine details and
a decrease in image clarity.
b. Low-Frequency Noise: Noise that exhibits energy in low-frequency components appears as large-
scale variations or patterns. Low-frequency noise can manifest as uneven illumination or background
variations in the image.
TRACE KTU
c. Color Noise: In color images, noise can exhibit different frequency properties in different color
channels. For example, noise may have higher energy in the blue channel compared to the red and
green channels, resulting in color artifacts.
Some Important Noise Probability Density Functions
Gaussian noise
Because of its mathematical tractability in both the spatial and frequency domains, Gaussian (also called
normal) noise models are used frequently in practice. In fact, this tractability is so convenient that it often
results in Gaussian models being used in situations in which they are marginally applicable at best.
The PDF of a Gaussian random variable, z , is given by: where
z represents intensity, 𝑧̅ represents mean value of z and 𝜎 is its standard
deviation. The standard deviation square is called variance.
When Gaussian noise is added to an image, it manifests as a random variation in pixel intensities. The noise
introduces a subtle grainy appearance, affecting the overall quality and clarity of the image. Higher levels of
Gaussian noise can obscure fine details, reduce contrast, and degrade image fidelity.
Rayleigh noise
The PDF of Rayleigh noise is given by
Note the displacement from the origin and the fact that the basic shape of this density is skewed to the right.
The Rayleigh density can be quite useful for approximating skewed histograms.
Erlang (gamma) noise
The PDF of Erlang noise is given by
𝑏 TRACE KTU
Where the parameters are such that a > 0, b is a positive number. The mean and variance of this distribution
𝑏
is given by 𝑧̅ = 𝑎 and 𝜎 2 = 𝑎2
Its shape is similar to Rayleigh disruption. This equation is referred to as gamma density it is correct only
when the denominator is the gamma function.
Although Eq. (5.2-5) often is referred to as the gamma density, strictly speaking this is correct only when the
denominator is the gamma function, When the denominator is as shown, the density is more appropriately
called the Erlang density.
Exponential noise
The PDF of exponential noise is given by
1 1
The mean and variance of this function is: 𝑧̅ = and 𝜎 2 =
𝑎 𝑎2
𝑎+𝑏 (𝑏−𝑎)2
The mean and variance is given by 𝑧̅ = and 𝜎 2 =
2 12
TRACE KTU
Impulse (salt-and-pepper) noise
The PDF of (bipolar) impulse noise is given by
If neither probability is zero, and especially if they are approximately equal, impulse noise values will
resemble salt-and-pepper granules randomly distributed over the image.
For this reason, bipolar impulse noise also is called salt and- pepper noise. Data-drop-out and spike
noise also are terms used to refer to this type of noise.
Scaling usually is part of the image digitizing process. Because impulse corruption usually is large
compared with the strength of the image signal, impulse noise generally is digitized as extreme (pure
black or white) values in an image.
Thus, the assumption usually is that a and b are “saturated” values, in the sense that they are equal to the
minimum and maximum allowed values in the digitized image.
As a result, negative impulses appear as black (pepper) points in an image. For the same reason, positive
impulses appear as white (salt) noise.
Periodic Noise
Periodic noise in an image arises typically from electrical or electromechanical interference during
image acquisition.
TRACE KTU
Let Sxy represents the set of coordinates in the sub - image of size m*n centered at point (x,y).
The arithmetic mean filter computes the average value of the corrupted image g(x,y) in the area defined
by Sxy.
The value of the restored image f at any point (x,y) is the arithmetic mean computed using the pixels in
the region defined by Sxy.
In other words:
This operation can be implemented using a spatial filter of size m * n in which all coefficients have value
1/mn.
A mean filter smooths local variations in an image, and noise is reduced as a result of blurring.
Here, each restored pixel is given by the product of the pixels in the sub-image window, raised to the
power 1/mn.
a geometric mean filter achieves smoothing comparable to the arithmetic mean filter, but it tends to lose
less image detail in the process.
3. Harmonic mean filter
The harmonic mean filter works well for salt noise, but fails for pepper noise.
It does well also with other types of noise like Gaussian noise.
The contraharmonic mean filter yields a restored image based on the expression
where Q is called the order of the filter.
This filter is well suited for reducing or virtually eliminating the effects of salt-and-pepper noise.
Note that the contraharmonic filter reduces to the arithmetic mean filter if Q = 0, and to the harmonic
mean filter if Q = -1.
ORDER STATISTIC FILTERS:
TRACE KTU
Order-statistic filters are nonlinear spatial filters whose response is based on ordering (ranking) the
pixels contained in the image area encompassed by the filter, and then replacing the value of the center
pixel with the value determined by the ranking result.
1. Median Filters:
The best-known filter in this category is the median filter, which, as its name implies, replaces the value
of a pixel by the median of the intensity values in the neighborhood of that pixel (the original value of
the pixel is included in the computation of the median).
Median filters are quite popular because, for certain types of random noise, they provide excellent noise-
reduction capabilities, with considerably less blurring than linear smoothing filters of similar size.
Median filters are particularly effective in the presence of impulse noise, also called salt-and-pepper
noise because of its appearance as white and black dots superimposed on an image.
Median filters are particularly effective in the presence of both bipolar and unipolar impulse noise.
Although the median filter is by far the order-statistic filter most used in image processing, it is by no
means the only one.
The median represents the 50th percentile of a ranked set of numbers, but you will recall from basic
statistics that ranking lends itself to many other possibilities.
For example, using the 100th percentile results in the so-called max filter, given by
This filter is useful for finding the brightest points in an image. Also, because pepper noise has very low
values, it is reduced by this filter as a result of the max selection process in the sub image area Sxy
This filter is useful for finding the darkest points in an image. Also, it reduces salt noise as a result of the
min operation.
3. Midpoint filter
The midpoint filter simply computes the midpoint between the maximum and minimum values in the area
encompassed by the filter:
Note that this filter combines order statistics and averaging. It works best for randomly distributed noise,
like Gaussian or uniform noise.
4. Alpha Trimmed Filter:
TRACE KTU
ADAPTIVE FILTERS:
1. Adaptive, local noise reduction filter
The simplest statistical measures of a random variable are its mean and variance.
These are reasonable parameters on which to base an adaptive filter because they are quantities closely
related to the appearance of an image.
The mean gives a measure of average intensity in the region over which the mean is computed, and the
variance gives a measure of contrast in that region.
Our filter is to operate on a local region, Sxy. The response of the filter at any point (x, y) on the which
the region is to be centered is to be based on four quantities:
If 𝜎 2 𝜼 is zero, then the filter should return simply the value of g(x, y). This is the trivial, zero noise case
in which g(x, y) equal to f(x, y).
If the local variance is high relative to 𝜎 2 𝜼 then the filter would return a value close to g(x, y). A high
typical local variance is associated with these edges and these would be preserved.
If the two variances are equal, we want the filter to return the arithmetic mean value of the pixels in Sxy
This condition occurs when the local area has the same properties as the overall image, and local noise is
to be reduced simply by averaging.
The only quantity that needs to be known or estimated is the variance of the overall noise 𝜎 2 𝜼 The other
parameters are computed from the pixels in Sxy at each location (x, y) on which the filter window is
centered.
An additional benefit of the adaptive median filter is that it seeks to preserve detail while smoothing non
impulse noise, something that the “traditional” median filter does not do.
the adaptive median filter also works in a rectangular window area Sxy .
Unlike those filters, however, the adaptive median filter changes (increases) the size of Sxy. during filter
operation, depending on certain conditions listed in this section.
Keep in mind that the output of the filter is a single value used to replace the value of the pixel at (x, y),
the point on which the window Sxy is centered at a given time.
The key to understanding the mechanics of this algorithm is to keep in mind that it has three main
purposes: to remove salt-and-pepper (impulse) noise, to provide smoothing of other noise that may not
be impulsive, and to reduce distortion, such as excessive thinning or thickening of object boundaries.
The values zmax and zmin are considered statistically by the algorithm to be “impulse-like “noise
components, even if these are not the lowest and highest possible pixel values in the image.
BASIC EDGE DETECTION
The image gradient and its properties:
The tool of choice of finding edge strength and direction at location (x, y) of an image f, the gradient is
𝜕𝑓
𝑔𝑥
TRACE KTU 𝑦
𝜕𝑥
denoted by ∇𝑓 and defined as the vector: ∇𝑓 = 𝑔𝑟𝑎𝑑(𝑓) = [𝑔 ] = [𝜕𝑓 ].
𝜕𝑦
This vector has the important property that it points in direction of greatest rate of change f at location (x, y).
The magnitude of ∇𝑓 denoted as M (x, y) is given by √𝑔𝑥 2 + 𝑔𝑦 2 is the value of rate of change in the
direction of gradient vector.
𝑔𝑦
The direction of gradient vector is given by the angle 𝛼(𝑥, 𝑦) = 𝑡𝑎𝑛−1 (𝑔 ) measured with respect to x axis.
𝑥
The direction of edge at an arbitrary point (x, y) is orthogonal to the direction 𝛼(𝑥, 𝑦) of the gradient vector
at that point.
Gradient Operators:
𝜕𝑓 𝜕𝑓
Obtaining the gradient is finding the partial derivatives 𝜕𝑥 and 𝜕𝑦 at every pixel location in the image.
Sobel Operator:
The Sobel operator is a commonly used edge detection algorithm in image processing. It is named after its
inventor, Irwin Sobel, and is used to detect edges in an image by applying a set of convolution kernels.
The Sobel operator uses two kernels, one for detecting horizontal edges and another for detecting vertical
edges. These kernels are 3x3 matrices that are convolved with the input image to obtain a filtered output
image.
The horizontal Sobel kernel is:
−1 0 1
[−2 0 2 ]
−1 0 −1
The vertical Sobel kernel is:
−1 −2 −1
[0 0 0]
1 2 1
To apply the Sobel operator, the two kernels are separately convolved with the input image, and the
magnitude of the resulting gradient is calculated at each pixel. The gradient magnitude represents the
strength of the edge at that pixel.
The output image from the Sobel operator is usually further processed by thresholding or other techniques to
produce a binary image of edges. This binary image can then be used for further image analysis, such as
object detection or tracking.
Prewitt Operator:
The Prewitt operator is another widely used edge detection algorithm in image processing. Like the Sobel
operator, it is named after its inventor, Judith Prewitt, and uses convolution kernels to detect edges in an
image.
The Prewitt operator also uses two kernels, one for detecting horizontal edges and another for detecting
vertical edges. These kernels are also 3x3 matrices that are convolved with the input image to obtain a
filtered output image.
The horizontal Prewitt kernel is:
−1 0 1
[−1 0 1]
−1 0 1 TRACE KTU
The vertical Prewitt kernel is:
−1 −1 −1
[0 0 0]
1 1 1
Similar to the Sobel operator, the Prewitt operator calculates the magnitude of the gradient at each pixel by
convolving the two kernels with the input image. This gradient magnitude represents the strength of the edge
at that pixel.
The output image from the Prewitt operator can also be further processed by thresholding or other
techniques to produce a binary image of edges. This binary image can then be used for further image
analysis.
Compare Sobel and Prewitt Operators:
Feature Sobel Operator Prewitt Operator
Kernels Two kernels for horizontal and vertical Two kernels for horizontal and
edge detection. vertical edge detection.
Performance Better for detecting edges in the presence Less sensitive to noise but may miss
of noise. some edges.
Magnitude Calculates magnitude using square root Calculates magnitude using sum of
Calculation of sum of squares of horizontal and absolute values of horizontal and
vertical gradients. vertical gradients.
Edge Detection Produces thicker edges with more Produces thinner edges with more
Results emphasis on diagonals. emphasis on horizontal and vertical
directions.
Computation Requires more computations due to the Faster due to the absence of a square
Time square root operation. root operation.
In general, the Sobel operator is more suitable for detecting edges in the presence of noise, while the Prewitt
operator is less sensitive to noise but may miss some edges.
Laplacian Operator:
The Laplacian operator is another commonly used edge detection algorithm in image processing. It is a
second-order derivative operator that calculates the Laplacian of the input image to detect edges.
The La-Placian operator of an image f(x,y) is
•
TRACE KTU
La-placian filter is a linear spatial filter.
• Apply it over the image and perform convolution operation.
• This will produce a La-Placian image that has grayish edge lines and other discontinuities
• All are superimposed on a dark featureless background.
• Background features can be recovered while still preserving the sharpening effect of La-placian
operation by simply adding the original image and La-Placian image.
•
Zero Crossings:
Zero crossings are an important concept in image processing and edge detection. In the context of edge
detection, a zero crossing is a point in an image where the intensity changes from positive to negative or
vice versa, indicating the presence of an edge.
Zero crossings can be detected using the Laplacian operator or other second-order derivative operators.
After applying the Laplacian operator, the resulting filtered image is examined to identify regions where
the intensity changes sign. These regions are then marked as zero crossings, indicating the location of an
edge in the image.
However, the Laplacian operator is sensitive to noise and may produce false positive zero crossings. To
address this, the filtered image can be further processed using techniques such as non-maximum
suppression or thresholding to remove false positives and retain only the true zero crossings.
Zero crossings can also be used to extract other features from an image, such as corners or blob-like
structures. By detecting regions with multiple zero crossings, it is possible to identify corners or regions
with high curvature. By detecting regions with clustered zero crossings, it is possible to identify blob-
like structures in the image.
Significance:
It is significant because it allows us to identify the location of edges in an image based on the change in
intensity from positive to negative or vice versa. This makes it a valuable tool for a wide range of
applications, including object recognition, computer vision, and medical image analysis.
The zero-crossing operator is typically applied after a filter has been applied to the image, such as the
Laplacian operator. The filtered image is examined for points where the intensity changes sign, which
indicates the presence of an edge. The zero-crossing operator can then be used to mark these points,
making it easier to identify and analyze the edges in the image.
One of the main advantages of the zero-crossing operator is that it is relatively robust to noise, which is a
common problem in image processing. The operator can detect edges even in images with high levels of
noise, making it a useful tool in many real-world applications.
Another advantage of the zero-crossing operator is that it can be used to detect other features in an image
besides edges. For example, it can be used to identify corners or blob-like structures by looking for
clusters of zero crossings.
THRESHOLDING
TRACE KTU
The basics of intensity thresholding
Intensity thresholding is an image processing technique used to separate objects of interest from the
background in an image. The basic idea behind thresholding is to convert an image into a binary image
by setting all pixel values above a certain threshold to one and all values below the threshold to zero.
The threshold value is typically chosen based on the intensity histogram of the image. The histogram
shows the distribution of pixel intensities in the image, and the threshold can be selected at a point where
there is a significant difference in the distribution between the objects of interest and the background.
There are different types of thresholding methods, such as global thresholding, local thresholding, and
adaptive thresholding. Global thresholding sets a fixed threshold value for the entire image, while local
thresholding sets different threshold values for different regions of the image based on their local
characteristics. Adaptive thresholding adjusts the threshold value dynamically based on the local image
characteristics and is particularly useful for images with non-uniform lighting or background.
The thresholded image can be further processed using various post-processing techniques such as
morphological operations to remove small objects or fill gaps in the segmented objects.
Single value (Binary) thresholding
• Simplest thresholding method is binary thresholding.
• Here all pixel values those are greater than the specific threshold value is assign a standard value.
• Example: If the pixel value is smaller than the threshold, it is set to 0, otherwise, it is set to a maximum
value (generally 255).
• This threshold value which can be changed arbitrarily.
• The application of this algorithms is when we have to separate foreground with background.
• The drawback of this algorithm is that it will always segment the image in to two categories.
Multi value thresholding:
• In bi-level thresholding, image is segmented into two different regions.
• The pixels with gray values greater than a certain value T are classified as object pixels, and the others
with gray values lesser than T are classified as background pixels.
• Multilevel thresholding is a process that segments a gray level image into several distinct regions
• This technique determines more than one threshold for the given image and segments the image into
certain brightness regions, which correspond to one background and several objects.
• The method works very well for objects with colored or complex backgrounds, on which bi-level
thresholding fails to produce satisfactory results.
TRACE KTU
•
BASIC GLOBAL THRESHOLDING
Global → threshold T depends on the gray values of the pixel
A global thresholding technique is the one which makes use of a single threshold value for the whole
image. They are Histogram based thresholding techniques.
The simplest of all thresholding techniques is to partition the image histogram by using a single global
threshold, T.
Creates a binary image after thresholding.
Segmentation is then accomplished by scanning the image pixel by pixel and labeling each pixel as
object or back-ground, depending on whether the gray level of that pixel is greater or less than the value
of T.
The success of this method depends entirely on how well the histogram can be partitioned.
The objects of interest in this case are darker than the background, so any pixel with a gray level ≤ T was
labelled black (0), and any pixel with a gray level ≥ T was labeled white (255).
The key objective is to generate a binary image.
The type of global thresholding just described can be expected to be successful in highly controlled
environments.
One of the areas in which this often is possible is in industrial inspection applications, where control of
the illumination usually is feasible.
How to select the threshold T in global thresholding?
The following algorithm can be used to obtain T automatically.
1. Select an initial estimate of T
2. Segment the image using T. This will produce two groups of pixels: G1 consisting of all pixels with gray
level values >T and G2 consisting of pixels with values <= T
3. Compute the average gray level values µ1 and µ2 for the pixels in regions G1and G2
1
4. Compute the new threshold value 𝑇 = 2 ( 𝜇1 + 𝜇2 )
5. Repeat steps 2 through 4 until the difference in T in successive iterations is smaller than a pre-defined
parameter ∆T which is initialized as zero. The average intensity is the good choice for initial T value
This simple algorithm works well in situations where there is a reasonably clear valley between the
modes of the histogram related to objects and background.
Parameter ∆𝑇 is used to control the number of iterations in situations where speed is an important issue.
In general, the larger ∆𝑇 is, the fewer iterations the algorithm will perform.
The initial threshold must be chosen greater than the minimum and less than maximum intensity level in
the image.
TRACE KTU
The average intensity of the image is a good initial choice for T
OPTIMUM GLOBAL THRESHOLDING USING OTSU METHOD
Thresholding may be viewed as a statistical-decision theory problem whose objective is to minimize the
average error incurred in assigning pixels to two or more groups (also called classes). This problem is
known to have an elegant closed-form solution known as the Bayes decision rule.
The solution is based on only two parameters: the probability density function (PDF) of the intensity
levels of each class and the probability that each class occurs in a given application. Unfortunately,
estimating PDFs is not a trivial matter, so the problem usually is simplified by making workable
assumptions about the form of the PDFs, such as assuming that they are Gaussian functions.
Even with simplifications, the process of implementing solutions using these assumptions can be
complex and not always well-suited for practical applications.
The approach discussed in this section, called Otsu’s method (Otsu [1979]), is an attractive alternative.
The method is optimum in the sense that it maximizes the between-class variance, a well-known
measure used in statistical discriminant analysis.
The basic idea is that well-thresholded classes should be distinct with respect to the intensity values of
their pixels and, conversely, that a threshold giving the best separation between classes in terms of their
intensity values would be the best (optimum) threshold.
In addition to its optimality, Otsu’s method has the important property that it is based entirely on
computations performed on the histogram of an image, an easily obtainable 1-D array
The algorithm assumes that the image contains two classes of pixels: object and background. The goal is
to find a threshold value that maximizes the between-class variance, which is defined as the sum of the
variances of the two classes weighted by their probabilities.
1. Compute the histogram of the image and normalize it to obtain the probability density function (PDF).
Denote the components of histogram pi, i = 0, 1, 2, …., L – 1.
2. Compute the cumulative distribution function (CDF) of the PDF, 𝑃1 (𝑘) = ∑𝑘𝑖=0 𝑝𝑖 for k = 0, 1, …., L – 1.
3. Compute the mean intensity of the image and the total variance. 𝑚(𝑘) = ∑𝑘𝑖=0 𝑖 𝑝𝑖
5. Compute the between-class variance for each threshold value using the class probabilities, means, and
variances.
6. Obtain the Otsu threshold k*, as the value of k for which 𝜎𝐵 2 (𝑘) is maximum. If maximum is not
unique, obtain k* by averaging the values of k corresponding to the various maxima detected.
TRACE KTU
7. Obtain the separability measure 𝛈∗ by evaluating
Applications:
at k = k*
Otsu’s method is a widely applicable technique that finds its use in numerous applications in computer
vision and image processing. Some of the applications of Otsu’s method are as follows:
Object Detection and Recognition: Otsu’s method can effectively segment images into foreground and
background regions, which makes it useful for detecting and recognizing objects in images
Medical Imaging: Otsu’s method is extensively used in medical imaging applications for segmenting
images of organs and tissues. Since it can assist in identifying abnormalities or anomalies in the images
and help in the diagnosis
Document Analysis: Otsu’s method finds its application in segmenting handwritten or printed text in
document images, which can aid in optical character recognition (OCR) and document analysis
Quality Control and Inspection: Otsu’s method can be used in quality control and inspection
applications to detect defects or anomalies in images of manufactured products
Advantages of Otsu's method:
1. It is a simple and computationally efficient method that can be easily implemented.
2. It is an automatic thresholding method that does not require manual input or user intervention.
3. It is a widely used and well-established method that has been shown to produce good results in many
applications.
4. It can handle a wide range of image types, including grayscale and color images.
5. It is a global thresholding method that can be applied to the entire image or a subset of the image.
Disadvantages of Otsu's method:
1. It assumes that the image histogram is bimodal, which may not be the case for all images. In cases where
the histogram is not bimodal, Otsu's method may not produce optimal results.
2. It may not work well for images with high levels of noise or low contrast.
3. It may not be suitable for images with complex or irregular backgrounds.
4. It does not take into account spatial information or texture information, which may be important for
some applications.
MULTIPLE THRESHOLDING
TRACE KTU
VARIABLE THRESHOLDING
Variable thresholding is a technique used in image processing to adaptively adjust the threshold value based
on the local characteristics of the image. The goal is to overcome the limitations of global thresholding,
where a single threshold value is used to segment the entire image. With variable thresholding, the threshold
value is adjusted based on the local intensity or texture characteristics of the image, resulting in more
accurate and robust segmentation results.
Image Partitioning
One of the simplest approaches to variable thresholding is to subdivide an image into nonoverlapping
rectangles.
The rectangles are chosen small enough so that the illumination of each is approximately uniform.
Variable thresholding based on local image properties
A more general approach than the image subdivision method discussed in the previous section is to
compute a threshold at every point, (x, y) in the image based on one or more specified properties
computed in a neighborhood of (x, y).
We illustrate the basic approach to local thresholding using the standard deviation and mean of the pixels
in a neighborhood of every point in an image. These two quantities are quite useful for determining local
thresholds because they are descriptors of local contrast and average intensity.
Let 𝜎𝑥𝑦 and 𝑚𝑥𝑦 denotes the standard deviation and mean value of set of pixels contained in a
neighbourhood Sxy centered at coordinates (x, y)
The following are common forms of variable, local thresholds: where a and b are
non- negative constants and mG is the global mean.
Image. This equation is evaluated over all pixel locations and different threshold is computed at each
location (x, y) using the neighborhood Sxy .
Significant power (with a modest increase in computation) can be added to local thresholding by using
predicates based on the parameters computed in the neighbourhoods of (x, y):
TRACE KTU
This implementation is quite useful in document processing, where speed is a fundamental requirement.
The scanning typically is carried out line by line in a zigzag pattern to reduce illumination bias.
Let zk+1 represents the intensity of the point encountered in the scanning sequence at step k+1, then
moving averages at this new point is given by:
Suppose that we want to extract from a color image all regions having a specified color range: say,
reddish hues.
One way to segment color image based on this parameter is to compute a distance measure, D(z, a),
between an arbitrary point z and the average color a, then we can segment the image as follows:
where T is the threshold and it is understood that the distance computation
is performed at all coordinates in the input image to generate the corresponding segmented values in g.
REGION BASED SEGMENTATION
Region Growing
As its name implies, region growing is a procedure that groups pixels or subregions into larger regions
based on predefined criteria for growth.
The basic approach is to start with a set of “seed” points and from these grow regions by appending to
each seed those neighboring pixels that have predefined properties similar to the seed (such as specific
ranges of intensity or color).
In Region growing method, we start with a random pixel as the seed pixel and then check the adjacent
pixels.
If the adjacent pixels satisfy the predefined rules, then that pixel is added to the region of the seed pixel
Region is grown from the seed pixel by adding in neighbouring pixels that are similar, increasing the
size of the region.
When the growth of one region stops, we simply choose another seed pixel which does not yet belong to
any region and start again.
Drawback:
o Current region dominates the growth process
o Different choices of seeds may give different segmentation results.
TRACE KTU
A basic region-growing algorithm based on 8-connectivity may be stated as follows.
Let R represents the entire image region and select Q the predicate. One approach for segmentation is to
subdivide it successively into smaller and smaller quadrants so that for any region Ri, Q(Ri) = TRUE.
We start with the entire region. When Q(Ri) = FALSE, we divide the image segments into quadrants.
If Q is false for any quadrant, we subdivide that quadrant into sub – quadrants and so on.
This particular splitting technique has a convenient representation in the form of so called, quad trees,
i.e. trees with exactly four descendants. the root of the tree corresponds to the entire image, and that each
node corresponds to the subdivision of a node into four descendant nodes. In this case, only R4 was
subdivided further.
If only splitting is used, the final partition normally contains adjacent regions with identical properties.
This drawback can be remedied by allowing merging as well as splitting.
Satisfying the constraints of segmentation requires merging only adjacent regions whose combined
pixels satisfy the predicate Q. That is, two adjacent regions Rj and Rk are merged only if Q (Rj ∪ Rk)=
TRUE.
The preceding discussion can be summarized by the following procedure in which, at any step, we
1. Split into four disjoint quadrants any region Ri for which Q (Ri) = FALSE.
2. When no further splitting is possible, merge any adjacent regions Rj and Rk for which Q (Rj ∪ Rk) =
TRUE.
TRACE KTU