/usr/share/octave/site/m/vlfeat/toolbox/misc/vl_lbpfliplr.m is in octave-vlfeat 0.9.17+dfsg0-6+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | function f = vl_lbpfliplr(f)
% VL_LBPFLIPLR Flip LBP features left-right
% F = VL_LBPFLIPLR(F) flips the LBP features F from left to
% right.
%
% Example::
% The following instructions return results almost identical
% assuming that the width of I is exactly divisible by the cell
% size:
% F = VL_LBP(FLIPLR(I), 8)
% F_ = VL_LBPFLIPLR(VL_LBP(I), 8)
%
% See also: VL_LBP(), VL_HELP().
% construct permutation
perm = zeros(1,58) ;
perm(58) = 58 ;
perm(57) = 57 ;
% i is the start of the sequence of 1 and j its length
% recall that i=0 -> E, i=1 -> SE, etc
% the length j remains the same.
% flipping the start gives the flipped end, and subtracting the length
% gives the flipped start
for i = 0:7
for j = 1:7
i_ = mod(4 - i - j + 1, 8) ;
j_ = j ;
perm(i * 7 + j) = i_ * 7 + j_ ;
end
end
f = f(:, end:-1:1, perm) ;
|