Hand gesture recognition and hand tracking for medical applications