Color Image Segmentation...

Introduction

Image processing, in the general sense, means image transformation:  taking a source
 image in our case it is a bmp image) and generating the destination image by combining
 the pixel values by finding maximum, minimum, mean, median  e.g. within a 
local region of size 3X3 or 5X5 . The purposes of image transformation are numerous.
 Most of the time, the goal is to remove or lessen some unwanted features such as noise
 or blur, and enhance the features of interest. Image improvement, restoration
or enhancement, is always useful for cosmetic purposes (visual quality improvement),
but can also help making the analysis tasks more robust.Image Processing is used
for two purposes:

1)      Improving the visual appearance of images to a viewer, and

2)      Preparing images for measurement of the features and structures present in it. 

The techniques that are appropriate for each of these tasks are not always the same,
but there is considerable similarity in the techniques.

What is color?

The human eye is sensitive to the intensity of light (dark areas opposed to bright),
which is captured by gray-level images. This is known as the achromatic sensation.

It is also sensitive, to some extent, to the spectral composition of light, i.e. the
superposition of different wavelengths. Lab experiments have shown that any
 colored sensation can be described as the mixture, in given proportions, of three well
chosen primary colors, such as red, green and blue; this is known as the tristimulus theory. 

If the proportions of each color component, or "channel", are coded on eight bits, one
obtains a 24-bits-per-pixel representation, often referred to as "True Color" images. This
format is very often used in image processing because it allows representing as  many
 colors as the eye can distinguish. We give names to different colors we perceive:
orange, indigo, purple, olive green... These correspond to different hues. Furthermore,
colors can be seen as more or less pure. This property is called the saturation:
the more saturated a color is, the more vivid it appears; the less saturated it is, the closer
 it comes to gray. This qualitative description of color is sometimes better suited for
processing because it is not sensitive to the choice of the color primaries.
 Anyway, since it does not correspond to the native digitized color representation,
some conversions may be required. 

In any case, a color image is three times as large as a gray-level image in terms of
 storage requirements and requires at least three times more processing.

Problem Definition

Image segmentation is a long-standing problem in computer vision. Often it is viewed as
an ill-defined problem in comparison  to other vision tasks, which have apparently well
defined   objectives, such as detection, recognition, and tracking. Unfortunately, without
 addressing segmentation problems, those special purpose vision tasks are fundamentally
 ill defined, and have to suffer from generality and robustness. The confusion in defining
 image segmentation and also perceptual grouping  problems simply reflect the important
 fact that image segmentation is perhaps a computing process and should not be
treated as a task.

Objective

The objective is to divide the image into different regions that hopefully corresponds to
objects in the image, on the basis  of pixel parameters like intensity values in different
planes viz. Red, Green, Blue planes. The segmentation of images is to generate segments,
 which correspond to objects, parts of objects, or group of objects which appear in the image. 

In this project, I have implemented Region growing, Split – merge and Watershed algorithms
used for color as well as gray color images.

Methodology

Watershed Segmentation:

The concepts of watersheds and catchments basins are well known in topography.
Watershed lines divide individual catchments basins. Image data may be interpreted as
a topographic surface where the gradient image gray-levels  represent altitudes.
 Region edges correspond to high watersheds and low-gradient region interiors correspond
 to catchments  basins. Catchments basins of the topographic surface are  homogeneous
 in the sense that all pixels belonging to the same  catchments basin are connected with
the basin's region of minimum altitude  (gray-level) by a simple path of pixels that have
 monotonically decreasing altitude (gray-level) along the path. Such catchments basins then
 represent the regions of the segmented image.
The principle underlying the morphological
 watershed is that a symbolic drop of water, placed on a pixel of  high gradient, will drain down
to a pixel that has regional minimum gradient value. Each pixel lying in the descending path of
this  drop of water will be associated  with that same regional minimum to form catchments
 basins, and the basins will ultimately identify distinct  regions with different labels. Each local
minimum has an associated segment defined by its catchments basin.
 

Region Growing

Region growing approach is the opposite of the split and merge approach:
An initial set of small areas are iteratively merged according to similarity constraints. Start by
choosing an arbitrary seed pixel and compare  it with neighboring pixels . Region is grown
from the seed pixel by adding in neighboring pixels that are similar, increasing the size of the
  region. When the growth of one region stops we simply choose another seed pixel which
 does not yet belong to any region and start again. This whole process is continued until all
pixels belong  to some region. A bottom up method.

Region growing methods often give very good segmentations that correspond
well to the observed edges.  

 

 

Region growing  method.

However starting with a particular seed pixel and letting this region grow completely
before trying other seeds  biases the segmentation  in favor of the regions which are

segmented first. This can have several undesirable  effects:

1)Current region dominates the growth process -- ambiguities around edges
       of adjacent regions may    not be resolved correctly.

2)Different choices of seeds may give different segmentation results.

3)Problems can occur if the (arbitrarily chosen) seed point lies on an edge.

To counter the above problems, simultaneous region growing techniques have
 been developed.Similarities of neighboring regions are taken into account in the

growing process.No single region is allowed to completely dominate the proceedings.

 A number of regions are allowed to grow at the same time. similar regions will gradually
 coalesce into expanding regions. Control of these methods may be quite complicated
 but efficient methods have been developed. Easy and efficient to implement on
 parallel computers.

Region Splitting and Merging

The basic idea of region splitting is to break the image into a set of disjoint regions
which are coherent within themselves.
Initially take the image as a whole to be the
 area of interest.
Initially take the image as a whole to be the area of interest.
 Look at the area of interest  and decide if all pixels contained in the region satisfy
 some similarity constraint. If TRUE then the area of interest corresponds to a
region in the image. If FALSE split the area of interest (usually into four equal sub-areas)
and consider each of the sub-areas as the area of interest in turn.

A.         This process continues until no further splitting occurs. In
      the worst case this happens when the areas are just one pixel in size.

B.         This is a divide and conquers or top down method.

If only a splitting schedule is used then the final segmentation would probably contain
 many neighboring regions that have identical or similar properties.
Thus, a merging
process is used after each split, which compares adjacent regions and merges
 them if necessary. Algorithms of this nature are called split and merge algorithms.

To illustrate the basic principle of these methods the following imaginary image is considered.

Results 
 
           fig 1.            fig 2.            fig.3             fig  4.

Fig. 1 is the original image.Fig.2 is the output of Region growing.Fig.3 is the output
 of Split and Merge method segmentation. Fig 4. is the result of Watershed segmentation. 
The above image shows the results of region growing, split and merge as well as watershed
 segmentation of the image.The original image mainly consists of two objects. They are
crane in white color, background in black color.

In the region-growing algorithm, the result will entirely depend on the position of the
 seed pixel given by the user. Even though other regions are present in the image, the
 algorithm identifies only the region in   the vicinity of the seed pixel.

Split and Merge algorithm is an iterative method. The algorithm runs successfully over
the entire image. But the output of this algorithm will have “square” like regions with
 distorted edges of the objects in the image. Quite often it gives ambiguous results.
This method also depends on the quality of the test used to detect in-homogeneity
in each region. Small sub regions within large uniform areas can easily be missed with
 method. Watershed segmentation in comparison to the other two methods viz
. region growing, Split and Merge gives
 more accurate results. This algorithm works over entire image successfully and identifies
different objects in the image unlike region growing method. In the fig.4 the edges are
continuous and similar to the original image.