3
我創建了很多matlab本地二進制模式的實現,我對它們有點困惑。本地二進制模式原始代碼和參考文獻matlab
Wikipedia解釋如何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源代碼。謝謝。
Canonical = [Ojala,等](http://www.cse.oulu.fi/CMV/Downloads/LBPMatlab)。 – chappjc
@chappjc非常感謝您的信息。我在源代碼中看到的是,維基百科的信息(步驟6)不正確。 LBP的最終圖像是在每個像素中的一個8位二進制數,表示像素按照其鄰居的行爲。轉換爲十進制的這個二進制數可以具有最大值255和最小值0.在以這種方式表示每個像素之後,構造具有256個分箱的直方圖。沒有完成每個單元格中直方圖的拼接。我對嗎? – mad