1. A method comprising: capturing, by a mobile device, a first image of a series of images; obtaining, by the mobile device, based on the first image, a reference template corresponding to a class of targets, the reference template including data representing a first target image, the first target image corresponding to a target to be tracked in the series of images, the target being part of the class of targets; identifying, by the mobile device and based on the data representing the first target image of the reference template, a second target image corresponding to the target from the first image or from a second image of the series of images captured by the mobile device; determining, by the mobile device, a difference between a first viewing angle for the first target image in the reference template and a second viewing angle for the second target image in the first image or in the second image; rectifying, by the mobile device, at least a portion of the first image or at least a portion of the second image based on the difference between the first viewing angle and the second viewing angle to generate a rectified image; generating, by the mobile device, a tracking template based on the rectified image; capturing, by the mobile device, a third image of the series of images; and locating, by the mobile device, the target within the third image using the tracking template.