Fix direction detection for haar cascade matcher.