calculates LBP