function LBPhistogram = FnLBP(img, R, P, numRowPatch, numColPatch)
LBPimg = zeros(size(img, 1)-2*R, size(img,2)-2*R);
% The Angle of Neighbour Sampling Points
theta = ((P:-1:1)*(2*pi/P))+(pi/2);
% The Amount of Displacements Required to Find the Neighbour Sampling Points
dxy = round([-R*sin(theta); R*cos(theta)]);
o = img(R+1:size(img,1)-R, R+1:size(img,2)-R);
for i = 1 : P
%
compMat = img(R+dxy(1,i)+1:size(img,1)-R+dxy(1,i), R+dxy(2,i)+1:size(img,2)-R+dxy(2,i)) - o;
LBPimg = (compMat >= 0) * (2^(P-i)) + LBPimg;
end
%%
rowPatchSize = ceil(size(img,1)/numRowPatch);
colPatchSize = ceil(size(img,2)/numColPatch);
LBPimg = padarray(LBPimg,[R+rowPatchSize*numRowPatch-size(img,1) R+(colPatchSize*numColPatch-size(img,2))/2], 256);
LBPimgCells = mat2cell(LBPimg, rowPatchSize * ones(1, numRowPatch), colPatchSize * ones(1, numColPatch));
bins = [0,1,2,3,4,6,7,8,12,14,15,16,24,28,30,31,32,48,56,60,62,63,64,96,112,120,124,126,127,128,129,131,135,143,159,191,192,193,195,199,207,223,224,225,227,231,239,240,241,243,247,248,249,251,252,253,254,255,256];
LBPhistogram = cellfun(@(x) imhistogram(x, bins), LBPimgCells, 'UniformOutput',0);
LBPfeats = cell2mat(cellfun(@(x) x(1:58), LBPhistogram', 'UniformOutput',0));
LBPhistogram = LBPfeats(:)';
没有合适的资源?快使用搜索试试~ 我知道了~
LBP.rar_The Method Method_lbp
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共4个文件
m:3个
tiff:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 101 浏览量
2022-09-21
21:25:13
上传
评论
收藏 46KB RAR 举报
温馨提示
The LBP (Local Binary Pattern) method code.
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TIFF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 4 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/fca2fc36c4174e7caf12f1c9ba2c9265_weixin_42657024.jpg!1)
邓凌佳
- 粉丝: 67
- 资源: 1万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)