Updated LBP and PCA functions (in accordance with changes in Bob)