image filter

image noise
        • Image noise is the interference of random signals in the process of image acquisition or transmission, which hinders people's understanding and analysis of images
signal of.
        • The generation of image noise comes from the environmental conditions in the image acquisition and the quality of the sensor components themselves.
The main factor of generating image noise is that the transmission channel used is polluted by noise.
Gaussian noise
Gaussian noise refers to a type of noise whose probability density function obeys Gaussian distribution.
In particular, if a noise whose magnitude distribution obeys a Gaussian distribution, and any two samples of it are uncorrelated, then
Call it white Gaussian noise.
It is necessary to distinguish two different concepts of Gaussian noise and white noise. Gaussian noise means that the probability density function of the noise obeys the Gaussian distribution.
White noise means that there is no correlation between any two sampling samples of noise, and the angles described by the two are different. White noise does not have to obey Gaussian points
Cloth, Gaussian distributed noise is not necessarily white noise.
cause:
1) The image sensor is not bright enough and the brightness is not uniform enough when shooting;
2) The noise and mutual influence of each component of the circuit;
3) The image sensor works for a long time and the temperature is too high

 

salt and pepper noise
Salt and pepper noise, also known as impulse noise, is a random white or black point.
Salt and pepper noise = pepper noise + salt noise. The value of salt and pepper noise is 0 (pepper) or 255 (salt).
The former is low grayscale noise, and the latter belongs to high grayscale noise. Generally, two kinds of noise appear at the same time, and they appear as black and white noise on the image.
For color images, it may also appear as 255 or 0 randomly appearing in the three channels of BGR of a single pixel.
This noise occurs if there is an error in communication and the values ​​of some pixels are lost during transmission.
Salt and pepper noise may be caused by sudden strong interference of the image signal, etc. e.g. a failed sensor resulting in pixel values
is the minimum value, a saturated sensor results in a maximum pixel value
Summary of main points:
1. Image filtering, that is, to suppress the noise of the target image under the condition of retaining the details of the image as much as possible, is indispensable in image preprocessing
The quality of its processing effect will directly affect the effectiveness and reliability of subsequent image processing and analysis.
2. Eliminating noise components in an image is called image smoothing or filtering. Most of the energy of the signal or image is concentrated in the low frequency and
Mid-frequency bands are common, while in higher frequency bands, information of interest is often drowned out by noise. So a filter that reduces the amplitude of high frequency components
The influence of noise can be reduced.
3. Smoothing filtering is a spatial domain filtering technique for low frequency enhancement. Its purpose falls into two categories: one is to blur; the other is to remove noise. spatial domain
Smoothing filtering is generally carried out by simple average method, which is to find the average brightness value of adjacent pixel points. The size of the neighborhood is directly related to the smoothing effect,
The larger the neighborhood, the better the smoothing effect, but if the neighborhood is too large, smoothing will cause a greater loss of edge information, thus making the output image blurred, so
The size of the neighborhood needs to be chosen reasonably.
4. Regarding the filter, an image metaphor is: we can think of the filter as a window containing weighting coefficients, when using this filter
When smoothing the image with the wave filter, we put this window on top of the image, and look at the image we get through this window.
Filter purpose:
1. Eliminate the noise mixed in the image. 2. Extract image features for image recognition.
Filtering requirements:
1. The outline and edge of the image cannot be damaged. 2. The visual effect of the image should be better.

mean filtering
Mean filtering is the most commonly used method in image processing. From the perspective of frequency domain, mean filtering is a low-pass filter, and high-frequency signals will be
It will be removed, so it can help eliminate sharp image noise, and achieve image smoothing, blurring and other functions. The ideal mean filter is to use each image
Replaces each pixel in the image with the average of the pixel and its surrounding pixels.

 

Calculate each pixel in the image from left to right and top to bottom, and finally get the processed image.
Two parameters can be added to the mean filter, namely the number of iterations and the size of Kernel data.
The same Kernel, but with multiple iterations, the effect will get better and better.
Similarly, the number of iterations is the same, the larger the Kernel matrix, the more obvious the effect of mean filtering.

 

Note that this kernel weighted sum has to be divided by 9 to be the mean value, and the blue center pixel is replaced with the mean value
Advantages: simple algorithm, fast calculation speed;
Disadvantages: While reducing noise, the image is blurred, especially the edges and details of the scene
median filter
Median filtering is also one of the most common means of eliminating image noise, especially to eliminate salt and pepper noise. The effect of median filtering is better than that of mean filtering.
Waves are better. The only difference between median filtering and mean filtering is that instead of replacing each pixel in the center with the mean value, the surrounding pixels and the center
After sorting the heart pixels, take the median value.
A median filter of size 3X3 is as follows

 

Advantages: the suppression effect is very good, and the clarity of the picture is basically maintained;
Disadvantages: The suppression effect on Gaussian noise is not very good
Maximum and minimum filtering
The maximum and minimum value filtering is a relatively conservative image processing method. Similar to the median filter, the surrounding pixels and the center image must first be sorted.
prime value, then compare the central pixel value with the minimum and maximum pixel values, if it is smaller than the minimum value, replace the central pixel with the minimum value,
If the center pixel is larger than the maximum value, replace the center pixel with the maximum value.
A Kernel matrix is ​​a 3X3 maximum and minimum filter as follows:

 

Expansion -- guided filtering
In the definition of guided filtering, a local linear model is used.
This model believes that a point on a function has a linear relationship with points on its adjacent parts, and a complex function can use many local
When you need to find the value of a certain point on the function, you only need to calculate the value of all the linear functions including this point
And do the average. This model is very useful for representing non-analytic functions.

 

image enhancement
        Purposefully emphasize the overall or local characteristics of the image, make the original unclear image clear or emphasize some interesting features
Signs, expand the difference between different object features in the image, suppress uninteresting features, improve image quality, enrich
It can increase the amount of information, enhance the image interpretation and recognition effect, and meet the needs of some special analysis.
Image enhancement can be divided into two types:
Point processing technology. Only a single pixel is processed.
Field processing techniques. Process the pixel and its surrounding points, that is, use the convolution kernel
1. Linear transformation
Image enhancement linear transformation mainly adjusts the contrast and brightness of the image:
 
Parameter a affects the contrast of the image, and parameter b affects the brightness of the image, which can be divided into the following situations:
a>1: Enhance the contrast of the image, the image looks clearer
a<1: The contrast of the image is reduced, and the image looks blurry
a=1 and b≠0: The overall gray value of the image moves up or down, that is, the overall image becomes brighter or darker, and the contrast of the image will not be changed.
degree, when b>0, the image becomes brighter, and when b<0, the image becomes darker
2. Piecewise linear transformation
That is, for x in an area of ​​interest, increase or decrease its contrast coefficient a, thereby increasing or decreasing the contrast of this area
3. Log transformation
The logarithmic transformation expands the low gray value part of the image and compresses its high gray value part to achieve the purpose of emphasizing the low gray value part of the image;
At the same time, it can well compress the dynamic range of images with large changes in pixel values, in order to highlight the details we need.

 

4. Power law transformation/gamma transformation
The power law transform is mainly used for image correction, correcting bleached pictures or too dark pictures.

 

 

According to the size of γ, it can be mainly divided into the following two situations:
γ > 1: process bleached images, grayscale compression
γ < 1: Process the black picture, enhance the contrast, make the details more clear
Common methods of image enhancement (including but not limited to):
1. Flip, translate, rotate, zoom
2. Separate a single r, g, b three color channels
3. Add noise
4. Histogram equalization
5. Gamma transformation
6. Invert the grayscale of the image
7. Increase the contrast of the image
8. Scale the grayscale of the image
9. Mean filtering
10. Median filtering
11. Gaussian filtering

 

Guess you like

Origin blog.csdn.net/cyy1104/article/details/131896210