ViolaJones: auxiliary functions (should have been committed before)