Robust global motion compensation and its applications