Fixed generateFeatures in HAAR