# 局部二值模式

局部二值模式（local binary pattern，LBP）是计算机视觉中的一种纹理描述子，它通过将邻域灰度值与中心像素比较并阈值化，把得到的符号读作一个二进制编码，从而对每个像素的邻域进行编码；这些编码的直方图可作为纹理分类、人脸识别及相关任务的特征。该算子计算代价低、对任意单调灰度变换不变，并且对光照变化具有鲁棒性，这使它成为纹理分析和人脸识别中的标准工具。<sup>[1](http://var.scholarpedia.org/article/Local_Binary_Patterns)</sup>

| 关键事实 | 详情 |
|---|---|
| 核心计算 | 以中心值对 3×3 邻域做阈值化；8 个符号构成 \( 2^{8} = 256 \) 个编码之一，编码直方图即为描述子<sup>[1](http://var.scholarpedia.org/article/Local_Binary_Patterns)</sup> |
| 灰度不变性 | 只保留差值 \( g_{p} - g_{c} \) 的符号，因此任何单调灰度变换都不改变输出<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> |
| 广义算子 | LBP(P,R) 在半径为 R 的圆上采样 P 个点；P 控制角度量化，R 控制空间分辨率<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> |
| 均匀模式 | 至多包含两次按位 0/1 跳变的模式；对 8 邻域而言，256 个模式中有 58 个是均匀模式，共给出 59 个直方图标签<sup>[1](http://var.scholarpedia.org/article/Local_Binary_Patterns)</sup> |
| 人脸识别 | 分块 LBP 直方图拼接为空间增强直方图，用卡方最近邻匹配，在 FERET 上优于 PCA、贝叶斯类内/类间分类器和弹性束图匹配<sup>[3](https://doi.org/10.1109/tpami.2006.244)</sup> |
| 速度 | 对比研究发现，在判别力相当的情况下，LBP 比其他纹理分析方法快最多 6000 倍<sup>[4](https://oulurepo.oulu.fi/bitstream/handle/10024/34741/isbn951-42-7076-2.pdf?sequence=1)</sup> |
| 主要弱点 | 阈值化使 LBP 不鲁棒：输入的微小变化，尤其是平坦恒定灰度区域上的噪声，可能翻转许多位<sup>[5](https://arxiv.org/pdf/1612.06795)</sup> |

## 工作原理

原始算子以中心值对其 3×3 邻域做阈值化来为每个像素打标签：八个邻域像素各贡献一位，若其灰度值不小于中心值则记 1，否则记 0。形式上，编码为

\[ \mathrm{LBP}_{P,R} = \sum_{p=0}^{P-1} 2^{p} \cdot s(i_{p} - i_{c}), \quad s(x) = \begin{cases} 1, & x \geq 0 \\ 0, & x < 0 \end{cases} \]

其中 \( i_{c} \) 是中心灰度值，\( i_{p} \) 是第 \( p \) 个邻域像素的灰度值。<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC3996985/)</sup> 于是这些符号被解释为一个 P 位二进制数，给出 \( 2^{P} \) 个不同的编码值；每个符号被赋予二项式权重 \( 2^{p} \)。<sup>[4](https://oulurepo.oulu.fi/bitstream/handle/10024/34741/isbn951-42-7076-2.pdf?sequence=1)</sup> 由于只有符号被保留，输出不受灰度的任何单调变换影响：编码捕捉的是局部空间结构，而非对比度。<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup>

图像或区域的描述子是编码的直方图，

\[ H_{i} = \sum_{x,y} I\{f_{l}(x,y) = i\}, \quad N_{i} = \frac{H_{i}}{\sum_{j} H_{j}} \]

当图像块大小不同时使用归一化。<sup>[1](http://var.scholarpedia.org/article/Local_Binary_Patterns)</sup>

## 具体做法

广义算子在围绕中心像素、半径为 R 的圆上使用 P 个等间距采样点；P 控制角度空间的量化，R 控制空间分辨率，未恰好落在像素中心上的邻域点通过插值估计。<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> 实践中，对每个像素计算一个编码，将编码映射为标签（可选地通过下文的均匀映射，用含 \( 2^{P} \) 个元素的查找表实现），<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> 然后全局或按区域构建直方图。

在人脸识别中，人脸区域被划分为小区域，从每个小区域独立提取 LBP 直方图，再将直方图拼接为单个空间增强特征直方图；识别使用以卡方为不相似度度量的最近邻分类器。<sup>[3](https://doi.org/10.1109/tpami.2006.244)</sup>

## 起源

这一思想有一个前身：何与王 1990 年的纹理单元与纹理谱方法，这是一个 3×3 三级方案，产生 \( 3^{8} = 6561 \) 个纹理单元，与 LBP 非常相似。<sup>[4](https://oulurepo.oulu.fi/bitstream/handle/10024/34741/isbn951-42-7076-2.pdf?sequence=1)</sup><sup> • </sup><sup>[7](https://doi.org/10.1109/tgrs.1990.572934)</sup> 广义 LBP 算子由奥亚拉、皮耶蒂凯宁和梅恩佩于 2002 年在 IEEE TPAMI 上提出，此后学界广泛接受了 LBP。<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> 人脸识别流程由阿霍宁、哈迪德和皮耶蒂凯宁于 2006 年在 IEEE TPAMI 上提出。<sup>[3](https://doi.org/10.1109/tpami.2006.244)</sup>

## 变体

**均匀模式。** 若一个模式按环形遍历时至多包含两次按位 0/1 跳变，则称其为均匀模式。对 (8,R) 邻域有 256 个模式，其中 58 个是均匀模式，给出 59 个标签；所有非均匀模式共用一个标签。在 (8,1) 下均匀模式占全部模式的略低于 90%，在 (16,2) 下约占 70%。<sup>[1](http://var.scholarpedia.org/article/Local_Binary_Patterns)</sup><sup> • </sup><sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> 均匀映射 \( \mathrm{LBP}^{u2}_{P,R} \) 有 \( P \cdot (P-1) + 3 \) 个不同的输出值。<sup>[8](https://psycnet.apa.org/doi/10.1109/TIP.2010.2044957)</sup>

**旋转不变性与 LBP-HF。** 旋转不变性通过循环按位右移实现，\( \mathrm{LBP}^{ri}_{P,R} = \min\{ \mathrm{ROR}(\mathrm{LBP}_{P,R}, i) \mid i = 0, \ldots, P-1 \} \)；对 P = 8 有 36 个唯一的旋转不变模式。<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> LBP 直方图傅里叶特征（LBP-HF）则计算均匀 LBP 直方图的离散傅里叶变换。<sup>[9](https://cmp.felk.cvut.cz/~matas/papers/ahonen-rotinv-scia09.pdf)</sup>

**对比度与噪声变体。** 完备 LBP（CLBP）由郭、张和张于 2010 年在 IEEE TIP 上提出，将局部差值分解为符号与幅值：CLBP_S 与原 LBP 相同，CLBP_M 编码幅值，CLBP_C 编码以图像平均灰度水平阈值化的中心像素；将三者结合可改善旋转不变分类，而传统 LBP 等价于 CLBP_S、后者比 CLBP_M 保留更多局部结构，这解释了为何这个简单算子效果尚可。<sup>[8](https://psycnet.apa.org/doi/10.1109/TIP.2010.2044957)</sup> 局部三值模式（LTP）由谭和特里格斯于 2010 年在 IEEE TIP 上提出，使用用户阈值 t 将差值编码为三个值（−1、0、1），以应对均匀区域中的噪声，代价是不再严格具有灰度不变性。<sup>[10](https://doi.org/10.1109/tip.2010.2042645)</sup><sup> • </sup><sup>[11](http://www.ee.cuhk.edu.hk/~xgwang/papers/liuFWPHeccv16.pdf)</sup> 其他有名称的变体包括：中心对称 LBP，比较中心对称的像素对，<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC3996985/)</sup><sup> • </sup><sup>[12](https://doi.org/10.1016/j.patcog.2008.08.014)</sup> 主导 LBP，保留最频繁的旋转不变模式，<sup>[13](https://doi.org/10.1109/tip.2009.2015682)</sup> 完备局部二值计数，统计 1 的个数而非编码位置，<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC3996985/)</sup><sup> • </sup><sup>[14](https://doi.org/10.1109/tip.2012.2204271)</sup> 嵌入纠错机制的抗噪 LBP，<sup>[15](https://doi.org/10.1109/tip.2013.2268976)</sup> 以及中值鲁棒扩展 LBP（MRELBP）。<sup>[16](https://doi.org/10.1109/tip.2016.2522378)</sup>

**动态纹理。** 赵和皮耶蒂凯宁用体积局部二值模式（VLBP）将 LBP 扩展到视频，结合了运动与外观，并提出 LBP-TOP，为计算简便而在三个正交平面（XY、XT、YT）上拼接 LBP 共现统计量。<sup>[17](https://doi.org/10.1109/tpami.2007.1110)</sup>

**尺度自适应变体。** SARLBP 由乌帕迪亚伊、洛里和德索萨于 2025 年在 IEEE TIP 上提出，为每个径向方向动态确定单一最优尺度，以应对 LBP 对噪声和尺度变化的敏感性以及无法捕捉宏观结构的问题，并在高斯噪声和椒盐噪声下于 ALOT、CUReT、UMD 和 Kylberg 数据库上评估，性能显著优于其他最先进的 LBP 变体。<sup>[18](https://doi.org/10.1109/tip.2025.3529376)</sup>

## 应用

阿霍宁、哈迪德和皮耶蒂凯宁的人脸流程在包含对不同面部表情、光照和受试者衰老的鲁棒性的 FERET 测试中，优于主成分分析、贝叶斯类内/类间分类器和弹性束图匹配。<sup>[3](https://doi.org/10.1109/tpami.2006.244)</sup> 对动态纹理，VLBP 和 LBP-TOP 在 DynTex 和 MIT 数据库上明显优于早期方法，一种基于块的方法在 Cohn-Kanade 面部表情数据库上取得了极好的结果。<sup>[17](https://doi.org/10.1109/tpami.2007.1110)</sup> 一项大规模评估在十三个广泛使用的纹理数据集上考察了四十种纹理特征、32 种 LBP 变体和 8 种深度卷积网络描述子，发现 MRELBP 的总体性能最佳，而深度 CNN 的 Fisher 向量池化对表观变化极大的纹理明显最佳。<sup>[19](https://www.sciencedirect.com/science/article/abs/pii/S003132031630245X)</sup> 在医学影像中，2025 年一项关于结肠癌组织病理学的研究提出了交叉 LBP（CO-LBP），它将周围 8 个像素各与其直径相对的像素比较，并保持 O(n) 效率，报告了 94.57% 的准确率和 90.91% 的卡帕系数。<sup>[20](https://www.nature.com/articles/s41598-025-18145-0)</sup>

## 局限与替代方法

LBP 的核心缺点是不鲁棒：输入图像的微小变化可能导致输出的大变化，尤其是在噪声图像或恒定灰度的平坦区域上，这是由阈值化方案造成的。<sup>[5](https://arxiv.org/pdf/1612.06795)</sup> 按定义 \( \mathrm{LBP}^{riu2} \) 丢弃了对比度——它是空间模式的极好度量，但不是幅值的度量；对比度可由旋转不变的局部方差度量单独捕捉，二者的联合分布对旋转不变纹理分析非常有力。<sup>[2](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)</sup> 与此相对，对由光照变化引起的单调灰度变化的鲁棒性或许是它在现实世界中最重要的性质，而其计算简单性使实时分析成为可能。<sup>[1](http://var.scholarpedia.org/article/Local_Binary_Patterns)</sup>

与替代方法相比，LBP 避免了词袋框架中耗时的词汇表预训练，简单、灵活且易于实现。<sup>[11](http://www.ee.cuhk.edu.hk/~xgwang/papers/liuFWPHeccv16.pdf)</sup> 一项对比研究得出结论：几乎所有 LBP 方法都显著优于其他纹理方法，包括共现特征和 Gabor 特征。<sup>[19](https://www.sciencedirect.com/science/article/abs/pii/S003132031630245X)</sup> 尚未出现 LBP 与 HOG 或 Haar 的已发表正面对比基准。<sup>[4](https://oulurepo.oulu.fi/bitstream/handle/10024/34741/isbn951-42-7076-2.pdf?sequence=1)</sup><sup> • </sup><sup>[21](https://link.springer.com/article/10.1007/s11263-025-02658-2)</sup>

## References

1. [Local Binary Patterns, Scholarpedia (Pietikäinen & Zhao)](http://var.scholarpedia.org/article/Local_Binary_Patterns)
2. [Multiresolution gray-scale and rotation invariant texture classification with local binary patterns (Ojala, Pietikäinen, Mäenpää, IEEE TPAMI 24(7):971–987, 2002)](https://psycnet.apa.org/doi/10.1109/TPAMI.2002.1017623)
3. [T. Ahonen, A. Hadid, M. Pietikainen (2006). Face Description with Local Binary Patterns: Application to Face Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence.](https://doi.org/10.1109/tpami.2006.244)
4. [The local binary pattern approach to texture analysis, extensions and applications (Mäenpää, 2003, PhD thesis, University of Oulu)](https://oulurepo.oulu.fi/bitstream/handle/10024/34741/isbn951-42-7076-2.pdf?sequence=1)
5. [LBP and its variants (draft of book chapter, arXiv:1612.06795, Pietikäinen & Zhao)](https://arxiv.org/pdf/1612.06795)
6. [Completed Local Ternary Pattern for Rotation Invariant Texture Classification (PMC-hosted paper)](https://pmc.ncbi.nlm.nih.gov/articles/PMC3996985/)
7. [Dong-chen He, Li Wang (1990). Texture Unit, Texture Spectrum, And Texture Analysis. IEEE Transactions on Geoscience and Remote Sensing.](https://doi.org/10.1109/tgrs.1990.572934)
8. [A Completed Modeling of Local Binary Pattern Operator for Texture Classification (Guo, Zhang, Zhang, IEEE TIP 19(6):1657–1663, 2010)](https://psycnet.apa.org/doi/10.1109/TIP.2010.2044957)
9. [Rotation Invariant Image Description with Local Binary Pattern Histogram Fourier Features (Ahonen, Matas, He, Pietikäinen, SCIA 2009)](https://cmp.felk.cvut.cz/~matas/papers/ahonen-rotinv-scia09.pdf)
10. [Xiaoyang Tan, Bill Triggs (2010). Enhanced Local Texture Feature Sets for Face Recognition Under Difficult Lighting Conditions. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2010.2042645)
11. [Evaluation of LBP and Deep Texture Descriptors with a New Robustness Benchmark (ECCV 2016)](http://www.ee.cuhk.edu.hk/~xgwang/papers/liuFWPHeccv16.pdf)
12. [Marko Heikkilä, Matti Pietikäinen, Cordelia Schmid (2008). Description of interest regions with local binary patterns. Pattern Recognition.](https://doi.org/10.1016/j.patcog.2008.08.014)
13. [S. Liao, M.W.K. Law, A.C.S. Chung (2009). Dominant Local Binary Patterns for Texture Classification. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2009.2015682)
14. [Yang Zhao, De-Shuang Huang, Wei Jia (2012). Completed Local Binary Count for Rotation Invariant Texture Classification. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2012.2204271)
15. [Jianfeng Ren, Xudong Jiang, Junsong Yuan (2013). Noise-Resistant Local Binary Pattern With an Embedded Error-Correction Mechanism. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2013.2268976)
16. [Li Liu and colleagues (2016). Median Robust Extended Local Binary Pattern for Texture Classification. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2016.2522378)
17. [Guoying Zhao, Matti Pietikainen (2007). Dynamic Texture Recognition Using Local Binary Patterns with an Application to Facial Expressions. IEEE Transactions on Pattern Analysis and Machine Intelligence.](https://doi.org/10.1109/tpami.2007.1110)
18. [Parth C. Upadhyay, John A. Lory, Guilherme N. DeSouza (2025). SARLBP: Scale Adaptive Robust Local Binary Patterns for Texture Representation. IEEE Transactions on Image Processing.](https://doi.org/10.1109/tip.2025.3529376)
19. [Local binary features for texture classification: Taxonomy and experimental study (Liu et al., Pattern Recognition 2016)](https://www.sciencedirect.com/science/article/abs/pii/S003132031630245X)
20. [An effective study on the diagnosis of colon cancer with the developed local binary pattern method (Scientific Reports, 2025)](https://www.nature.com/articles/s41598-025-18145-0)
21. [A Lightweight Hybrid Gabor Deep Learning Approach and its Application to Medical Image Classification (International Journal of Computer Vision, 2025)](https://link.springer.com/article/10.1007/s11263-025-02658-2)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Language and vision AI › Computer vision › Vision methods and geometry › Feature detection and description

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/local-binary-patterns

English original: https://www.edgepedia.org/local-binary-patterns
