A blind retrospective MRI motion estimation and compensation algorithm is designed for arbitrary sampling trajectories. Using the idea of natural images being sparsely representable, the algorithm is based on motion estimation between a motion corrupted image and it’s sparse representative. Therefore, rigid motion models are designed and used in gradient descent methods for image quality optimization. As the motion estimation and compensation work on arbitrary real valued sampling coordinates, the algorithm is capable for all trajectories. Image reconstruction is performed by computationally efficient gridding. The exact motion estimation results are shown for PROPELLER and radial trajectory simulation.