9

This sample image:

img

is warped on the left side.

I don't want to dewarp, but just to remove shadow gradient (caused by book's spine). I guess gradient can be calculated from upper part of the image and that information can be used for reconstruction.

First I thought to apply some layer transformation in Photoshop. I took upper part with clear gradient and scaled it vertically to cover whole image in new layer. Then I did layer difference:

img

but while upper part is acceptably reconstructed, colored part is not.

Does anyone have an idea how to approach this in Photoshop, or Python/SciPy/OpenCV, or Matlab?

Royi
  • 19,608
  • 4
  • 197
  • 238
zetah
  • 583
  • 3
  • 12

1 Answers1

8

The simplest approach would be to divide the gradient rather than subtract it. Here's what the result looks like:

Gradient Removal

datageist
  • 4,897
  • 4
  • 32
  • 53