Creating a Binary Mask with an Intensity Threshold

A threshold turns each numeric sample into one of two states. State how to handle a value exactly at the cutoff.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace three samples
  2. Keep original measurements available

Trace three samples

With threshold 100 and a rule accepting at least 100, values 99, 100, and 101 become false, true, and true. Inclusive comparison boundaries determine the middle case.

Keep original measurements available

A mask preserves selected membership and discards how far a sample lies from the threshold. Store intensities separately if later steps need them. Bitsets illustrate one way to represent boolean selections.[1][2]

References

  1. scikit-image Contributors, NumPy Images and Coordinate Conventions ↩
  2. scikit-image Contributors, Image Data Types and Representable Values ↩