how to implement LTP Feature extract

7 次查看(过去 30 天)
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