where k is a parameter that controls the effect, ?? (i,j) is the standard deviation in the neighborhood of pixel (i,j), Bavg (i,j) is the mean value of the pixels in the neighborhood, and the neighborhood is a rectangular region centered on pixel (i,j) spanning a generally odd number of pixels.