Search code examples
c++image-processingopencv3.0feature-extractionlbph-algorithm

Histogram calculation for variance local binary pattern (VLBP) in OpenCV C++


I want to calculate the histogram for Variance local binary pattern of a gray scale image using OpenCV C++.

Can someone explain me how to exactly find histogram for variance LBP in OpenCV C++ and what exactly it means?

Also please provide some links that are useful in this case.


Solution

  • VAR is a rotation invariant measure of local variance (have a look at this paper for a more in-depth explanation) defined as:

    VAR

    where P is the number of pixels in the local neighbourhood and μ is the average intensity computed across the local neighbourhood.

    LBP variance (LBPV) is a texture descriptor that uses VAR as an adaptive weight to adjust the contribution of the LBP code in histogram calculation (see this paper for details). The value of the kth bin of the LBPV histogram can be expressed as:

    LBPV

    where N and M are the number of rows and columns of the image, respectively, and w is given by:

    w

    According to this answer the code for calculating LBP using OpenCV is not available for public use, but here you can find a workaround to make that function accesible.