资源简介
图像lbp特征,一个简单的lbp特征提取算法,matlab编写。
代码片段和文件信息
%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.3
% 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.
error(nargchk(15nargin));
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=siz
相关资源
- LBP四种特征提取算法
- 表情识别 源码Matlab LBP+LPQ SVM PCA
- CLBP人脸识别程序及运行结果
- matlab常用纹理特征提取方法GLCM,GLD
- matlab开发-MeshLBP
- 改变旧MATLAB函数的CLBP
- lbp MATLAB代码
- LBP特征提取 程序 代码 MATLAB版
- 图像lbp特征提取的MATLAB实现源码
- 基于多尺度块的LBP(MB-LBP)代码(m
- HOG+LBP的行人检测
- lbp matlab程序中的getmapping文件
- GaborGMRFLBP纹理特征提取方法_MATLAB
- 结合查找法做的旋转不变性LBP特征提
- 局部二值模式(Local Binary Patterns)图
- lab的matlab实现
- LBP图像特征提取matlab程序
- LBP纹理特征官方MATLAB代码和测试用例
- 基于MATLAB的LBP图片特征提取算法,人
- 支持lbp直方图的图像相似度计算
- LBP算法的Matlab代码
- 局部二值模式进行编码的人脸识别
- 多尺度LBP
- LBP(局部二值模式)特征提取
- LBP方法
- LBP特征提取的MATLAB实现
- LBP-DBN人脸识别matlab代码
- matlab实现HOG+LBP+HIKSVM行人检测算法
- 三种LBP模式的子程序
- MATLAB实现LTP和LBP算法
评论
共有 条评论