The previous section looked at ways to segment the image in the foreground and background using a threshold. It also looked at ways to derive a result suitable for analysis with the use of morphological operators. The morphological operators were used to clean the results of the threshold by removing isolated pixels. In most real-life applications, these isolated pixels are due to the effect of noise in your image-acquisition system. Some of the noise can be removed using the techniques described in the previous chapter, but this may not remove all the noise. In this section, we will look at ways to use filters to remove noise and prepare images to create masks. Filtering can be a step that is inserted before thresholding and morphological processing. If your images are high contrast and have extremely low levels of noise, this might not be required. However, this is relatively rare.
There are two categories of filtering, depending on the type of domain that is used for filtering...