91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-08
  • 語言: Matlab
  • 標(biāo)簽: lbp??getmapping.m??

資源簡介

lbp matlab程序中的getmapping文件

資源截圖

代碼片段和文件信息

%GETMAPPING?returns?a?mapping?table?for?LBP?codes.
%??MAPPING?=?GETMAPPING(SAMPLESMAPPINGTYPE)?returns?a?mapping?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
%?Authors:?Marko?Heikkil?and?Timo?Ahonen

??
mapping?=?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?
????????????

評論

共有 條評論