Robust global motion estimation for video security based on improved k-means clustering