where G is the original image, K is the discrete convolution kernel, H is the filtered image with indices i and j defining the two dimensional array of pixels, T is the threshold, S is the resulting segmented binary image, B and C are the two values of the binary image, D is a constant, and * is the discrete, 2D convolution operator.