Cost matrix as an image