We consider the problem of head tracking and pose estimation in realtime from low resolution images. Tracking and pose recognition are treated as two coupled problems in a probabilistic framework: a template-based algorithm with multiple pose-specific reference models is used to determine jointly the position and the scale of the target and its head pose. Target representation is based on Histograms of Oriented Gradients (HOG): descriptors which are at the same time robust under varying illumination, fast to compute and discriminative with respect to pose. To improve pose recognition accuracy, we define the likelihood as a parameterized function and we propose to learn it from training data with a new discriminative approach based on the large-margin paradigm. The performance of the learning algorithm and the tracking are evaluated on public images and video databases.