1. A method of controlling an imaging apparatus that images an imaging target region by dividing the imaging target region into a plurality of divided regions and generates a merged image of a larger region than the divided regions by merging the obtained images in the respective divided regions, the method comprising the steps of: acquiring a first image and a second image in each of the plurality of divided regions; generating a correction parameter from a relative position deviation amount between the second images of adjacent divided regions using the second images; and generating the merged image by correcting the first images of the adjacent divided regions using the correction parameter and merging the corrected first images, wherein the second image is an image in which a depth of field or a focusing position, or both, are different from those of the first image.