Reprint: A preliminary understanding of LBP

Source: Internet
Author: User
Tags scale image

Transfer from http://blog.csdn.net/ty101/article/details/8905394

The PDF version of this article, as well as all literature and code involved, can be downloaded at the following address:

1. pdf version and Literature: http://download.csdn.net/detail/ty101/5349816

2, the original author of the MATLAB code: http://download.csdn.net/detail/ty101/5349894

LBP is an operator used to describe the texture characteristics of an image, which was put forward by people such as T.ojala of the University of Oulu in Finland in 1996 [1], and in 2002, Timo Ojala and others published an article on LBP in Pami (2), which was very clear about the multi-resolution, The improved LBP features of the invariant and rotational invariant of gray scale and equivalent patterns. The core idea of LBP is that the gray value of the center pixel is used as the threshold value, and the corresponding binary code is compared with his field to represent the local texture feature. Well, that's a bit of a mouthful.-_-#还是举例吧, below we start from the simplest, step by step to explain the entire LBP feature (the entire LBP feature extraction process Please see the article at the end of the appendix).

L Primary LBP calculation method (first, the multi-resolution, gray scale invariant, rotation invariant ^_^)

Suppose we have a 3*3 window in which the values in the window represent the grayscale values of each pixel, as shown below:

You can see that the grayscale value of the center pixel is 6, we compare the gray value of this center pixel with the size of the pixel value of the 8 fields around it, which means we compare 7, 9, 8, 7, 1, 2, 5, 6, 8, 6, and 6, and we'll set the corresponding square on the right to 1 and less than 6 to 0. Then we have to go to the right side of the window, we put these 1 and 0 in a counterclockwise direction to get the so-called LBP mode: 11110001 (note is binary), and then convert this number to 10, that is, 241.

Tips: Window shapes in the extended LBP

The above-mentioned version is Timo Ojala in 1996, in 2002 when Timo Ojala in Pami's article on the above algorithm was extended. The extended algorithm can set the neighborhood and RADIUS properties, use p to represent the number of pixels in the neighborhood, and use R to represent the radius, the primary version we described above is the version of p=8,r=1.0 ( regardless of interpolation, which is described in detail later ). Describes the situation when p,r takes a different value:

Note that the field of the primary version [1] is not the idea of the interpolation (i.e., the Square neighborhood), whereas the 2002 Pami article [2] is a circular neighborhood that involves interpolation (it can be seen that only the diagonal pixels need interpolation ). In fact, the square window into a circular window is also conducive to the subsequent rotation invariance implementation, will be described in detail later.

Tips: About the robustness of the luminance variation of LBP and the invariant gray scale

Gray scale is not changed actually very good understanding, we still use Figure 1 as an example, we will increase the brightness 10 times times:

It can be seen that the gray scale transformation does not affect the last local two value mode, the same reason, even if the gray value of the 9 pixels of the window has a non-linear transformation of brightness, as long as the center pixel gray value and the 8 neighborhood pixel gray value of the size of the relationship is not changed , The resulting LBP feature will not change. Note, however, that if the brightness is transformed, the value of the central pixel grayscale is not the same as the gray value of the surrounding pixels, and the LBP feature will change accordingly. For example, the window in Figure 1 has a non-linear change in brightness, and the result is:

As you can see, the local two value pattern on the right is not the same as the local two value pattern in Figure 1.

Adding rotational invariance to the LBP operator

In the 2000 Pietikinen and others described how to extend the LBP feature in the article [3] to make it rotational invariant. Here we take a p=8,r=1.0 circular window as an example to explain the rotation invariance of the LBP operator. The grayscale value of the center point is the gray value of the 8 pixels in the gc,8 neighborhood is gi={g0,g1,..., G7}, and when the image rotates, the grayscale value in the circular neighborhood is in the circumference of the circle with a GC-centric R radius. For example, we have a window like this:

Then rotate the image counterclockwise 45 degrees each time, enumerate all possible values, get the following results:

We can see that as long as we take the minimum value of the enumerated values above, we can eliminate the effect of rotation. For example, we get a binary LBP value of 10000011 (that is, the original is rotated 45 degrees counterclockwise), and then constantly shift the binary to the right (plus it itself, a total of 8 values are possible), then the minimum result is the LBP value of the window.

Tips: The changing LBP features of rotation also play a role in certain features

When p=8,r=1.0, there will eventually be a 2^p=2^8=256, and there will be only 36 rotation-invariant two-value patterns for the unchanged LBP feature:

L use equivalence mode to improve rotational invariance

After adding the rotation invariance, is it all right? Not really, later, T.ojala found that the effect is not very good, because when we put the P and R value is very large, it means that the local two value pattern binary number of bits will be very large (P and r value greater, the more pixels in the neighborhood, T.ojala in the paper [2] has given, p value is 24), In this way, the resulting histogram is very sparse, not conducive to classification. If the values of P and R are too small, the segmentation accuracy of the angle is reduced, which reduces the performance of the later classification. To solve these problems, T.ojala and others in the literature [2] proposed a method called "equivalence mode" to reduce the dimension of LBP features. T.ojala and others found that there is a class of patterns in the image of the frequency and high, such patterns are equivalent mode, they have a feature is that the number of black and white jumps is less than or equal to 2(in the first row in Figure 7 is the equivalent mode, the other is non-equivalent mode). In addition, we can also launch, in P neighborhood, the number of equivalent mode U is: u=p* (P-1) +2, other modes are called non-equivalence mode. The LBP value of the equivalent pattern is equal to the number of 1 in the two-value code, and the LBP value of the non-equivalence pattern is p+1, which is represented by a formula:

where U (lbpp,r) <=2 represents 0, 1 hops is less than or equal to 2. Although the equivalence pattern accounts for only a small fraction of all patterns, T.ojala shows that this small subset of equivalence patterns can depict more than 90% of the texture characteristics.

L Analysis of LBP support multi-resolution

As we can see in Figure 2, as long as the size of P and R is constantly changing (that is, the concept of the so-called "window size" commonly used in image processing), which allows LBP to have multi-resolution recognition, a common method is to scale the image to a certain factor instead of changing the size of P and R, T.ojala in the conference paper [4] It was suggested that, according to their experiments, using the previous method (and changing the window size rather than the scale image) would have a better effect. When, as in [4], T.ojala and other people also proposed to the image of the gray histogram and LBP features combined to enhance the effect of classification, the specific content can be referred to Texture classification bymulti-predicate Local Binary Pattern Operators This article ^_^.

Here are some of the LBP"original" article, more look at the original author's article is the King, hehe.

Reference documents:

[1] T.ojala, M.pietikinen et al. A comparative Study of Texture Measures with classification based on Feature distribution. Pattern recognition. 1996. vol.29.pp.51-59.

[2] T.ojala, M.pietikinen. Multiresolution Gray-scale and Rotation invarianttexture classification with Local Binary Patterns. Pattern analysis and Machineintelligence. vol.24.7.pp.971-986

[3] M.pietikinen, T.ojala, and Z.xu. Rotation-invariant Texture classificationusing Feature distributions. Pattern recognition. vol.33.pp.43-52.

[4] T.maenpaa, M. Pietikinen, and T. Ojala, "Texture classification bymulti-predicate Local Binary Pattern Operators," Pr OC. 15th Int ' L conf.pattern Recognition, vol. 3, pp. 951-954, 2000.

APPENDIX:LBP Feature Extraction Flowchart

The PDF version of this article, as well as all literature and code involved, can be downloaded at the following address:

1. pdf version and Literature: http://download.csdn.net/detail/ty101/5349816

2, the original author of the MATLAB code: http://download.csdn.net/detail/ty101/5349894

LBP is an operator used to describe the texture characteristics of an image, which was put forward by people such as T.ojala of the University of Oulu in Finland in 1996 [1], and in 2002, Timo Ojala and others published an article on LBP in Pami (2), which was very clear about the multi-resolution, The improved LBP features of the invariant and rotational invariant of gray scale and equivalent patterns. The core idea of LBP is that the gray value of the center pixel is used as the threshold value, and the corresponding binary code is compared with his field to represent the local texture feature. Well, that's a bit of a mouthful.-_-#还是举例吧, below we start from the simplest, step by step to explain the entire LBP feature (the entire LBP feature extraction process Please see the article at the end of the appendix).

L Primary LBP calculation method (first, the multi-resolution, gray scale invariant, rotation invariant ^_^)

Suppose we have a 3*3 window in which the values in the window represent the grayscale values of each pixel, as shown below:

You can see that the grayscale value of the center pixel is 6, we compare the gray value of this center pixel with the size of the pixel value of the 8 fields around it, which means we compare 7, 9, 8, 7, 1, 2, 5, 6, 8, 6, and 6, and we'll set the corresponding square on the right to 1 and less than 6 to 0. Then we have to go to the right side of the window, we put these 1 and 0 in a counterclockwise direction to get the so-called LBP mode: 11110001 (note is binary), and then convert this number to 10, that is, 241.

Tips: Window shapes in the extended LBP

The above-mentioned version is Timo Ojala in 1996, in 2002 when Timo Ojala in Pami's article on the above algorithm was extended. The extended algorithm can set the neighborhood and RADIUS properties, use p to represent the number of pixels in the neighborhood, and use R to represent the radius, the primary version we described above is the version of p=8,r=1.0 ( regardless of interpolation, which is described in detail later ). Describes the situation when p,r takes a different value:

Note that the field of the primary version [1] is not the idea of the interpolation (i.e., the Square neighborhood), whereas the 2002 Pami article [2] is a circular neighborhood that involves interpolation (it can be seen that only the diagonal pixels need interpolation ). In fact, the square window into a circular window is also conducive to the subsequent rotation invariance implementation, will be described in detail later.

Tips: About the robustness of the luminance variation of LBP and the invariant gray scale

Gray scale is not changed actually very good understanding, we still use Figure 1 as an example, we will increase the brightness 10 times times:

It can be seen that the gray scale transformation does not affect the last local two value mode, the same reason, even if the gray value of the 9 pixels of the window has a non-linear transformation of brightness, as long as the center pixel gray value and the 8 neighborhood pixel gray value of the size of the relationship is not changed , The resulting LBP feature will not change. Note, however, that if the brightness is transformed, the value of the central pixel grayscale is not the same as the gray value of the surrounding pixels, and the LBP feature will change accordingly. For example, the window in Figure 1 has a non-linear change in brightness, and the result is:

As you can see, the local two value pattern on the right is not the same as the local two value pattern in Figure 1.

Adding rotational invariance to the LBP operator

In the 2000 Pietikinen and others described how to extend the LBP feature in the article [3] to make it rotational invariant. Here we take a p=8,r=1.0 circular window as an example to explain the rotation invariance of the LBP operator. The grayscale value of the center point is the gray value of the 8 pixels in the gc,8 neighborhood is gi={g0,g1,..., G7}, and when the image rotates, the grayscale value in the circular neighborhood is in the circumference of the circle with a GC-centric R radius. For example, we have a window like this:

Then rotate the image counterclockwise 45 degrees each time, enumerate all possible values, get the following results:

We can see that as long as we take the minimum value of the enumerated values above, we can eliminate the effect of rotation. For example, we get a binary LBP value of 10000011 (that is, the original is rotated 45 degrees counterclockwise), and then constantly shift the binary to the right (plus it itself, a total of 8 values are possible), then the minimum result is the LBP value of the window.

Tips: The changing LBP features of rotation also play a role in certain features

When p=8,r=1.0, there will eventually be a 2^p=2^8=256, and there will be only 36 rotation-invariant two-value patterns for the unchanged LBP feature:

L use equivalence mode to improve rotational invariance

After adding the rotation invariance, is it all right? Not really, later, T.ojala found that the effect is not very good, because when we put the P and R value is very large, it means that the local two value pattern binary number of bits will be very large (P and r value greater, the more pixels in the neighborhood, T.ojala in the paper [2] has given, p value is 24), In this way, the resulting histogram is very sparse, not conducive to classification. If the values of P and R are too small, the segmentation accuracy of the angle is reduced, which reduces the performance of the later classification. To solve these problems, T.ojala and others in the literature [2] proposed a method called "equivalence mode" to reduce the dimension of LBP features. T.ojala and others found that there is a class of patterns in the image of the frequency and high, such patterns are equivalent mode, they have a feature is that the number of black and white jumps is less than or equal to 2(in the first row in Figure 7 is the equivalent mode, the other is non-equivalent mode). In addition, we can also launch, in P neighborhood, the number of equivalent mode U is: u=p* (P-1) +2, other modes are called non-equivalence mode. The LBP value of the equivalent pattern is equal to the number of 1 in the two-value code, and the LBP value of the non-equivalence pattern is p+1, which is represented by a formula:

where U (lbpp,r) <=2 represents 0, 1 hops is less than or equal to 2. Although the equivalence pattern accounts for only a small fraction of all patterns, T.ojala shows that this small subset of equivalence patterns can depict more than 90% of the texture characteristics.

L Analysis of LBP support multi-resolution

As we can see in Figure 2, as long as the size of P and R is constantly changing (that is, the concept of the so-called "window size" commonly used in image processing), which allows LBP to have multi-resolution recognition, a common method is to scale the image to a certain factor instead of changing the size of P and R, T.ojala in the conference paper [4] It was suggested that, according to their experiments, using the previous method (and changing the window size rather than the scale image) would have a better effect. When, as in [4], T.ojala and other people also proposed to the image of the gray histogram and LBP features combined to enhance the effect of classification, the specific content can be referred to Texture classification bymulti-predicate Local Binary Pattern Operators This article ^_^.

Here are some of the LBP"original" article, more look at the original author's article is the King, hehe.

Reference documents:

[1] T.ojala, M.pietikinen et al. A comparative Study of Texture Measures with classification based on Feature distribution. Pattern recognition. 1996. vol.29.pp.51-59.

[2] T.ojala, M.pietikinen. Multiresolution Gray-scale and Rotation invarianttexture classification with Local Binary Patterns. Pattern analysis and Machineintelligence. vol.24.7.pp.971-986

[3] M.pietikinen, T.ojala, and Z.xu. Rotation-invariant Texture classificationusing Feature distributions. Pattern recognition. vol.33.pp.43-52.

[4] T.maenpaa, M. Pietikinen, and T. Ojala, "Texture classification bymulti-predicate Local Binary Pattern Operators," Pr OC. 15th Int ' L conf.pattern Recognition, vol. 3, pp. 951-954, 2000.

APPENDIX:LBP Feature Extraction Flowchart

Top
0
Step

Reprint: A preliminary understanding of LBP

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.