Improved raster image distance measurement.