0% found this document useful (0 votes)
7 views

Lecture 9-1

Uploaded by

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

Lecture 9-1

Uploaded by

my5911319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

DIP (Digital Image Processing)

Prepared by Burhanuddin Lecturer of Computer Science at the


Department of Computer Science GDC Gulabad Dir(lower)
Email: [email protected]
Segmentation Approach
• Edge-Based Segmentation: Focuses on detecting boundaries
between regions, typically where there’s a significant change in pixel
intensity. gradient operators, edge detectors
• Sobel
• Canny
• Laplacian operators.
• Region-Based Segmentation: Relies on grouping pixels that are
similar in certain attributes (like color or intensity) to form coherent
regions. Methods include
• region growing
• region merging
• split-and-merge
Detection Method
• Edge-Based: Identifies edges by analyzing changes in intensity and
marking them as boundaries.
• The focus is on discontinuity in pixel values, so it works well for
images with clear boundaries.

• Region-Based: Looks for uniformity within a region. It starts from a


set of seed points and grows these areas based on criteria of
similarity.
• Effective when regions have relatively homogenous properties.
Complexity
• Edge-Based: Typically less computationally intensive because it only
needs to detect boundaries rather than entire regions.

• Region-Based: Generally more complex, as it needs to analyze large


areas for pixel similarity.
• Requires more computation, especially for merging or growing
regions.
Sensitivity to Noise
• Edge-Based: Can be sensitive to noise, as even small fluctuations in
pixel values can create false edges.
• This can lead to incomplete or fragmented boundaries.

• Region-Based: Less sensitive to noise because it relies on global


uniformity in regions rather than just changes at the boundaries.
Edge-Based Types
• Gradient-Based Edge Detection
• Sobel Operator
• Prewitt Operator

• Laplacian-Based Edge Detection


• Laplacian of Gaussian (LoG)
• Difference of Gaussians (DoG)
Gradient-based edge detection
• Identifies edges by calculating the gradient (rate of change) in image
intensity.
Sobel Operator
• The Sobel operator calculates the gradient in both the horizontal (x) and vertical (y) directions
using convolution.
• It combines these gradients to highlight regions with a high rate of change in intensity.
How it Works: The Sobel operator applies two 3x3 convolution kernels, one for detecting
edges along the x-axis and another for the y-axis.
Prewitt Operator
• The Prewitt operator is similar to the Sobel operator but uses a
different set of convolution kernels to calculate gradients in x and y
directions.
• Generally used for simpler edge detection applications.

• How it Works: The Prewitt operator uses these 3x3 kernels.

The gradient magnitude GGG is calculated in the same way as Sobel.


Laplacian-Based Edge Detection
• Laplacian-based edge detection uses the Laplacian operator, a
second-order derivative, to identify areas of rapid intensity change,
highlighting edges in images.

• Unlike gradient-based methods, which detect edges by looking for


intensity changes in specific directions.
Laplacian Operator
• The Laplacian operator calculates the second derivative of the image
intensity function, pinpointing locations where intensity changes rapidly.
• How It Works: Common kernels for the Laplacian operator in a 3x3
neighborhood are.

• These kernels are convolved with the image to compute the second
derivative, with the result emphasizing areas where the pixel intensity
changes rapidly.
• Detects edges in all directions and can emphasize finer details.
• Very sensitive to noise; requires smoothing before application in noisy
images.
Region-Based Segmentation
• Segments an image into regions with similar properties, typically by
grouping connected pixels with similar intensity values or colors.

Key Types of Region-Based Segmentation


Thresholding
• Global Thresholding
• Adaptive (Local) Thresholding
Region Growing
Region Splitting
Region Merging
Watershed Segmentation
Thresholding
It converts grayscale or color images into binary images by setting pixels
to either black or white, based on a threshold value.

• Global Thresholding
• Adaptive Thresholding
Global Thresholding
How Global Thresholding Works:
Choose a Threshold Value, T:
• The threshold T can be selected manually based on the image histogram or determined
automatically.
• Pixels with intensity values greater than or equal to T are assigned to the foreground
(often set to white), while pixels below T are assigned to the background (often set to
black).
Selecting an Optimal Threshold:
• Manual Selection: View the image histogram and select a threshold based on
intensity peaks.
• Automated Methods: Methods like Otsu’s algorithm can find an optimal
threshold automatically by maximizing the variance between the two pixel
classes.
Pros and Cons
Pros
• Simple and efficient to implement, especially suitable for images with uniform lighting.
• Works well when there is a significant contrast between object and background.
Cons
• Less effective if the image has uneven lighting or shadows, as the single threshold may
not separate regions accurately.
• May require multiple trials to manually select a suitable threshold.
Adaptive Thresholding
Define the Neighborhood:
• A small region, or window, around each pixel (e.g., 5×5, 11×11 pixels) is selected as the local
neighborhood.
Calculate the Local Threshold:
• Within each neighborhood, a local threshold is calculated, typically as the mean or weighted
mean intensity value of the pixels in that region.
• Some methods also use the median or combine the mean with the standard deviation to
calculate a robust threshold for each neighborhood.
• Pros
• Handles images with non-uniform lighting effectively.
• Helps retain fine details in varying lighting conditions, especially for textured or complex images.
• Cons
• Computationally more intensive due to the need to calculate thresholds for multiple
neighborhoods.
• May be sensitive to noise in images if the neighborhood is too small.
Introduction to Region Growing
• Definition: Region growing is a technique used in image segmentation
where neighboring pixels with similar attributes (such as color or
intensity) are grouped together to form a region.

• Goal: To segment an image into meaningful regions by growing


regions based on predefined criteria.

• Use Cases: Medical image segmentation, object detection, image


analysis.
Region Growing Basics
• Seed Selection: A pixel (or group of pixels) is chosen as the starting
point or "seed".

• Criteria for Region Growing:


• Homogeneity: New pixels are added to the region if their properties (like
intensity, color, texture) are similar to the seed.
• Thresholding: A threshold is applied to define how similar the neighboring
pixels must be to the seed pixel.
Region Growing Process
• Step 1: Seed Selection: The process starts by selecting a seed pixel or
a set of seeds.

• Step 2: Region Expansion: Neighboring pixels are compared to the


seed's attributes. If they meet the similarity criterion, they are added
to the region.

• Step 3: Stopping Condition: The region growing continues until no


further pixels can be added to the region based on the criteria.
Challenges in Region Growing
• Seed Selection: Selecting an appropriate seed is crucial, as poor seed
selection may lead to improper segmentation.

• Thresholding: Choosing the right threshold is challenging because too


strict or too loose thresholds can affect the quality of segmentation.

• Noise: Noise can lead to incorrect region growth, resulting in


fragmented or overgrown regions.
Introduction to Region Splitting
• Definition: Region splitting is a technique used in image segmentation
where an image is recursively divided into smaller regions based on
certain criteria until a stopping condition is met.

• Goal: To partition an image into homogeneous regions by dividing it


into smaller regions that meet certain properties (e.g., uniform
intensity or texture).

• Goal: To partition an image into homogeneous regions by dividing it


into smaller regions that meet certain properties (e.g., uniform
intensity or texture).
Region Splitting Basics
• Process Overview:
• The image is divided into smaller regions (usually quadrants).
• Each region is evaluated for homogeneity.
• If a region is not homogeneous, it is further split into smaller subregions.

• Homogeneity Criterion: Similar to region growing, regions must


satisfy certain uniformity criteria (e.g., pixel intensity, color, or
texture).
Region Splitting Process
• Step 1: Initial Split: The entire image is considered a single large
region.

• Step 2: Evaluate Homogeneity: Check if the region meets the desired


homogeneity criterion (e.g., pixel intensity or color).

• Step 3: Split if Necessary: If the region is not homogeneous, split it


into smaller subregions.

• Step 4: Repeat: Continue the splitting process for all subregions until
the regions are homogeneous enough or meet a defined threshold.
Challenges in Region Splitting
• Over-Splitting: If the threshold is too strict, the image may be divided
into too many small regions, losing meaningful structures.

• Under-Splitting: If the threshold is too lenient, large, non-


homogeneous regions may remain undivided.
Introduction to Region Merging
• Definition: Region merging is a technique used in image segmentation
to combine adjacent regions that are similar in terms of intensity,
color, texture, or other attributes.

• Goal: To improve segmentation by merging smaller homogeneous


regions into larger ones, reducing fragmentation and refining
boundaries.

• Use Cases: Object recognition, medical image segmentation, satellite


image analysis, texture segmentation.
Region Merging Basics
• Process Overview:
• After image segmentation (using techniques like region splitting), small
homogeneous regions are formed.
• Region merging works by combining these regions based on predefined
criteria.

• Homogeneity Criterion: Merging is based on the similarity between


adjacent regions (e.g., similar intensity, color, or texture).
Region Merging Process
• Step 1: Initial Segmentation: Start with an image that has been split
into smaller regions (using techniques like region splitting or
thresholding).
• Step 2: Evaluate Adjacent Regions: Compare neighboring regions to
determine if they meet the similarity criterion for merging.
• Step 3: Merge Regions: If two adjacent regions meet the criterion
(e.g., similarity in pixel intensity), they are merged into a larger region.
• Step 4: Repeat: The merging process continues iteratively until no
more regions can be merged.
Challenges in Region Merging
• Choosing the Right Similarity Threshold: If the threshold is too strict,
many regions may not be merged, leading to over-segmentation. If it’s
too lenient, different objects may merge, leading to under-
segmentation.

• Edge Definition: Poor handling of region boundaries can result in


merged regions that don't accurately represent object boundaries in
the image.
• Region growing starts with a seed pixel (or a set of seed pixels) and
iteratively adds neighboring pixels to the region if they meet certain
criteria (like color similarity, intensity, or texture). This process
continues until no more pixels can be added to the region.

• Merging begins by segmenting an image into smaller regions and then


combining adjacent or similar regions based on a predefined similarity
criterion. Regions are merged iteratively if they meet the similarity
condition.
Watershed Segmentation in Image
Processing
• Definition: Watershed segmentation is an image segmentation
technique based on topography.
Thanks

You might also like