Removing Noise
One-Step Noise Removal
The following methods let you remove noise in one step:
Despeckle method (Document/Medical only)
The Despeckle method is designed specifically for removing specks from 1-bit images, such as FAX transmissions or scanned documents.
The Median method is an effective general method for removing salt-and-pepper noise from any kind of image. You control the strength of the method by specifying the size of the neighborhood (the surrounding pixels used for calculating the median value). This method causes minimal blurring of the image.
The Average method can be used to remove uniform and Gaussian noise, but there is more blurring of the image than with the median filter. You control the strength of the method by specifying the size of the neighborhood (the surrounding pixels used for calculating the arithmetic mean).
The AddWeightedBitmaps method can be used to average the bitmaps in a list, eliminating random noise contained in the images. Typically, you would call this method for a series of images taken for the same object at short intervals. This method can eliminate random noise by performing a weighted average.
The GaussianFilter method smoothes or blurs an image by applying a Gaussian filter to each pixel of the bitmap. The amount of blur is determined by the size of the neighborhood used by the method.
Creating Your Own Noise Removal Function
The following methods let you create your own function for noise removal:
BinaryFilter method (Document/Medical only)
MaxFilter method (Document/Medical only)
MinFilter method (Document/Medical only)
The binary filters (for erosion and dilation of black objects) can be used for noise removal. The BinaryFilter method applies directional binary filters. The MaxFilter and MinFilter methods let you control the neighborhood size for erosion or dilation. One noise removal technique with these methods is to create two copies of a bitmap, apply a dilation filter to one of them and an erosion filter to the other, then combine the two using Combine with the CB_OP_AVG (averaging) flag. To combine image data from the source bitmap (the slave) into the destination bitmap (master) using a perspective warp, use the CombineWarp method. If you want to specify the areas to be combined, the operations to be performed when combining the data, and which color planes (R or G or B or R, G, and B) are used, use the CombineExt method.
[Document/Medical only] The AutoBinary method transforms the bitmap into a binary image using a threshold calculated automatically based on statistical features of the bitmap. Best results are obtained with grayscale bitmaps.
[The Deinterlace method deinterlaces video source images by removing the black lines. It proceeds by merging lines in the image together and/or blending them together.
The SmoothEdges method smoothes the edges of a bitmap.
Fourier Transforms
Fourier Transforms are useful in removing harmonic noise like:
Herringbone patterns seen in video images
Sine wave patterns
Moiré patterns
Halftone patterns
Interference patterns
Fourier Transforms are also useful in removing noise from video signals and CCDs.
Fourier transforms convert an image from one where intensity varies over space into one where the intensity varies with frequency. After an image has been described (transformed) as a series of frequencies and phase, that information can then be analyzed using a power spectrum. The power spectrum is a two-dimensional map that plots the frequency of pixel intensity values. Low frequencies lie close to the origin and high frequencies close to the edges. From the analysis suitable filters can be applied to remove those parts of the image that correspond to the noise in the image. The image can then be retransformed back into the original image, only without the noise.
A Discrete Fourier Transform is a Fourier transform that uses a series which has values that have both a real and an imaginary component. Discrete Fourier transforms reveal periodicities in the data as well as the relative strengths of those periodicities.
Discrete Fourier Transforms can take a long time to compute. To reduce computing time, Fast Fourier Transforms can be used, which reduce the number of computations from 2N2 to 2N Lg N. However, using a Fast Fourier Transform requires that the number of points in the series be a power of 2.
The following functions provide Fourier transform capabilities:
Initialize Fourier Transform coefficients. | |
Computes the Discrete Fourier Transform of an image or the Inverse Discrete Fourier Transform, whichever is specified. | |
Computes the Fast Fourier Transform of an image or the Inverse Fast Fourier Transform, whichever is specified. | |
Frees the storage that was allocated by InitFourierTransformation | |
Converts the frequency harmonics amplitude or phase to a bitmap. It allows displaying the results of FFT and DFT as a bitmap. | |
Filters the frequency harmonics according to the range rectangle. | |
Creates a mask filter for use in removing specific frequency components from a bitmap. |
The DynamicBinary method converts a bitmap into a black and white image without changing its bits per pixel.