【发布时间】:2013-06-20 10:52:52
【问题描述】:
我已经能够实现基本的本地二进制模式 (LBP),无需插值。以下是代码:(OpenCV)
int center = 0;
int center_lbp = 0;
for (int row = 1; row < Image.rows; row++)
{
for (int col = 1; col < Image.cols; col++)
{
center = Image.at<int>(row, col);
center_lbp = 0;
if ( center <= Image.at<int>(row-1, col-1) )
center_lbp += 1;
if ( center <= Image.at<int>(row-1, col) )
center_lbp += 2;
if ( center <= Image.at<int>(row-1, col+1) )
center_lbp += 4;
if ( center <= Image.at<int>(row, col-1) )
center_lbp += 8;
if ( center <= Image.at<int>(row, col+1) )
center_lbp += 16;
if ( center <= Image.at<int>(row+1, col-1) )
center_lbp += 32;
if ( center <= Image.at<int>(row+1, col) )
center_lbp += 64;
if ( center <= Image.at<int>(row+1, col+1) )
center_lbp += 128;
cout << "center lbp value: " << center_lbp << endl;
LBPImage.at<int>(row, col) = center_lbp;
}
}
阅读了很多东西...但现在无法弄清楚如何使用统一模式概念创建直方图...确实检查了几个链接...那里没什么...有人可以帮忙...
谢谢!
【问题讨论】:
-
从您包含的标签来看,您正在使用 opencv 或正在考虑使用它。如果你有,“opencv histogram”的简单谷歌搜索可能是相关的。这是搜索docs.opencv.org/doc/tutorials/imgproc/histograms/…时的链接之一
-
Histogram和LBP histogram比car和carpet之间的关系更密切一些,但上面的链接在这种情况下完全没用
标签: c++ opencv image-processing pattern-matching computer-vision