Image segmentation is a fundamental step in image processing and analysis, and various techniques have been developed to partition an image into meaningful and homogeneous regions. Segmentation techniques aim to group pixels with similar characteristics into clusters, ...
Image Segmentation Techniques
Image segmentation is a fundamental step in image processing and analysis, and various techniques have been developed to partition an image into meaningful and homogeneous regions. Segmentation techniques aim to group pixels with similar characteristics into clusters, making it easier to identify and analyze distinct objects, regions, or patterns within an image.
1. Thresholding:
Thresholding is a simple and widely used segmentation technique that separates pixels into two classes based on a predefined threshold value. Pixels with values above the threshold are assigned to one class, while pixels below the threshold are assigned to another. Thresholding is effective for segmenting images with clear bimodal distributions, such as black and white images or images with distinct foreground and background regions.
2. Region Growing:
Region growing algorithms start with a seed point and iteratively add neighboring pixels to the region if they meet certain criteria, such as being within a specified range of the seed point's intensity or texture. Region growing continues until no more pixels satisfy the criteria, resulting in the formation of a homogeneous region. Multiple regions can be grown simultaneously to segment the entire image.
3. Region Splitting and Merging:
Region splitting and merging techniques iteratively divide and combine regions to achieve an optimal segmentation. Initially, the image is divided into small, homogeneous regions. Adjacent regions with similar characteristics are then merged, while regions with significant differences are split further. This process continues until a desired level of segmentation is achieved.
4. Clustering:
Clustering algorithms aim to group pixels into clusters based on their similarity. Pixels are represented as data points in a multidimensional feature space, where each dimension represents a pixel characteristic such as intensity, color, or texture. Clustering algorithms, such as k-means and hierarchical clustering, then group these data points into clusters, each representing a distinct region in the image.
5. Boundary Detection:
Boundary detection techniques identify boundaries between different regions in an image. Edges, which are sharp transitions in pixel values, often indicate object boundaries. Edge detection algorithms, such as the Canny edge detector, locate these edges and trace them to delineate object boundaries.
6. Watershed Segmentation:
Watershed segmentation treats an image as a topographic surface, where pixels represent elevation values. The algorithm floods the surface from predefined markers, representing object seeds, and creates dams at boundaries where water from different markers would merge. The resulting watershed lines define the object boundaries.
7. Graph-Based Segmentation:
Graph-based segmentation represents an image as a graph, where nodes represent pixels and edges represent relationships between pixels. Segmentation algorit
Size: 13.59 MB
Language: en
Added: Sep 03, 2024
Slides: 47 pages
Slide Content
SEGMENTATION TECHNIQUES BY AHMED R. A. SHAMSAN & MOHAMMED ALMOHAMADI
What is Image Segmentation?
segmentation techniques
Threshold-based segmentation
Threshold-based segmentation
segment an image into regions of pixels with gray levels from a set D and into the background otherwise "band threshold" refers to a technique used to segment or separate different regions or objects within an image based on the intensity values of specific bands or channels. An image typically consists of multiple color channels, each representing different color information such as red, green, and blue in RGB images. Band-Thresholding
Multi-thresholding is a technique used in image processing to segment an image into multiple regions based on intensity levels . Thresholding involves dividing an image into two regions – one with pixel values below a certain threshold and another with pixel values above the threshold. Multi-thresholding extends this concept by dividing the image into more than two regions, allowing for finer segmentation . Multi-thresholding
semi-thresholding, the threshold value is determined based on the local characteristics of the image. This can be particularly useful when dealing with images that have varying illumination or contrast levels across different regions. The goal is to adaptively set the threshold for each pixel or neighborhood, improving segmentation accuracy. semi-thresholding
If some property of an image after segmentation is known a priori, the task of threshold selection is simplified, since the threshold is chosen to ensure this property is satisfied. A printed text sheet may be an example if we know that characters of the text cover 1/p of the sheet area. Thresholding detection
The process of thresholding detection involves the following steps: Image Acquisition: The process begins with capturing or loading an image into the system. Grayscale Conversion: If the image is in color, it is often converted to grayscale to simplify the analysis. This results in a single-channel image where each pixel represents the intensity of light. Threshold Selection: The critical step is selecting an appropriate threshold value. This value determines the dividing line between the pixels that will be considered as part of the object or region of interest and those that belong to the background. Global Thresholding: A single threshold is applied to the entire image. Adaptive Thresholding: Different thresholds are applied to different regions of the image based on local characteristics . Pixel Classification: Each pixel in the image is then classified into one of the two categories based on whether its intensity is above or below the selected threshold. Binary Image Creation: The result is a binary image, where pixels classified as part of the object are typically represented as white, and those classified as background are represented as black.
choose a threshold T (based on the image histogram) such that 1/p of the image area has gray values less than T and the rest has gray values larger than T in text segmentation, prior information about the ratio between the sheet area and character area can be used if such a priori information is not available - another property, for example the average width of lines in drawings, etc. can be used - the threshold can be determined to provide the required line width in the segmented image P-tile-thresholding
if objects have approximately the same gray level that differs from the gray level of the background histogram shape analysis Histogram shape analysis is a fundamental tool in image processing, providing insights into the characteristics of an image and guiding subsequent processing steps for tasks such as enhancement, segmentation, and quality assessment. bi-modal histogram
Mode method - find the highest local maxima first and detect the threshold as a minimum between them to avoid the detection of two local maxima belonging to the same global maximum, a minimum distance in gray levels between these maxima is usually required or techniques to smooth histograms are applied Bi-modal histogram threshold detection algorithms:
Hysteresis Thresholding | Introduces two thresholds: Upper threshold ( T_upper ): Pixels exceeding this value are confidently classified as “object.“ Lower threshold ( T_lower ): Pixels below this value are definitively classified as "background.“ The magic lies in the intermediate region between the thresholds. Pixels within this range are only considered "object" if they are connected to pixels exceeding the upper threshold. This "memory" effect essentially ignores isolated noise pixels that fall within the intermediate range, resulting in a more robust segmentation.
Iterative Thresholding Algorithm
Local thresholding Now, instead of using one line for the whole picture, we use different lines for different areas. If a pixel lives in a dark neighborhood, it might have a lower threshold. If it’s in a bright neighborhood, the threshold could be higher. This way, we adapt to changes in lighting or variations across the image. Why Do We Use It? Local thresholding helps us find objects in an image even when the lighting isn’t consistent. For example, if you’re looking for coins in a photo, some coins might be in shadow while others are well-lit. Local thresholding helps us find all of them.
Edge-based Segmentation: Edge-based segmentation identifies the boundaries or edges between different objects or regions in an image. Edges often represent significant changes in intensity or color, which are crucial for object detection and segmentation. Using Binary Images for Edge Detection: Binary images are commonly employed in edge detection algorithms. One popular approach is to convert a grayscale image to a binary one and then apply edge detection techniques like the Sobel operator, Prewitt operator, or Canny edge detector. Benefits of Edge-based Segmentation: Edge-based segmentation is useful because it highlights the boundaries between objects Challenges: While edge-based segmentation is effective in many cases, it may also be sensitive to noise and variations in lighting conditions. Therefore, pre-processing steps like smoothing or filtering may be applied to enhance the robustness of the segmentation.
Region Based Segmentation Region-based segmentation is a computer vision technique that involves dividing an image into regions based on certain characteristics or criteria. The goal is to group together pixels or superpixels that share similar properties, such as color, texture, or intensity, in order to identify meaningful and homogeneous regions within an image. In Segmentation: Use the extracted features to partition the image into regions. This is often done by clustering or grouping pixels based on their feature similarities.
Region Growing Region Growing is a region-based segmentation technique used in image processing to group pixels into homogeneous regions based on certain criteria. The basic idea behind Region Growing is to start with an initial seed pixel or set of pixels and iteratively add neighboring pixels to the region if they satisfy certain similarity conditions. Note that the complete segmentation of the image must be It meets several criteria: All pixels must be assigned to regions Each pixel must belong to only one region Each region must be a connected group of pixels Each area must be unified
Region Based Segmentation Merge Regions: repeatedly check neighboring regions, and if they satisfy the homogeneity criteria, merge them into a single region. The merging process continues until the stopping criteria are met. Stopping Criteria: Define conditions for stopping the merging process. Common stopping criteria include reaching a specified number of segments or when no further merging improves homogeneity. Advantages of Region Merging: It can handle over-segmented images by merging adjacent regions. It allows for the creation of segments with variable shapes and sizes. The merging process is adaptive and depends on local image characteristics. Algorithm Steps: Begin with each pixel as a separate region. Compute a region dissimilarity measure for adjacent regions based on properties such as pixel intensity, color, or texture. Merge the pair of neighboring regions with the lowest dissimilarity measure. Repeat steps 2 and 3 until a stopping criterion is met (e.g., a specified number of segments or no further improvement in dissimilarity).
Split Region Identify Regions for Splitting: Identify regions that are not sufficiently homogeneous or show signs of containing multiple objects. Define thresholds or criteria for homogeneity that indicate when a region should be considered for splitting. Split Operation: For each identified region to be split: Choose a splitting strategy, which may involve dividing the region into smaller subregions based on certain criteria. This could be done by employing algorithms like region growing, thresholding, or other segmentation techniques. Post-Split Homogeneity Check: After the split operation, reevaluate the homogeneity of the newly created regions. Ensure that the split has improved the homogeneity and addressed the issues identified during the merging step.
Split and Merge Split And Merge Segmentation Is A Technique Used To Divide An Image Into Meaningful Regions Based On Certain Criteria. The Process Involves Recursively Splitting The Image Into Smaller Parts (Splitting Step) And Then Merging Similar Adjacent Regions (Merging Step) To Create A Segmented Result. How Does It Work? Splitting (Top-down): The Image Is Initially Divided Into Quadrants (Usually Equal-sized Regions). Each Quadrant Is Evaluated Based On A Homogeneity Criterion (E.G., Uniformity Of Gray Levels). If A Quadrant Is Homogeneous (Similar Enough), It Is Not Split Further. Otherwise, The Quadrant Is Recursively Split Into Smaller Regions.
Cont’d… Merging (Bottom-Up): After splitting, we examine adjacent regions. If two neighboring regions are similar (based on the same homogeneity criterion), they are merged into a larger region. This process continues until all regions pass the homogeneity test. Homogeneity Criterion: The key to split and merge segmentation lies in defining what makes a region homogeneous. Examples of homogeneity criteria: Uniformity: A region is homogeneous if its gray scale levels are constant or within a given threshold. Local Mean vs. Global Mean: If the mean intensity of a region is greater than the mean of the entire image, the region is considered homogeneous. Variance: The gray level variance within a region should be below a specified value for it to be homogeneous.
Clustering-Based Segmentation Clustering-based Segmentation Is A Technique Used In Image Processing To Partition An Image Into Meaningful And Homogeneous Regions Or Segments Based On The Similarity Of Pixel Characteristics. The Fundamental Idea Is To Group Pixels That Share Similar Properties Into Clusters, Making It Easier To Identify And Analyze Distinct Regions Within An Image. types of clustering-based segmentation techniques K-Means Clustering Mean-Shift Hierarchical Clustering
K-Means Clustering Partition the data points into K clusters randomly. Find the centroids of each cluster. For each data point: Calculate the distance from the data point to each cluster. Assign the data point to the closest cluster. Recompute the centroid of each cluster. Repeat steps 2 and 3 until there is no further change in the assignment of data points (or in the centroids).
How steps is going on
K-Means Clustering EXAMPLE Duda et al. RGB VECTOR
Clustering | example
K-Means Clustering | example Original K=5 K=11
K-means, only color is used in segmentation, four clusters (out of 20) are shown here.
33 K-means, color and position is used in segmentation, four clusters (out of 20) are shown here. Each vector is (R,G,B,x,y).
what is Behind K-Means The core objective of k-means clustering is to minimize the within-cluster variance. This essentially means k-means tries to create clusters where the data points within a cluster are as close together as possible, reducing the overall spread within each group. By achieving this, we can be more confident that points within a cluster share similar characteristics.
How Mean-Shift Works: The goal of mean shift is to identify clusters by shifting data points toward the mode (highest density) of nearby points within a certain radius. Here’s how it works: Initialization: Start by considering each data point as a potential cluster centroid. Iterative Steps: For each data point: Calculate the mean of all points within a certain radius (the “kernel”) centered at that data point. Shift the data point towards this mean. Repeat the above step until convergence or a maximum number of iterations is reached. Mean-Shift
Versatile technique for clustering-based segmentation Mean shift segmentation
Simple Mean Shift procedure: Compute mean shift vector Translate the Kernel window by m(x) Computing the Mean Shift
Real Modality Analysis
Attraction basin Attraction basin: the region for which all trajectories lead to the same mode Cluster: all data points in the attraction basin of a mode
Attraction basin
Mean shift clustering The mean shift algorithm seeks modes of the given set of points Choose kernel and bandwidth For each point: Center a window on that point Compute the mean of the data in the search window Center the search window at the new mean location Repeat ( b,c ) until convergence Assign points that lead to nearby modes to the same cluster
Segmentation by Mean Shift Compute features for each pixel (color, gradients, texture, etc ) Set kernel size for features Kf and position Ks Initialize windows at individual pixel locations Perform mean shift for each window until convergence Merge windows that are within width of Kf and Ks
Mean shift segmentation results
Mean shift pros and cons Pros Good general-practice segmentation Flexible in number and shape of regions Robust to outliers Cons Have to choose kernel size in advance Not suitable for high-dimensional features When to use it Oversegmentatoin Multiple segmentations Tracking, clustering, filtering applications
Hierarchical Clustering Hierarchical clustering creates a hierarchy of clusters by merging or splitting them based on similarity measures. How Hierarchical Clustering Works: The process involves the following steps: Initialization: Treat each data point as a separate cluster. Merging or Splitting: Iteratively combine the closest clusters until a stopping criterion is reached. Two main approaches: Agglomerative (Bottom-Up): Start with individual data points and merge them into larger clusters. Divisive (Top-Down): Begin with all data points in one cluster and recursively split them.
Hierarchical Clustering A hierarchy might be more nature Different users might care about different levels of granularity or even pruning's.
Hierarchical Clustering Top-down (divisive) Partition data into 2-groups (e.g., 2-means) Recursively cluster each group Bottom-up (agglomerative) Start with every point in its own cluster. Repeatedly merge the “closest” two clusters Different definitions of “closest” give different algorithms.