简体   繁体   中英

Understanding implementation of Local binary pattern

I am trying to understand the scikit-image implementation of Local Binary Pattern in detail. I understand how LBP works, but I fail to get some points in the implementation.

My main question is: Is the weight matrix in scikit-imgae the same as for example in this image here?

image of weight matrix

When trying to find the answer on my own I faced some problems:

  • texture.py uses a function (_local_binary_pattern() ) that I couldnt find at the beginning - but I guess it is defined in _texture.pyx . Am I right?
  • How does the function bilinear_interpolation[cnp.float64_t, double, double]( &image[0, 0], rows, cols, r + rp[i], c + cp[i], b'C', 0, &texture[i]) work? What do the box brackets mean? The "&" point to the adress of the variables, right? Where is the result of the function call stored? I dont see anything like x = bilinear_interpolation(...)
  • Where can I find the definitions of functions like bilinear_interpolation?

Thanks for any advice and help!

Best, Bernhard

I think I found the answer by just trying the algorithm on images. The weight matrix in the local binary pattern in scikit-image is as follows.

It starts at 3 o clock and the goes counterclockwise. For 8 points this would result in:

--------4--------

--8-----------2--

16--------------1

--32----------128

--------64-------

I got the other questions regarding the code open - so I am still happy about any comments etc..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM