1. A method for determining a motion between a first coordinate system and and a second coordinate system, comprising steps of: extracting a first set of keypoints from a first image acquired of a scene by a camera arranged on a moving object; extracting a second set of keypoints from a second image acquired of the scene by the camera; determining first and second poses from the first and second sets of keypoints, respectively; determining a score for each possible motion between the first and the second poses using a scoring function and a pose-transition graph constructed from training data where each node in the post-transition graph represents a relative pose and each edge represents a motion between two consecutive relative poses; and selecting, based on the score, a best motion as the motion between the first and second coordinate systems, wherein the steps are performed in a processor.