The recent focus on performing visual navigation and place recognition in changing environments has resulted in a large number of heterogeneous techniques each utilizing their own learnt or hand crafted visual features. This paper presents a generally applicable method for learning the appropriate distance metric by which to compare feature responses from any of these techniques in order to perform place recognition under changing environmental conditions. We implement an approach which learns to cluster images captured at spatially proximal locations under different conditions, separated from frames captured at different places. The formulation is a convex optimization, guaranteeing the existence of a global solution. We evaluate the general applicability of our method on two benchmark change datasets using three typical image pre-processing and feature types: GIST, Principal Component Analysis and learnt Convolutional Neural Network features. The results demonstrate that the distance metric learning approach uniformly improves single-image-based visual place recognition performance across all feature types. Furthermore, we demonstrate that this performance improvement is maintained when the sequence-based algorithm SeqSLAM is applied to the single-image place recognition results, leading to state-of-the-art performance.