# Region growing

Region growing is a simple region-based image segmentation method. It is also classified as a pixel-based image segmentation method since it involves the selection of initial seed points.
This approach to segmentation examines neighboring pixels of initial seed points and determines whether the pixel neighbors should be added to the region. The process is iterated on, in the same manner as general data clustering algorithms. A general discussion of the region growing algorithm is described below.

## Region-based segmentation

The main goal of segmentation is to partition an image into regions. Some segmentation methods such as thresholding achieve this goal by looking for the boundaries between regions based on discontinuities in grayscale or color properties. Region-based segmentation is a technique for determining the region directly. The basic formulation is:
    $(a){\text{ }}\bigcup _{i=1}^{n}{R_{i}=R.}$
    $(b){\text{ }}R_{i}{\text{ is a connected region}},{\text{ i}}={\text{1}},{\text{ 2}},{\text{ }}...,{\text{n}}$
    $(c){\text{ }}R_{i}\bigcap R_{j}=\varnothing ,i\neq j$
    $(d){\text{ }}P(R_{i})=\mathrm {TRUE} {\text{ for }}i=1,2,...,n.$
    $(e){\text{ }}P(R_{i}\bigcup R_{j})=\mathrm {FALSE} {\text{ for any adjacent region }}R_{i}{\text{ and }}R_{j}.$
    $P(R_{i})$ is a logical predicate defined over the points in set $R_{i}$ and $\varnothing$ is the null set.
(a) means that the segmentation must be complete; that is, every pixel must be in a region.
(b) requires that points in a region must be connected in some predefined sense.
(c) indicates that the regions must be disjoint.
(d) deals with the properties that must be satisfied by the pixels in a segmented region. For example, $P(R_{i})={\text{TRUE}}$ if all pixels in $R_{i}$ have the same grayscale.
(e) indicates that region $R_{i}$ and $R_{j}$ are different in the sense of predicate $P$.

## Basic concept of seed points

The first step in region growing is to select a set of seed points. Seed point selection is based on some user criterion (for example, pixels in a certain grayscale range, pixels evenly spaced on a grid, etc.). The initial region begins as the exact location of these seeds.
The regions are then grown from these seed points to adjacent points depending on a region membership criterion. The criterion could be, for example, pixel intensity, grayscale texture, or colour.
Since the regions are grown on the basis of the criterion, the image information itself is important. For example, if the criterion were a pixel intensity threshold value, knowledge of the histogram of the image would be of use, as one could use it to determine a suitable threshold value for the region membership criterion.
One can use 4-connected neighborhood to grow from the seed points. An alternative for pixels adjacent relationship is the 8-connected neighborhood. Pixels adjacent to the seed points are examined and classified into the seed points if they have the same intensity value. It is an iterated process until there are no change in two successive iterative stages. Other criteria can be chosen; the main goal is to classify the similarity of the image into regions.

## Segmentation Objectives

The primary goal of segmentation is to partition an image into distinct and semantically meaningful regions. Prior sections of this discourse have explored various methodologies, such as boundary detection and thresholding, to achieve this objective. However, region growing presents an alternative approach, focusing on directly identifying and expanding regions from designated seed points, thus offering a nuanced perspective in the field of image segmentation.

## Region Growing Technique

Region growing represents a sophisticated algorithmic technique used to group pixels or subregions into larger, coherent regions based on predefined criteria. This iterative process commences with seed points strategically positioned within the image. These seeds serve as the genesis for region expansion, as neighboring pixels that satisfy specified similarity criteria—such as intensity or color ranges—are progressively assimilated into the growing region, thereby delineating cohesive boundaries.

## Seed Point Selection

The selection of appropriate seed points is a critical aspect of region growing, significantly influencing the efficacy and accuracy of the segmentation process. Seed points can be chosen based on prior domain knowledge or computed dynamically by analyzing pixel properties. In scenarios where prior information is lacking, properties are computed for each pixel, with clusters of values indicative of potential seed points. Pixels proximal to these cluster centroids are often deemed suitable as seed points.

## Similarity Criteria

The selection and definition of similarity criteria are paramount in guiding the region growing process. The choice of criteria is contingent upon the specific problem domain and the characteristics of the image data under consideration. For instance, in applications such as land-use satellite imagery analysis, color may serve as a pivotal determinant for region delineation, whereas in monochrome images, intensity and spatial properties assume greater significance.

## Connectivity Consideration

Ensuring connectivity is a fundamental aspect of region growing, essential for generating meaningful segmentation results. Neglecting connectivity considerations can lead to the formation of spurious regions, thereby undermining the integrity and utility of the segmentation process. Connectivity mechanisms facilitate the coherent aggregation of pixels into meaningful regions, thereby enhancing the interpretability and applicability of the segmentation outcomes.

## Stopping Rule

Establishing a robust stopping rule is imperative to govern the termination of the region growing process. While local criteria such as intensity, texture, and color play a pivotal role in halting region growth, additional parameters such as size, similarity with grown pixels, and region shape contribute to refining the segmentation outcomes. These stopping rules ensure that region growing ceases once the predefined criteria for inclusion in a region are no longer satisfied, thereby fostering the generation of accurate and meaningful segmentation results.

## Region Growing Algorithm

A basic region-growing algorithm based on 8-connectivity can be summarized as follows:
* Find all connected components in the seed array S(x, y) and erode each connected component to one pixel, labeling all such pixels as 1. All other pixels in S are labeled 0.
* Form an image fo such that, at a pair of coordinates (x, y), fo(x, y) = 1 if the input image satisfies the given predicate Q at those coordinates; otherwise, fo(x, y) = 0.
* Let g be an image formed by appending to each seed point in S all the 1-valued points in fo that are 8-connected to that seed point.
* Label each connected component in g with a different region label (e.g., 1, 2, 3, ...). This is the segmented image obtained by region growing.

## Important issues
### Suitable selection of seed points

The selection of seed points is depending on the users. For example, in a grayscale lightning image, we may want to segment the lightning from the background. Then probably, we can examine the histogram and choose the seed points from the highest range of it.

### More information of the image is better

Obviously, the connectivity or pixel adjacent information is helpful for us to determine the threshold and seed points.

### Minimum area threshold

No region in region growing method result will be smaller than this threshold in the segmented image.

### Similarity threshold value

If the difference of pixel-value or the difference value of average grayscale of a set of pixels less than “Similarity threshold value”, the regions will be considered as a same region.
The criteria of similarities or so called homogeneity we choose are also important. It usually depends on the original image and the segmentation result we want.
Some criteria often used are grayscale (average intensity or variance), color, and texture or shape.

## Advantages and disadvantages
### Advantages

* Can correctly separate the regions that have the same properties we define.
* Can provide the original images which have clear edges with good segmentation results.
* Simple concept: only need a small number of seed points to represent the property we want, then grow the region.
* Can determine the seed points and the criteria we want to make.
* Can choose the multiple criteria at the same time.
* Theoretical very efficient due to visiting each pixel by a limited bound of times.

### Disadvantages

* Unless image has had a threshold function applied, a continuous path of points related to color may exist, which connects any two points in the image.
* Practically random memory access slows down the algorithm, so adaption might be needed