Noise Removing

Q:  My image is noisy. How can I remove the noise from the image?

A:  There are a lot of types of noises can corrupt an image, for example: salt and pepper noise, Gaussian noise and blur noise. There are many filters implemented in BIFILTER.OCX can solve this problem. Ones of this filters give better results for salt and pepper noise (such as median filter), other ones give better results for Gaussian noise (such as adaptive filters). There can be no best or optimal filter defined. The best resulting filter always depends on the noise type, the image and the desired goals.


For black and white papers the morphological filtering methods can be applied to remove the undesired noises of faxing or scanning. For example: to remove thin lines and small noise regions, use the BinaryErosion method or BinaryOpening, to remove small bumps, and strengthen the lines use BinaryDilation or BinaryClosing. To remove noises corrupting color or higher bit level grayscale images, use the nonlinear, spatial and adaptive filter class. For example to remove large outliers form images, use the FilterMedian method, for smaller outliers FilterMean method, for removing Gaussian noises use the adaptive filter class, etc. See the descriptions of the filters above in chapter Effects and Filters. It’s important, that removing noise always reduces the quality of the image for example smoothing the edges, etc. If the preview dialog is shown, the input parameters of the filtering can be changed onscreen, so the optimal properties of the filtering can be tuned.

 

Code example:

       Dim hSourceDib As Long

       Dim hResDib As Long

       Dim BIFilterObj As Object

       ‘        Load the input image

       …

                Set BIFilterObj = CreateObject("BIFILTER.BIFilterCtrl.1")

                hResDib = BIFilterObj. BIFilterObj. FilterMedian(hSourceDib, 5, DispBoth, hWnd);

                Set BIFilterObj = Nothing

       ‘        Further processing