Image feature extraction (color, texture, shape)

Source: Internet
Author: User
Tags numeric value

The main content of this article is reproduced from the blog: http://blog.csdn.net/abcjennifer/article/details/7424971

http://blog.csdn.net/abcjennifer/article/details/7425483

http://blog.csdn.net/abcjennifer/article/details/7427033

1. Color Feature Extraction

The research of feature extraction algorithm of computer vision is very important. In some algorithms, the extraction of a high-complexity feature may be able to solve the problem (for purposes such as target detection), but this will be at the expense of processing more data and requiring a higher processing effect. Color features do not require a lot of computation. Simply convert the pixel values in the digital image to a numeric value. Therefore, the color feature has become a better feature with its low complexity.

In the image processing, we can analyze the color of a specific pixel in several ways and extract its color feature component. For example, by manually marking a region to extract the color characteristics of a specific area (region), the area in a color space three components of the respective average, or you can establish three color histogram and other methods. Here we introduce the concept of color histogram and color moment.

(1) color histogram:

The color histogram is used to reflect the composition and distribution of the image color, i.e. the probability of various colors appearing. Swain and Ballard first proposed the application of color histogram for Image feature extraction [40], first using color space three components of the color histogram, after the observation of the experimental data found that the image is rotated, scaled and transformed, the image color histogram change is not small, That is, the image histogram is not sensitive to the physical transformation of the image. Therefore, color features are often extracted and applied to measure and compare the global difference of two images with color histogram. In addition, if the image can be divided into multiple areas, and the foreground and background color distribution are significantly different, then the color histogram will appear Shuangfeng shape.

The color histogram also has its drawbacks: because the color histogram is the result of global color statistics, the positional characteristics between pixel points are lost. Several images may have the same or similar color histogram, but their image pixel location distribution is completely different. Therefore, the relationship between the image and the color histogram is so that the color histogram does not have a good effect on the recognition of the foreground object.

Taking into account the above problems of color histogram, the main tone histogram is produced. The so-called main-tone histogram is based on the assumption that a few pixels of the value can represent most of the pixels in the image, that is, the most frequently occurring pixels are selected as the primary color, only the main color composition of the main tone histogram to describe an image. Such descriptors do not degrade the effect of matching by color characteristics, because at some point the frequency of small pixels can be considered noise.

(2) Color moment:

The color moment is an effective color feature, presented by Stricker and Orengo [41], which uses the concept of moment in linear algebra to represent the color distribution in an image by its moment. Color distribution is described using the first-order moment of color (mean average), second-order moment of color (variance variance), and color three-moment (skewness skewness). Unlike color histograms, image characterization is not quantified by using color moments. Because each pixel has a color space of three color channels, the image's color moment has 9 components to describe. The color moment is often used in combination with other image features because of the small dimension of the color moment.

(3) color set:

The above two methods are usually used for color comparison, matching, etc. between the global or region of two images, and the method of color set is to realize the retrieval of large-scale images based on color. The method of color set proposed by Smith and Chang [42], the method of color conversion to the HSV color space, the image according to its color information image segmentation into several region, and the color is divided into several bins, each region of color space quantization to establish color index, Then the binary Image Color Index table is established. To speed up the search, you can also construct a binary search tree for feature retrieval.


2. Texture Feature Extraction

The texture of an image is a quantified image feature in the image calculation. The image texture describes the spatial color distribution and intensity distribution of the image or its small area. Texture feature extraction is divided into structure-based methods and statistical data-based methods. A structure-based texture feature extraction method is to model the texture to be detected and search for duplicate patterns in the image. This method has a good effect on the texture recognition of artificial synthesis. But for the texture recognition in traffic image, the method based on statistic data is more effective.

(1) LBP characteristics

The LBP method (Local binary patterns) is a method for Image feature classification in computer vision. The LBP method was first used by T in 1994. Ojala, M.pietikäinen, and D. Harwood proposed [43][44] for texture feature extraction. The LBP method was later used in conjunction with the Hog feature classifier to improve the detection effect on some data sets [45].

The following steps are taken to extract the LBP eigenvectors:

First, the detection window is divided into a 16x16 small area (cell), for each cell in a pixel, its ring neighborhood of 8 points (also can be the ring neighborhood multiple points, as shown in Figure 3‑4. As shown in the three neighborhood examples of the LBP algorithm, a clockwise or counter-clockwise comparison is performed, if the center pixel value is larger than the neighbor, the neighbor is assigned a value of 1, otherwise the assignment is 0, so that each point gets a 8-bit binary number (usually converted to decimal). The histogram for each cell is then computed, that is, the frequency at which each number (assumed to be a decimal number) occurs (i.e., a binary sequence that calculates whether each pixel is large in the vicinity of a dot), and then the histogram is normalized. Finally, the statistical histogram of each cell is connected, and the LBP texture of the whole graph is obtained, then it can be classified by SVM or other machine learning algorithms.

(2) gray-scale symbiosis matrix is another method of texture feature extraction, which first defines a direction (orientation) and a step in pixel (step), gray-scale symbiosis Matrix T (NXN), then defines M (I,J) The frequency at which the pixels of the gray level I and J appear simultaneously at a point and at a point along the defined direction span step. where n is the number of gray-level divisions. Since the symbiosis matrix has a combination of direction and step, one factor that determines the frequency is the number of pixels that contribute to the matrix, which is less than the total number and decreases as the step size increases. So the resulting symbiosis matrix is a sparse matrix, so the gray level division n is often reduced to 8 levels. If the co-occurrence matrix of the pixels in the left and right direction is calculated horizontally, the symmetric symbiosis matrix. Similarly, if you only consider pixels on the single direction (left or right) of the current pixel, it is called an asymmetric symbiosis matrix.

[43] T. Ojala, M. Pietikäinen, and D. Harwood (1994), "performance evaluation of texture measures with classification based on Kullback discrimination of distributions ", Proceedings of the 12th IAPR International Conference on Pattern recognition (I CPR 1994), vol. 1, pp. 582-585.
T. Ojala, M. Pietikäinen, and D. Harwood (1996), "A comparative Study of Texture Measures with classification Based o N Feature Distributions ", Pattern Recognition, vol, pp. 51-59.
[Xiaoyu Wang, Tony x. Han, Shuicheng Yan, "an HOG-LBP Human Detector with Partial occlusion handling", ICCV 2009


3. Edge Feature Extraction

Edge detection is an essential tool in graphic image processing, computer vision, and machine vision, often used for feature extraction and feature detection, to detect edges or discontinuities in a digital image that have a noticeable change, and in one-dimensional space, similar operations are called step detection. Edge is the boundary between different Qu yuan in an image, usually an edge image is a binary image. The goal of edge detection is to capture areas where the brightness changes dramatically, and these areas are usually our concern. A two-degree discontinuous area in an image is usually one of the following:

# Image Depth Discontinuity

# image (gradient) toward discontinuous place

# image Illumination (intensity) discontinuity

# Texture Change Place

Ideally, an edge detector for the given image can be used to get a series of successive curves that represent the bounds of the object. Therefore, the application of edge detection algorithm will greatly reduce the amount of image data, so as to filter out a lot of information we do not need, leaving the important structure of the image, the work to be processed is greatly simplified. However, the edges extracted from the normal picture are often destroyed by the segmentation of the image, that is, the detected curves are usually not contiguous, some edge curve segments open, the edge segments are lost, and there are some edges that we are not interested in. This requires the accuracy of the edge detection algorithm. The following is a description of two edge detection algorithms implemented in this paper: canny operator and sobel operator for edge detection.

(1) Canny operator edge detection

The canny edge detection algorithm is based on a multi-order edge operator, which was first proposed by John F. Canny in 1986 [46], and he not only gives a method of edge detection, but also puts forward the computational theory of edge detection.

The canny edge detector uses a detection model derived from the Gaussian model, because the unhandled image may contain noise, so a Gaussian filter is started on the original image, resulting in a slightly smoother image so as not to interfere with the global key parameters by a single noise pixel.

Take a 5x5 Gaussian filter template as an example (see Equation 3-7) and apply Gaussian filtering to image A to get B. The intensity gradient statistics of the image below are based on Figure B.


The edges of an image may vary in direction, so the canny algorithm uses four filters to detect horizontal, vertical, and diagonal edges in the image, respectively. The edge detector (such as Roberts, Prewitt, Sobel) returns a horizontal component, the GX and the vertical direction component Gy, which can be determined by this edge gradient and direction:

The angles of all edges are around the selected four directions (0°,45°,90°,135°) above. The next step is to track the edge line by hysteresis threshold.

Compared with the small intensity gradient, the higher intensity gradient is more easily used as the edge line. It is often not feasible to define a threshold in most images to determine how much of a light intensity gradient is suitable as an edge line, so the canny algorithm uses hysteresis to determine thresholds. The method uses two thresholds to define the high and low boundary respectively. Assume that all edges should be unaffected by noise and are continuous curves. So we set a high gate limit to determine the curve that determines the edge, and then start with the direction information to track those traceable image edges. When tracing the edge, applying a low threshold allows us to track the areas that contain the edges until the beginning of the next curve is found.

As shown in Figure 3‑5, (a) is a grayscale image of the original, (b) is a Gaussian filter smoothing diagram, (c) and (d) are manually set high and low thresholds as shown in the canny edge detection results. According to the test of multi-group image data, it is found that when the canny high and low threshold value is set to 50,150, the most effective information is preserved and there is not too much redundant information. Therefore, the threshold value [thres1,thres2]= 50,120 as the canny edge detection parameter is used in this paper. The following code is implemented in OPENCV:

Cvcanny (DST,SRC, 50, 120, 3);



(2) Sobel operator Edge detection

Similar to the canny operator, the sobel operator [47] also uses gradient information to detect the edge of the image. In the edge detection of the image, the gradient of each pixel is calculated and the maximum variation of the variation from the bright to the dark in different directions is given. The result shows whether the brightness of the image changes to "sharp" or "smooth" at that point, thus determining the probability that the area will become an edge. In practice, the possibility of becoming an edge (called magnitude) is more reliable and more convenient than the computational direction. At each pixel point in the image, the gradient vector only wants the direction of maximum brightness growth, and the length of the gradient vector corresponds to the intensity change rate of the direction. This means that the Sobel operator at a point on the previous area of the same pixel image is a 0 vector, and there is a set of vector values at the points on the edge line as a luminance gradient.

Mathematically, a 3x3 mask is applied to the original image to calculate the gradient approximation of the horizontal and vertical two-direction changes. If we define a as the source image, and the horizontal approximate gradient and the vertical approximate gradient respectively as an image, the method is calculated as follows:


3-9, * denotes a two-dimensional convolution operation. This establishes the coordinate system in the x-coordinate direction to the right, the y-coordinate direction downward, at each point in the image, using formula 3-8 to describe the total gradient size and direction. The results of edge detection using the Sobel operator are shown in Figure 3‑6.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.