Working version of interpolation based on the centroid stuff, it does not
work on some images, do not know why yet