Image thresholding

Thresholding is the simplest method of image segmentation. From a grayscale image, thresholding can be used to create binary images. In this exercise we will not convert images into binary image, but we will try to separate pixels with certain values from others.

The simplest thresholding methods replace each pixel in an image with a black pixel if the image intensity I is less than some fixed constant T, or a white pixel (of same value) if the image intensity is greater than that constant.

Types of thresholding:

  • Greater then
  • Lower then
  • In between

Try to implement all of those types of thresholding with continuous run of program. Secondary we will implement automatic thresholding given by algorithm:

    1. Select initial threshold value, typically the mean 8-bit value of the original image.
    2. Divide the original image into two portions;
      1. Pixel values that are less than or equal to the threshold; background
      2. Pixel values greater than the threshold; foreground
    3. Find the average mean values of the two new images
    4. Calculate the new threshold by averaging the two means.
    5. If the difference between the previous threshold value and the new threshold value are below a specified limit, you are finished. Otherwise apply the new threshold to the original image and keep trying.

Automatic Thresholding is a great way to extract useful information encoded into pixels while minimizing background noise. This is accomplished by utilizing a feedback loop to optimize the threshold value before converting the original grayscale image to binary. The idea is to separate the image into two parts; the background and foreground.

Return to top


         Original Image                          Less then                           Greater then  

Simple sollution in LV


Data Value