Image processing apparatus, image pickup apparatus, image processing method, and storage medium
An image processing apparatus acquires lens information, combines a plurality of images with different focus positions based on information about an imaging magnification acquired from the lens information to generate a combined image with a depth of field deeper than that of each of the plurality of images, and detects a main object. In a case where the processor has not detected the main object, the processor is configured to combine the plurality of images based on the information about the imaging magnification.
1 . An image processing apparatus comprising:
a memory storing instructions; and
a processor configured to execute the instructions to:
detect a main object,
determine whether or not macro imaging, and
combine a plurality of images captured at different focus positions to generate a combined image having a depth of field deeper than that of each of the plurality of images, in a case where the main object is detected, or in a case where macro imaging without detecting the main object.
2 . The image processing apparatus according to claim 1 , wherein the processor is configured to acquire lens information, and determine whether or not macro imaging based on the lens information.
3 . The image processing apparatus according to claim 2 , wherein the lens information includes an imaging magnification.
4 . The image processing apparatus according to claim 2 , wherein the lens information includes lens ID which identifies the lens.
5 . The image processing apparatus according to claim 2 , wherein the processor is configured to calculate an imaging magnification using the lens information.
6 . The image processing apparatus according to claim 5 , wherein in a case where the imaging magnification is equal to or higher than a certain threshold, the processor is configured to determine whether or not macro imaging.
7 . An image pickup apparatus comprising:
the image processing apparatus according to claim 1 ; and
an imaging unit configured to acquire the plurality of images.
8 . The image processing apparatus according to claim 1 , wherein in a case where the processor has determined that there is a moving object, the processor does not combine the plurality of images.
9 . The image processing apparatus according to claim 8 , wherein the processor is configured to determine that there is the moving object before determining the main object.
10 . An image processing method comprising the steps of:
detecting a main object,
determining whether or not macro imaging, and
combining a plurality of images captured at different focus positions to generate a combined image having a depth of field deeper than that of each of the plurality of images, in a case where the main object is detected, or in a case where macro imaging without detecting the main object.
11 . A non-transitory computer-readable storage medium storing a program for causing a computer to execute the image processing method according to claim 10 .
12 . The image processing apparatus according to claim 1 , wherein the processor is configured to extract an in-focus area of each of the plurality of images and to generate the combined image.
13 . The image processing apparatus according to claim 1 , wherein the processor is configured to determine whether to combine the plurality of images based on whether an evaluation value calculated for the main object is higher than a predetermined threshold.
14 . The image processing apparatus according to claim 13 , wherein the evaluation value is calculated based on a position of the main object in the image.
15 . The image processing apparatus according to claim 13 , wherein the evaluation value is calculated based on a size of the main object in the image.
16 . The image processing apparatus according to claim 13 , wherein the evaluation value is calculated based on the number of the main object in the image.
17 . The image processing apparatus according to claim 1 , wherein the main object is an object on which in-focus position is placed to generate the combined image.
18 . The image processing apparatus according to claim 1 , wherein the processor is configured to detect the main object to determine the scene for at least one of the plurality of images.
19 . The image processing apparatus according to claim 1 , wherein the processor is configured to combine the plurality of images in the case the processor has detected the main object, regardless of whether or not macro imaging.
20 . An image capturing apparatus comprising:
an image capturing unit configured to capture an image of an object;
at least one processor; and
a memory coupled to the at least one processor, the memory having instructions that cause the processor to function as:
a detecting unit configured to detect a main object,
a determining unit configured to determine whether or not macro imaging, and
a controlling unit configured to control the image capturing unit to capture a plurality of images at different focus positions based on a detection result detected by the detecting unit and a determination result determined by the determining unit.
21 . The image capturing apparatus according to 20 , wherein the image capturing unit configured to capture the plurality of images
in a case where the processor has detected the main object or
in a case where the processor has not detected the main object and in a case of macro imaging.