Skip to main content
. 2022 Aug 5;42(3):977–994. doi: 10.1016/j.bbe.2022.07.009
Algorithm 1 Adaptive threshold algorithm
Input: ImageI, (x,y) is used to represent the coordinates of the pixel. wt0 and wt1 represent the number of pixels in the COVID-19 region and the normal region, respectively. ut0 and ut1 represent the average gray levels of the two regions, respectively.
Output: Threshold T
Initialization: t=0
1 while t<=255
2 if max{wt0×wt1×(ut0-ut1)2}
3 T=t;
4 bleak;
5 else t=t + 1;
6 end