1. An image processing apparatus comprising: a circuit that performs: calculating at least one of a tangent-line direction and a normal-line direction of an edge around a target pixel in an input image by using a direction and a magnitude of a gradient of pixel values of pixels neighboring the target pixel in the input image; converting coordinates of pixels neighboring the target pixel into rotated coordinates rotated to rotated coordinate axes, the rotated coordinate axes having a short axis and a long axis, wherein the short axis traverses the normal-line direction and the long axis traverses the tangent-line direction; and fitting by obtaining a curved surface by using a curved surface model described by a position of pixels on the rotated coordinate axes, the curved surface approximating a distribution of local pixel values neighboring the target pixel, and by calculating a corrected pixel value of the target pixel from an approximated pixel value of the target pixel on the curved surface and based on the position of pixels on the rotated coordinate axes.