O'Reilly logo

Visual Media Processing Using MATLAB Beginner's Guide by George Siogkas

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

Thresholding an image

Now that you have learned two different ways to work with image pixels, we will present another useful and common tool found in image processing software, which is thresholding. Image thresholding can be defined as the process of creating binary images by setting pixels with values above a certain threshold to 1 and the rest to 0. It is usually used for separating the foreground from the background of an image. As we did for the previous examples, we will show three different ways to implement image thresholding in MATLAB; using for loops, a special way of indexing, and using a ready-made thresholding MATLAB function.

Image thresholding using for loops

The classic programming way to implement grayscale image thresholding is ...

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