how to implement LTP Feature extract

6 views (last 30 days)
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
}

Accepted Answer

Image Analyst
Image Analyst on 18 Oct 2021

More Answers (0)

Categories

Find more on Computer Vision Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!