Effects of noise on gradient computation

Derivative filters computed using finite difference are quite sensitive to noise. As we saw in the last chapter, the pixels in an image that have very different intensity values from their neighbors are generally the noise pixels. In general, the more the noise the larger the change in intensity, and the stronger is the response obtained with the filters. The next code block adds some Gaussian noise to the image to see the effects on the gradient. Let us again consider a single row (row 0, precisely) of the image, and let us plot the intensity as a function of the x location:

from skimage.util import random_noise
sigma = 1 # sd of noise to be added
im = im + random_noise(im, var=sigma**2)

The following diagram shows the output of the previous code block after adding some random noise to the chess image. As we can see, adding random noise to the input image has a high impact on the (partial) derivatives and the gradient magnitude; the peaks corresponding to the edges become almost indistinguishable from the noise and the pattern gets destroyed:

 

Smoothing the image before applying the derivative filter should be helpful, as it removes the high frequency components likely to be noise and forces the (noisy) pixels (that are different from their neighbors) to look more like their neighbors. Hence, the solution is to first smooth the input image with an LPF (such as the Gaussian filter) and then find peaks (using a threshold) in the smoothed image. This gives rise to the LoG filter (if we use the second-order derivative filter) that we shall explore later in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.244.216