---
kind: concept
slug: image-thresholding
title: Image thresholding
summary: >-
  Splitting an image into classes by comparing pixel values with cut points. Multilevel thresholding picks several grey-level cuts by an Otsu or Kapur score, found by metaheuristic search (MAAPO). Single-threshold classification cuts one colour index, such as Excess Blue, at a value tuned on labelled pixels. Two sources, one method each.
tags: [image-segmentation, optimization, remote-sensing]
papers: ["2609.12756", "2609.40212"]
related: [metaheuristic-optimization, segmentation-evaluation, multi-layer-perceptron, convolutional-neural-network]
status: draft
updated_at: 2026-10-19
---

## Overview

Thresholding turns a pixel value into a class by comparing it with one or more
cut points. The two sources on this page use it for different tasks, and the
variants differ in what the cut points are chosen to optimise.

- **Multilevel thresholding** picks k grey-level cut points t1 < ... < t_k on
  the range 0 to L-1. The cut points divide the image into k+1 classes
  [arxiv:2609.12756 §1] [arxiv:2609.12756 eq. 22]. They are chosen by maximising
  a criterion over the grey-level histogram, here Otsu or Kapur entropy
  [arxiv:2609.12756 eq. 22]. No labels are needed. Adding thresholds makes
  exhaustive search grow exponentially, so the paper uses meta-heuristics to
  search for the cut points [arxiv:2609.12756 §1].
- **Single-threshold classification of a colour index** computes one value per
  pixel from its RGB channels, then labels the pixel by comparing that value
  with one cut [arxiv:2609.40212 §2.2.1]. The cut is chosen to maximise the
  Matthews correlation coefficient (MCC) against hand-labelled pixels
  [arxiv:2609.40212 §2.2.1] [arxiv:2609.40212 eq. 7]. This variant is supervised.

Two source cards list this concept. Each variant rests on one of them, and the
two papers do not share a dataset or task, so their numbers are not compared.

## Variants

### Metaheuristic search over cut points (MAAPO)

The search is an artificial protozoa optimizer (APO) extended with two parts:
a membrane-style split and merge of the population, and a roulette-wheel
fitness-distance rule that picks the guiding solution [arxiv:2609.12756 §3].
The membrane part is controlled by a volume diversity metric, mVOL
[arxiv:2609.12756 §3.1] [arxiv:2609.12756 eq. 15]. The paper applies this search
to segmentation with the Otsu and Kapur objectives and reports results against
APO and other optimizers [arxiv:2609.12756 §5.3]. Card:
[MAAPO: an innovative membrane algorithm based on artificial protozoa optimizer for multilevel threshold image segmentation](/papers/2609.12756).

The base APO is not a thresholding method. It is a general search, and it is
the baseline the paper compares against [arxiv:2609.12756 §2.1] [tab. 11]
[tab. 12].

### Single threshold on a vegetation index (Excess Blue)

The paper classifies each pixel of UAV orthomosaics as urbanized or
non-urbanized using one index and one threshold [arxiv:2609.40212 §2.2.1]. The
steps are:

1. Standardise the RGB channels to the range 0 to 1, and compute the chromatic
   coordinates r, g and b [arxiv:2609.40212 tab. 1 note].
2. Compute the index for each pixel. Excess Blue is 1.4b − g [arxiv:2609.40212 tab. 1].
3. Label pixels by one cut. For Excess Blue, a value above the threshold means
   urbanized [arxiv:2609.40212 §3.1] [fig. 6].

The paper tests 16 indices and clusters them by the absolute Pearson correlation
between their values. It keeps one index per cluster, the one with the best
MCC, and six remain [arxiv:2609.40212 §3.1] [eq. 8] [fig. 5]. For each kept
index the threshold maximising MCC on the training site is taken [tab. 2].
On the second site, Excess Blue reaches MCC 0.61 and accuracy 0.87, the best
index there by MCC [arxiv:2609.40212 tab. 2]. Its optimised threshold is 0.108.
Thresholds per acquisition series move between 0.100 and 0.131, and the single
value 0.108 lowers MCC by at most 0.04 [arxiv:2609.40212 §3.1] [fig. 7]. Card:
[Recognition of Urbanized Areas in UAV-Derived Very-High-Resolution Visible-Light Imagery](/papers/2609.40212).

The same paper compares this variant with pixel classifiers on RGB patches
(a linear network, an MLP and a CNN). Those networks are not thresholds, so
they are covered only in "When to use which".

## When to use which

The table covers constraints that the two sources address. It does not cover
other methods.

| Situation | Use | Why |
|---|---|---|
| Few thresholds, where exhaustive search is affordable | Not covered: no source here compares exhaustive search | The paper's motivation is that cost grows exponentially with the threshold count [arxiv:2609.12756 §1]; it does not report results at small counts |
| Many thresholds (4 to 7 tested per RGB band) | A metaheuristic search | The paper's segmentation runs used 4 to 7 thresholds per band [arxiv:2609.12756 §5.3] |
| Plain APO is the planned search | MAAPO's extra parts, if the cost is acceptable | On segmentation, MAAPO's average rank was lower than APO's on all six metric and objective pairs, Otsu and Kapur [arxiv:2609.12756 tab. 11] [arxiv:2609.12756 tab. 12] |
| Kapur entropy objective, PSNR, SSIM or FSIM | MAAPO | Lowest average rank on all three metrics [arxiv:2609.12756 tab. 12] |
| Otsu objective, PSNR or FSIM | Not clear from this paper | MAAPO ranks behind PSO and GWO on PSNR and behind DE on FSIM [arxiv:2609.12756 tab. 11] |
| Tight runtime budget | Check the cost first | MAAPO ran slower than APO on the CEC2017 suite, 1.38 s against 0.81 s per run. Segmentation runtime is not reported [arxiv:2609.12756 tab. 7] |
| Need a fully specified implementation | Not MAAPO alone | Several rules are not stated, see Pitfalls below [arxiv:2609.12756 §3.2] [arxiv:2609.12756 §5.3] |
| Two classes, one colour index, and hand-labelled pixels to tune the cut | Single threshold on Excess Blue | Best index of the six kept on both sites by MCC; WIEL MCC 0.61, accuracy 0.87 [arxiv:2609.40212 tab. 2] [arxiv:2609.40212 §3.1] |
| No labelled pixels to tune the cut | Not supported by this paper's evidence | Otsu's threshold on Excess Blue gave JERZ MCC 0.23, against 0.66 for the optimised threshold [arxiv:2609.40212 tab. 4] [arxiv:2609.40212 tab. 2] |
| Higher accuracy is needed and labels and compute are available | A pixel classifier on RGB patches, not a single threshold | Best WIEL MCC about 0.82, accuracy about 0.96, from a linear network with 9 px patches [arxiv:2609.40212 tab. 3] [arxiv:2609.40212 §3.2] |
| Scenes with shadows or dark ground | Expect errors with either method | Excess Blue and the networks both misclassify shadows; a brightness rule is suggested but untested [arxiv:2609.40212 §4] [fig. 9] |

## Implementation sketch

The common core of the multilevel variant is a search over candidate cut
points, scored by the histogram criterion. The paper's search loop itself is in
[arxiv:2609.12756 alg. 1]. The rounding rule from a continuous candidate to
grey levels is not stated in the paper, so the sketch leaves it open.

```pseudocode
# Histogram of the grey channel, L bins  [arxiv:2609.12756 §5.3]
hist = grey_histogram(image, L)
# Candidate: k real values; to be mapped to grey levels  [arxiv:2609.12756 eq. 22]
t = to_grey_levels(candidate)  # rounding and de-duplication: not stated
# Objective to maximise: Otsu or Kapur entropy  [arxiv:2609.12756 eq. 22]
fitness = objective(hist, t)
# Search loop: any metaheuristic; MAAPO's is in [arxiv:2609.12756 alg. 1]
best = search(fitness, k, lower=0, upper=L - 1)
```

For colour images, the paper segments each RGB band separately and then
combines the three results. The combining rule is not defined
[arxiv:2609.12756 §5.3].

The single-threshold variant has a different core: one index per pixel, then
a search over one cut value scored by MCC on labelled pixels.

```pseudocode
# Excess Blue per pixel from 0-1 RGB  [arxiv:2609.40212 tab. 1]
def excess_blue(rgb):
    total = rgb[..., 0] + rgb[..., 1] + rgb[..., 2]
    b = rgb[..., 2] / total   # chromatic coordinates r, g, b
    g = rgb[..., 1] / total
    return 1.4 * b - g
# Choose the cut that maximises MCC on labelled training pixels  [§2.2.1]
# Candidate grid and step are not stated in the paper
best_t = argmax_t mcc(excess_blue(train_rgb) > t, train_labels)
# Label a pixel urbanized when its index is above the cut  [§3.1]
urbanized = excess_blue(image_rgb) > best_t
```

## Contradictions

None known. The two sources cover different tasks and datasets, so their
numbers do not bear on each other. Both name Otsu, but for different uses: the
MAAPO paper uses it as a multilevel objective, and the UAV paper reports
single-threshold Otsu on indices as a baseline that performs much worse than
the MCC-optimised cut [arxiv:2609.40212 tab. 4]. This is a difference of
setting, not a disagreement.

## Pitfalls

- **Best of 20 runs.** The segmentation numbers are the best of 20 runs, not
  means [arxiv:2609.12756 §5.3]. CEC2017 results are means over 51 runs
  [arxiv:2609.12756 tab. 6].
- **Margins are small.** On CEC2017, MAAPO's Friedman rank (3.35) is within
  0.02 of MAQUATRE's (3.37) [arxiv:2609.12756 §4.5]. These results are
  author-reported.
- **SSIM constant.** C2 is printed as 8.5225 [arxiv:2609.12756 §5.2]. The
  paper does not explain it; check it before reuse.
- **Metric scope.** The paper does not say whether PSNR, SSIM and FSIM are
  computed per band or on the whole image [arxiv:2609.12756 §5.3].
- **Selection rules.** The paper does not state which best solution the
  distance term uses, or whether the roulette rule uses fixed or time-varying
  weights [arxiv:2609.12756 §3.2].
- **Dimensions.** Only 4 to 7 thresholds per band were tested. Other counts
  are not shown [arxiv:2609.12756 §5.3].
- **Code.** No official code was located and checked. See the card for the
  search.
- **Threshold search not described.** For the Excess Blue variant, the grid,
  step size, search range and strict or non-strict comparison are not stated
  [arxiv:2609.40212 §2.2.1].
- **Labels and sampling.** Labels were made by hand on 54 sample squares per
  dataset. The paper calls the sampling both a uniform grid and a random sample,
  and gives no estimate of label error [arxiv:2609.40212 §2.1.1] [arxiv:2609.40212 §2.1.2].
- **Accuracy is misleading here.** About 87% of JERZ pixels are non-urbanized,
  so accuracy alone rewards labelling everything non-urbanized. For AB, accuracy
  0.86 comes with MCC 0.23 on JERZ [arxiv:2609.40212 §2.3] [arxiv:2609.40212 tab. 2].
- **Two sites only.** Results come from one site each, with one UAV per site.
  The paper says generalisation needs larger datasets [arxiv:2609.40212 §4].
- **Shadows.** Excess Blue and the networks both misclassify shadows, and bare
  soil and dead matter in shadow are read as vegetation [arxiv:2609.40212 §4]
  [fig. 9]. Excess Blue calls dark pixels urbanized, while the networks call them
  non-urbanized [arxiv:2609.40212 §4]. The brightness rule the paper proposes
  was not tested [arxiv:2609.40212 §4].

## Papers

- [MAAPO: an innovative membrane algorithm based on artificial protozoa optimizer for multilevel threshold image segmentation](/papers/2609.12756): adds membrane-style splitting and merging and a roulette fitness-distance selection rule to APO, and reports results on multilevel thresholding with Otsu and Kapur objectives (author-reported).
- [Recognition of Urbanized Areas in UAV-Derived Very-High-Resolution Visible-Light Imagery](/papers/2609.40212): compares 16 colour indices with one threshold each, and linear, MLP and CNN pixel classifiers, for urbanized areas in UAV RGB imagery; Excess Blue is the best index, and the networks reach higher accuracy (author-reported).
