资源简介
LBP算法,返回直方图和特征点图像,支持Uniform Pattern
代码片段和文件信息
%LBP returns the local binary pattern image or LBP histogram of an image.
% J = LBP(IRNMAPPINGMODE) returns either a local binary pattern
% coded image or the local binary pattern histogram of an intensity
% image I. The LBP codes are computed using N sampling points on a
% circle of radius R and using mapping table defined by MAPPING.
% See the getmapping function for different mappings and use 0 for
% no mapping. Possible values for MODE are
% ‘h‘ or ‘hist‘ to get a histogram of LBP codes
% ‘nh‘ to get a normalized histogram
% Otherwise an LBP code image is returned.
%
% J = LBP(I) returns the original (basic) LBP histogram of image I
%
% J = LBP(ISPMAPPINGMODE) computes the LBP codes using n sampling
% points defined in (n * 2) matrix SP. The sampling points should be
% defined around the origin (coordinates (00)).
%
% Examples
% --------
% I=imread(‘rice.png‘);
% mapping=getmapping(8‘u2‘);
% H1=LBP(I18mapping‘h‘); %LBP histogram in (81) neighborhood
% %using uniform patterns
% subplot(211)stem(H1);
%
% H2=LBP(I);
% subplot(212)stem(H2);
%
% SP=[-1 -1; -1 0; -1 1; 0 -1; -0 1; 1 -1; 1 0; 1 1];
% I2=LBP(ISP0‘i‘); %LBP code image using sampling points in SP
% %and no mapping. Now H2 is equal to histogram
% %of I2.
function result = lbp(varargin) % imageradiusneighborsmappingmode)
% Version 0.3.2
% Authors: Marko Heikkil?and Timo Ahonen
% Changelog
% Version 0.3.2: A bug fix to enable using mappings together with a
% predefined spoints array
% Version 0.3.1: Changed MAPPING input to be a struct containing the mapping
% table and the number of bins to make the function run faster with high number
% of sampling points. Lauge Sorensen is acknowledged for spotting this problem.
% Check number of input arguments.
narginchk(15);
image=varargin{1};
d_image=double(image);
if nargin==1
spoints=[-1 -1; -1 0; -1 1; 0 -1; -0 1; 1 -1; 1 0; 1 1];
neighbors=8;
mapping=0;
mode=‘h‘;
end
if (nargin == 2) && (length(varargin{2}) == 1)
error(‘Input arguments‘);
end
if (nargin > 2) && (length(varargin{2}) == 1)
radius=varargin{2};
neighbors=varargin{3};
spoints=zeros(neighbors2);
% Angle step.
a = 2*pi/neighbors;
for i = 1:neighbors
spoints(i1) = -radius*sin((i-1)*a);
spoints(i2) = radius*cos((i-1)*a);
end
if(nargin >= 4)
mapping=varargin{4};
if(isstruct(mapping) && mapping.samples ~= neighbors)
error(‘Incompatible mapping‘);
end
else
mapping=0;
end
if(nargin >= 5)
mode=varargin{5};
else
mode=‘h‘;
end
end
if (nargin > 1) && (length(varargin{2}) > 1)
spoints=varargin{2};
neighbors=size(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2093 2014-10-10 09:21 lbptest.m
文件 6057 2014-10-09 13:38 lbp.m
- 上一篇:计算ADC的动态参数
- 下一篇:神金网络,对于temprtrom算法
相关资源
- 非常经典的MATLAB人脸识别程序可显示
- GMM模型,用MATlab编写的。可以用来训
- MATLAB基于肤色模型和模板匹配的人脸
- 肤色模型人脸识别matlab代码
- lab的matlab实现
- matlab基于笔记本电脑的摄像头的人脸
- 视频中人脸识别
- 根据亮度分布检测火焰
- 森林火灾视频识别提取
- 基于Matlab神经网络的图像识别
- matlab编写的有关图像识别分类方法的
- LBP图像特征提取matlab程序
- 二维对称图像矩阵ICA人脸识别MATLAB源
- MATLAB人脸识别PCALDAKPCABP,可视化界面
- MATLAB人脸识别程序加论文
- 人脸识别门禁系统.zip
- PCA和LDA人脸识别matlab代码最紧邻分类
- 基于pca实现人脸识别matlab代码
- lbp特征提取算法
- 果蔬图像识别
- LBP纹理特征官方MATLAB代码和测试用例
- 基于MATLAB的LBP图片特征提取算法,人
- Deep Semi-NMF源代码
- matlab图像识别程序
- matlab圈出照片中人脸和五官的位置
- MATLAB实现人脸识别光照归一化算法
- 基于SVM(支持向量机) 的人脸识别
- MATLAB图像识别80192
- 人脸识别MATLAB程序
- 基于肤色的RGB多人脸检测
评论
共有 条评论