Improve some class like CMetric and DistanceTransform