Image Segmentation
|
Introduction |
Our goal:Our goal in this work to implement our own segmentation algorithm based on splitting merge quadtree algorithm.
|
Splitting merge quadtree algorithm |
The workflow:The following diagram explains our workflow in a very high level
|
Split stage:The split stage aimed to divide the image into homogenous regions according a certain color criterion.We used quadtree structure, it's a tree structure in which each internal node has exactly four children
|
|
In this stage we combined edge and region information, we used Sobel edge detection approach to get the Magnitude and Direction of the image. Sobel operator: The operator uses two kernels which are convolved with the original image. The x-coordinate is defined here as increasing in the "right"-direction, and the y-coordinate is defined as increasing in the "down"-direction. At each point in the image, the resulting gradient approximations can be combined to give: the gradient magnitude, using: Using this information, we can also calculate the gradient's direction: For merging two regions we used local processing edge linking approach combined with a color criterion. To determine the homogenouty of R1 and R2 we checked the similarity for each adjacent pixel from R1 and R2. The principal properties used for establishing similarity between two pixels:
|G (s, t ) − G (x, y )| < E
|Θ (s, t ) − Θ (x, y )| < A
If each adjacent pixel from R1 and R2 satisfy the above criterions, then we check the color similarity of the regions R1 and R2 using the following formula, if |color (R1 ) − color (R2 )| < C Then the regions are homogenous, if not then the regions are non-homogenous |
Results: |
|
|
|
|
|
|
|
|
Related files:All the code we wrote, available here |
|