[Study Notes] Digital Image Processing (1): Image Feature Extraction

sequence

1. Feature representativeness and distinguishability
The greater the difference between objects of different categories in an image, the better. For example, when distinguishing between table tennis and football, the texture feature of the image is a very good feature, because football generally has a hexagonal texture structure, but table tennis does not.
2. Stability
Features of images of the same class should have similar feature values. It is guaranteed that the similarity of images within a category is greater than the similarity of images between categories. For example, color is a good feature when distinguishing ripe apples from immature apples, as unripe apples are usually green in color while ripe apples are usually yellow or red . The size feature is not a stable feature when distinguishing ripe apples from immature
3. Independence
Image features should be independent of each other, minimizing the correlation with each other, the correlation between images will affect the expression of content. For example, the diameter of an apple and the end of an apple are two highly correlated features, both of which can reflect the size of an apple, and if two features are used at the same time, it will appear redundant.

1. Color Feature Extraction

1.1 Color histogram

The color histogram is used to describe the numerical distribution of pixel colors in the image, which can reflect the statistical distribution of image colors and the basic tone of the image.

1.1.1 General color histogram

Suppose s ( xi ) {s( x _{ i } ) }s(xi) for imageF {F}A specific colorxi {x_{i}} in FxiThe number of pixels in the image F{F}The total number of pixels in F is N = Σ js ( xj ) {N=\Sigma_{j}s(x_{j})}N=Sjs(xj) ,xi {x _{ i } }xiThe frequency of occurrence of pixels is
h = s ( xi ) N = s ( xi ) Σ js ( xj ) h=\frac{s(x_{i})}{N}=\frac{s(x_{i})} {\Sigma_{j}s(x_{j})}h=Ns(xi)=Sjs(xj)s(xi)
the whole image F{F}The general color histogram of F
can be expressed as H ( F ) = [ h ( x 1 ) , h ( x 2 ) , . . . , h ( xn ) ] H(F)=[h(x_{1}), h( x_{2} ),...,h(x_{n})]H(F)=[h(x1),h(x2),...,h(xn) ]
where n represents the number of certain color values.

The histogram of a general image is as follows

image
insert image description here
The general color histogram method is not sensitive to transformations such as image rotation, small translation, and small zoom, and is not sensitive to changes in image quality.

1.1.2 Global accumulation histogram

Suppose an image F{F}The general color histogram of a feature in F is H ( F ) = [ h ( x 1 ) , h ( x 1 ) , . . . , h ( xn ) ] {H(F)=[h(x_{ 1}),h(x_{1}),...,h(x_{n})]}H(F)=[h(x1),h(x1),...,h(xn)],令
λ ( x i ) = ∑ j ≤ i h ( x j ) {\lambda( x _ { i } ) = \sum _ { j \le {i} } h( x_{j} ) } λ ( xi)=jih(xj)
indicates that the color is less than or equal toxi x_{i}xiThe cumulative sum of the general color histograms of all elements of the image FFThe feature accumulation histogram of F can be expressed as:
λ ( F ) = [ λ ( x 1 ) , λ ( x 1 ) , . . . , λ ( xn ) ] { \lambda (F) = [\lambda( x_{1}), \lambda(x_{1}) ,...,\lambda(x_{n})] }λ ( F )=[ λ ( x1),λ ( x1),...,λ ( xn) ]
The frequency of adjacent pixel values ​​is also adjacent to the position of the global cumulative histogram

You can understand it this way, the general color histogram is equivalent to a probability density function, and the global cumulative histogram is a distribution function, that is, the cumulative histogram is the integral of the general histogram F ( x ) =
∫ − ∞ xp ( x ) dx { F(x)=\int_{-\infty}^{x} p(x)dx }F(x)=xp(x)dx
λ ( x i ) = ∑ j ≤ i h ( x j ) { \lambda(x_{i} )= \sum _ { j \le {i} } h( x_{j} )} λ ( xi)=jih(xj)

1.1.3 Main tone histogram

In an image, different color values ​​appear with different probabilities, and usually a few colors can cover the main tone of the entire image.

The main color histogram is to calculate the frequency of each color, and select the color with the highest frequency as the main color. The main color histogram can suppress the influence of noise in the image.

1.2 Color moments

Moment is an important statistic, which is often used to characterize the distribution characteristics of data. In statistics, the first moment represents the mean, the second moment represents the variance, and the third moment represents the degree of deviation. The color moments of an image are used to characterize the distribution of colors within the image.

  • For digital images, the first moment is defined as:
    μ i = 1 N ∑ j = 1 NP ij { \mu_{i} = \frac{1}{N} \sum_{j=1}^{N} P_{ij } }mi=N1j=1NPij
    where P ij P_{ij}PijRepresents a digital image PPP 'siiThe jjth of the i image channelvalue of j pixels,NNN represents the number of pixels in the image
  • Let us give:
    σ i = [ 1 N ∑ j = 1 N ( P ij − µ i ) 2 ] 1 / 2 { \sigma_{i} = [\frac{1}{N} \sum_{j= 1}^{N} ( P_{ij} - \mu_{i}) ^{2} ]^{1/2} }pi=[N1j=1N(Pijmi)2]1/2
  • The third-order color moment is defined as:
    si = [ 1 N ∑ j = 1 N ( P ij − μ i ) 3 ] 1 / 3 { s_{i} = [\frac{1}{N} \sum_{j=1 }^{N} ( P_{ij} - \mu_{i} )^{3} ]^{1/3} }si=[N1j=1N(Pijmi)3]1/3

1.3 Color Sets

A color set can also be called a color index set, which is an approximation to an image color histogram. The steps of the color set method are: convert the image from RGB space to HSV space, and quantize the color space into several small cubes with equal side lengths; second, divide the image into several sub-regions according to the color of the image; third, Each subregion is indexed using a color class in the quantization space, representing the image as a binary set of color indices.

The simplest set of colors can be achieved by setting a threshold. For example, given a certain color value mmm , given its thresholdτ m \tau_{m}tm, generate the color set cc from the color histogramc can be expressed as
c [ m ] = { 1 , h [ m ] ≥ τ m 0 , other c[m]=\left\{ \begin{aligned} 1,h[m] \ge\tau_{m} \ \0, else \end{aligned} \right.c[m]={ 1,h[m]tm0,Other
where h [ m ] h[m]h [ m ] indicates that the color value in the histogram ismmThe component at the position corresponding to m

1.4 Color aggregation vector

The core idea of ​​the color set vector is to divide the pixels of each color quantization interval of the color histogram into two parts. If the continuous area occupied by some pixels in the color quantization interval is greater than the specified threshold, the pixels in this area will be regarded as aggregated pixel, otherwise non-aggregated pixel

The color aggregation vector can be expressed as < ( α 1 , β 1 ) , . . . , ( α n , β n ) > <(\alpha_{1}, \beta_{1} ),...,(\alpha_{ n}, \beta_{n})><( a1,b1),...,( an,bn)> , whereα i \alpha_{i}aiSum β i \beta_{i}biRespectively represent the iith of the color histogramThe number of aggregated and non-aggregated pixels in i color quantization intervals .

Guess you like

Origin blog.csdn.net/AlepH_Sin/article/details/111150752