Article Directory
1. Color space
- RGB is the more superimposed, the brighter (usually used for computer display)
- CMY is the more superimposed, the blacker (usually used for printing)
Conversion formula of gray scale image:
2. Histogram equalization
Non-linearly stretch the image. Redistributing the number of pixels in each gray scale unit is generally for the whole picture taken as too white or too dark. If it is partial darkness or volume, then it is fine. An adaptive histogram can be used.
3. Morphology
4. Filtering/Convolution
Different functions need to define different functions
- Smoothing, denoising
- Gradient, sharpen
- Edge, salient point, texture
- Pattern detection
4.1 Filling before filtering
To keep the size unchanged, the filling operation before filtering:
- Zero padding
- Boundary copy
- Mirror image
- Block copy
The specific effect is as follows:
At present, the zero-padding method should be used the most.
4.2 Several classic filters
-
Average filtering: generally not used much, that is, it cannot denoise, nor can it extract features well.
-
Median filtering: generally used for denoising.
-
Gaussian Wave Recorder: Blur the surroundings, a bit similar to the background blur function of a mobile phone camera. (The main function is to build a Gaussian pyramid)
-
Prewitt filter for gradient detection:
4.2.1 Laplacian 算子
The above methods to find the gradient are equivalent to the gradient of the first derivative, and the laplacian operator is the second derivative. Note that all his convolutions and sums are equal to zero.
The laplacian operator, because the total sum is equal to 0, when the picture is very uniform, it is 0. When a certain pixel is more prominent, the final filtering result will be more prominent, then a sharpening can be achieved The process, below is his renderings.
In addition, there is a simple filter to achieve the sharpening effect.
5. Image pyramid
There are two general image pyramids, one is the Gaussian pyramid, and the other is the Laplacian pyramid.
5.1 Gaussian Pyramid
Ordinary pictures, if they are directly down-sampled, a lot of details will be lost. You can pass Gaussian filtering first, and then down-sample the pictures after Gaussian filtering, and the resulting pictures will be clearer. As shown in the figure below: The image pyramid formed by the Gaussian filtering method is the Gaussian pyramid.
5.2 Laplace Pyramid
The purpose of the Laplacian Pyramid is to make up the missing part after the down-sampling of the Gaussian pyramid is completed, and then the up-sampling restoration. To put it bluntly, he is a difference.
Digression
1. Why are filters generally symmetrical?
In fact, the main purpose is to reduce the complexity of the calculation.
2. Curtain
Jiang Wei reduces the dimensionality, and then removes some less important data.