필터 지우기
필터 지우기

how to implement LTP Feature extract

조회 수: 9 (최근 30일)
jacky huynh
jacky huynh 2021년 10월 17일
편집: jacky huynh 2021년 10월 19일
Hi everyone,
i have see code in matlab " extractLBPFeatures" , code as bellow, if LTP how to change (LTP is are an extension ), pls help me and explain how to thanks everybody
{
% -----------------------------------------------------------------
function lbp = computeMultibyteLBP(I, x, y, numNeighbors, interpolation, numBytes, offsets, weights)
coder.inline('always');
lbp = zeros(1,numBytes,'uint8');
center = I(y,x);
p2 = coder.internal.indexInt(numNeighbors);
p1 = coder.internal.indexInt((8*numBytes)-7+1);
for n = coder.unroll(1:numBytes) % MSB [xxxx] LSB
for p = p2:-1:p1 % reverse order b/c of bitshift to left
if strcmpi(interpolation, 'linear')
neighbor = vision.internal.LBPImpl.bilinearInterp(I, x, y, p, offsets, weights);
else
neighbor = vision.internal.LBPImpl.nearestInterp(I, x, y, p, offsets);
end
lbp(n) = bitor(lbp(n), uint8(neighbor >= center));
lbp(n) = bitshift(uint8(lbp(n)),uint8(1));
end
% bit p1-1
if strcmpi(interpolation, 'linear')
neighbor = vision.internal.LBPImpl.bilinearInterp(I, x, y, p1-1, offsets, weights);
else
neighbor = vision.internal.LBPImpl.nearestInterp(I, x, y, p1-1, offsets);
end
lbp(n) = bitor(lbp(n), uint8(neighbor >= center));
% next byte
p2 = p1-2;
p1 = p2-7+1;
end
end
}

채택된 답변

Image Analyst
Image Analyst 2021년 10월 18일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by