Addition on functions in tools.cpp for face detection.