opencv-linear and non-linear filtering of images

Image filtering includes suppressing the noise of the target image while preserving the details of the image as much as possible

Image filtering

definition

The definition of
image filtering is as follows: Image filtering, that is , to suppress the noise of the target image under the condition that the image filtering includes as much as possible to preserve the details of the image . It is an indispensable operation in image preprocessing, and the quality of its processing effect will directly affect The validity and reliability of subsequent image processing and analysis.

purpose

(1) Denoise the image;

(2) Extract the features of objects in the image.

classification

Image filtering includes linear filtering and non-linear filtering

(1) Linear filtering : box filtering, mean filtering, Gaussian filtering;

(2) Non-linear filtering : median filtering, bilateral filtering

Linear filter

Classification of linear filters

Linear filters are often used to eliminate unwanted frequencies in the input signal or to select a desired frequency from many frequencies. Several common linear filters are as follows:

(1) Low-pass filter: allows low-frequency waves to pass.

(2) High-pass filter: allows high-frequency waves to pass.

(3) Band-pass filter: allows waves of a certain range of frequencies to pass.

(4) Band stop filter: Prevents waves of a certain range of frequencies from passing through and allows waves of other frequencies to pass.

(5) All-pass filter: Allows waves of all frequencies to pass, only changing the phase relationship of the waves.

(6) Notch filter: a special band-stop filter that prevents a narrow frequency range from passing.

Blur and sharpen

The images obtained by different filters are different.

(1) If we want to reduce the noise, what we need is to remove the noise, that is, we need to blur the image.

(2) If we want to extract features, what we need is to make the features obvious, that is, we need to sharpen the image.

So blurring and sharpening are the effects of the image after filtering operations.

(1) If it is low-pass filtering, it is easier to reduce the noise , that is, the effect is a blur effect.

(2) If it is high-pass filtered, it is easier to display features , that is, the effect is a sharpening effect.

Compared

Linear filter

The original data and filtering result of the linear filter is an arithmetic operation , which is realized by adding, subtracting, multiplying and dividing, such as mean filter (average of pixel gray value in template), Gaussian filter (gaussian weighted average), etc. .
Since the linear filter is an arithmetic operation and has a fixed template, the transfer function of the filter can be determined and unique (the transfer function is the Fourier transform of the template).

Non-linear filter

The original data of the non-linear filter and the filtering result are in a logical relationship , which is realized by logical operations, such as maximum filter, minimum filter, median filter, etc., by comparing the gray value in a certain neighborhood To achieve this, there is no fixed template, so there is no specific transfer function (because there is no template for Fourier transform)

In addition, expansion and corrosion are also achieved through maximum and minimum filters.

Guess you like

Origin blog.csdn.net/qq_28258885/article/details/112631530