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; performing image alignment between adjacent divided regions using the second images; and generating the merged image by merging the first images of the adjacent divided regions based on a result of the alignment performed using the second images, wherein the second image is an image in which a depth of field or a focusing position, or both thereof are different from those of the first image.