Real-time face detection and recognition system in complex backgrounds