A non-transitory computer-readable storage medium storing a program for causing a computer to execute a control method for controlling an image processing apparatus that performs learning of an image processing model for combining a plurality of images, the control method comprising:
- obtaining a first image group, which includes a plurality of frame images including a basis frame image that becomes a basis for combining the plurality of images;
- obtaining a second image;
- generating a third image group, which includes superimposed images obtained by superimposing the second image on each of the frame images;
- obtaining, as a training image, one of the superimposed images corresponding to the basis frame image;
- generating an input image group by performing an image processing with respect to the frame images and the second image, or the superimposed images;
- and
- performing the learning of the image processing model based on an error between (1) an output image outputted from the image processing model by inputting the input image group into the image processing model, and (2) the training image,
- wherein in the generating of the third image group, superimposing positions of the second image on each of the frame images are made different for each of the frame images, and
- wherein, as a preprocessing when the image processing model is used, an aligning processing is performed in which remaining frame images excluding the basis frame image are shifted in accordance with the basis frame image so that a position of a main subject is aligned between the frame images.