简体   繁体   English

了解本地二进制模式的实现

[英]Understanding implementation of Local binary pattern

I am trying to understand the scikit-image implementation of Local Binary Pattern in detail.我试图详细了解 Local Binary Pattern 的 scikit-image 实现。 I understand how LBP works, but I fail to get some points in the implementation.我了解 LBP 的工作原理,但我在实现中没有得到一些要点。

My main question is: Is the weight matrix in scikit-imgae the same as for example in this image here?我的主要问题是:scikit-imgae 中的权重矩阵是否与此处这张图片中的示例相同?

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 . texture.py使用我一开始找不到的 function (_local_binary_pattern() ) - 但我猜它是在_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? function bilinear_interpolation[cnp.float64_t, double, double]( &image[0, 0], rows, cols, r + rp[i], c + cp[i], b'C', 0, &texture[i ])工作? What do the box brackets mean?方括号是什么意思? The "&" point to the adress of the variables, right? “&”指向变量的地址,对吧? Where is the result of the function call stored? function 调用的结果存储在哪里? I dont see anything like x = bilinear_interpolation(...)我没有看到类似 x = bilinear_interpolation(...)
  • Where can I find the definitions of functions like bilinear_interpolation?在哪里可以找到像 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. scikit-image 中局部二进制模式中的权重矩阵如下所示。

It starts at 3 o clock and the goes counterclockwise.它从 3 点钟开始,逆时针方向走。 For 8 points this would result in:对于 8 分,这将导致:

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

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

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

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

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

I got the other questions regarding the code open - so I am still happy about any comments etc..我收到了关于代码打开的其他问题 - 所以我仍然对任何评论等感到高兴。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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