O'Reilly logo

Computer Vision with Python 3 by Saurabh Kapur

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Image thresholding

Thresholding in image processing means to update the color value of a pixel to either white or black according to a threshold value. If the pixel value is greater than the threshold value, then set the pixel to WHITE, otherwise set it to BLACK. There are variations to thresholding as well. One of them is inverse thresholding, where we flip greater than to lesser than and everything else remains the same.

This is one of the simplest ways of filtering images. Using the concept of getting pixel values and setting pixel values from Chapter 1, Introduction to Image processing, it is fairly simple to write a code for image thresholding. Let's look at how we can implement image thresholding using scikit-image.

The following piece ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required