Skip to main content
. 2021 Dec 17;10(12):1347. doi: 10.3390/biology10121347
Algorithm 1 Binary thresholding
1. START
2.   READ source image, s(x,y) where x and y denotes the pixel coordinates
3.   threshold value, t = 127
4.   maximum value, m = 255
5.   FOR pixel in s(x,y):
6.     IF s[pixel] < t:
7.       s[pixel] = 0
8.     ELSE
9.       s[pixel] = 255
10.      END IF
11.   END FOR
12. END