Lulumoy Studio

Math guide

Threshold

Compares each pixel with a threshold T. The level is given as a percentage so it works the same in 8 and 16 bits.

T=p100·M,M∈{255,65535}
p is the level in % and M the maximum value for the bit depth.
I′={M si / if / se I>T, 0 en otro casoBinario / Binary0 si / if / se I>T, M en otro casoBinario invertido / Binary invertedmin(I,T)Truncar / TruncateI si / if / se I>T, 0 en otro casoA cero / To zero0 si / if / se I>T, I en otro casoA cero invertido / To zero inverted
In colour images each channel is compared separately.

Parameters

ParameterMeaning
Level (%)p, from 0 to 100 %.
TypeRule from the table above.

References

  1. OpenCV 4.x documentation — Miscellaneous Image Transformations (threshold, adaptiveThreshold). docs.opencv.org/4.x/d7/d1b/group__imgproc__misc.html
  2. R. C. Gonzalez, R. E. Woods. Digital Image Processing, 4th ed. Pearson, 2018.