【发布时间】:2014-04-05 08:28:17
【问题描述】:
我用 matlab 建立了很多本地二进制模式的实现,我对它们有点困惑。
维基百科解释了basic LBP 的工作原理:
1- Divide the examined window into cells (e.g. 16x16 pixels for each cell).
2- For each pixel in a cell, compare the pixel to each of its 8 neighbors (on its left-top, left-middle, left-bottom, right-top, etc.). Follow the pixels along a circle, i.e. clockwise or counter-clockwise.
3- Where the center pixel's value is greater than the neighbor's value, write "1". Otherwise, write "0". This gives an 8-digit binary number (which is usually converted to decimal for convenience).
4- Compute the histogram, over the cell, of the frequency of each "number" occurring (i.e., each combination of which pixels are smaller and which are greater than the center).
5- Optionally normalize the histogram.
6- Concatenate (normalized) histograms of all cells. This gives the feature vector for the window.
看看这个算法,我可以得出结论,每个 LBP 特征向量都有 num_cels*256 维,其中 num_cels 是图像的 16x16 像素单元的数量。每个单元格将有 256 个可能的值(0 到 255),因此特征向量的大小可以变化很大。
但是,查看一些 LBP 实现,VLFEAT_LBP 返回一个矩阵而不是特征向量。在this implementation LBP 作为 256 个特征向量返回,我认为(不确定)是所有单元格的所有直方图的总和。我只想知道:哪个是经典的LBP解释和matlab源码。
【问题讨论】:
-
规范 = Ojala, et al..
-
@chappjc 非常感谢您提供的信息。我在源代码中看到的是来自维基百科的信息(步骤 6)不正确。 LBP 的结果图像在每个像素中是一个 8 位二进制数,表示像素如何根据其邻居的行为。这个转换为十进制的二进制数可以具有最大值 255 和最小值 0。在以这种方式表示每个像素之后,构建具有 256 个 bin 的直方图。每个单元格中的直方图的串联没有完成。我说的对吗?
标签: matlab computer-vision lbph-algorithm