1. An image processing apparatus for correcting image quality degradation, comprising a processor configured to function as: a generating unit that generates a parameter defining a deformation process for correcting the image quality degradation; a determining unit that determines whether a reference area, which is an image area required by the deformation process, fits within a captured area that contains the image and is larger than the image; an adjusting unit that adjusts the parameter such that the reference area fits within the captured area, in a case where it is determined by the determining unit that the reference area does not fit within the captured area; and a deforming unit that applies the deformation process to the image in accordance with the parameter, wherein: the deformation process is a combination of a plurality of geometric deformation processes, the generating unit generates a plurality of parameters defining the plurality of geometric deformation processes, the determining unit performs the determination based on a sum total of displacement amounts, in each of the plurality of geometric deformation processes, before and after the geometric deformation process is applied, and a positional relationship of the captured area and the image, and the adjusting unit adjusts the plurality of parameters that are generated by the generating unit, by setting, for each of the plurality of geometric deformation processes, an upper limit for a displacement amount before and after the geometric deformation process is applied, such that the sum total of displacement amounts is a value in a range in which the reference area fits within the captured area.