Recognizing facial expressions under rigid and non-rigid facial motions