A non-transitory computer readable medium for implementing a method for determining movement of a vehicle, the non-transitory computer readable medium comprising a processor-readable medium on which program instructions are embodied, wherein the program instructions are operable, when executed by at least one processor in a system, to cause the system to:
- receive a first image corresponding to a first time period;
- receive a second image corresponding to a second time period, wherein the first image and the second image are taken from a camera from a frame of reference of the vehicle;
- detect, via an optical flow algorithm implemented over the entirety of the first and second images, a difference between one or more portions of the first image and a respective one or more portions of the second image, wherein the one or more image portions correspond to an object moving independent of the vehicle;
- remove the one or more image portions of the first and second images based on the difference;
- and
- determine movement of the vehicle based on the remaining image portions via a machine learning algorithm.