added the sqrt because the distance transform is squared