1. A method comprising: determining, by a computing device, a first local binary pattern for a first image in a video; determining, by the computing device, a second local binary pattern for a second image in the video; determining, by the computing device, an optical flow between the first image and the second image based on a distance between the first local binary pattern and the second local binary pattern, wherein the distance measured between the first local binary pattern and the second local binary pattern is between binary numbers representing the first local binary pattern and the second local binary pattern, and wherein the distance between the first local binary pattern and the second local binary pattern is a summation of square Euclidean distances; and outputting, by the computing device, the optical flow for use in aligning the first image to the second image.