资源简介
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人脸识别和特征提取
- matlab人脸识别217995
- PCA人脸识别Eigenface特征脸Matlab
- 基于KL变换的人脸识别 matlab
- LBP四种特征提取算法
- 基于Matlab行人检测系统
- MATLAB 图像处理识别程序
- Face Recognition with KNN in MATLAB(12017108
- 人脸识别yale数据.mat格式
- 基于PCA和SVM的人脸识别.zip
- 基于SVD分解和最近邻算法的高维人脸
- MATLAB人脸识别考勤系统摄像头,记录
- PCA算法实现人脸识别基于matlab GUI界面
- 基于matlab的人脸识别271850
- 2D2DPCA人脸识别matlab代码/ORL库
- PCA人脸识别MATLAB代码/ORL库
- CNN卷积神经网络图像识别matlab
- matlab结课大作业人脸识别是否戴口罩
- PCA人脸识别论文附MATLAB程序
- 应用matlab计算人脸识别率
- 个人收集的人脸识别经典算法源码
- 基于K-L变换的人脸识别系统
- 基于matlab的人脸识别源代码235297
- 基于PCA使用Yale人脸数据库的人脸识别
- 人脸识别系统
- 模式识别课程作业 基于svm的人脸识别
- SRC人脸识别程序MATLAB
- 1维的简单LDA和2维LDA人脸识别的matla
- 基于MATLAB的人脸识别
- 人脸识别及匹配的matlab实现
评论
共有 条评论