Computer Vision: Image Preprocessing

1. Common storage:

RGB: additive color mixing, three color channels
CMYK: subtractive color mixing, four dimensions
HSV: concept of human vision, three elements: hue, saturation, brightness
CIE-XYZ: based on intuitive determination of human color vision: medium wave, short wave, long wave

2. The principle of image storage:

RGB: Three-channel color map: GRAY=R 0.3+G 0.59+B*0.11

3. Storage format:

BMP: Bitmap storage, takes up a lot of space
JPG: The most common lossy compression, capable of compressing images to 10:1-40:1
GIF: Continuous tone lossless compression based on the LZW algorithm, with a compression rate of 50%
PNG: Relatively new image file format capable of providing lossless compression 30% smaller than pen GIF

4. Image processing:

(1) Spatial domain:

Point operations: HE, CLAHE
Morphological operations: dilation, erosion
Adjacent operations: convolution, pyramid

(2) Frequency domain:

Fourier transform
Wavelet transform

5. Feature extraction method:

(1) Histogram:

a: A statistic on image data/feature distribution
Grayscale, color, gradient, edge, shape, texture, local feature points, visual vocabulary
b: Interval
A representation of a data or feature, which needs to be predefined or learned based on data
C : Histogram equalization:
Adjusting the contrast map using the image histogram
is usually used to increase the local contrast of many images, especially when the contrast of the useful data of the image is similar, after equalization, the brightness can be better in the histogram. The upper distribution
actually stretches the image non-linearly and redistributes the number of pixels in each grayscale unit, so that the number of pixels in a certain grayscale range is roughly the same value. The
classical algorithm uses the same change for the entire image, if For partial overexposure, adaptive histogram equalization can be used: the
moving template slides in the original image according to the specified step size, after each movement, the histogram equalization is performed in the template area, and the mapped result is assigned to all points in the area of ​​the template. Each point is assigned multiple times, and the final value is the mean of multiple assignments.

(2) CLAHE

AHE will over-amplify the noise in relatively uniform areas in the image, and CLAHE will make the image contrast more natural during the histogram construction process.
Steps:
a: The image is divided into blocks, and the unit is block
b: First calculate the histogram, then build the histogram, and finally equalize
c: Traverse and operate each image block, perform double-line interpolation between blocks
d: Do layer filtering with the original image Color manipulation (optional)

6. Morphology

Dilation : The highlighted part of the image is expanded, similar to the expansion of the field.
Corrosion: The highlighted part of the original image is eroded, similar to the erosion of the field
.
, the holes in the target can be removed.
When the noisy image is binarized with a threshold, the obtained boundary is very unsmooth, there are some wrongly judged holes in the object area, and some small noise objects are scattered in the background area. Successive opening and closing operations can be improved.

7. Filtering/Convolution

Functions: smoothing, de-drying, gradient, sharpening, edge, salient point, texture, pattern detection
Boundary filling: when the output of the same size is obtained, the larger the convolution kernel, the more the
supplementation type: 0 (most commonly used) , Boundary Copy, Mirror, Hot Copy
Smooth Mean Filtering: There is a defect, it neither removes noise well, but also destroys the details of the image, making the picture blurred
Median filter: The pixel values ​​in the convolution domain are sorted from small to large, Taking the middle value as the convolution output can effectively remove the salt and pepper noise.
Smooth Gaussian filtering: simulate the human eye, focus on the central area, and effectively remove the Gaussian noise. There is a Gaussian matrix and the corresponding standard deviation parameter. The smaller the parameter, the more concentrated the area of ​​interest. (Gaussian pyramid)
2D convolution: can be split into two identical ID convolutions—column convolution, row convolution,
which can reduce the calculation of 2D convolution: K K
2
1D convolution: 2K calculation
gradients Prewitt filtering: horizontal gradient / vertical Edge
Horizontal direction is gradient, vertical direction value is unchanged
Gradient sobel filter: horizontal gradient/vertical edge
Horizontal direction is gradient, vertical direction is Gaussian smoothing
Applicable to vertical edge or horizontal edge image
Laplacian filter: second-order differential calculation Child, role: the periphery is higher (lower) than the center point, edge detection, areas where pixel values ​​rapidly change. The sum of the convolution kernel is 0.
Other filtering: displacement filtering, sharpening filtering (first find out the highlight and then subtract an average)
How to speed up the convolution: perform fast Fourier transform on the image and the convolution sum, and get the result. Perform the inverse transformation.
Gaussian Pyramid: First perform image smoothing, and then perform downsampling processing.
Gaussian filtering must be passed before downsampling.
Laplacian Pyramid: High-frequency information is lost during convolution and downsampling. The high-frequency information lost by all layers is preserved for image restoration.

8. Frequency Domain Analysis - Fourier Transform

A signal can consist of sufficiently many sine and cosine waves of different frequencies and amplitudes.
2D Fourier transform: a combination of vertical stripes + horizontal stripes.
Low Pass Filter, High Frequency Filter: High Frequency - Detail. Low Frequency - Frame.
Laplacian filtering: for image restoration.
Disadvantage: Most of the actual new numbers are non-stationary signals
. Solution:
(1) STFT (Short Time Fourier Transform) method to add time domain information to set the pane
. Frequency resolution is low.
(2) Wavelet change: It is close to the idea of ​​STFT, but the wavelet transform directly changes the basis of the Fourier transform, and
replaces the infinite-length trigonometric function with a finite-length decaying wavelet basis. Not only can the frequency be obtained, but also the time can be located.
Wavelet function conditions: mean 0, localized in both time and frequency domains.
Wavelet transform is to express the original signal as a linear combination of a set of wavelet bases, and to achieve the purpose of data compression by ignoring the unimportant parts.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324468594&siteId=291194637