Computer Vision: Traditional Image Processing Methods

1. Image segmentation

Classical digital image segmentation algorithms are generally based on one of two basic characteristics of gray values: discontinuity and similarity.

(1) Based on the threshold:

One or more grayscale thresholds are calculated based on the grayscale features of the image, and the grayscale value of each pixel in the image is compared with the threshold, and finally the pixels are classified into appropriate categories according to the comparison results.
The key to the algorithm: determine the threshold.

(2) Based on the edge:

The so-called edge refers to the collection of continuous pixels on the boundary line of two different areas in the picture, which is the reflection of the discontinuity of the local features of the image, and reflects the sudden change of image characteristics such as grayscale, color, and texture.
First determine the edge pixels in the image, and connect these pixels together to form the desired area boundary.
insert image description here

(3) Based on area

The image is divided into different regions according to the similarity, mainly including the seed region generation method, the region splitting and merging method and the watershed algorithm.
Region growing method:
The process of aggregating pixels or sub-regions into larger regions according to a pre-defined criterion, and it is necessary to fully ensure that the divided regions meet the following conditions: internal connectivity, mutual exclusion, and the union of each subset can be make up the complete set.
The condition of region growth is actually some similarity criteria defined according to the continuity between pixel gray levels, and the condition of region growth stop is a termination rule.
When the absolute value of the difference between the gray value of the pixel to be added and the average gray value of all pixels in the divided area is not greater than the maximum pixel gray value distance, the pixel is added to the divided area. Instead, the region growing algorithm stops.
Watershed algorithm:
an image area segmentation algorithm, the watershed algorithm can convert edges in the image into "mountains" and uniform areas into "valleys", which helps to segment objects.
In the process of segmentation, it takes the similarity between adjacent pixels as an important reference, so as to connect the pixels with similar spatial positions and similar gray values ​​(for gradients) to form a closed contour.
Steps:
Grayscale the color image, and then obtain the gradient map.
The watershed algorithm is performed on the basis of the gradient map to obtain the edge line of the segmented image.

(4) Based on graph theory

Graph Cuts:
The first type of vertex corresponds to each pixel in the image. An edge connecting every two neighbor vertices (corresponding to every two neighbor pixels in the image).
The other two terminal vertices, called S (source: for foreground) and T (for background), are connected between each ordinary vertex and these two terminal vertices, forming the second kind of edge.
Cuts in Graph Cuts refer to a set of edges in which the disconnection of all edges leads to the separation of the residual 'S' and 'T' graphs, which is called a cut. If a cut has the smallest sum of the weights of all its edges, it is called the minimum cut, which is the result of the graph cut.
。。。
insert image description here

R(A) assigns the penalty of label l to pixel p, when the probability that the gray value of pixel p belongs to the target is greater than the background Rp(1) is less than Rp(0)
, i.e. pixel p is more likely to belong to the target, classify p as The goal is to keep R(L) as small as possible.
B is the penalty for discontinuity between pixels p and q. Generally speaking, if p and q are more the same, then B is larger. If it is very different, B is close to 0.
insert image description hereProcess:
first take two seed points
to establish
the thickness of the edge in a graph Represent the size of the corresponding weight
Find the combination of the weight and the smallest edge
Complete the function of image segmentation
insert image description here
GrabCut:
Assuming that the foreground and background are Gaussian mixture models (GMM), for each pixel, either a certain Gaussian component from the target GMM, or Some Gaussian component from the background GMM.
The boundary is used to represent the penalty of discontinuity between neighboring pixels. If the difference between the two neighboring pixels is small, then it is very likely to belong to the same target or background. Otherwise, it may be an edge, which is obtained iteratively through the K-Means algorithm.
GMM: Two sets of points are randomly generated from two different normal distributions. If there is no GMM, it can only be described by the same two-dimensional Gaussian distribution.
GrabCut segmentation:
Iteratively performs Graph Cuts to optimize the color model of the foreground and background. The energy becomes smaller with the continuous iteration, and the segmentation effect is getting better and better. Process: (1) Initialize the color model with markers (K=5) (2) Iterate through GraphCut

2. Face detection

Harr-like feature + cascade classifier

3. Pedestrian detection

(1)HOG+SVM
(2)DPM

Guess you like

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