Curvilinear Distance Metric Learning