Skip to content
AI360Xpert
Beta

Region Growing Segmentation

Plant a seed pixel inside the object and keep absorbing neighbours that look similar until nothing similar remains. Connectivity plus similarity does the work.

A seed absorbs similar connected neighbours until the tolerance rule stops it, leaving bright outliers as natural walls.
A seed absorbs similar connected neighbours until the tolerance rule stops it, leaving bright outliers as natural walls.

Why Does This Exist?

Thresholding asks only about brightness, so one speck of noise anywhere in the image becomes foreground, and one shadowed pixel inside the object becomes a hole. Real targets like tumors in MRI scans or fields in satellite photos are connected patches, not scattered pixels, and region growing adds exactly that missing constraint: a pixel joins only if it looks similar and touches the region.

Smooth the image first, because single noisy pixels veto growth or seed false regions. The smoothing options live in spatial filtering. This page covers seeded growing, the homogeneity rule, and split-and-merge. Splitting touching objects needs watershed segmentation instead.

Think of It Like This

Paint spreading to the curb

Tip a bucket of paint on flat pavement and it spreads outward in every direction, stopping only where the ground changes: a curb, a wall, a strip of gravel. The pour point is the seed, the flat pavement is the similar neighbourhood, and the curb is the homogeneity boundary.

It stops holding at the gaps paint cannot reason about. A narrow crack in the curb lets paint leak into the next lot, the same way a thin bridge of similar pixels lets a region bleed into its neighbour. The spread rule is local, so it never sees the leak coming.

How It Actually Works

The growing loop

Start with one or more seed pixels. Repeat: examine every unassigned neighbour of the current region, absorb each one whose similarity to the region passes the homogeneity test, and stop when a full pass absorbs nothing. Four-connectivity (up, down, left, right) grows diamond shapes and resists diagonal leaks; eight-connectivity includes diagonals and grows faster but leaks through corner-touching pixels.

The homogeneity rule

The standard test compares a candidate pixel pp against the region mean μR\mu_R: absorb pp when ∣I(p)−μR∣<δ|I(p) - \mu_R| < \delta. The tolerance δ\delta is the whole game. Too small and textured objects shatter into fragments; too large and the region floods the background.

Work it on a 3 by 3 grid with seed 100100 at the center:

[981011509910010297103200]\begin{bmatrix} 98 & 101 & 150 \\ 99 & 100 & 102 \\ 97 & 103 & 200 \end{bmatrix}

With δ=10\delta = 10, every neighbour except 150150 and 200200 clears ∣I(p)−100∣<10|I(p) - 100| < 10, so the region grows to 77 pixels and stops. The two bright outliers become natural walls, and recomputing μR\mu_R as growth proceeds (here it drifts to about 100100) keeps textured interiors absorbing.

Split-and-merge

Seeds are a liability when objects are unknown, so split-and-merge starts seedless. It recursively splits the image into quadrants until every block is homogeneous, then merges adjacent similar blocks. The quadtree structure makes it fast, but the blocky first pass leaves staircase borders that seeded growing avoids.

Code

Breadth-first growing on the fixture grid, four-connected, tolerance 1010:

from collections import deque
grid = [[98, 101, 150], [99, 100, 102], [97, 103, 200]]seed, delta = (1, 1), 10region = {seed}queue = deque([seed])
while queue:    r, c = queue.popleft()    for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)):        n = (r + dr, c + dc)        if n in region:            continue        if 0 <= n[0] < 3 and 0 <= n[1] < 3:            if abs(grid[n[0]][n[1]] - grid[seed[0]][seed[1]]) < delta:                region.add(n)                queue.append(n)
print(f"grown pixels: {len(region)}")# -> grown pixels: 7

Seven pixels grow, the 150150 and 200200 corners stay out, matching the hand trace.

Watch Out For

Planting one seed and trusting the result

Symptom: two runs with slightly different seeds return visibly different regions, and there is no principled way to pick between them. Single seeds make the output a function of the click, not the image. Fix it with multiple seeds per object plus a background seed set, or with automatic seeds from local minima, and distrust any region that appears under only one seeding.

Leaking through narrow bridges

Symptom: the tumor region includes a thin streak running off into healthy tissue, connected through a one-pixel-wide bridge of similar values. Local similarity cannot see global shape. Fix it by shrinking δ\delta, switching to four-connectivity, or adding a gradient-magnitude veto so growth stops at even faint edges.

The Quick Version

  • Region growing absorbs connected neighbours that pass a similarity test, starting from seed pixels.
  • The homogeneity rule ∣I(p)−μR∣<δ|I(p) - \mu_R| < \delta decides every admission, and δ\delta sets fragment-versus-flood.
  • Four-connectivity resists diagonal leaks; eight-connectivity grows faster but bleeds through corners.
  • Split-and-merge removes the need for seeds using a quadtree, at the cost of blocky borders.
  • Seeds, tolerance, and noise decide the output, so smooth first and never trust a single-seed run alone.