1. An image processing apparatus configured to: calculate a structure index that is an index of magnitude of variation of pixel values in a predetermined region around a target pixel of an input image, with respect to each target pixel; extract a high frequency structure index that is a high frequency component of the structure index; calculate a smoothed structure index obtained by smoothing the structure indices, with respect to each target pixel; calculate a synthesis index obtained by synthesizing the smoothed structure index and the high frequency structure index, as a flatness index of the target pixel; and perform a noise reduction process of the target pixel in accordance with the flatness index.