Balanced histogram thresholding
Encyclopedia
In image processing
Image processing
In electrical engineering and computer science, image processing is any form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image...

, the balanced histogram thresholding method (BHT), is a very simple method used for automatic image thresholding. Like Otsu's Method
Otsu's method
In computer vision and image processing, Otsu's method is used to automatically perform histogram shape-based image thresholding, or, the reduction of a graylevel image to a binary image. The algorithm assumes that...

 and the Iterative Selection Thesholding Method, this is a histogram
Histogram
In statistics, a histogram is a graphical representation showing a visual impression of the distribution of data. It is an estimate of the probability distribution of a continuous variable and was first introduced by Karl Pearson...

 based thresholding method. This approach assumes that the image is divided in two main classes: The background and the foreground. The BHT method tries to find the optimum threshold level that divides the histogram in two classes.
This method weighs the histogram, checks which of the two sides is heavier, and removes weight from the heavier side until it becomes the lighter. It repeats the same operation until the edges of the weighing scale
Weighing scale
A weighing scale is a measuring instrument for determining the weight or mass of an object. A spring scale measures weight by the distance a spring deflects under its load...

meet.

Given its simplicity, this method is a good choice as a first approach when presenting the subject of automatic image thresholding.

Algorithm

The following listing, in C notation, is a simplified version of the Balanced Histogram Thresholding method:

int BHThreshold(int[] histogram) {
i_m = (int)((i_s + i_e) / 2.0f); // center of the weighing scale I_m
w_l = get_weight(i_s, i_m + 1, histogram); // weight on the left W_l
w_r = get_weight(i_m + 1, i_e + 1, histogram); // weight on the right W_r
while (i_s <= i_e) {
if (w_r > w_l) { // right side is heavier
w_r -= histogram[i_e--];
if (((i_s + i_e) / 2) < i_m) {
w_r += histogram[i_m];
w_l -= histogram[i_m--];
}
} else if (w_l >= w_r) { // left side is heavier
w_l -= histogram[i_s++];
if (((i_s + i_e) / 2) > i_m) {
w_l += histogram[i_m + 1];
w_r -= histogram[i_m + 1];
i_m++;
}
}
}
return i_m;
}

This method may have problems when dealing with very noisy images, because the weighing scale may be misplaced. The problem can be minimized by ignoring the extremities of the histogram.

External links

ImageJ Plugin
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK