I scanned a photo onto my computer, but there are some slight warping that formed when scanned the image. The photo is not perfectly square, and the photo is slightly curved. Below is a much exaggerated example, where the red box represents my photo, and the blue box represents a perfect rectangle, anchored at the top left and bottom right of the image.
What transformations / techniques can I use to correct this?