0% found this document useful (0 votes)
3 views132 pages

Image Processing Unit 3

Uploaded by

Keerthana V A
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views132 pages

Image Processing Unit 3

Uploaded by

Keerthana V A
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Black and White image

Greyscale image Color image


• An image is a two-dimensional function f(x,y).
• Where x,y : spatial coordinates and f(x,y): intensity (brightness/gray level)
• In general, the value of a digital image at any coordinates (x,y) is denoted f (x,y), where x and y are
integers.
• When we need to refer to specific coordinates (I,j), we use the notation f(I,j), where the arguments
are integers.
• Image is nothing but matrix of intensity values where each element = pixel
• Digital Image: f (x,y ), containing M rows and N columns, where ( x,y) are discrete coordinates.
• Types of Images
 Binary Image (0,1)
 Grayscale Image
 Color Image (RGB bands)
Image processing : Processing images using computer algorithms
Objectives
• Improve visual quality
• Extract information
• Enable automation
Applications
• Remote sensing
• Medical imaging
• Computer vision
• Robotic
Three ways of
representing f (x,y)

Intensity Display
Value Output
0 Black
0.5 Gray
1 White
Medical Imaging

Applications:
• MRI, CT scan analysis
• Tumour detection
• Organ segmentation
• Helps doctors in diagnosis & treatment planning
Remote Sensing & GIS (NASA’s LANDSAT
satellites)
Microscopy alone, the application areas are too numerous
Intensity Transformations and 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.
• Two principal categories of spatial processing are intensity
transformations and spatial filtering.
• Intensity transformations operate on single pixels of an image for
tasks such as contrast manipulation and image thresholding.
• Spatial filtering performs operations on the neighbor hood of every
pixel in an image. Examples of spatial filtering include image
smoothing and sharpening.
where f(x,y) is an input image, g(x,y) is the output image, and T is an operator on f defined over a neighborhood of point
(x,y) .
The point (𝑥 , 𝑦 )shown is an arbitrary location in the image, and the small region shown is a neighborhood of (𝑥 , 𝑦 )
Applying the operator T to the pixels in the neighbor hood to yield an output value at that location.
The smallest possible neighborhood is of size. In this case, g depends only 1x1 on the value of f at a single point x, y and T
in Equation becomes an intensity (also called a gray-level, or mapping) transformation function of the form

Enhancement is the process of


manipulating an image so that the
result is more suitable than the original
for a specific application.
IMAGE NEGATIVES
Reversing the intensity levels of a digital image in this manner
produces the equivalent of a photographic negative.
LOG TRANSFORMATIONS
that this transformation maps a narrow
range of low intensity values in the input
into a wider range of output levels.
Conversely, higher values of input levels
are mapped to a narrower range in t
We use a transformation of this type to
expand the values of dark pixels in an
image, while compressing the higher-level
values.
POWER-LAW (GAMMA) TRANSFORMATIONS
Contrast stretching.
Low-contrast images can result from poor illumination, lack of dynamic range in the imaging sensor, or even the wrong
setting of a lens aperture during image acquisition.
Contrast stretching expands the range of intensity levels in an image so that it spans the ideal full intensity range of the
recording medium or display device.
There are applications in which it is of interest to highlight a specific range of intensities in an image. Some of
these applications include enhancing features in satellite imagery, such as masses of water, and enhancing
flaws in X-ray images.
The method, called intensity-level slicing, can be implemented in several ways, but most are variations of two
basic themes. One approach is to display in one value (say, white) all the values in the range of interest and in
another (say, black) all other intensities.
• Intuitively, it is reasonable to conclude that an image whose pixels
tend to occupy the entire range of possible intensity lev els and, in
addition, tend to be distributed uniformly, will have an appearance of
high contrast and will exhibit a large variety of gray tones.
HISTOGRAM EQUALIZATION
The condition in
(a) that T(r) be monotonically increasing guarantees that output
intensity values will never be less than corresponding input values,
thus preventing artifacts created by reversals of intensity.
(b) Condition (b) guarantees that the range of output intensities is the
same as the input.
(c) Finally, condition (a’) guarantees that the mappings from s back to r
will be one-to-one, thus preventing ambiguities.
we see that it is possible for multiple input values to map to a single output value and still satisfy these two conditions.
That is, a monotonic transformation function performs a one-to-one or many-to-one mapping.

presents a problem if we wanted to recover the values of r uniquely from the mapped values (inverse mapping can be
visualized by reversing the direction of the arrows).
This would be possible for the inverse mapping of sk in Fig. 3.17(a), but the inverse mapping of sq is a range of values,
which, of course, prevents us in general from recovering the original value of r that resulted
Histogram matching
Given:
Spatial filtering
• Spatial filtering modifies an image by replacing the value of each pixel by a
function of the values of the pixel and its neighbors.
• If the operation performed on the image pixels is linear, then the filter is
called a linear spatial filter.
• Otherwise, the filter is a nonlinear spatial filter.
• A linear spatial filter performs a sum-of-products operation between an
image f and a filter kernel, w.
• The kernel is an array whose size defines the neighborhood of operation,
and whose coefficients determine the nature of the filter.
• Other terms used to refer to a spatial filter kernel are mask, template, and
window.
• The mechanics of linear spatial filtering using a 3 × 3 kernel.
• At any point (x, y) in the image, the response, g(x, y), of the filter is the sum of
products of the kernel coefficients and the image pixels encompassed by the
kernel:

• Observe that the center coefficient of the kernel, w(0, 0), aligns with the pixel at
location (x, y). For a kernel of size m × n, we assume that m = 2a + 1 and n = 2b +
1, where a and b are nonnegative integers.

• where x and y are varied so that the center (origin) of the kernel visits every pixel
in f once. kernel of arbitrary odd size.
Correlation and convolution
• Correlation is an operation that measures the similarity between an image and a filter
(kernel) as the kernel is shifted over the image.
• At each position, corresponding elements of the image and kernel are multiplied and
summed.
• If the image region closely resembles the kernel pattern, the correlation output will be
high.
• Convolution is an operation used∘ to compute the response of an image to a filter, where
the kernel is first rotated by )flipped) and then shifted across the image.
• At each position, corresponding elements are multiplied and summed to produce the
filtered output.
• Convolution is widely used for smoothing, sharpening, edge detection, and system
analysis.
• 1-D illustration,
f: 1-D function
w: a kernel
• The kernel is of size 1 × 5, so a = 2 and b = 0
Correlation function
• variables x and y so that the center point of w visits every pixel in f,
where we assume that f has been padded appropriately
• a = (m − 1) 2, b = (n − 1) 2, and we assume that m and n are odd
integers.
• where the minus signs align the coordinates of f and w when one of
the functions is rotated by 180°
• This equation implements the sum of products process to which we
refer to as linear spatial filtering.
• a 2-D function G(x, y) is said to be separable if it can be written
• as the product of two 1-D functions, G1(x ) and G2(x ); that is, G(x, y) =
G1 (x)G2 (y).
• A spatial filter kernel is a matrix, and a separable kernel is a matrix that
can be expressed as the outer product of two vectors. For example, the 2
* 3 kernel

• A separable kernel of size m × n can be expressed as the outer product of


two vectors, v and w. where v and w are vectors of size m × 1 and n × 1,
respectively. For a square kernel
• of size m × m, we write
• For an kernel: Each output pixel multiplications
• For an image of size : Total operations
Intensity Transformations & Spatial Filtering

•w (Weights/Coefficients): These are the numerical values


that define what the filter actually does (e.g., blurring,
sharpening, or edge detection).
•Spatial Context: The mask represents a neighborhood of
pixels. When you "filter" an image, you center this mask
over a pixel in the original image.
•Spatial filtering is a process of linear combination. To
calculate the new value for the pixel sitting under w5 (the
center), you multiply every weight by the pixel value
directly beneath it and sum them up.

Where:
•R is the resulting intensity value for the center pixel.
•zi is the intensity of the image pixel corresponding to mask coefficient wi.
SPATIAL FILTER KERNELS CONSTRUCTION
• One approach is based on formulating filters based on mathematical properties
Computing an average is analogous to integration.
Conversely, a filter that computes the local derivative of an image sharpens the image
• A second approach is based on sampling a 2-D spatial function whose shape has a desired property
A second approach is based on sampling a 2-D spatial function whose shape has a desired property
A third approach is to design a spatial filter with a specified frequency response, allow some
frequencies while suppress others
SMOOTHING (LOWPASS) SPATIAL FILTERS
• Smoothing (also called averaging) spatial filters are used to reduce
sharp transitions in intensity
• Because random noise typically consists of sharp transitions in
intensity, an obvious application of smoothing is noise reduction.
• Application: Smoothing prior to image resampling to reduce aliasing
• Smoothing is used to reduce irrelevant detail in an image, where
“irrelevant” refers to pixel regions that are small with respect to the
size of the filter kernel.
• Another application is for smoothing the false contours that result
from using an insufficient number of intensity levels in an image
lowpass filters based on box and Gaussian
kernels
• The simplest, separable lowpass filter kernel is the box kernel, whose coefficients
have the same value (typically 1)
• An m × n box filter is an m × n array of 1’s, with a normalizing constant in front,
whose value is 1 divided by the sum of the values of the coefficients (i.e., 1 mn
when all the coefficients are 1’s).
• Why normalization:
• First, the average value of an area of constant intensity would equal that intensity
in the filtered image, as it should.
• Second, normalizing the kernel in this way prevents introducing a bias during
filtering; that is, the sum of the pixels in the original and filtered images will be
the same
• Because in a box kernel all rows and columns are identical, the rank of these
kernels is 1, which, as we discussed earlier, means that they are separable.
box filters of size m 
m with m = 3, 11, and
21
LOWPASS GAUSSIAN FILTER KERNELS
• For example, a defocused lens is often modeled as a lowpass filter, but box filters are
poor approximations to the blurring characteristics of lenses.
• Another limitation is the fact that box filters favor blurring along perpendicular
directions.
• In applications involving images with a high level of detail, or with strong geometrical
components, the directionality of box filters often produces undesirable results.
• The kernels of choice in applications such as those just mentioned are circularly
symmetric (also called isotropic, meaning their response is independent of orientation).
• As it turns out, Gaussian kernels of the form
• There is nothing to be gained by using a Gaussian kernel larger than

• for image processing. Because typically we work with kernels of odd


dimensions, we would use the smallest odd integer that satisfies this
condition
SHARPENING (HIGHPASS) SPATIAL FILTERS

• Averaging is analogous to integration, it is logical to conclude that sharpening can


be accomplished by spatial differentiation.
• Image differentiation enhances edges and other discontinuities (such as noise) and
de-emphasizes areas with slowly varying intensities.
• Sharpening is often referred to as highpass filtering
• Derivatives of a digital function are defined in terms of differences
• There are various ways to define these differences.
• first derivative:
1. Must be zero in areas of constant intensity.
2. Must be nonzero at the onset of an intensity step or ramp.
3. Must be nonzero along intensity ramps.
SHARPENING (HIGHPASS) SPATIAL FILTERS
• any definition of a second derivative
1. Must be zero in areas of constant intensity.
2. Must be nonzero at the onset and end of an intensity step or ramp.
3. Must be zero along intensity ramps.
A basic definition of the first-order derivative of a one-dimensional
function f (x )

We define the second-order derivative of f (x) as the difference


SHARPENING (HIGHPASS) SPATIAL FILTERS
• As we traverse the profile from left to right we encounter first an area of
constant intensity and, both derivatives are zero there, so condition (1) is
satisfied by both.
• Next, we encounter an intensity ramp followed by a step, and we note that
the first-order derivative is nonzero at the onset of the ramp and the step;
• similarly, the second derivative is nonzero at the onset and end of both the
ramp and the step; therefore, property (2) is satisfied by both derivatives.
• Finally, we see that property (3) is satisfied also by both derivatives because
the first derivative is nonzero and the second is zero along the ramp.
• Note that the sign of the second derivative changes at the onset and end of a
step or ramp. In fact, we see in Fig. 3.44(c) that in a step transition a line
joining these two values crosses the horizontal axis midway between the two
extremes. This zero crossing property is quite useful for locating edges
SHARPENING (HIGHPASS) SPATIAL FILTERS
• Edges in digital images often are ramp-like transitions in intensity, in which case the first
derivative of the image would result in thick edges because the derivative is nonzero
along a ramp.
• In theory, an ideal edge looks like a sudden jump:
• But real images are usually blurred slightly because of: sensor limitations, optics,
atmospheric effects, and interpolation
• So edges often look like a gradual transition:
• This gradual transition is called a ramp edge.
• Intensity profile:
• Differences:
• The derivative is nonzero across the whole ramp.
• The detected edge becomes: wide, thick, and spread over several pixels
• because the slope exists throughout the ramp
SHARPENING (HIGHPASS) SPATIAL FILTERS
• On the other hand, the second derivative would produce a double edge one pixel thick,
separated by zeros.
• From this, we conclude that the second derivative enhances fine detail much better than the
first derivative, a property ideally suited for sharpening images.
• second derivatives require fewer operations to implement than first derivatives
• Second derivative behavior
• The second derivative measures: “How rapidly the slope changes”
• For a ramp:
Intensity:
slope is constant in the middle
changes occur mainly at the start and end /
• So second derivative responds only at transition boundaries. /
• Instead of one thick edge: /
___/
 one positive thin edge
 one negative thin edge
____████____
 zeros in between
This is called a double edge response.
___█__█___
USING THE SECOND DERIVATIVE FOR IMAGE
SHARPENING—THE LAPLACIAN

• the simplest isotropic derivative operator (kernel) is the Laplacian,


which, for a function (image) f (x, y) of two variables, is defined as
USING THE SECOND DERIVATIVE FOR IMAGE
SHARPENING—THE LAPLACIAN
• Because in smooth regions:
So most pixels become near zero intensity.
Only edges remain bright/dark.
Thus the Laplacian image looks like:
thin grey edge lines
black background
• The Laplacian alone contains mostly edge information.
• But we want Sharpened Image is the original image content PLUS
enhanced edges
• Sharpened Image Original Edge Information
USING THE SECOND DERIVATIVE FOR IMAGE
SHARPENING—THE LAPLACIAN

If Laplacian kernel has positive centre: Some books define Laplacian as:

then sharpening is: Here centre coefficient is negative.


Then sharpening becomes:
Because:
edges in Laplacian may appear negative
subtracting boosts transitions
UNSHARP MASKING AND HIGHBOOST FILTERING

1. Blur the original image.


2. Subtract the blurred image from the original (the resulting difference
is called the mask.)
3. Add the mask to the original.
USING FIRST-ORDER DERIVATIVES FOR IMAGE
SHARPENING—THE GRADIENT
• The gradient of an image f at coordinates (x, y) is defined as the two dimensional
column vector

• This vector has the important geometrical property that it points in the direction of
the greatest rate of change of f at location (x, y).
• The magnitude (length) of vector f , denoted as M(x, y) (the vector norm notation f
is also used frequently), where

• Is the value at (x, y) of the rate of change in the direction of the gradient vector
• This vector has the important geometrical property that it points in the direction of
the greatest rate of change of f at location (x, y).
USING FIRST-ORDER DERIVATIVES FOR IMAGE SHARPENING—THE
GRADIENT
• The magnitude (length) of vector f , denoted as M(x, y)

is the value at (x, y) of the rate of change in the direction of the gradient vector.
• gradient image: Note that M(x, y) is an image of the same size as the original,
created when x and y are allowed to vary over all pixel locations in f.

• If intensity changes rapidly gradient magnitude becomes large it means edge


exists
• If intensity changes slowly gradient magnitude is small indicating uniform area
Approximate Gradient Magnitude
• The exact formula requires squaring, addition and square root
• square root operations were expensive computationally
• approximate gradients are faster in real-time systems

• Isotropic property means that response is independent of edge direction


• An isotropic operator detects horizontal, vertical, diagonal edges equally
• The approximation does NOT treat all directions equally because absolute
values create directional bias
• The gradient is used frequently in industrial inspection, either to aid
humans in the detection of defects
• or, what is more common, as a preprocessing step in automated
inspection.
Roberts cross-gradient operators
The edge defects are also quite visible in this image, but with the added
advantage that constant or slowly varying shades of gray have been
eliminated, thus simplifying considerably the computational task required for
automated inspection.
Image segmentation fundamentals

(a)Every pixel must belong somewhere


(b)Pixels in same region must touch
(c)One pixel cannot belong to two regions
(d)Pixels inside a region must be similar like same intensity or texture
(e)Neighboring regions must actually differ
Image segmentation fundamentals

• the fundamental problem in segmentation is to partition an image into


regions that satisfy the preceding conditions
• Segmentation algorithms for monochrome images generally are based on
one of two basic categories dealing with properties of intensity values:
discontinuity and similarity.
• In the first category, we assume that boundaries of regions are sufficiently
different from each other, and from the background, to allow boundary
detection based on local discontinuities in intensity.
• Edge-based segmentation is the principal approach used in this category.
• Region-based segmentation approaches in the second category are based
on partitioning an image into regions that are similar according to a set of
predefined criteria.
• The three types of image characteristics in which we are interested
are isolated points, lines, and edges.

Taylor series about x


• x is the separation between samples of f this separation is measured
in pixel units x = 1 for the sample preceding x and x = −1 for the
sample following x
second order derivative:
second order derivative:
third order, central derivative

Fourth order, central derivative


In summary, we arrive at the following conclusions:
(1) First-order derivatives generally produce thicker edges.
(2) Second-order derivatives have a stronger response to fine detail, such
as thin lines, isolated points, and noise.
(3) Second-order derivatives produce a double-edge response at ramp and
step transitions in intensity.
(4) The sign of the second derivative can be used to determine whether a
transition into an edge is from light to dark or dark to light.
DETECTION OF ISOLATED POINTS: the Laplacian

• partial derivatives are computed using the second-order finite


differences

• A point has been detected at a location (x, y) on which the kernel is


centered if the absolute value of the response of the filter at that point
exceeds a specified threshold.
• Such points are labeled 1 and all others are labeled 0 in the output image,
thus producing a binary image.
• where g(x, y) is the output
image, T is a nonnegative threshold,
and Z is given by
In X-ray imaging:
1. dense metal absorbs more X-rays:
appears brighter
2. air/void absorbs less and hence more X-
rays pass through: appears darker
3. So tiny hole look like black spot
The Laplacian detector kernel in Fig.
10.4(a) is isotropic, so its response is
independent of direction (with respect to
the four directions of the 3  3 kernel:
vertical,
horizontal, and two diagonals).
LINE DETECTION
• second derivatives to result in a stronger filter response, and to
produce thinner lines than first derivatives.
• Laplacian kernel for line detection also, keeping in mind that the
double-line effect of the second derivative must be handled properly
• Often, interest lies in detecting lines in specified directions like oriented at 0°,
45°,90°
• at a given point in the image, ZK >Z j , for all j ≠ k, that point is said to be more
likely associated with a line in the direction of kernel k
• For example, if at a point in the image, Z1 >Zj for j = 2,3,4, that point is said to
be more likely associated with a horizontal line
A step edge is characterized by a transition between two intensity levels occurring ideally over the distance of one
pixel.
In practice, digital images have edges that are blurred and noisy, with the degree of blurring determined principally by limitations
in the focusing mechanism (e.g., lenses in the case of optical images), and the noise level determined principally by the electronic
components of the imaging system In such situations, edges are more closely modeled as having an intensity ramp profile
Roof edges are models of lines through a region, with the base (width) of the edge being determined by the thickness and
sharpness of the line.
We conclude from these observations that the magnitude of the first
derivative can be used to detect the presence of an edge at a point in
an image. Similarly, the sign of the second derivative can be used to
determine whether an edge pixel lies on the dark or light side of an
edge. Two additional properties of the second derivative around an
edge are: (1) it produces two values for every edge in an image; and (2)
its zero crossings can be used for locating the centers of thick edges,
The Roberts cross-gradient
operators

Prewitt operators
For every pixel:
• Convolve the image with all 8 Kirsch kernels.
• Compare the 8 responses.
• The largest response is taken as the edge magnitude.
• The direction associated with the kernel producing that maximum
response is taken as the edge direction.
• So instead of computing:
• and
• (as in Sobel-based gradient methods), Kirsch obtains both magnitude and
direction directly from the kernel responses.
Sobel
Direction Response •Uses two kernels (horizontal and vertical).
•Computes magnitude and angle mathematically.
N 120 •Limited directional sensitivity.
NE 80 Kirsch
•Uses eight directional kernels.
E 45 •Computes magnitude as the largest kernel response.
SE 20 •Direction is the orientation of the kernel producing that
response.
S -30
•Better at identifying edge orientation in all compass directions.
SW -10
W 40
NW 90
The Marr-Hildreth Edge Detector
1) It should compute derivatives Edges are locations where intensity
changes rapidly
• First derivative (Gradient)
• Operators: Roberts, Prewitt, Sobel
• These detect where intensity changes rapidly
• Second derivative
• Operators: Laplacian, LoG (Laplacian of Gaussian)
• These detect where the rate of change itself changes.
2) It should be tunable to different scales: Not all edges are the same.
Marr-Hildreth practical implementation

The Marr-Hildreth edge-detection algorithm may be summarized as


follows:

1. Filter the input image with an n × n Gaussian lowpass kernel obtained


by sampling
2. Compute the Laplacian of the image resulting from Step 1 using, for
example, the 3 × 3 kernel.
3. Find the zero crossings of the image from Step 2.
The Canny Edge Detector
Canny’s approach is based on three basic objectives:
1. Low error rate. All edges should be found, and there should be no spurious
responses.
2. Edge points should be well localized. The edges located must be as close as possible
to the true edges. That is, the distance between a point marked as an edge
by the detector and the center of the true edge should be minimum.
3. Single edge point response. The detector should return only one point for each
true edge point. That is, the number of local maxima around the true edge should
be minimum. This means that the detector should not identify multiple edge pixels
where only a single edge point exists.
• a good approximation to the optimal step edge detector is the first derivative of a
Gaussian
• Let f (x, y) denote the input image and G(x, y) denote the Gaussian function

• We form a smoothed image, f x y s( , ), by convolving f and G:

This operation is followed by computing the gradient magnitude and direction


Edge direction

• Magnitude of Gradient image typically contains wide ridges around local maxima
• The next step is to thin those ridges. One approach is to use nonmaxima suppression.
• The essence of this approach is to specify a number of discrete orientations of the edge normal
• Four orientations† for an edge passing through the center point of the region: horizontal, vertical, +45°,
and −45°.
• we have to quantize all possible edge directions into four ranges, we have to define a range of directions
over which we consider an edge to be horizontal.
• We determine edge direction from the direction of the edge normal, which we obtain directly from the
image data
Nonmaxima suppression
• Nonmaxima suppression scheme for a 3 × 3 region centered at an
arbitrary point (x, y) in a:
Hysteresis thresholding
Low threshold, TL and a high threshold, TH
Initially both the matrix are zero
• After thresholding, gNH(x,y) will usually
have fewer nonzero pixels than gNL(x,y)
• all the nonzero pixels in gNH(x,y) will be contained in gNL(x,y)
because the latter image is formed with a lower threshold

After the thresholding operations, all strong pixels in gNH(x,y) are


assumed to be valid edge pixels, and are so marked immediately.
Thresholding
• In the previous section, regions were identified by first finding edge segments, then attempting
to link the segments into boundaries.
• Techniques for partitioning images directly into regions based on intensity values and/or
properties of these values.
The Basics of Intensity Thresholding
• Intensity histogram in Fig. 10.32(a) corresponds to an image, f (x, y), composed of light objects
on a dark background, in such a way that object and background pixels have intensity values
grouped into two dominant modes
• any point (x, y) in the image at which f (x, y) > T is called an object point. Otherwise, the point is
called a background point. In other words, the segmented image, denoted by g(x, y),
• When T is a constant applicable over an entire image, the process given in this
equation is referred to as global thresholding. When the value of T changes over
an image, we use the term variable thresholding.
• If T depends on the spatial coordinates (x, y) themselves, then variable
thresholding is often referred to as dynamic or adaptive thresholding.
• multiple thresholding classifies a point (x, y) as belonging to the background if f
(x, y) ≤ T1 , to one object class if T1< f (x ,y) ≤ T2, and to the other object class if f
(x, y) > T .
• we may infer intuitively that the success of intensity thresholding is related
directly to the width and depth of the valley(s) separating the histogram
modes.
• In turn, the key factors affecting the properties of the valley(s) are:
(1) the separation between peaks (the further apart the peaks are, the better
the chances of separating the modes);
(2) the noise content in the image (the modes broaden as noise increases);
(3) the relative sizes of objects and background;
(4) the uniformity of the illumination source; and
(5) the uniformity of the reflectance properties of the image.
The Role of Noise in Image Thresholding
The Role of Illumination and Reflectance in Image Thresholding
• When the intensity distributions of objects and background pixels are
sufficiently distinct, it is possible to use a single (global) threshold
applicable over the entire image.
• The following iterative algorithm can be used for this purpose:
The threshold value
computed by the basic
algorithm was
169, while the threshold
computed by Otsu’s method
was 182, which is closer to
the lighter areas in the
image defining the cells. The
separability measure was
0.467.
USING IMAGE SMOOTHING TO IMPROVE GLOBAL THRESHOLDING
USING IMAGE SMOOTHING TO IMPROVE GLOBAL THRESHOLDING
USING EDGES TO IMPROVE GLOBAL THRESHOLDING
USING EDGES TO IMPROVE GLOBAL THRESHOLDING
• the chances of finding a “good” threshold are enhanced considerably
if the histogram peaks are tall, narrow, symmetric, and separated by
deep valleys
• One approach for improving the shape of histograms is to consider
only those pixels that lie on or near the edges between objects and
the background.
• If only the pixels on or near the edges between objects and
background were used, the resulting histogram would have peaks of
approximately the same height.
MULTIPLE THRESHOLDS
• Otsu’s method can be extended to an arbitrary number of thresholds
SEGMENTATION BY REGION GROWING AND BY REGION
SPLITTING AND MERGING
• To grow a region, the algorithm must decide if a neighboring pixel is "similar enough" to
join the group. However, "similarity" can only be measured using the data features
actually present in the image
• If you are analyzing satellite data to find forests, water bodies, or urban zones, color (or
multispectral bands) provides a massive advantage because trees are green and water is
blue/black. Attempting this on a black-and-white image would be incredibly difficult
because a gray patch could be a concrete road or a muddy river.
• Just because two pixels look identical does not mean they belong to the same object.
They must be physically touching
• A region-growing algorithm expands step-by-step. It needs to know exactly when to stop
expanding so it doesn't accidentally bleed into a completely different, adjacent object.
• To prevent this, the algorithm can track the history or global characteristics of the region
it has already built
REGION SPLITTING AND MERGING
• An alternative is to subdivide an image initially into a set of disjoint regions and then merge
and/or split the regions in an attempt to satisfy the conditions of segmentation
• Let R represent the entire image region and select a predicate Q. One approach for
segmenting R is to subdivide it successively into smaller and smaller quadrant regions so
that, for any region Ri ,Q(Ri ) = TRUE
• We start with the entire region, R. If Q(R) = FALSE, we divide the image into quadrants
• If Q is FALSE for any quadrant, we subdivide that quadrant into sub-quadrants, and so on
• This splitting technique has a convenient representation in the form of so-called quadtrees
• quadtrees; that is, trees in which each node has 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.
• the final partition normally contains adjacent regions with identical properties. This
drawback can be remedied by allowing merging as well as splitting
• two adjacent regions Rj and Rk are merged only if Q R R ( j k ) = TRUE.

You might also like