Take a slider, with the grayscale imageLoading... above it and a black-and-white maskLoading... below. Slide right and the mask shrinks toward the brightest pixels. Slide left and it grows toward everything. The best position is the analyst's choice; the image does not fix it.
The threshold enginesLoading... let you set the slider numerically. Otsu's methodLoading... sets it for you by minimizing intra-class variance, which finds the value that best separates the histogram's two modes. The Classifier engineLoading... skips the slider entirely and learns the boundary from your annotations. Each of the three determines, pixel by pixel, where foreground stops and background starts.