-
大小: 2KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-04-17
- 语言: Matlab
- 标签: lbp变换 MATLA LBP getmapping
资源简介
LBP特征提取的MATLAB实现,其getmapping.m定义了lbp三种不同的模式,而lbp.m则是lbp的实现,当然它只是简单的整幅图像的lbp变换(没有分区域),其中很巧妙地运用了整体移动的方法计算lbp值。
代码片段和文件信息
%GETMAPPING returns a structure containing a mapping table for LBP codes.
% MAPPING = GETMAPPING(SAMPLESMAPPINGTYPE) returns a
% structure containing a mapping table for
% LBP codes in a neighbourhood of SAMPLES sampling
% points. Possible values for MAPPINGTYPE are
% ‘u2‘ for uniform LBP
% ‘ri‘ for rotation-invariant LBP
% ‘riu2‘ for uniform rotation-invariant LBP.
%
% Example:
% I=imread(‘rice.tif‘);
% MAPPING=getmapping(16‘riu2‘);
% LBPHIST=lbp(I216MAPPING‘hist‘);
% Now LBPHIST contains a rotation-invariant uniform LBP
% histogram in a (162) neighbourhood.
%
function mapping = getmapping(samplesmappingtype)
% Version 0.1.1
% Authors: Marko Heikkil?and Timo Ahonen
% Changelog
% 0.1.1 Changed output to be a structure
% Fixed a bug causing out of memory errors when generating rotation
% invariant mappings with high number of sampling points.
% Lauge Sorensen is acknowledged for spotting this problem.
table = 0:2^samples-1;
newMax = 0; %number of patterns in the resulting LBP code
index = 0;
if strcmp(mappingtype‘u2‘) %Uniform 2
newMax = samples*(samples-1) + 3;
for i = 0:2^samples-1
j = bitset(bitshift(i1samples)1bitget(isamples)); %rotate left
numt = sum(bitget(bitxor(ij)1:samples)); %number of 1->0 and
%0->1 transitions
%in binary string
%x is equal to the
%number of 1-bits in
%XOR(xRotate left(x))
if numt <= 2
table(i+1) = index;
index = index + 1;
else
table(i+1) = newMax - 1;
end
end
end
if strcmp(mappingtype‘ri‘) %Rotation invariant
tmpMap = zeros(2^samples1) - 1;
for i = 0:2^samples-1
rm = i;
r = i;
for j = 1:samples-1
r = bitset(bitshift(r1samples)1bitget(rsamples)); %rotate
%left
if r < rm
rm = r;
end
end
if tmpMap(rm+1) < 0
tmpMap(rm+1) = newMax;
newMax = newMax + 1;
end
table(i+1) = tmpMap(rm+1);
end
end
if strcmp(mappingtype‘riu2‘) %Uniform & Rotation invariant
newMax = samples + 2;
for i = 0:2^samples - 1
j = bitset(bitshift(i1samples)1bitget(isamples)); %rotate left
numt = sum(bitget(bitxor(ij)1:samples));
if numt <= 2
table(i+1) = sum(bitget(i1:samples));
else
table(i+1) = samples+1;
end
end
end
mapping.table=table;
mapping.samples=samples;
mapping.num=newMax;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2749 2014-04-03 20:57 getmapping.m
文件 1015 2014-04-01 09:35 LBP.m
- 上一篇:数字图像滤波程序
- 下一篇:matlab编写的蛙跳聚类算法(SFLA)
相关资源
- matlab编写的蛙跳聚类算法(SFLA)
- 数字图像滤波程序
- GCC时延估计
- 基于kaiser窗的双谱线插值FFT谐波分析
- 加窗插值FFT算法的matlab 512点仿真
- GM_PHD_Filter_v110
- PUMA560机器人的仿真界面
- pls 可以用于计算排列熵
- 图像质量评价(image quality)代码
- 用α-β滤波器结合卡尔曼滤波器对相位
- matlab实现遗传算法 (Matlab Genetic Al
- 切比雪夫(Chebyshev)多项式展开式的
- SIR病毒传播模型的matlab程序
- STATCOM无功补偿不平衡负载,阶梯调制
-
simuli
nk_sfcl-master -
matlab/simuli
nk仿真永磁无刷直流电机 - matlab 开发光伏阵列通用仿真模型
- 激光雷达点云滤波的topscan算法实现
- 比较分析协作通信三个节点时系统 (
- 基于HOUGH变换的车道线检测和识别的程
- matlab画庞加莱(poincare)映射
- 高斯过程回归算法工具箱
- 增广拉格朗日乘子法matlab源码
- 外国人开发的地磁数据处理全套程序
- 新的宽带DOA估计方法TOFS (wideband D
- 求解电力系统经济调度等优化问题的
- matlab频率估计
- 计算脉搏信号的方法 PPG (Blood Puls
- 石墨烯的电导率计算 (Complex conduc
- 提取地震子波的完整代码(Wave Extra
评论
共有 条评论