资源简介
lbp MATLAB代码,包括lbp,getmapping两个函数,另外有自己修改的图像化界面
代码片段和文件信息
%C computes the VAR descriptor.
% J = CONT(IRNLIMSMODE) returns either a rotation invariant local
% variance (VAR) image or a VAR histogram of the image I. The VAR values
% are determined for all pixels having neighborhood defined by the input
% arguments. The VAR operator calculates variance on a circumference of
% R radius circle. The circumference is discretized into N equally spaced
% sample points. Function returns descriptor values in a continuous form or
% in a discrete from if the quantization limits are defined in the argument
% LIMS.
%
% Examples
% --------
%
% im = imread(‘rice.png‘);
% c = cont(im416);
% d = cont(im4161:500:2000);
%
% figure
% subplot(121)imshow(c[]) title(‘VAR image‘)
% subplot(122)imshow(d[]) title(‘Quantized VAR image‘)
function result = cont(varargin)
% Version: 0.1.0
% 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;
lims=0;
mode=‘i‘;
end
if (nargin > 2) && (length(varargin{2}) == 1)
radius=varargin{2};
neighbors=varargin{3};
spoints=zeros(neighbors2);
lims=0;
mode=‘i‘;
% 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 && ~ischar(varargin{4}))
lims=varargin{4};
end
if(nargin >= 4 && ischar(varargin{4}))
mode=varargin{4};
end
if(nargin == 5)
mode=varargin{5};
end
end
if (nargin == 2) && ischar(varargin{2})
mode=varargin{2};
spoints=[-1 -1; -1 0; -1 1; 0 -1; -0 1; 1 -1; 1 0; 1 1];
neighbors=8;
lims=0;
end
% Determine the dimensions of the input image.
[ysize xsize] = size(image);
miny=min(spoints(:1));
maxy=max(spoints(:1));
minx=min(spoints(:2));
maxx=max(spoints(:2));
% Block size each LBP code is computed within a block of size bsizey*bsizex
bsizey=ceil(max(maxy0))-floor(min(miny0))+1;
bsizex=ceil(max(maxx0))-floor(min(minx0))+1;
% Coordinates of origin (00) in the block
origy=1-floor(min(miny0));
origx=1-floor(min(minx0));
% Minimum allowed size for the input image depends
% on the radius of the used LBP operator.
if(xsize < bsizex || ysize < bsizey)
error(‘Too small input image. Should be at least (2*radius+1) x (2*radius+1)‘);
end
% Calculate dx and dy;
dx = xsize - bsizex;
dy = ysize - bsizey;
%Compute the local contrast
for i = 1:neighbors
y = spoints(i1)+origy;
x = spoints(i2)+origx;
% Calculate floors and ceils for the x and y.
fy = floor(y); cy = ceil(y);
fx = floor(x); cx = ceil(x);
% Use double type images
ty = y - fy;
tx = x - fx;
% Calculate the interpolation weigh
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4380 2015-06-01 16:06 lbp\cont.m
文件 5406 2015-06-01 16:06 lbp\getmapping.m
文件 6514 2015-06-01 16:59 lbp\lbp.m
文件 977 2015-06-04 08:45 lbp\Mycont.m
文件 738 2015-06-05 20:14 lbp\Mygetmapping.m
文件 1583 2015-06-05 20:01 lbp\Mylbp.m
目录 0 2015-09-22 21:40 lbp
----------- --------- ---------- ----- ----
19598 7
相关资源
- 光谱拟合matlab代码
- k-中心点算法Matlab代码实现
- KCF加尺度matlab代码
- 基于DWT和SVD结合的水印嵌入MATLAB代码
- 层次聚类matlab代码
- 人工蜂群算法 matlab代码
- 三种传统去噪方法MATLAB代码
- LBP特征提取 程序 代码 MATLAB版
- 局部保持投影原文及matlab代码
- 无约束最优化的matlab代码
- 均值滤波MATLAB代码实现
- 自适应滤波matlab代码
- 图像lbp特征提取的MATLAB实现源码
- Gauss消去法:顺序高斯消去 matlab代码
- 常见纹理特征提取的MATLAB代码
- 经验模态分解Matlab代码
- sift配准 matlab代码
- adaboost算法Matlab代码及训练数据
- MIMO-OFDM不同信道估计的对比matlab代码
- SVM算法仿真matlab代码
- 遗传算法-matlab代码
- 用衍射追迹实现衍射受限透镜成像。
- DNA加法MATLAB代码
- 多层感知器解决异或问题MATLAB代码
- HOG特征matlab代码实现
- 信噪比matlab代码
- 基于多尺度块的LBP(MB-LBP)代码(m
- 二维码识别 matlab代码 内
- 不变矩Matlab代码
- 随机波束成型rbfmatlab代码
评论
共有 条评论