Thresholding

 

Home Up Publications Research Projects Source Code Contact

 

Back Next

Next: Smoothing Up: The CMSC 426 Image Previous: Layout and Functionality

 

Thresholding

Image thresholding is a technique for converting a grayscale or color image to a binary image based upon a threshold value. If a pixel in the image has intensity less than the threshold value, the corresponding pixel in the resultant image is set to white. Otherwise, if the pixel is greater than or equal to the threshold intensity, the resulting pixel is set to black.

In the image workshop, a binary image may be created in one of two ways using the threshold operation panel. First, the viewer may select a threshold value using the image histogram and scrollbar. The histogram horizontal axis represents different pixel intensity values in increasing order. The histogram vertical axis represents the number of pixels in the image which had a particular intensity value. Thus, by sliding the scrollbar back and forth, the users selects an intensity value. This is indicated by the red bar in the histogram. The second method for creating a binary image is by clicking the ``auto'' button. This executes an automatic thresholding algorithm which finds the optimal threshold for the image and displays the resulting binary image. Currently, the ``auto'' button just starts an animation that lets the user see the thresholded image at each threshold. The red bar moves from left to right scanning the entire range of thresholds while at the same time displaying the thresholded image. The user can suspend and resume this process at any point by just clicking the right mouse button. Once the ``auto'' button is pressed, it takes a while for it to start the animation, but the wait is well worth the result at the end. The automatic choice of the best threshold will be obtained by maximising the contrast along the edges of the object, but this has not been implemented yet.


 

Vasanth Philomin
Thu Jun 11 12:35:41 EDT 1998