O'Reilly logo

Learn OpenCV 4 by Building Projects - Second Edition by Prateek Joshi, Vinicius G. Mendonca, David Millan Escriva

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

Noise removal

If we don't remove the noise, we can detect more objects than we expect because noise is normally represented as small points in the image and can be segmented as an object. The sensor and scanner circuit normally produces this noise. This variation of brightness or color can be represented in different types, such as Gaussian noise, spike noise, and shot noise.

There are different techniques that can be used to remove the noise. Here, we are going to use a smooth operation, but depending on the type of noise, some are better than others. A median filter is normally used for removing salt-and-pepper noise; for example, consider the following image:

The preceding image is the original input with salt-and-pepper noise. If we ...

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