Due to noise and blur, regions in real images are seldom homogeneous in grey level and sharp along their borders. Preprocessing the image with an enhancement filter that reduces these effects will yield better segmentation results.
Figure 2: Symmetric Pairs of Pixels
The SNF filter compares each pixel to its 8-connected neighbors. (Note that the 1-pixel image boundary is ignored in our implementation.) The neighbors are inspected in symmetric pairs around the center, i.e. N S, W E, NW SE, and NE SW; see Figure 2 for diagram of a neighborhood centered around a pixel, with the symmetric pairs colored the same. Essentially, the one pixel in each pair closest to the center in grey level is selected, but only if its intensity is within of the center pixel, otherwise, the center pixel's value is used. If the center pixel is equidistant from the pair, or is a local minima or maxima, its value is selected instead. The collection of four selected pixels are averaged together, and finally, the center pixel is replaced by the mean of this average and the center pixel's current grey level. This latter average is similar to that of a damped gradient descent which yields a faster convergence.
The first phase of segmentation is a combination of three iterative SNF filters. The first step runs for a small number of iterations (e.g. four) with and is used to preserve edges. We define to be the median of the standard deviations of all neighborhoods centered around each non-border pixel in the image. See [5] for a parallel median algorithm. To flatten the interior of regions, SNF is iterated with , where is typically set to for this application. The stopping criteria for this iterative filter occurs when the percentage of ``fixed'' pixels reaches 100.0 %, this percentage has not changed for three iterations, or when we reach 200 iterations, whichever comes first. Finally, we sharpen the borders of regions with SNF using , again stopping the iterative process when the pixels have fixed, as defined above. The resulting image has near-homogeneous regions with sharp transitions between bordering regions.