Learn the masking operation to isolate objects. Combine masks through intersection and union.

When we discussed the thresholding operations, we produced binary images, i.e., grayscale images that take only two values, typically 0 and 255. As their name implies, their purpose is to mask an image.

Masking is the operation of identifying the area of the objects of interest in an image and ignoring the irrelevant image areas for a given task.

Isolating objects

Let’s consider the image below. We have an inspection task for which we need to isolate the green anchor dowels. We need to create a mask that will be active (255) in the areas of the green anchor dowels and inactive (0) everywhere else.

Get hands-on with 1200+ tech skills courses.