1. An image processing apparatus comprising: a gain calculation unit that calculates a plurality of first gains that respectively correspond to a plurality of predetermined edges based on a target pixel value and values of pixels adjacent to the target pixel; a blend ratio calculation unit that calculates a plurality of characteristic amounts that represent an accuracy of detecting the plurality of edges based on the target pixel value and the values of adjacent pixels and calculates a plurality of weights that respectively correspond to the plurality of first gains based on the plurality of characteristic amounts; a gain adjustment unit that calculates a second gain based on the plurality of first gains and the plurality of weights; and an output image generation unit that applies the second gain to the target pixel value to generate output image data.