Skip to content

Instantly share code, notes, and snippets.

@seaslee
Created November 22, 2012 12:02
Show Gist options
  • Select an option

  • Save seaslee/4130800 to your computer and use it in GitHub Desktop.

Select an option

Save seaslee/4130800 to your computer and use it in GitHub Desktop.
computer the number of 1->0 and 0->1 transitions in binary string
%use in computer the lbp descriptor
j = bitset(bitshift(i,1,samples),1,bitget(i,samples)) %rotate left; cyclic shift
numt = sum(bitget(bitxor(i,j),1:samples)) %number of 1->0 and
%0->1 transitions
%in binary string
%x is equal to the
%number of 1-bits in
%XOR(x,Rotate left(x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment