Autofocus detection method and device, imaging device, and storage medium
The method improves autofocus detection by dividing images into regions, calculating defocus amounts, and excluding unreliable regions, addressing the challenge of multiple subjects with different distances and achieving efficient and accurate focusing.
Patent Information
- Application Number
- JP2023203365
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-06-11
- Estimated Expiration
- 2043-11-30
AI Technical Summary
Existing autofocus detection methods in digital imaging, particularly those using the pupil division phase difference method, struggle to accurately calculate defocus amounts when multiple subjects with different shooting distances are present, leading to inefficiencies and longer focusing times.
The proposed method involves dividing the images of a pair of subject image signals obtained by pupil division into regions, performing correlation calculations between corresponding regions, calculating defocus amounts, grouping regions by shooting distance, and excluding regions with low reliability to enhance focusing accuracy and speed.
This approach enables high-precision and high-speed autofocus detection even when multiple subjects with different shooting distances are present, allowing for selective focusing on specific subjects based on area, distance, or reliability.
Smart Images

Figure 2025088579000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of digital imaging, and more particularly to an autofocus detection method and apparatus, a photographing apparatus, and a non-volatile computer-readable storage medium.
Background Art
[0002] In an automatic focus detection device of the pupil division phase difference method mounted on a camera, the defocus amount is calculated from the phase difference (relative position change) of a pair of subject images obtained by pupil division. In an automatic focus detection device of the pupil division phase difference method, when there are a plurality of subjects with different shooting distances, a value in which a plurality of phase shift amounts are mixed is output from the sensor, so that it may not be possible to calculate the defocus amount of the subject with high accuracy.
[0003] In order to solve this problem, for example, an automatic focus detection device of the pupil division phase difference method described in Patent Document 1 (Japanese Patent Application Laid-Open No. 2021-148841) performs a correlation operation on an image signal sequence output from a sensor, and when it is determined that there is reliability from the correlation operation result, the defocus amount is calculated based on the correlation operation result. When it is determined that there is no reliability from the correlation operation result, the reliability for the image signal on the start side of the image signal sequence on which the correlation operation was performed is compared with the reliability for the image signal on the end side, and at least one of the image signals on the start side and the end side is excluded from the image signal sequence based on the comparison result, thereby narrowing down the image signal sequence, and repeating the narrowing down of the image signal sequence and the correlation operation for the range of the narrowed-down image signal sequence until it is determined that there is reliability.
[0004] In Patent Document 1, by repeatedly performing the narrowing down and the correlation operation for the range of the narrowed-down image signal sequence until it is determined that there is reliability, signals of subjects with different shooting distances are excluded, and the defocus amount of the subject is calculated with high accuracy. Therefore, the correlation operation has to be repeatedly executed, and it takes time to focus on the subject.
Summary of the Invention
[0005] In view of the above circumstances, the present disclosure proposes an autofocus detection method and apparatus, a photographing apparatus, and a non-transitory computer-readable storage medium that can focus on any one of a plurality of subjects having different photographing distances with high precision and high speed even when there are a plurality of subjects having different photographing distances.
[0006] According to one aspect of the present disclosure, there is provided an autofocus detection method including: a region division step of dividing the images of a pair of subject image signals obtained by pupil division into regions respectively; a correlation calculation step of performing a correlation calculation between each divided region of one of the images of the pair of subject image signals and the corresponding divided region of the other; a defocus amount calculation step of calculating a defocus amount for each divided region based on the correlation calculation result obtained in the correlation calculation step; a grouping process step of grouping the divided regions corresponding to subjects having the same photographing distance so as to be in the same group based on the defocus amount for each divided region; a reliability calculation step of calculating the reliability of the correlation calculation result obtained in the correlation calculation step; and an exclusion process step of excluding, from each group, the divided regions that satisfy a predetermined condition based on the reliability calculated in the reliability calculation step.
[0007] According to another aspect of the present disclosure, there is provided an autofocus detection apparatus including: a region division unit that divides the images of a pair of subject image signals obtained by pupil division into regions respectively; a correlation calculation unit that performs a correlation calculation between each divided region of one of the images of the pair of subject image signals and the corresponding divided region of the other; a defocus amount calculation unit that calculates a defocus amount for each divided region based on the correlation calculation result by the correlation calculation unit; a grouping process unit that groups the divided regions corresponding to subjects having the same photographing distance so as to be in the same group based on the defocus amount for each divided region; a reliability calculation unit that calculates the reliability of the correlation calculation result by the correlation calculation unit; and an exclusion process unit that excludes, from each group, the divided regions that satisfy a predetermined condition based on the reliability calculated by the reliability calculation unit.
[0008] According to another aspect of the present disclosure, there is provided a photographing apparatus including a processor and a storage unit for storing instructions executable by the processor, wherein when the processor executes the instructions stored in the storage unit, the photographing apparatus is configured to execute the above-described autofocus detection method.
[0009] According to another aspect of the present disclosure, there is provided a non-volatile computer-readable storage medium storing computer program instructions, wherein when the computer program instructions are executed by a processor, the non-volatile computer-readable storage medium is configured to implement the above-described autofocus detection method.
[0010] According to another aspect of the present disclosure, there is provided a computer program product including a non-volatile computer-readable storage medium storing computer-readable code or computer-readable code, wherein when the computer-readable code operates in a processor of an electronic device, the processor of the electronic device is caused to execute the above-described autofocus detection method.
[0011] According to the autofocus detection method and apparatus, photographing apparatus, and non-volatile computer-readable storage medium of each aspect of the present disclosure, in an apparatus capable of splitting a light beam from a subject, projecting it onto different sensors or different sensor regions, and obtaining a defocus amount from the phase difference between a pair of subject images, for a pair of pupil-split subject images output from a sensor, grouping is performed based on the defocus amount calculated from the correlation operation result for each split region, and the image information of each split region is grouped together as the image information of a subject at the same shooting distance, and by excluding disturbance factors, even when there are a plurality of subjects with different shooting distances, autofocus detection of the subject can be performed with high accuracy and high speed. Further, by grouping the image information of each split region together as the image information of a subject at the same shooting distance for each group, it is possible to selectively focus on an arbitrary subject such as a subject with a large area at the center of the angle of view, a subject with the closest shooting distance, or a subject with the highest reliability among a plurality of subjects with different shooting distances.
[0012] Hereinafter, other features and aspects of the present disclosure will become clear by explaining exemplary embodiments in detail with reference to the drawings.
Brief Description of the Drawings
[0013] The drawings, which form a part of the specification, together with the specification, show exemplary embodiments, features, and aspects of the present disclosure and are used to interpret the principles of the present disclosure.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Modes for Carrying Out the Invention
[0014] Hereinafter, various exemplary embodiments, features, and aspects of the present disclosure will be described in detail with reference to the drawings. In the drawings, the same reference numerals represent elements having the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0015] As used herein, the term "exemplary" means "used as an example, instance, or illustration." Any embodiment described as "exemplary" herein is not necessarily to be construed as preferred or superior to other embodiments.
[0016] Also, to better explain the present disclosure, many specific details are shown in the following specific embodiments. Those skilled in the art should understand that the present disclosure can be implemented similarly even without any specific details. In some embodiments, well-known methods, means, elements, and circuits are not described in detail in order to emphasize the gist of the present disclosure.
[0017] In related art, as an autofocus detection method, a method has been proposed in which, until it is determined to be reliable, the correlation operation is repeated for the range of the image signal sequence after narrowing down to exclude signals of subjects with different shooting distances. However, there is a problem that it takes time to focus on the subject. Therefore, in the present disclosure, for a pair of pupil-segmented subject images, grouping is performed based on the defocus amount calculated from the correlation operation result for each segmented region, information is grouped for each of a plurality of subjects with different shooting distances, and disturbance factors are excluded, thereby solving the above problem.
[0018] In the present disclosure, as shown in FIG. 1, an autofocus detection method executed in a device product that performs focus adjustment of a camera, such as a mobile phone, an industrial camera, a security camera, an automotive camera, a camera module, etc., is proposed.
[0019] In the embodiment shown in FIG. 1, the autofocus detection method may include the following steps.
[0020] Step S110 (Region Division Step): Divide the images of the pair of subject images after pupil division into regions respectively.
[0021] In this embodiment, the light beam from the subject is divided by the pupil and projected onto different sensors or different sensor regions, and the images of the pair of subject images output from different sensors or different sensor regions are divided into regions respectively. The number of divided regions can be set arbitrarily. It is desirable that the divided regions be as small as possible so that signals with mixed phase shift amounts due to a plurality of subjects with different shooting distances are easily excluded.
[0022] Step S120 (Correlation Calculation Step): Perform a correlation calculation between each divided region of one of the images of the pair of subject images and the corresponding divided region of the other.
[0023] In this embodiment, for each divided region of the images of the pair of subject images, a correlation value is obtained by performing a correlation calculation between one divided region of the images of the pair of subject images and the corresponding divided region of the other.
[0024] For each divided region of the pair of subject images after pupil division, within a certain shift range, perform an operation of obtaining the difference between pixel data and the sum of their absolute values while shifting by a predetermined amount, and preferably perform a correlation calculation from the sum of the absolute values of the differences obtained by shifting by the predetermined amount to obtain the phase difference. That is, it is good to fix the pixel data group of one divided region of the pair of subject images and shift the pixel data group of the other corresponding divided region in pixel units to obtain the phase difference. And it is preferable to calculate the moving direction and moving amount of the optical system of the focus adjustment device based on the obtained phase difference.
[0025] In one possible implementation form, for each divided region of the images of the pair of subject images, the correlation calculation is performed in parallel. Thereby, the calculation time can be further reduced.
[0026] Step S130 (Defocus amount calculation step): Based on the correlation operation result obtained in the correlation operation step, calculate the defocus amount for each divided region.
[0027] In this embodiment, based on the correlation operation result for each divided region, calculate the defocus amount for each divided region.
[0028] By estimating sub-pixels with finer pixel subdivision, it is advisable to identify the point where the correlation value is maximized in sub-pixel units and calculate the defocus amount.
[0029] In one possible implementation form, for each divided region of the images of a pair of subject image signals, calculate the defocus amount based on the correlation operation result in parallel. Thereby, the operation time can be further reduced.
[0030] Step S140 (Grouping process step): Based on the defocus amount for each divided region, group the divided regions corresponding to subjects at the same shooting distance so that they belong to the same group.
[0031] In this embodiment, based on the calculated defocus amount for each divided region, group the divided regions corresponding to subjects at the same shooting distance so that they belong to the same group. That is, group each of the image information of the divided regions into the image information of the subject with a large area at the center of the angle of view or the closest subject.
[0032] Step S150 (Reliability calculation step): Calculate the reliability of the correlation operation result obtained in the correlation operation step.
[0033] In one possible implementation form, for each divided region of the images of a pair of subject image signals, calculate the reliability of the correlation operation result in parallel. Thereby, the operation time can be further reduced.
[0034] It is preferable to calculate the reliability from a plurality of elements such as the contrast and similarity of the divided regions of the images of the pair of subject images obtained by pupil division. In one possible implementation, the reliability is calculated based on at least one of a saturation pixel threshold, an insufficient pixel threshold, contrast, and a degree of coincidence. Also, it is desirable that the case where the reliability is the highest is 1.0 and the case where the reliability is the lowest is 0.0.
[0035] Step S160 (exclusion processing step): For each group, exclude the divided regions that satisfy a predetermined condition from the group based on the reliability calculated in the reliability calculation step.
[0036] In one possible implementation, for each group, a threshold is set based on the reliability calculated in the reliability calculation step, and the divided regions with a reliability below the threshold are excluded from the group. Also, for each group, the divided regions in which the defocus amount calculated in the defocus amount calculation step is an outlier may also be excluded from the group.
[0037] As described above, according to the present embodiment, in an apparatus capable of performing pupil division on the light beam from a subject and projecting it onto different sensors or different sensor regions, and obtaining the defocus amount from the phase difference of a pair of subject images, for the pair of pupil-divided subject images output from the sensor, grouping is performed based on the defocus amount calculated from the correlation calculation result for each divided region, and the image information of each divided region is grouped for each group as the image information of a subject at the same shooting distance, and by excluding disturbance factors, even when there are a plurality of subjects with different shooting distances, automatic focus detection of the subject can be performed with high accuracy and high speed. Also, by grouping the image information of each divided region for each group as the image information of a subject at the same shooting distance, it becomes possible to selectively focus on any subject such as a subject with a large area at the center of the angle of view, a subject with the closest shooting distance, or a subject with the highest reliability among a plurality of subjects with different shooting distances.
[0038] FIG. 2 shows a flowchart of an autofocus detection method according to another embodiment of the present disclosure. As shown in FIG. 2, the autofocus detection method may include the following steps.
[0039] Step S210: Divide the images of a pair of subject image signals after pupil division into regions respectively.
[0040] Similarly divide each of the images of the pair of subject image signals after pupil division into regions. That is, the divided regions of the images of the pair of subject image signals after pupil division have the same size and shape. FIG. 3 shows a state in which the images of a pair of subject images after pupil division output from the image sensor are divided into regions. In FIG. 3, they are divided into a plurality of rectangular regions, but it is not limited thereto. Other shaped regions such as square regions may also be used. For each region of the divided subject images, perform correlation calculation, reliability calculation, and defocus amount calculation. Also, it is desirable that the divided regions be as small as possible so that an image signal in which phase shift amounts due to a plurality of subjects with different shooting distances are mixed is easily excluded.
[0041] Step S220: Perform a correlation calculation on the divided regions of the images of the pair of subject image signals.
[0042] The calculation means for the correlation calculation can calculate a correlation value by a known method. For example, while shifting a predetermined amount in pixel units, an operation is performed to obtain the difference between each pixel data of a pair of subject images after pupil division and the sum of their absolute values, and a correlation calculation is performed from the sum of the absolute values of the differences obtained by shifting the predetermined amount to obtain a phase difference. As an example, when the right eye image after pupil division is R, the left eye image after pupil division is L, the pixel position is n, and the shift amount is i, the formula for obtaining the correlation value is as follows.
Equation
[0043] Also, for the correlation operation, since it can be performed for each divided region, parallel operation (by a plurality of CPU cores) as shown in FIG. 8 is enabled. Thereby, the operation time can be further reduced.
[0044] Step S230: Calculate the defocus amount for each divided region based on the correlation operation result.
[0045] The defocus amount calculation means performs sub-pixel estimation using the spatial structure for the correlation operation result (phase value) for each divided region by a known method, and calculates the defocus amount. Sub-pixel estimation is performed by using gradient information to perform piecewise approximation or parabolic approximation based on the correlation values before and after the shift amount of the minimum correlation value calculated by the correlation operation. As an example, assuming that the shift amount of the minimum correlation value is min, the mathematical formula of the parabolic approximation (parabola fitting) method is as follows.
Equation
[0046] Regarding the defocus amount calculation, since it can be performed for each divided region, parallel operation (by a plurality of CPU cores) as shown in FIG. 8 is enabled. Thereby, the operation time can be further reduced.
[0047] Step S240: Group the divided regions such that the divided regions corresponding to the subjects at the same shooting distance belong to the same group based on the defocus amount for each divided region.
[0048] The operation means for the grouping process can perform grouping for the defocus amount for each divided region by clustering using, for example, the k-means method or the like by a known method.
[0049] Step S250: Calculate the reliability of the correlation operation result.
[0050] The reliability calculation means can consider a method of calculating the reliability by performing saturation determination, deficiency determination, similarity deficiency determination, and contrast deficiency determination on the pixel values of each pixel of a pair of subject images obtained by pupil segmentation, for example.
[0051] As one index related to the reliability, in the saturation determination and deficiency determination of the pixel values of each pixel for each divided region, a saturation pixel threshold and a deficiency pixel threshold are set. If even one pixel among the pixels used in the correlation calculation exceeds the saturation pixel threshold or is below the deficiency pixel threshold, the reliability is set to 0.
[0052] As one index related to the reliability, in the similarity deficiency determination, as shown in FIG. 4, the minimum value of the correlation value is used as the index of the reliability. When the minimum value is large, it is considered that the similarity is low, the degree of coincidence is low, and the reliability is low.
[0053] As one index related to the reliability, in an example of the contrast deficiency determination, as shown in FIG. 5, the difference between the maximum value and the minimum value of the correlation value is used as the index of the reliability. The difference represents the range of the correlation value map. When the difference is small, it is considered that the contrast is low, indicating that the reliability is low.
[0054] Also, as one index related to the reliability, in another example of the contrast deficiency determination method, the sum of the absolute values of the differences between adjacent pixels of the right-eye image or the left-eye image of a pair of subject images obtained by pupil segmentation is obtained. When this value is small, it is considered that the contrast is low, indicating that the reliability is low. Assuming that the right-eye image obtained by pupil segmentation is R and the pixel position is n, the formula for obtaining the right-eye image contrast is as follows.
Equation
Equation
[0055] The result of the reliability calculation method described above can be used as the reliability as it is. However, for example, as shown in FIG. 6, it is desirable to associate an index with the reliability, with the case of the highest reliability being 1.0 and the case of the lowest reliability being 0.0. Note that the association may be linear as shown in FIG. 6(a) or non-linear as shown in FIG. 6(b). The index in FIG. 6 refers to, for example, the value of the similarity deficiency determination or the contrast deficiency determination.
[0056] Also, among the several reliability calculation methods described above, although the reliability obtained by one reliability calculation method can be used as the reliability, it is desirable to calculate the final reliability by combining these multiple reliability calculation methods. When the highest reliability in each reliability calculation method described above is 1.0 and the lowest reliability is 0.0, weights may be assigned to the similarity deficiency determination and the contrast deficiency determination. An example of the calculation formula for the final reliability is shown below.
Equation
[0057] Regarding reliability calculation, since it can be calculated for each divided region, parallel calculation (by multiple CPU cores) is possible as shown in FIG. 8. Thereby, the calculation time can be further reduced. Also, it is possible to calculate the reliability value after grouping based on the reliability calculated from the results of the correlation calculation for each divided region.
[0058] Step S260: For each group, exclude the divided regions with outliers or low signal reliability from the group.
[0059] Based on the reliability calculated in step S250, set a threshold value. If the reliability of the divided region is below the threshold value, exclude the divided region from the group. For example, calculate the average of the reliabilities of the divided regions for each group as the threshold value, and if the reliability of the divided region is below the threshold value of the group to which it belongs, exclude the divided region from the group.
[0060] Also, based on the defocus amount of each divided region for each group grouped by clustering of the divided regions, as shown in FIG. 7, an average may be set as a threshold value, and a divided region that is an outlier with respect to the group threshold value may be excluded from the group. Thereby, automatic focus detection of a subject can be performed with higher accuracy.
[0061] Step S270: Selectively focus on the subject.
[0062] For each group, calculate the average reliability and the average defocus amount of the divided regions excluding the outlier and the divided regions with low signal reliability, and selectively focus on the subject based on the calculated average reliability and average defocus amount. Regarding the calculation of the average reliability and the average defocus amount, since it can be calculated for each group, parallel calculation (by a plurality of CPU cores) as shown in FIG. 8 is enabled. Thereby, the calculation time can be further reduced.
[0063] When the defocus amount calculated for each group is focused on, it is possible to focus on the subject with the closest shooting distance. Also, when the reliability of each group is focused on, it is also possible to focus on the subject with the highest reliability. Further, when the number of elements (divided regions) or the position of each group is focused on, it is also possible to focus on the subject with a large area at the center of the angle of view.
[0064] Note that the automatic focus detection method has been described above by taking as an example the case where the reliability calculation is executed after the defocus amount calculation, but those skilled in the art can understand that the present disclosure is not limited thereto. For example, the reliability calculation may be executed after the defocus amount calculation, or the reliability calculation and the defocus amount calculation may be executed simultaneously.
[0065] Thus, according to this embodiment, in an apparatus capable of splitting a light beam from a subject, projecting it onto different sensors or different sensor regions, and obtaining a defocus amount from the phase difference between a pair of subject images, for a pair of pupil-split subject images output from the sensor, grouping is performed based on the defocus amount calculated from the correlation operation result for each split region, and the image information of each split region is grouped for each group as the image information of a subject at the same shooting distance, and outliers that do not belong to the group or signals with low reliability are excluded. Thereby, when there are a plurality of subjects with different shooting distances, signals in which the phase shift amounts due to the plurality of subjects are mixed are excluded or divided into different groups, and approximate defocus amounts and regions with high reliability are divided into the same group and averaged, so that highly accurate autofocus detection can be performed. Also, since the operation can be performed in parallel for each split region, autofocus detection can be performed at high speed.
[0066] FIG. 9 is a block diagram of an autofocus detection apparatus according to an exemplary embodiment. As shown in FIG. 9, this autofocus detection apparatus includes a region division unit 901 that divides the images of a pair of pupil-split subject image signals into regions respectively, a correlation operation unit 902 that performs a correlation operation between each split region of one of the images of the pair of subject image signals and the corresponding split region of the other, a defocus amount calculation unit 903 that calculates a defocus amount for each split region based on the correlation operation result by the correlation operation unit 902, a grouping processing unit 904 that groups the split regions corresponding to a subject at the same shooting distance so that they become the same group based on the defocus amount for each split region, a reliability calculation unit 905 that calculates the reliability of the correlation operation result by the correlation operation unit 902, and an exclusion processing unit 906 that excludes split regions that satisfy a predetermined condition from the group for each group based on the reliability calculated by the reliability calculation unit 905.
[0067] In one possible implementation, the correlation operation unit 902 performs the correlation operation in parallel for each split region of the images of the pair of subject image signals.
[0068] In one possible implementation, the defocus amount calculation unit 903 calculates the defocus amount based on the correlation calculation result in parallel for each divided region of the images of the pair of subject image signals.
[0069] In one possible implementation, the reliability calculation unit 905 calculates the reliability of the correlation calculation result in parallel for each divided region of the images of the pair of subject image signals.
[0070] In one possible implementation, the exclusion processing unit 906 excludes, for each group, the divided regions with reliability below the threshold value from the group, and the threshold value is set based on the reliability calculated by the reliability calculation unit 905.
[0071] In one possible implementation, the exclusion processing unit 906 excludes, for each group, the divided regions where the defocus amount is an outlier from the group.
[0072] In one possible implementation, the reliability calculation 905 calculates the reliability based on at least one of a saturation pixel threshold, an insufficient pixel threshold, contrast, and a degree of coincidence.
[0073] Regarding the apparatus in the above embodiment, the specific method for each unit to execute operations has been described in detail in the embodiment related to the method, so detailed description is omitted here.
[0074] FIG. 10 shows a configuration example of a photographing apparatus to which the autofocus detection apparatus according to the embodiment is applied. This photographing apparatus includes an optical lens unit 1001, an image sensor unit 1002, an image data generation unit 1003, a lens driving unit 1004, and the above autofocus detection apparatus 1005.
[0075] The optical lens unit 1001 condenses the subject image onto the image sensor unit 1002. Also, the optical lens unit 1001 moves the focus based on the focus control signal from the lens driving unit 1004.
[0076] The lens driving unit 1004 generates a focus control signal from the information output from the autofocus detection device 1005 and outputs it to the optical lens unit 1001.
[0077] The image sensor unit 1002 generates RAW data of each pixel corresponding to the optical image of the subject condensed by the optical lens unit 1001 and outputs it to the image data generation unit 1003. Also, it outputs a pair of pupil-segmented subject images to the autofocus detection device 1005.
[0078] The image data generation unit 1003 generates image data by performing predetermined signal processing on the RAW data of each pixel and outputs it externally.
[0079] As described above, the autofocus detection device 1005 includes a region division unit 901, a correlation calculation unit 902, a defocus amount calculation unit 903, a grouping processing unit 904, a reliability calculation unit 905, and an exclusion processing unit 906. The autofocus detection device 1005 outputs information for focusing on the subject selected based on the pair of pupil-segmented subject image signals to the lens driving unit 1004. The autofocus detection device 1005 may be realized by hardware, by software, or by the cooperation of hardware and software.
[0080] According to this embodiment, in an apparatus capable of splitting a light beam from a subject, projecting it onto different sensors or different sensor regions, and obtaining a defocus amount from the phase difference between a pair of subject images, for the pair of pupil-split subject images output from the sensor, grouping is performed based on the defocus amount calculated from the correlation calculation result for each split region, and the image information of each split region is grouped together as the image information of a subject at the same shooting distance, and by excluding disturbance factors, even when there are a plurality of subjects with different shooting distances, automatic focus detection of the subject can be performed with high accuracy and high speed. Further, by grouping the image information of each split region as the image information of a subject at the same shooting distance for each group, it is possible to selectively focus on an arbitrary subject such as a subject with a large area at the center of the angle of view, a subject with the closest shooting distance, or a subject with the highest reliability among a plurality of subjects with different shooting distances.
[0081] An embodiment of the present disclosure further provides a computer-readable storage medium storing computer program instructions, wherein when the computer program instructions are executed by a processor, the above-described automatic focus detection method is realized. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0082] An embodiment of the present disclosure further provides an electronic device including a processor and a storage unit for storing instructions executable by the processor, wherein the processor is configured to execute the above-described automatic focus detection method when executing the instructions stored in the storage unit.
[0083] An embodiment of the present disclosure further provides a computer program product including a non-volatile computer-readable storage medium storing computer-readable code or computer-readable code, wherein when the computer-readable code operates in a processor of an electronic device, the processor of the electronic device is caused to execute the above-described automatic focus detection method.
[0084] The above describes each embodiment of the present disclosure. However, the above description is merely exemplary, not exhaustive, and is not limited to each disclosed embodiment. For those skilled in the art, various modifications and changes are obvious without departing from the scope and spirit of each described embodiment. The terms chosen in this specification are for the purpose of preferably interpreting the principles of each embodiment, the actual application, or the improvement over the existing technology, or for enabling other skilled persons to understand each embodiment disclosed in this text.
Claims
1. A region division step of dividing the images of a pair of subject image signals with divided pupils into regions respectively; A correlation operation step of performing a correlation operation between each divided region of one of the images of the pair of subject image signals and the corresponding divided region of the other; A defocus amount calculation step of calculating a defocus amount for each divided region based on the correlation operation result obtained in the correlation operation step; A grouping process step of grouping the divided regions corresponding to subjects at the same shooting distance so that they belong to the same group based on the defocus amount for each divided region; A reliability calculation step of calculating the reliability of the correlation operation result obtained in the correlation operation step; An exclusion process step of excluding, for each group, the divided regions that satisfy a predetermined condition from the group based on the reliability calculated in the reliability calculation step. An automatic focus detection method characterized by including the above steps.
2. The automatic focus detection method according to claim 1, wherein in the correlation operation step, the correlation operation is performed in parallel for each divided region of the images of the pair of subject image signals.
3. The automatic focus detection method according to claim 1, wherein in the defocus amount calculation step, the calculation of the defocus amount based on the correlation operation result is performed in parallel for each divided region of the images of the pair of subject image signals.
4. The automatic focus detection method according to claim 1, wherein in the reliability calculation step, the calculation of the reliability of the correlation operation result is performed in parallel for each divided region of the images of the pair of subject image signals.
5. In the exclusion process step, for each group, the divided regions with a reliability below a threshold value are excluded from the group, The threshold value is set based on the reliability calculated in the reliability calculation step. The automatic focus detection method according to claim 1, characterized by the above.
6. The automatic focus detection method according to claim 1, wherein the exclusion process step further includes, for each group, excluding the divided regions whose defocus amount is an outlier from the group.
7. The automatic focus detection method according to claim 1, wherein in the reliability calculation step, the reliability is calculated based on at least one of a saturation pixel threshold value, an insufficient pixel threshold value, contrast, and degree of coincidence.
8. A region division unit that divides the images of a pair of subject image signals with divided pupils into regions respectively; A correlation calculation unit that performs a correlation calculation between each divided region of one of the images of the pair of subject images and the corresponding divided region of the other; A defocus amount calculation unit that calculates a defocus amount for each divided region based on the correlation calculation result by the correlation calculation unit; A grouping processing unit that groups the divided regions corresponding to subjects at the same shooting distance so that they belong to the same group based on the defocus amount for each divided region; A reliability calculation unit that calculates the reliability of the correlation calculation result by the correlation calculation unit; An exclusion processing unit that excludes divided regions that satisfy a predetermined condition from each group based on the reliability calculated by the reliability calculation unit for each group. An autofocus detection device characterized by including:
9. A processor; A storage unit for storing instructions executable by the processor, including: When the processor executes the instructions stored in the storage unit, it is configured to execute the autofocus detection method according to any one of claims 1 to 7. A photographing device characterized by:
10. A non-volatile computer-readable storage medium storing computer program instructions, wherein when the computer program instructions are executed by a processor, the autofocus detection method according to any one of claims 1 to 7 is realized. A non-volatile computer-readable storage medium characterized by:
Citation Information
Patent Citations
Focus detecting photometric device
JP1991164727A
Imaging apparatus
JP2006191467A
Focus detection device and imaging device
JP2015102735A
Imaging apparatus and control method of the same
JP2020038319A
Automatic focus detector, automatic focus detection method, and automatic focus detection program
JP2021148841A