Learning and Probabilistic Methods for Visual Servoing and Tracking: An Optimization Approach