如何实现LBP uniform
How to implement LBP uniform
我是 OpenCV 新手。我正在尝试做一个样本来提取面部特征。我正在阅读几篇论文,其中最受推荐的一篇是 LBP。我了解 LBP 描述符的工作原理,但我从中读取了一个变体。 LBP 制服我理解它是 LBP 原始但一旦你有二进制序列(例如你将一个特定像素与邻居比较并且你有下一个结果 - > 11110001,我知道有 2 个转换,所以在那种情况下我们可以说它是统一,因为转换次数 <= 2。
我的问题是在完成此过程后我必须在该像素中计算什么代码。我知道 LBP 原始 wew 有 256 个值,但是使用 LBP uniform que 的这个变体将数量减少到 59 个 bins 值。所以我的问题是,如果每个像素中的转换次数是 <=2 或 >2.
,那么在测试之后我必须输入什么代码
谢谢!我希望我解释正确。
here's a lookup-table for this, assuming 8 neighbours:
static int uniform[256] =
{
0,1,2,3,4,58,5,6,7,58,58,58,8,58,9,10,11,58,58,58,58,58,58,58,12,58,58,58,13,58,
14,15,16,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,17,58,58,58,58,58,58,58,18,
58,58,58,19,58,20,21,22,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,
58,58,58,58,58,58,58,58,58,58,58,58,23,58,58,58,58,58,58,58,58,58,58,58,58,58,
58,58,24,58,58,58,58,58,58,58,25,58,58,58,26,58,27,28,29,30,58,31,58,58,58,32,58,
58,58,58,58,58,58,33,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,34,58,58,58,58,
58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,
58,35,36,37,58,38,58,58,58,39,58,58,58,58,58,58,58,40,58,58,58,58,58,58,58,58,58,
58,58,58,58,58,58,41,42,43,58,44,58,58,58,45,58,58,58,58,58,58,58,46,47,48,58,49,
58,58,58,50,51,52,58,53,54,55,56,57
};
使用这个,您只需将 8 位 lbp 值替换为 LUT 中的值:
value = uniform[value];
我是 OpenCV 新手。我正在尝试做一个样本来提取面部特征。我正在阅读几篇论文,其中最受推荐的一篇是 LBP。我了解 LBP 描述符的工作原理,但我从中读取了一个变体。 LBP 制服我理解它是 LBP 原始但一旦你有二进制序列(例如你将一个特定像素与邻居比较并且你有下一个结果 - > 11110001,我知道有 2 个转换,所以在那种情况下我们可以说它是统一,因为转换次数 <= 2。
我的问题是在完成此过程后我必须在该像素中计算什么代码。我知道 LBP 原始 wew 有 256 个值,但是使用 LBP uniform que 的这个变体将数量减少到 59 个 bins 值。所以我的问题是,如果每个像素中的转换次数是 <=2 或 >2.
,那么在测试之后我必须输入什么代码谢谢!我希望我解释正确。
here's a lookup-table for this, assuming 8 neighbours:
static int uniform[256] =
{
0,1,2,3,4,58,5,6,7,58,58,58,8,58,9,10,11,58,58,58,58,58,58,58,12,58,58,58,13,58,
14,15,16,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,17,58,58,58,58,58,58,58,18,
58,58,58,19,58,20,21,22,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,
58,58,58,58,58,58,58,58,58,58,58,58,23,58,58,58,58,58,58,58,58,58,58,58,58,58,
58,58,24,58,58,58,58,58,58,58,25,58,58,58,26,58,27,28,29,30,58,31,58,58,58,32,58,
58,58,58,58,58,58,33,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,34,58,58,58,58,
58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,
58,35,36,37,58,38,58,58,58,39,58,58,58,58,58,58,58,40,58,58,58,58,58,58,58,58,58,
58,58,58,58,58,58,41,42,43,58,44,58,58,58,45,58,58,58,58,58,58,58,46,47,48,58,49,
58,58,58,50,51,52,58,53,54,55,56,57
};
使用这个,您只需将 8 位 lbp 值替换为 LUT 中的值:
value = uniform[value];