Filter löschen
Filter löschen

how to implement LTP Feature extract

9 Ansichten (letzte 30 Tage)
jacky huynh
jacky huynh am 17 Okt. 2021
Bearbeitet: jacky huynh am 19 Okt. 2021
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
}

Akzeptierte Antwort

Image Analyst
Image Analyst am 18 Okt. 2021

Weitere Antworten (0)

Kategorien

Mehr zu Computer Vision Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by