Region and Edge Based Segmentaion
Segmentation is the separation of one or more regions or objects in an image based on a discontinuity or a similarity criterion. A region in an image can be defined by its border (edge) or its interior, and the two representations are equal. There are prominently three methods of performing segmentation:
- Pixel Based Segmentation
- Region-Based Segmentation
- Edges based segmentation
Edges based segmentation
Edge-based segmentation contains 2 steps:
- Edge Detection: In edge detection, we need to find the pixels that are edge pixels of an object. There are many object detection methods such as Sobel operator, Laplace operator, Canny, etc.
|Sobel vertical Operator|
|Sobel Horizontal Operator|
|Negative Laplace Operator|
- Edge Linking: In this step, we try to refine the edge detection by linking the adjacent edges and combine to form the whole object. The edge linking can be performed using any of the two methods below:
- Local Processing: In this method, we used gradient and direction to link the neighborhood edges. If two edges have a similar direction vector then they can be linked.
- Global processing: This method can be done using HOG transformation
- Pros :
- This approach is similar to how the humans brain approaches the segmentation task.
- Works well in images with good contrast between object and background.
- Does not work well on images with smooth transitions and low contrast.
- Sensitive to noise.
- Robust edge linking is not trivial and easy to perform.
In this segmentation, we grow regions by recursively including the neighboring pixels that are similar and connected to the seed pixel. We use similarity measures such as differences in gray levels for regions with homogeneous gray levels. We use connectivity to prevent connecting different parts of the image.
There are two variants of region-based segmentation:
- Top-down approach
- First, we need to define the predefined seed pixel. Either we can define all pixels as seed pixels or randomly chosen pixels. Grow regions until all pixels in the image belongs to the region.
- Bottom-Up approach
- Select seed only from objects of interest. Grow regions only if the similarity criterion is fulfilled.
- Similarity Measures:
- Similarity measures can be of different types: For the grayscale image the similarity measure can be the different textures and other spatial properties, intensity difference within a region or the distance b/w mean value of the region.
- Region merging techniques:
- In the region merging technique, we try to combine the regions that contain the single object and separate it from the background.. There are many regions merging techniques such as Watershed algorithm, Split and merge algorithm, etc.
- Since it performs simple threshold calculation, it is faster to perform.
- Region-based segmentation works better when the object and background have high contrast.
- It did not produce many accurate segmentation results when there are no significant differences b/w pixel values of the object and the background.
- In this implementation, we will be performing edge and region-based segmentation. We will be using scikit image module for that and an image from its dataset provided.
Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the Machine Learning Foundation Course at a student-friendly price and become industry ready.