Improving phase detection autofocus (PDAF) focus performance

By employing a machine-learning confidence model to adjust confidence values and determine lens positions, the PDAF focus performance is enhanced, addressing the issue of blurred images in challenging scenes.

WO2025043582A1PCT designated stage expired Publication Date: 2025-03-06QUALCOMM INC +6

Patent Information

Application Number
PCT/CN2023/116041
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

Phase Detection Auto Focus (PDAF) algorithms can sometimes determine a lens position that results in a blurred image, particularly in challenging scene scenarios such as flat, spotlight, or backlit scenes.

Method used

The implementation of a machine-learning confidence model that categorizes grids in a region of interest (ROI) based on confidence values associated with defocusing values, adjusting confidence values for grids with incorrect defocusing values and high confidence, and determining the lens position based on grids with high confidence values.

Benefits of technology

This approach improves PDAF focus performance by accurately identifying and correcting incorrect defocusing values, leading to clearer images and reducing the occurrence of blurred images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023116041_06032025_PF_FP_ABST
    Figure CN2023116041_06032025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are systems and techniques for improving focus performance. For example, a computing device can categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids. The computing device can adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold. The computing device can determine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.
Need to check novelty before this filing date? Find Prior Art

Description

IMPROVING PHASE DETECTION AUTOFOCUS (PDAF) FOCUS PERFORMANCEFIELD

[0001] The present disclosure generally relates to camera autofocus. For example, aspects of the present disclosure are related to systems and techniques for improving phase detection autofocus (PDAF) focus performance.BACKGROUND

[0002] A camera is a device that captures images, such as still images or video frames, by receiving light through a lens and by using the lens (and sometimes one or more mirrors) to bend and focus the light onto an image sensor or a photosensitive material such as photographic film. The resulting images are captured by the image sensor and either stored on the photographic film, which can be developed into printed photographs, or stored digitally onto a secure digital (SD) card or other storage device. To capture a clear image, as opposed to a blurry image, a camera must be focused properly. Focusing a camera involves moving the lens forward and backward to ensure that light coming from an object that is the intended subject of the captured image is being properly focused onto the image sensor or photographic film. PDAF algorithms are often employed to determine a lens position for focusing a camera. However, these algorithms can sometimes determine a lens position for the camera that can result in the camera producing a blurred image. As such, a technique for improving PDAF focus performance can be beneficial.SUMMARY

[0003] The following presents a simplified summary relating to one or more aspects disclosed herein. Thus, the following summary should not be considered an extensive overview relating to all contemplated aspects, nor should the following summary be considered to identify key or critical elements relating to all contemplated aspects or to delineate the scope associated with any particular aspect. Accordingly, the following summary has the sole purpose to present certain concepts relating to one or more aspects relating to the mechanisms disclosed herein in a simplified form to precede the detailed description presented below.

[0004] Systems and techniques are described for improving PDAF focus performance. According to at least one example, an apparatus for focusing a camera is provided. The  apparatus includes at least one memory and at least one processor coupled to the at least one memory and configured to: categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and determine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0005] In another illustrative example, a method for focusing a camera is provided. The method includes: categorizing each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; adjusting at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and determining a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0006] In another illustrative example, a non-transitory computer-readable storage medium is provided that comprises instructions stored thereon which, when executed by at least one processor, cause the at least one processor to: categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and determine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0007] In another illustrative example, an apparatus for focusing a camera is provided that includes: means for categorizing each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective  confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; means for adjusting at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and means for determining a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0008] Aspects generally include a method, apparatus, system, computer program product, non-transitory computer-readable medium, user device, user equipment, wireless communication device, and / or processing system as substantially described with reference to and as illustrated by the drawings and specification.

[0009] Some aspects include a device having a processor configured to perform one or more operations of any of the methods summarized above. Further aspects include processing devices for use in a device configured with processor-executable instructions to perform operations of any of the methods summarized above. Further aspects include a non-transitory processor-readable storage medium having stored thereon processor-executable instructions configured to cause a processor of a device to perform operations of any of the methods summarized above. Further aspects include a device having means for performing functions of any of the methods summarized above.

[0010] The foregoing has outlined rather broadly the features and technical advantages of examples according to the disclosure in order that the detailed description that follows may be better understood. Additional features and advantages will be described hereinafter. The conception and specific examples disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present disclosure. Such equivalent constructions do not depart from the scope of the appended claims. Characteristics of the concepts disclosed herein, both their organization and method of operation, together with associated advantages will be better understood from the following description when considered in connection with the accompanying figures. Each of the figures is provided for the purposes of illustration and description, and not as a definition of the limits of the claims. The foregoing, together with other features and aspects, will become more apparent upon referring to the following specification, claims, and accompanying drawings.

[0011] This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used in isolation to determine the scope of the claimed subject matter. The subject matter should be understood by reference to appropriate portions of the entire specification of this patent, any or all drawings, and each claim.BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings are presented to aid in the description of various aspects of the disclosure and are provided solely for illustration of the aspects and not limitation thereof. So that the above-recited features of the present disclosure can be understood in detail, a more particular description, briefly summarized above, may be had by reference to aspects, some of which are illustrated in the appended drawings. It is to be noted, however, that the appended drawings illustrate only certain typical aspects of this disclosure and are therefore not to be considered limiting of its scope, for the description may admit to other equally effective aspects. The same reference numbers in different drawings may identify the same or similar elements.

[0013] FIG. 1A illustrates a Phase Detection Auto Focus (PDAF) camera system that is in phase and therefore in focus, in accordance with aspects of the present disclosure.

[0014] FIG. 1B illustrates the PDAF camera system of FIG. 1A that is out of phase with a front focus, in accordance with aspects of the present disclosure.

[0015] FIG. 1C illustrates the PDAF camera system of FIG. 1A that is out of phase with a back focus, in accordance with aspects of the present disclosure.

[0016] FIG. 2A illustrates a top-down view of a pixel array configuration of an image sensor with masks partially covering focus pixel photodiodes, in accordance with aspects of the present disclosure.

[0017] FIG. 2B is a legend identifying elements of FIG. 2A, in accordance with aspects of the present disclosure.

[0018] FIG. 2C illustrates a top-down view of a pixel array configuration of an image sensor with two side-by-side focus pixels covered by a 2 pixel by 1 pixel microlens, in accordance with aspects of the present disclosure.

[0019] FIG. 2D illustrates a top-down view of a pixel array configuration of an image sensor with four neighboring focus pixels covered by a 2 pixel by 2 pixel microlens, in accordance with aspects of the present disclosure.

[0020] FIG. 2E illustrates a top-down view of a pixel array configuration of an image sensor in which at least one focus pixel has two photodiodes, in accordance with aspects of the present disclosure.

[0021] FIG. 2F illustrates a top-down view of a pixel array configuration of an image sensor in which at least one focus pixel has four photodiodes, in accordance with aspects of the present disclosure.

[0022] FIG. 3A illustrates a side view of a single pixel of a pixel array of an image sensor that is partially covered with a mask, in accordance with aspects of the present disclosure.

[0023] FIG. 3B illustrates a side view of two pixels of a pixel array of an image sensor, the two pixels covered by a 2 pixel by 1 pixel microlens, in accordance with aspects of the present disclosure.

[0024] FIG. 4 is a block diagram of an example device that may be employed by the disclosed systems and techniques for improving PDAF focus performance, in accordance with aspects of the present disclosure.

[0025] FIG. 5 is a diagram illustrating examples of different types of scene scenarios that are challenging for PDAF, in accordance with aspects of the present disclosure.

[0026] FIG. 6 is a diagram illustrating an example of grids of a region of interest (ROI) of a scene, where the grids have correct defocusing values with associated high confidence values, in accordance with aspects of the present disclosure.

[0027] FIG. 7 is a diagram illustrating an example of grids of a ROI of a scene, where some of the grids have incorrect defocusing values with associated low confidence values, in accordance with aspects of the present disclosure.

[0028] FIG. 8 is a diagram illustrating an example of grids of a ROI of a scene, where some of the grids have incorrect defocusing values with associated high confidence values, in accordance with aspects of the present disclosure.

[0029] FIG. 9 is a flow chart illustrating an example of a process for collecting data for training an AI model for focusing a camera, in accordance with aspects of the present disclosure.

[0030] FIG. 10 is a diagram illustrating graphs showing example defocusing values, confidence values, and focus values for different lens positions, in accordance with aspects of the present disclosure.

[0031] FIG. 11 is a diagram illustrating graphs showing example focus values and phase disparities for different lens positions, in accordance with aspects of the present disclosure.

[0032] FIG. 12 is a flow chart showing an example of a process for adjusting confidence values to provide for an improved PDAF focus performance for a camera, in accordance with aspects of the present disclosure.

[0033] FIG. 13 is a flow chart illustrating an example of a process for focusing a camera, in accordance with aspects of the present disclosure.

[0034] FIG. 14 is a block diagram illustrating an example of a computing system, which may be employed by the disclosed systems and techniques for improving PDAF focus performance, in accordance with aspects of the present disclosure.DETAILED DESCRIPTION

[0035] Certain aspects and embodiments of this disclosure are provided below. Some of these aspects and embodiments may be applied independently and some of them may be applied in combination as would be apparent to those of skill in the art. In the following description, for the purposes of explanation, specific details are set forth in order to provide a thorough understanding of embodiments of the application. However, it will be apparent that various embodiments may be practiced without these specific details. The figures and description are not intended to be restrictive.

[0036] The ensuing description provides example embodiments only, and is not intended to limit the scope, applicability, or configuration of the disclosure. Rather, the ensuing description of the example embodiments will provide those skilled in the art with an enabling description for implementing an example embodiment. It should be understood that various changes may be made in the function and arrangement of elements without departing from the spirit and scope of the application as set forth in the appended claims.

[0037] Some modern cameras include automatic focusing functionality ( “autofocus” ) that allows the camera to focus automatically prior to capturing the desired image. Various autofocus technologies exist. Active autofocus ( “active AF” ) relies on determining a range between the camera and a subject of the image via a range sensor of the camera, typically by emitting infrared lasers or ultrasound signals and receiving reflections of those signals. While active AF works well in many cases and can be fairly quick, cameras with active AF can be bulky and expensive. Active AF can fail to properly focus on subjects that are very close to the camera lens (macro photography) , as the range sensor is not perfectly aligned with the camera lens, and this difference is exacerbated the closer the subject is to the camera lens. Active AF can also fail to properly focus on faraway subjects, as laser or ultrasound transmitters used in the range sensors that are used for active AF are typically not very strong. Active AF also often fails to properly focus on subjects on the other side of a window than the camera, as the range sensor typically determines the range to the window rather than to the subject.

[0038] Passive autofocus ( “passive AF” ) uses the camera’s own image sensor to focus the camera, and thus does not require additional sensors to be integrated into the camera. Passive AF techniques include Contrast Detection Auto Focus (CDAF) , Phase Detection Auto Focus (PDAF) , and in some cases hybrid systems that use both. CDAF is implemented by a CDAF algorithm, and PDAF is implemented by a PDAF algorithm.

[0039] In CDAF, the lens of a camera moves through a range of lens positions, typically with pre-specified distance intervals between each tested lens position, and attempts to find a lens position at which contrast between the subject′spixels and background pixels are maximized. CDAF relies on trial and error and has high latency as a result. The CDAF process also requires the motor that moves the lens to be actuated and stopped repeatedly in a short span of time every time the camera needs to focus for a photo, which puts stress on components and expends a fair amount of battery power. The camera can still fail to find a satisfactory focus using CDAF, for example if the distance interval between tested lens positions is too large, as the ideal focus may actually be between tested lens positions. CDAF may also struggle in images of subjects without high-contrast features, such as walls, or in images taken in low-light or high-light conditions where lighting conditions fade or blend features that would have higher contrast in different lighting conditions.

[0040] In PDAF, photodiodes within the camera are used to check whether light that is received by the lens of a camera from different angles converge to create a focused image that is “in phase” or fails to converge and thus creates a blurry images that is “out of phase. ” If light received from different angles is out of phase, the camera identifies a direction in which the light is out of phase to determine whether the lens needs to be moved forward or backward, and identifies a phase disparity indicating how out of phase the light is to determine how far the lens must be moved. In some cases, the lens is moved to the position corresponding to optimal focus. Compared to CDAF, PDAF generally focuses the camera more quickly by not relying on trial and error. PDAF also typically uses less power and wears components less than CDAF by actuating the motor for a single lens motion rather than for many small and repetitive motions. Like CDAF, however, PDAF may also struggle to properly focus in low-light conditions and high-light conditions. Some PDAF solutions also use masks or shielding as discussed further below, which reduces the total amount of light that is received by certain photodiodes. In some cases, a hybrid autofocus solution may be employed that uses PDAF to move the lens to a first position, then uses CDAF to check contrast at a number of lens positions within a defined distance / range of the first position in order to help compensate for any slight errors or inaccuracies in the PDAF autofocus.

[0041] As previously mentioned, in some cases, PDAF may determine a lens position for the camera that can result in the camera producing a blurred image. There can be challenging scene scenarios (e.g., a flat scene, a spotlight scene, and a backlit scene) for PDAF, where PDAF may not be able to provide good focusing results, which can result in the camera producing a blurry image (e.g., resulting in a failed focusing of the camera) .

[0042] The PDAF algorithm generates defocusing and confidence values. Each defocusing value (also referred to as a phase detection (PD) value) has an associated confidence value. Each defocusing value has an associated position for the lens for focusing the camera (e.g., graph 1000 shows an example of lens positions that correspond to different defocusing values) . The confidence value represents a level of confidence (e.g., a level of probability) that the lens position associated with the defocusing value will provide a successful focusing (e.g., not a failed focusing) of the camera such that the camera will produce a clear (not blurry) image.

[0043] PDAF focuses the camera by moving the lens of the camera to a position determined by these values (e.g., based on the defocusing and confidence values) . When the confidence  value (associated with a defocusing value) is high, the PDAF algorithm will use the defocusing value associated with the confidence value to determine the position for the lens. Conversely, when a confidence value (associated with a defocusing value) is low, the PDAF algorithm will not use the defocusing value associated with the confidence value to determine the position for the lens.

[0044] There can be some cases where a defocusing value is incorrect (e.g., unable to result in a successful focusing) , but the associated confidence value is high. For these cases, although the defocusing value is incorrect, since the confidence value is high, the PDAF algorithm will use the defocusing value associated with the high confidence value to determine the position for the lens. In these cases, since the PDAF algorithm has used an incorrect defocusing value to determine the position for the lens, the camera will not be properly focused (e.g., a failed focusing of the camera) and, as such, will produce a blurred image. As such, a technique for improving PDAF focus performance can be beneficial.

[0045] Systems and techniques are described herein for improving PDAF focus performance. In one or more aspects, the systems and technique uses machine learning (ML) for improving PDAF focus performance. In one or more examples, the systems and techniques provide an ML confidence model (e.g., one or more neural networks) that can output information that categorizes (e.g., flags) incorrect defocusing values (e.g., unable to provide for a successful focusing) with associated high confidence values. For these flagged incorrect defocusing values, the PDAF algorithm can lower (adjust) their associated high confidence values to an appropriate lower level accordingly. Since these incorrect defocusing values will now have associated low confidence values, the PDAF algorithm will disregard these incorrect defocusing values when determining a position for the lens for the focusing of the camera and, as such, the determined position for the lens will provide for a successful focusing of the camera such that the camera can produce clear (not blurry) images. In one or more examples, when all of the defocusing values are discarded (e.g., all of the defocusing values have low associated confidences values) , a CDAF algorithm can be employed (instead of the PDAF algorithm) to determine the position for the lens for the focusing of the camera.

[0046] Additional aspects of the present disclosure are described in more detail below with respect to the figures.

[0047] FIG. 1A illustrates a PDAF camera system that is in phase and therefore in focus. Rays of light 175 may travel from a subject 105 (e.g., an apple) through a lens 110 that focuses a scene with the subject 105 onto an image sensor (not pictured in its entirety) , where the image sensor includes the focus photodiode 125A and the focus photodiode 125B, which correspond to focus pixels. The focus photodiodes 125A and 125B may be associated with one or two focus pixels (e.g., focus photodiode 125A and focus photodiode 125B may be two photodiodes of a single focus pixel sharing a single microlens 120 or focus photodiode 125A may be associated with a first focus pixel and focus photodiode 125B may be associated with a second focus pixel, both focus pixels sharing a single microlens 120) of the pixel array of the image sensor. In some cases, the light rays 175 may travel through a microlens 120 before falling on the focus photodiode 125A and the focus photodiode 125B. When the camera system 100 is in the “in focus” state 150 of FIG. 1A, the rays of light 175 may ultimately converge at a plane that corresponds to the position of the focus photodiode 125A and the focus photodiode 125B. When the camera system 100 is in the “in focus” state 150 of FIG. 1A, rays of light 175 may also converge at a focal plane 115 (also known as an image plane) after passing through the lens 175 but before reaching the microlens 120 and / or focus photodiodes 125A and 125B.

[0048] Because the camera 100 of FIG. 1A is in an in-focus state 150, data from focus photodiodes 125A and 125B is aligned, here represented by an image 170A showing a clear and sharp representation of the subject 105 due to this alignment, as opposed to the misaligned representations of the subject 105 caused by the out-of-phase states 140 and 145 in FIG. 1B and FIG. 1C, respectively. The in-focus state 150 may also be referred to as an “in-phase” state, as the data from focus photodiode 125A and the focus photodiode 125B have no phase disparity, or have very little phase disparity (e.g., phase disparity falling below a predetermined phase disparity threshold) .

[0049] FIG. 1B illustrates the PDAF camera system of FIG. 1A that is out of phase with a front focus. The PDAF camera system 100 of FIG. 1B is the same as the PDAF camera system 100 of FIG. 1A, but the lens 110 is moved closer to the subject 105 and further from the focus photodiodes 125A and 125B, and is therefore in a “front focus” state 140. The lens position for the “in focus” state 150 is still drawn in FIG. 1B as a dotted outline for reference, with a double-sided arrow indicating movement of the lens between the “front focus” 140 lens position and the “in focus” 150 lens position.

[0050] When the camera system 100 is in the “front focus” state 140 of FIG. 1B, the rays of light 175 may ultimately converge at a plane (denoted by a dashed line) before the position of the focus photodiode 125A and the focus photodiode 125B, that is, between the microlens 120 and the focus photodiodes 125A and 125B. The rays of light 175 may also converge at a position (denoted by another dashed line) before the focal plane 115 after passing through the lens 175 but before reaching the microlens 120 and / or focus photodiodes 125A and 125B. Because the light 175 in the camera 100 of FIG. 1B is out of phase in the “front focus” state 140, data from focus photodiodes 125A and 125B is misaligned, here represented by an image 170B showing misaligned black-colored and white-colored representations of the subject 105, where the direction of misalignment in the image 170B is related to the front focus state 140, and the distance of misalignment in the image 170B is related to the distance of the lens 110 from its position in the focused state 150.

[0051] FIG. 1C illustrates the PDAF camera system of FIG. 1A that is out of phase with a back focus. The PDAF camera system 100 of FIG. 1C is the same as the PDAF camera system 100 of FIG. 1A, but the lens 110 is moved further from the subject 105 and closer to the focus photodiodes 125A and 125B, and is therefore in a “back focus” state 145 (also known as a “rear focus” state) . The lens position for the “in focus” state 150 is still drawn as a dotted outline for reference, with a double-sided arrow indicating movement of the lens between the “back focus” lens position 145 and the “in focus” lens position 150.

[0052] When the camera system 100 is in the “back focus” state 145 of FIG. 1C, the rays of light 175 may ultimately converge at a plane (denoted by a dashed line) beyond the position of the focus photodiode 125A and the focus photodiode 125B. The rays of light 175 may also converge at a position (denoted by another dashed line) beyond the focal plane 115 after passing through the lens 175 but before reaching the microlens 120 and / or focus photodiodes 125A and 125B. Because the light 175 in the camera 100 of FIG. 1C is out of phase in the “back focus” state 145, data from focus photodiodes 125A and 125B is misaligned, here represented by an image 170C showing misaligned black-colored and white colored representations of the subject 105, where the direction of misalignment in the image 170C is related to the back focus state 145, and the distance of misalignment in the image 170C is related to the distance of the lens 110 from its position in the focused state 150.

[0053] When the rays of light 175 converge before the plane of the focus photodiodes 125A and 125B as in the front focus state 140 or beyond the plane of the focus photodiodes 125A and 125B as in the back focus state 145, the resulting image produced by the image sensor may be out-of-focus or blurred. In the case that the image is out-of-focus, the lens 110 can be moved forward (toward the subject 105 and away from the photodiodes 125A and 125B) if the lens 110 is in the back focus state 145, or can be moved backward (away from the subject 105 and toward the photodiodes 125A and 125B) if the lens is in the front focus state 140. The lens 110 may be moved forward or backward within a range of positions which in some cases has a predetermined length R representing a possible range of motion of the lens in the camera system 100. The camera system 100, or a computing system therein, may determine a distance and direction of adjusting the position of the lens 100 to bring the image into focus based on one or more phase disparity values calculated as differences between data from two focus photodiodes that receive light from different directions, such as focus photodiodes 125A and 125B. The direction of movement of the lens 110 may correspond to a direction in which the data from the focus photodiodes 125A and 125B is determined to be out of phase, or whether the phase disparity is positive or negative. The distance of movement of the lens 110 may correspond to a degree or amount to which the data from the focus photodiodes 125A and 125B is determined to be out of phase, or the absolute value of the phase disparity.

[0054] The camera 100 may include motors (not pictured) that move the lens 110 between lens positions corresponding to the different states (e.g., front focus 140, back focus 145, and in focus 150) and motor actuators (not pictured) that the computing system within the camera activates to actuate the motors. The camera 100 of FIG. 1A, FIG. 1B, and FIG. 1C may in some cases also include various additional non-illustrated components, such as lenses, mirrors, partially reflective (PR) mirrors, prisms, photodiodes, image sensors, and / or other components sometimes found in cameras or other optical equipment. In some cases, the focus photodiodes 125A and 125B may be referred to as PDAF photodiodes, PDAF diodes, phase detection (PD) photodiodes, PD diodes, PDAF pixel photodiodes, PDAF pixel diodes, PD pixel photodiodes, PD pixel diodes, focus pixel photodiodes, focus pixel diodes, pixel photodiodes, pixel diodes, or in some cases simply photodiodes or diodes.

[0055] FIG. 2A illustrates a top-down view of a pixel array configuration of an image sensor with masks partially covering focus pixel photodiodes. An image sensor of a camera system may include an array of pixels, such as the pixel array 200 of FIG. 2A. The pixel array 200  may include an array of photodiodes, which is not shown in FIG. 2A as is the photodiodes are covered by color filters (e.g., Bayer filters or other types of color filters as discussed below) and microlenses 218 as identified in the legend 210 of FIG. 2B. Photodiodes of focus pixels are also partially covered by masks 220 in the pixel array 200 of FIG. 2A.

[0056] FIG. 2B is a legend identifying elements of FIG. 2A. The legend 210 identifies that a circle represents a microlens 218 of a single pixel, and that a dark shaded rectangle represents a mask 220. The legend 210 of FIG. 2B also identifies that squares with three different patterns each represent color filters 212, 214, and 216, each color filter being for one of three different colors: red, green, or blue. That is, squares of the first pattern represent a color filter 212 for a first color, which may for example be green; squares of the second pattern represent a color filter 214 for a second color, which may for example be blue; and squares of the third pattern represent a color filter 216 for a third color, which may for example be red. These color filters are arranged in color filter arrays (CFAs) over an array of photodiodes in the pixel arrays 200, 230, and 240 of FIG. 2A, FIG. 2C, and FIG. 2D, respectively. The colors (and number of colors) identified in the legend 210 of FIG. 2B, and the arrangements of color filters illustrated in the pixel arrays 200, 230, and 240 of FIG. 2A, FIG. 2C, and FIG. 2D, should be understood to be exemplary and should not be construed as limiting. Red, green, and blue color filters are traditionally used in image sensors and are often referred to as Bayer filters. Bayer filter CFAs often include more green Bayer filters than red or blue Bayer filters, for example in a proportion of 50%green, 25%red, 25%blue, to mimic sensitivity to green light in human eye physiology. Bayer filter CFAs with these proportions are sometimes referred to as BGGR, RGBG, GRGB, or RGGB, and are reflected in the presence of the color filter 212 in higher proportion than the color filters 214 and 216 in the pixel arrays 200, 230, and 240 of FIG. 2A, FIG. 2C, and FIG. 2D.Sometimes, in such Bayer filter CFAs, green is treated as two colors, labeled “Gr” and “Gb” respectively. Some CFAs use alternate color schemes and can even include more or fewer colors. For example, some CFAs use cyan, yellow, and magenta color filters instead of the traditional red, green, and blue Bayer color filter scheme. In an arrangement referred to as cyan yellow yellow magenta (CYYM) , 50%of the color filters are yellow, while 25%are cyan and 25%are magenta. Some filters also add a fourth green filter to the three cyan, yellow, and magenta filters, together referred to as a cyan yellow green magenta (CYGM) filter. Some CFAs use red, green, blue and “emerald” or cyan, referred to as an RGBE color scheme. In some cases, some mix or combination of the Bayer, CYYM, CYGM, or RGBE color schemes may be used. In some cases, color filters of one or more of the colors of the Bayer, CYYM,  CYGM, or RGBE color schemes may be omitted, in some cases leaving only two colors or even one color. While the legend 210 of FIG. 2B lists precisely three color filters 212, 214, and 216, and provides green, red, and blue as examples to adhere to the traditional Bayer filter color scheme, it should be understood that more than three colors or less than three colors may alternately be used in the CFA, and that the colors may vary, for example including red, green, blue, cyan, magenta, yellow, emerald, white (transparent) , or some combination thereof. Some image sensors, such as the Foveon  sensor, may lack color filters altogether, instead opting to use different photodiodes throughout the pixel array (optionally vertically stacked) , the different photodiodes having different spectral sensitivity curves and therefore responding to different wavelengths of light. Monochrome image sensors may also lack color filters and therefore lack color depth. Use of color filters in an image sensor used with the camera systems described further herein should therefore be considered optional.

[0057] The pixel array 200 of FIG. 2A is illustrated with two pixels that are used for phase detection auto focus (PDAF) , which are referred to herein as focus pixels, but may alternately be referred to as PDAF pixels or phase detection (PD) pixels. Other pixels not used for PDAF may simply be referred to as imaging pixels 204. In the pixel array 200 of FIG. 2A, any pixel without a mask 220 is an imaging pixel 204, even though only two imaging pixels 204 are specifically labeled. While two focus pixels are illustrated in the pixel array 200 of FIG. 2A, both in the same column but with three rows of imaging pixels in between, a different pixel array (not pictured) may have any number of focus pixels (i.e., one or more focus pixels) , which may be arranged in any possible pattern or arrangement. In some cases, patterns of focus pixels may repeat across a pixel array, for example in “tiles” that are 8 pixels by 8 pixels in size, or 16 pixels by 16 pixels in size.

[0058] The two focus pixels illustrated in FIG. 2A are both partially covered by masks 220, the two masks 220 labeled as mask 202A and mask 202B, respectively. Each of the masks 220 may be a mask or shield made of an opaque and / or reflective material, such as a metal. Each mask 220 limits the amount and direction of light that strikes the photodiode of the focus pixel that is partially covered by the mask. The mask 202A and mask 202B each limit how much light reaches and strikes the underlying focus pixel photodiode from a particular direction, and are disposed over two different focus pixel diodes in an opposite direction to produce a pair of left and right images. For example, the mask 202A is disposed over a left side of a first focus pixel, leaving the right side of that first focus pixel to receive light entering from the right side  (the right image) . The mask 202B is disposed over a right side of a second focus pixel, leaving the left side of that second focus pixel to receive light entering from the left side (the left image) . Because the two focus pixels are both illustrated as half-covered by the masks 220, their focus photodiodes effectively receive 50%of the light that an imaging photodiode (which would not be covered by a mask) in the same location on the pixel array would receive.

[0059] Any number of focus pixels may be included in a pixel array of an image sensor. Left and right pairs of focus pixels may be adjacent to one another, or may be spaced apart by one or more imaging pixels 204. The two pixels from a left and right pair of focus pixels may both be in the same row and / or same column of the pixel array, may be in a different row and / or different column, or some combination thereof. While masks 202A and 202B are shown within pixel array 200 as masking left and right portions of the focus pixel photodiodes, this is for exemplary purposes only. Focus pixel masks 220 may instead mask top or bottom portions of the focus pixel photodiodes, thus generating top and bottom images (or “up” and “down” images) from the focus pixel data received by the focus pixels. Like the left and right pairs of focus pixels, top and down pairs of focus pixels may both be in the same row and / or same column of the pixel array, may be in a different row and / or different column, or some combination thereof. A pixel array of an image sensor may have a focus pixel with a mask 220 over a left side of one focus pixel, a mask 220 over a right side of a second focus pixel, a mask 220 over a top side of a third focus pixel, a mask 220 over a bottom side of a fourth focus pixel, and optionally more focus pixels with any of these types of masks 220. Using focus pixels with masks 220 along multiple axes (e.g., left-right pairs of focus pixels as well as top-down pairs of focus pixels) can improve autofocus quality. One reason why autofocus quality can be improved by using focus pixels with masks 220 along multiple axes is because use of masks 220 along left and right sides of focus pixel photodiodes alone for PDAF can lead to poor focus on scenes or subjects with many horizontal edges (i.e., lines that appear along a left-right axis relative to the orientation of the focus pixels and masks 220) , and use of masks 220 along top and bottom sides of focus pixel photodiodes alone for PDAF can lead to poor focus on scenes or subjects with many vertical edges (i.e., lines that appear along an up-down axis relative to the orientation of the focus pixels and masks 220) .

[0060] Some PDAF camera systems do not use masks 220 on focus pixels as in FIG. 2A, but instead cover multiple pixels under a single microlens, which may alternately be referred to as an on-chip lens (OCL) . FIG. 2C illustrates a top-down view of a pixel array configuration with  two side-by-side focus pixels covered by a 2 pixel by 1 pixel microlens. FIG. 2D illustrates a top-down view of a pixel array configuration with four neighboring focus pixels covered by a 2 pixel by 2 pixel microlens. The pixel arrays 230 and 240 of FIG. 2C and FIG. 2D can also be interpreted based on the legend 210 of FIG. 2B.

[0061] Referring to FIG. 2C and 2D, the 2 pixel by 1 pixel microlens 232 of FIG. 2C and the 2 pixel by 2 pixel microlens 242 of FIG. 2D both span multiple adjacent focus pixels (i.e., the microlenses cover multiple adjacent focus pixel photodiodes) , and both can limit the amount and / or direction of light that strikes the focus pixel photodiodes of those focus pixels. The microlens 232 of FIG. 2C covers two horizontally-adjacent focus pixels of a pixel array 230, such that focus pixel data from both focus photodiodes may be generated, with focus pixel data from the left one of the focus pixels (labeled with an “L” ) representing light approaching from the left side of the pixel array 230, and focus pixel data from the right one of the focus pixels (labeled with an “R” ) representing light approaching from the right side of the pixel array 230. While the microlens 232 is shown within pixel array 230 as spanning left and right adjacent pixels / diodes (e.g., in a horizontal direction) , this is for exemplary purposes only. A 2 pixel by 1 pixel microlens 232 may instead span top and bottom adjacent pixels / diodes (e.g., in a vertical direction) , thus generating an up and down (or top and bottom) pair of focus photodiodes and corresponding pixel data.

[0062] Similarly, the microlens 242 of FIG. 2D covers a 2-pixel by 2-pixel square of four adjacent focus pixels of a pixel array 240, such that focus pixel data from all four photodiodes in the square may be generated. The focus pixel data from the four adjacent focus pixels thus includes focus pixel data from an upper-left pixel (labeled “UL” in FIG. 2D) representing light approaching from the upper-left of the pixel array 240, focus pixel data from an upper-right pixel (labelled “UR” in FIG. 2D) representing light approaching from the upper-right of the pixel array 240, focus pixel data from a bottom-left pixel (labeled “BL” in FIG. 2D) representing light approaching from the bottom-left of the pixel array 240, and focus pixel data from a bottom right pixel (labeled “BR” in FIG. 2D) representing light approaching from the bottom right of the pixel array 240. The configurations of pixel arrays 230 and 240 of FIG. 2C and FIG. 2D are exemplary; any number of focus pixels may be included within a pixel array, and may include one or more horizontally-oriented (left-right) 2-pixel by 1-pixel microlenses 232, one or more vertically-oriented (up-down) 2-pixel by 1-pixel microlenses 232, one or more 2-pixel by 2-pixel microlenses 242, or different combinations thereof.

[0063] Again referring to FIG. 2C and 2D, once the pixel array captures a frame, thus capturing focus pixel data for each focus pixel, focus pixel data from paired focus pixels may be compared with one another. For example, focus pixel data from a left focus pixel photodiode may be compared with focus pixel data from a right focus pixel photodiode, and focus pixel data from a top focus pixel photodiode may be compared with focus pixel data from a bottom focus pixel photodiode. If the compared focus pixel data values differ, this difference is known as the phase disparity, also known as the phase difference, defocus value, or separation error. Focus pixels under a 2-pixel by 2-pixel microlens 242 as in FIG. 2D essentially have two vertically-adjacent horizontally-oriented pairs of focus pixels and / or two horizontally-adjacent vertically-oriented pairs of focus pixels. Thus, the focus pixel data from the UL focus pixel may be compared to focus pixel data from the BL focus pixel (as a top / bottom pair) , focus pixel data from the UR focus pixel may be compared to focus pixel data from the BR focus pixel (as a top / bottom pair) , focus pixel data from the UL focus pixel may be compared to focus pixel data from the UR focus pixel (as a left / right pair) , focus pixel data from the BL focus pixel may be compared to focus pixel data from the BR focus pixel (as a left / right pair) , or some combination thereof. In some cases, focus pixel data may alternately or additionally be compared between pixels that are opposite each other diagonally (along two axes) . For example, focus pixel data from the UL focus pixel focus may be compared to focus pixel data from the BR focus pixel, and / or focus pixel data from the BL focus pixel focus may be compared to focus pixel data from the UR focus pixel.

[0064] While the focus pixels under the 2 pixel by 1 pixel microlens 232 of FIG. 2C and the focus pixels under the 2 pixel by 2 pixel microlens 242 of FIG. 2D are all illustrated having the color filter 212 of the first color, this is not required. In some cases, the normal pattern of the CFA of the pixel array may continue under a 2 pixel by 1 pixel microlens 232 and / or under a 2 pixel by 2 pixel microlens 242.

[0065] FIG. 2E illustrates a top-down view of a pixel array configuration of an image sensor in which at least one focus pixel has two photodiodes. In particular, a four-pixel by four-pixel pixel array 250 with four focus pixels is illustrated in FIG. 2E. The four focus pixels illustrated in the pixel array 250 each include two photodiodes, with the left-side photodiode and the right-side photodiode of each focus pixel’s photodiode pair labeled “L” and “R, ” respectively. Focus pixels with two photodiodes, like the focus pixels of FIG. 2E, are sometimes referred to as dual photodiode (2PD) focus pixels.

[0066] One of the 2PD focus pixels of FIG. 2E is labeled as 2PD focus pixel 252. The left-side photodiode (L) of the 2PD focus pixel 252 is labeled “left-side photodiode 254L, ” and the right-side photodiode (R) of the 2PD focus pixel 252 is labeled “right-side photodiode 254R. ” For each captured frame, the left photodiode 254L and the right photodiode 254R may capture light received by the 2PD focus pixel 252 from different angles. For a given frame, the data captured by the left photodiode 254L may be referred to as the left image or left image data, while the data captured by the right photodiode 254R may be referred to as the right image or right image data. The left image data and the right image data may be compared to determine phase disparity.

[0067] The pixel array 250 illustrated in FIG. 2E is a “sparse” 2PD pixel array in which only some of the pixels in the pixel array 250 include two photodiodes (namely, the focus pixels) . The remaining pixels are imaging pixels and only include a single photodiode. In some cases, however a “dense” 2PD pixel array may be used instead, in which every pixel in the pixel array (or a higher percentage of pixels in the pixel array) include two photodiodes, and can in some cases act as both focus pixels and imaging pixels simultaneously, or can switch between acting as a focus pixel for one frame and acting as an imaging pixel for another frame. While all of the 2PD focus pixels of FIG. 2E are shown as “horizontal” 2PD focus pixels having a left photodiode and a right photodiode, this arrangement is exemplary. A pixel array with 2PD focus pixels may additionally or alternately include “vertical” focus pixels with a top ( “up” ) photodiode and a bottom ( “down” ) photodiode and / or photodiodes that are arranged diagonally with respect to one another. Since use of only horizontal focus pixels can sometimes limit recognition of horizontal edges in images, and use of only vertical focus pixels can sometimes limit recognition of vertical edges in images, use of both horizontal focus pixels and vertical focus pixels can improve focus quality by performing well even in images with many horizontal edges and / or vertical edges.

[0068] FIG. 2F illustrates a top-down view of a pixel array configuration of an image sensor in which at least one focus pixel has four photodiodes. The pixel array 260 illustrated in FIG. 2F includes focus pixels in which each focus pixel includes four diodes, generally referred to as 4PD focus pixels or Quadrature Phase Detection (QPD) focus pixels. For example, a 4PD focus pixel 262 is labeled in FIG. 2F, and includes an upper-left photodiode labeled with the letters “UL, ” an upper-right photodiode labeled with the letters “UR, ” a bottom-left photodiode labeled with the letters “BL, ” and a bottom-right photodiode labeled with the letters “BR. ”  Data from each photodiode of the 4PD focus pixel 262 may be compared to data from an adjacent photodiode of the 4PD focus pixel 262 to determine phase difference. For example, photodiode data from the UL photodiode may be compared to photodiode data from the BL photodiode (as a top / bottom pair) , photodiode data from the UR photodiode may be compared to photodiode data from the BR photodiode (as a top / bottom pair) , photodiode data from the UL photodiode may be compared to photodiode data from the UR photodiode (as a left / right pair) , photodiode data from the BL photodiode may be compared to photodiode data from the BR photodiode (as a left / right pair) , or some combination thereof. In some cases, photodiode data from the 4PD focus pixel 262 may alternately or additionally be compared between photodiodes that are opposite each other diagonally (along two axes) . For example, photodiode data from the UL photodiode of the 4PD focus pixel 262 may be compared to photodiode data from the BR photodiode of the 4PD focus pixel 262, and / or photodiode data from the BL photodiode of the 4PD focus pixel 262 may be compared to photodiode data from the UR photodiode of the 4PD focus pixel 262.

[0069] The pixel array 260 illustrated in FIG. 2F is a “sparse” 4PD pixel array in which only some of the pixels in the pixel array 260 include four photodiodes (namely, the focus pixels) . The remaining pixels are imaging pixels and only include a single photodiode. In some cases, however a “dense” 4PD pixel array may be used instead, in which every pixel in the pixel array (or a higher percentage of pixels in the pixel array) include four photodiodes, and can in some cases act as both focus pixels and imaging pixels simultaneously, or can switch between acting as a focus pixel for one frame and acting as an imaging pixel for another frame. While all of the 4PD focus pixels of FIG. 2F are shown as “horizontal” 4PD focus pixels having a left photodiode and a right photodiode, this arrangement is exemplary. A pixel array with 4PD focus pixels may additionally or alternately include “vertical” focus pixels with a top ( “up” ) photodiode and a bottom ( “down” ) photodiode and / or photodiodes that are arranged diagonally with respect to one another. Since use of only horizontal focus pixels can sometimes limit recognition of horizontal edges in images, and use of only vertical focus pixels can sometimes limit recognition of vertical edges in images, use of both horizontal focus pixels and vertical focus pixels can improve focus quality by performing well even in images with many horizontal edges and / or vertical edges.

[0070] In some cases, a pixel array may use some combination of one or more pairs of focus pixels with masks 220 (as illustrated in FIG. 2A) , one or more pairs of focus pixels covered by  2-pixel by 1-pixel microlenses 232 (as illustrated in FIG. 2C) , one or more groups of focus pixels covered by 2-pixel by 2-pixel microlenses 242 (as illustrated in FIG. 2D) , one or more 2PD focus pixels 252 (as illustrated in FIG. 2E) , and / or one or more 4PD focus pixels 262 (as illustrated in FIG. 2F) . In some cases, focus pixels in any of the configurations illustrated in and discussed with respect to FIG. 2A-2F may be arranged in a vertically and / or horizontally tiled pattern, such as the tiled patterns of the 2PD and 4PD focus pixels of FIG. 2E and FIG. 2F.

[0071] FIG. 3A illustrates a side view of a single pixel of a pixel array of an image sensor that is partially covered with a mask. The side view of the pixel 300 illustrates the single-pixel microlens 218 over a color filter 310A, which is over a mask 220, the mask 220 covering the left side of the photodiode 320A. A ray of light 350B entering from the right side of the microlens 218 passes through the color filter 310A and reaches the photodiode 320A, while ray of light 350A entering from the left side of the microlens 218 is reflected by the mask 220. While a similar pixel with the mask 220 over the right side of the photodiode 320A is not illustrated, it should be understood that this could be achieved by horizontally flipping the illustration of FIG. 3A. In an alternate embodiment, the mask 220 may be positioned above the color filter 310A and / or above the microlens 218.

[0072] FIG. 3B illustrates a side view of two pixels of a pixel array of an image sensor, the two pixels covered by a 2 pixel by 1 pixel microlens. The side view of the two pixels 340 of FIG. 3B illustrates the 2 pixel by 1 pixel microlens 232 over one color filter 310B on the left and another adjacent color filter 310C on the right, with the color filter 310B on the left over a left photodiode 320B, and the color filter 310C on the right over a right photodiode 320C. Two rays of light 350C and 350D entering from the left side of the microlens 232 pass through the left color filter 310B and reach the left photodiode 320B, while two rays of light 350E and 350F entering from the right side of the microlens 232 pass through the right color filter 310C and reach the right photodiode 320C.

[0073] Each color filter of the color filters 310A, 310B, and 310C of FIG. 3A and FIG. 3B may be a color filter of any color previously described with respect to color filters 212, 214, and 216. That is, while FIG. 3A and FIG. 3B list red, green, and blue as example colors to adhere to the traditional Bayer color scheme, each color filter of the color filters 310A, 310B, and 310C may represent another color such as cyan, yellow, magenta, emerald, or white  (transparent) . While the color filters 310A, 310B, and 310C all are illustrated with an identical pattern in FIG. 3A and FIG. 3B, the pattern matching the pattern of color filter 212 of FIGS. 2A-2D, the three color filters 310A, 310B, and 310C need not all represent the same color of color filter as each other, and need not represent the same color as the color filter 212 of FIGS. 2A-2D. All three color filters 310A, 310B, and 310C can be different colors, or alternately any two (or all three) can optionally share a color. Alternatively, no color filter may be included.

[0074] FIG. 4 is a block diagram of an example device 400 that may be used for the disclosed systems and techniques for improving PDAF focus performance. Device 400 may include or may be coupled to a camera 402, and may further include a processor 406, a memory 408 storing instructions 410, a camera controller 412, a display 416, and a number of input / output (I / O) components 418. The example device 400 may be any suitable device capable of capturing and / or storing images or video including, for example, wired and wireless communication devices (such as camera phones, smartphones, tablets, security systems, dash cameras, laptop computers, desktop computers, automobiles, drones, aircraft, and so on) , digital cameras (including still cameras, video cameras, and so on) , or any other suitable device. The device 400 may include additional features or components not shown. For example, a wireless interface, which may include a number of transceivers and a baseband processor, may be included for a wireless communication device. Device 400 may include or may be coupled to additional cameras other than the camera 402. The disclosure should not be limited to any specific examples or illustrations, including the example device 400.

[0075] Camera 402 may be capable of capturing individual image frames (such as still images) and / or capturing video (such as a succession of captured image frames) . Camera 402 may include one or more image sensors (not shown for simplicity) and shutters for capturing an image frame and providing the captured image frame to camera controller 412. Although a single camera 402 is shown, any number of cameras or camera components may be included and / or coupled to device 400. For example, the number of cameras may be increased to achieve greater depth determining capabilities or better resolution for a given FOV.

[0076] Memory 408 may be a non-transient or non-transitory computer readable medium storing computer-executable instructions 410 to perform all or a portion of one or more operations described in this disclosure. Device 400 may also include a power supply 420, which may be coupled to or integrated into the device 400.

[0077] Processor 406 may be one or more suitable processors capable of executing scripts or instructions of one or more software programs (such as a PDAF algorithm, CAF algorithm, and / or an ML confidence model) stored within memory 408. In some aspects, processor 406 may be one or more general purpose processors that execute instructions 410 to cause device 400 to perform any number of functions or operations. In additional or alternative aspects, processor 406 may include integrated circuits or other hardware to perform functions or operations without the use of software. While shown to be coupled to each other via processor 406 in the example of FIG. 4, processor 406, memory 408, camera controller 412, display 416, and I / O components 418 may be coupled to one another in various arrangements. For example, processor 406, memory 408, camera controller 412, display 416, and / or I / O components 418 may be coupled to each other via one or more local buses (not shown for simplicity) .

[0078] Display 416 may be any suitable display or screen allowing for user interaction and / or to present items (such as captured images and / or videos) for viewing by the user. In some aspects, display 416 may be a touch-sensitive display. Display 416 may be part of or external to device 400. Display 416 may comprise an LCD, LED, OLED, or similar display. I / O components 418 may be or may include any suitable mechanism or interface to receive input (such as commands) from the user and to provide output to the user. For example, I / O components 418 may include (but are not limited to) a graphical user interface, keyboard, mouse, microphone and speakers, and so on.

[0079] Camera controller 412 may include an image signal processor 414, which may be (or may include) one or more image signal processors to process image frames or videos provided and / or obtained by camera 402. For example, image signal processor 414 may be configured to perform various processing operations for automatic focus (AF) , automatic white balance (AWB) , and / or automatic exposure (AE) . Examples of image processing operations include, but are not limited to, cropping, scaling (e.g., to a different resolution) , image stitching, image format conversion, color interpolation, image interpolation, color processing, image filtering (e.g., spatial image filtering) , and / or the like.

[0080] In some example implementations, camera controller 412 (such as the image signal processor 414) may implement various functionality, including imaging processing and / or control operation of camera 502. In some aspects, image signal processor 414 may execute instructions from a memory (such as instructions 410 stored in memory 408 or instructions  stored in a separate memory coupled to image signal processor 414) to control image processing and / or operation of camera 402. In other aspects, image signal processor 414 may include specific hardware to control image processing and / or operation of camera 402. Image signal processor 414 may alternatively or additionally include a combination of specific hardware and the ability to execute software instructions.

[0081] While not shown in FIG. 4, in some implementations, image signal processor 414 may include an AF module, an AWB module, and / or an AE module. Image signal processor 414 may be configured to execute an AF process, an AWB process, and / or an AE process. In some examples, image signal processor 414 may include hardware-specific circuits (e.g., an application-specific integrated circuit (ASIC) ) configured to perform the AF, AWB, and / or AE processes. In other examples, image signal processor 414 may be configured to execute software and / or firmware to perform the AF, AWB, and / or AE processes. When configured in software, code for the AF, AWB, and / or AE processes may be stored in memory (such as instructions 410 stored in memory 408 or instructions stored in a separate memory coupled to image signal processor 414) . In other examples, image signal processor 414 may perform the AF, AWB, and / or AE processes using a combination of hardware, firmware, and / or software. When configured as software, AF, AWB, and / or AE processes may include instructions that configure image signal processor 414 to perform various image processing and device managements tasks.

[0082] As previously mentioned, PDAF (e.g., a PDAF algorithm) is often employed to determine a lens position for focusing a camera. However, in some cases, PDAF may determine a lens position for the camera that may result in the camera producing a blurred image. There can be challenging scene scenarios (e.g., a flat scene, a spotlight scene, and a backlit scene) for PDAF, where PDAF may not be able to provide good focusing results, which can result in the camera producing a blurry image (e.g., resulting in a failed focusing of the camera) .

[0083] FIG. 5 shows examples of challenging scene scenarios for PDAF. In particular, FIG. 5 is a diagram illustrating examples of different types of scene scenarios that are challenging for PDAF. In FIG. 5, a flat scene 510, a spotlight scene 520, and a backlit scene 530 are shown. Each of these different types of scene scenarios shown in FIG. 5 are challenging for PDAF to be able to provide a lens position that allows for good focusing results. As such, for these types  of scene scenarios, PDAF will often determine a lens position where the camera is not property focused and produces a blurry image.

[0084] As previously mentioned, the PDAF algorithm generates defocusing and confidence values. Each defocusing value (also referred to as a phase detection (PD) value) has an associated confidence value. Each defocusing value has an associated position for the lens for focusing the camera (e.g., graph 1000 shows an example of lens positions that correspond to different defocusing values) . The confidence value represents a level of confidence (e.g., a level of probability) that the lens position associated with the defocusing value will provide a successful focusing (e.g., not a failed focusing) of the camera such that the camera will produce a clear (not blurry) image.

[0085] PDAF focuses the camera by moving the lens of the camera to a position determined by these values (e.g., based on the defocusing and confidence values) . When the confidence value (associated with a defocusing value) is high, the PDAF algorithm will use the defocusing value associated with the confidence value to determine the position for the lens.

[0086] FIG. 6 shows examples of correct defocusing values with associated high confidence values. In particular, FIG. 6 is a diagram illustrating an example of grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) of a region of interest (ROI) 610 of a scene 600, where the grids have correct defocusing values with associated high confidence values. In FIG. 6, the ROI 610 of the scene 600 is shown to be divided into a three by three (3x3) matrix including nine (9) sub-windows or grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) . In one or more examples, the ROI 610 may be divided into matrices of different sizes (e.g., 4x4 matrix, 5x5 matrix, etc. ) other than the size (e.g., 3x3 matrix) of the matrix as is shown in FIG. 6. Each grid (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) has a defocusing value (PD value) and an associated confidence value. For example, grid 0 has a defocusing value (PD value) of 0.19 and has an associated confidence value of 986.

[0087] In FIG. 6, the defocusing values for the grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) are all correct defocusing values that will provide for a successful focusing (e.g., not a failed focusing) . The associated confidence values for these defocusing values are all high. Since all of the grids have high confidence values, the PDAF algorithm will use the defocusing values from all of the grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) to determine a position for the lens for the focusing of the camera.

[0088] Conversely, when a confidence value (associated with a defocusing value) is low, the PDAF algorithm will not use the defocusing value associated with the confidence value to determine the position for the lens.

[0089] FIG. 7 shows examples of incorrect defocusing values with associated low confidence values. In particular, FIG. 7 is a diagram illustrating an example of grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) of a ROI 710 of a scene 700, where some of the grids 720 (e.g., grids 5 and 8) have incorrect defocusing values with associated low confidence values. In FIG. 7, the ROI 710 of the scene 700 is shown to be divided into a 3x3 matrix including nine sub-windows or grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) . In some examples, the ROI 710 may be divided into matrices of different sizes (e.g., 4x4 matrix, 5x5 matrix, etc. ) other than the size (e.g., 3x3 matrix) of the matrix as is shown in FIG. 7.

[0090] Each grid (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) has a defocusing value (PD value) and an associated confidence value. For example, grid 0 has a defocusing value (PD value) of 0.12 and has a high confidence value of 914. For another example, grid 5 has a defocusing value (PD value) of -1.41 and has a low confidence value of 251.

[0091] In FIG. 7, the defocusing values for the grids 0, 1, 2, 3, 4, 6, and 7 are correct defocusing values that will provide for a successful focusing (e.g., not a failed focusing) . The associated confidence values for these defocusing values are high. The defocusing values for the grids 720 (e.g., grids 5 and 8) are incorrect defocusing values that will not provide for a successful focusing (e.g., a failed focusing) . The associated confidence values for these defocusing values are low.

[0092] Since the grids 0, 1, 2, 3, 4, 6, and 7 have high confidence values, the PDAF algorithm will use defocusing values (e.g., which are correct defocusing values) from these grids (e.g., grids 0, 1, 2, 3, 4, 6, and 7) to determine a position for the lens for the focusing of the camera. Since the grids 720 (e.g., grids 5 and 8) have low confidence values, the PDAF algorithm will not use defocusing values (e.g., which are incorrect) from these grids 720 (e.g., grids 5 and 8) to determine a position for the lens for the focusing of the camera. Since the PDAF algorithm is not using (e.g., discarding) the defocusing values (which are incorrect) from the grids 720 (e.g., grids 5 and 8) to determine the position for the lens, the determined position for the lens should provide for a successful focusing (e.g., not a failed focusing) of the camera.

[0093] In one or more examples, there can be some cases where a defocusing value is incorrect (e.g., unable to result in a successful focusing) , but the associated confidence value is high. For these cases, although the defocusing value is incorrect, since the confidence value is high, the PDAF algorithm will use the defocusing value associated with the confidence value to determine the position for the lens. In these cases, since the PDAF algorithm has used an incorrect defocusing value to determine the position for the lens, the camera will not be properly focused (e.g., a failed focusing of the camera) and, as such, will produce a blurred image. As such, a technique for improving PDAF focus performance can be beneficial.

[0094] FIG. 8 shows examples of incorrect defocusing values with associated high confidence values. In particular, FIG. 8 is a diagram illustrating an example of grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) of a ROI 810 of a scene 800, where some of the grids 820 (e.g., grids 2, 5, and 8) have incorrect defocusing values with associated high confidence values. In FIG. 8, the ROI 810 of the scene 800 is shown to be divided into a 3x3 matrix including nine sub-windows or grids (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) . In one or more examples, the ROI 810 may be divided into matrices of different sizes (e.g., 4x4 matrix, 5x5 matrix, etc. ) other than the size (e.g., 3x3 matrix) of the matrix as is shown in FIG. 8.

[0095] Each grid (e.g., grids 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) has a defocusing value (PD value) and an associated confidence value. For example, grid 0 has a defocusing value (PD value) of 0.50 and has a high confidence value of 836. For another example, grid 2 has a defocusing value (PD value) of -1.52 and has a high confidence value of 770.

[0096] In FIG. 8, the defocusing values for the grids 0, 1, 3, 4, 6, and 7 are correct defocusing values that will provide for a successful focusing (e.g., not a failed focusing) . The associated confidence values for these defocusing values are high. The defocusing values for the grids 820 (e.g., grids 2, 5, and 8) are incorrect defocusing values that will not provide for a successful focusing (e.g., a failed focusing) . However, the associated confidence values for these defocusing values are high.

[0097] Since the grids 0, 1, 3, 4, 6, and 7 have high confidence values, the PDAF algorithm will use defocusing values (e.g., which are correct defocusing values) from these grids (e.g., grids 0, 1, 3, 4, 6, and 7) to determine a position for the lens for the focusing of the camera. Since the grids 820 (e.g., grids 2, 5, and 8) have high confidence values, the PDAF algorithm will additionally use defocusing values (e.g., which are incorrect) from these grids 820 (e.g.,  grids 2, 5, and 8) to determine the position for the lens for the focusing of the camera. Since the PDAF algorithm is using the defocusing values (which are incorrect) from the grids 820 (e.g., grids 2, 5, and 8) to determine the position for the lens, the determined position for the lens will provide a failed focusing (e.g., not a successful focusing) of the camera. As such, a technique for improving PDAF focus performance can be useful.

[0098] In one or more aspects, the systems and techniques provide for improving PDAF focus performance. In one or more examples, the systems and techniques employ a machine-learning (ML) confidence model (e.g., one or more neural networks) that can output information that flags (e.g., categorizes) grids with incorrect defocusing values (e.g., unable to provide for a successful focusing) and high associated confidence values. For these flagged (e.g., categorized) grids, the PDAF algorithm can lower (adjust) their associated high confidence values to an appropriate lower level accordingly. Since these grids with incorrect defocusing values will now have low confidence values, the PDAF algorithm will not use (e.g., disregard) the defocusing values from these grids when determining a position for the lens for the focusing of the camera. As such, the determined position for the lens will provide for a successful focusing of the camera such that the camera can produce clear (not blurry) images. In one or more examples, when all of the grids are discarded (e.g., all of the grids have low confidences values) , a CDAF algorithm can be employed (instead of the PDAF algorithm) to determine the position for the lens for the focusing of the camera.

[0099] FIG. 9 shows an example of a process for collecting data (e.g., defocusing values, confidence values, lens positions, and focus values) for training the disclosed ML confidence model. In particular, FIG. 9 is a flow chart illustrating an example of a process 900 for collecting data for training an AI model for focusing a camera (e.g., camera 402 of FIG. 4) . In one or more examples, one or more processors (e.g., processor 406 of FIG. 4, image signal processor 414 of FIG. 4, and / or processor 1410 of FIG. 14, or other processor (s) ) of a camera (e.g., camera 402 of FIG. 4) and / or a device (e.g., device 400 of FIG. 4) may perform the process 900.

[0100] In FIG. 9, during operation of the process, at block 904, one or more processors (e.g., of a camera and / or a device) may run a full sweep to collect data. For the full sweep, the lens of the camera can be manually (e.g., physically) moved to positions from one end (e.g., a maximum distance near end that is close to the camera) to another end (e.g., a maximum  distance far end that is away from the camera) in fixed incremental steps of distance (e.g., delta distance steps) . During the full sweep, data (e.g., defocusing values (PD values) , confidence values, lens positions, and focus values) can be determined (e.g., by the one or more processors running a PDAF algorithm) and collected (e.g., by the one or more processors) for grids of an ROI of one or more scenes (e.g., including one or more challenging scenes or non-challenging scenes for PDAF) at each lens position.

[0101] At block 910, the first position of the full sweep may be at lens position A. At block 915, the ROI of the one or more scenes can be configured (e.g., by the one or more processors) into a multiple window (MW) configuration including multiple grids in a matrix format (e.g., a 3x3 matrix, 5x5 matrix, etc. ) . At block 920, For each grid (e.g., sub-window) of the ROI of a scene, at the lens position (e.g., lens position A) , the PDAF algorithm can perform a traditional PD calculation to determine the defocusing value, the confidence value, the lens position, and the focus value for that grid. At block 925, the determined defocusing value, confidence value, lens position, and focus value for that grid may be saved (e.g., in memory, such as memory 408 of FIG. 4 and / or memory 1415 of FIG. 14) .

[0102] FIG. 10 shows examples of defocusing values, confidence values, and focus values. In particular, FIG. 10 is a diagram illustrating graphs 1000, 1010, 1020 showing example defocusing values, confidence values, and focus values for different lens positions. In FIG. 10, for graph 1000, the x-axis represents lens positions and the y-axis represents defocusing values (PD values) . Graph 1000 shows example defocusing values for different lens positions. For graph 1010, the x-axis represents lens positions and the y-axis represents confidence values. Graph 1010 shows example confidence values for different lens positions. For graph 1020, the x-axis represents lens positions and the y-axis represents focus values. Graph 1020 shows example focus values for different lens positions.

[0103] Referring back to FIG. 9, at decision block 930, the one or more processors can determine whether the full sweep has been completed (e.g., is done) . If the one or more processors determine that the full sweep has not been completed, the process 900 will proceed to block 935. At block 935, the lens will be moved to the next incremental position and the process will repeat, until the full sweep is done.

[0104] However, if the one or more processors determine that the full sweep has been completed, the process 900 will proceed to block 940. At block 940, the one or more processors  can determine the maximum (max) focus value (FV) and the corresponding lens position for the max FV. The determined corresponding lens position for the max FV can be referred to as the ground truth lens position. At block 945, the one or more processors can calculate an ideal defocusing value (PD value) for each grid at each lens position, by using the ground truth lens position (e.g., based on the ground truth lens position) .

[0105] FIG. 11 shows an example max FV along with its corresponding lens position (e.g., the ground truth lens position) . In particular, FIG. 11 is a diagram illustrating graphs 1100, 1110 showing example focus values (e.g., including a max FV) and phase disparities for different lens positions. For graph 1100, the x-axis represents lens positions, and the y-axis represents focus values.

[0106] In FIG. 11, an example focus value curve is plotted in graph 1100. The max FV is located at the peak of the focus value curve of graph 1100. Graph 1100 shows the associated lens position (e.g., at approximately 658) , which is labeled as Position (Pos) A, for the max FV.The corresponding lens position (e.g., Pos A) for the max FV will allow for the camera to provide the clearest possible image of the scene. The ideal defocusing value (PD value) for the corresponding lens position for the max FV is equal to zero (0) .

[0107] The ideal defocusing values (ideal PD values) for the other lens positions (e.g., including Pos B) can be obtained by using the corresponding lens position (e.g., Pos A) for the max FV. For example, the ideal defocusing value (ideal PD value) for Pos B can be determined by first calculating (e.g., by the one or more processors) the difference in distance between Pos A and Pos B (e.g., a delta lens position) . The ideal defocusing value (ideal PD value) for Pos B can be calculated (e.g., by the one or more processors) by using (e.g., based on) the traditional defocusing value (PD value) of Pos A (e.g., which was determined in block 920 by using traditional PD methods) , the determined delta lens position, and a defocus conversion coefficient (DCC) . The ideal defocusing value (ideal PD value) is a principled value on one lens position, and the traditional defocusing value (e.g., obtained by using traditional PD methods) is a calculated value on the one lens position.

[0108] The DCC is a precalculated parameter, which is a known value on the AF algorithm. Formula 1120 of FIG. 11 shows that DCC is equal to the delta lens position divided by a delta in the phase disparity. An example DCC curve, which is near linear, is plotted in graph 1110. For graph 1110, the x-axis represents lens positions, and the y-axis represents phase disparity.

[0109] Since the traditional defocusing value (PD value) of Pos A (e.g., which was determined in block 920 by using traditional PD methods) and the determined delta lens position are known, the one or more processors can calculate the ideal defocusing value (ideal PD value) for Pos B by using the DCC (e.g., the DCC curve plotted in graph 1110) .

[0110] Referring back to FIG. 9, at decision block 950, the one or more processors can determine, for each grid at each lens position, whether the difference between the traditional defocusing value (PD value) and the ideal defocusing value (ideal PD value) is greater than a predetermined threshold (e.g., an error threshold) . If the one or more processors determine that the difference between the traditional defocusing value (PD value) and the ideal defocusing value (ideal PD value) is not greater than the threshold (e.g., error threshold) , the process proceeds to block 965.

[0111] However, if the one or more processors determine that the difference between the traditional defocusing value (PD value) and the ideal defocusing value (ideal PD value) is greater than the threshold (e.g., error threshold) , the process proceeds to decision block 955. At decision block 955, for each grid at each lens position, the one or more processors can determine whether the confidence value (e.g., the traditional confidence value determined at block 920) associated with the traditional defocusing value (PD value) has a high value (e.g., is greater than a confidence value threshold) . If the one or more processors determine that the confidence value associated with the traditional defocusing value (PD value) does not have a high value (e.g., has a low value, and is not greater than the confidence value threshold) , the process 900 proceeds to block 965. At block 965, the one or more processors can label the grid as category B (e.g., a second category) .

[0112] However, if the one or more processors determine that the confidence value associated with the traditional defocusing value (PD value) does have a high value (e.g., is greater than the confidence value threshold) , the process 900 proceeds to block 960. At block 960, the one or more processors can label the grid as category A (e.g., a first category) . At block 970, the one or more processors can dump all of the PD raw data (e.g., ROI data including the grids) and their corresponding labels (e.g., category A or B) , for different types of scenes, into an AI model for training. At block 975, the different types of scenes can include, but are not limited to, a flat scene, a spotlight scene, a normal scene, a lowlight scene, a low texture scene, a high  contrast scene, and / or a lab scene. At block 980, the one or more processors can train the AI model using the PD raw data with the corresponding labels for the different scenes.

[0113] FIG. 12 shows an example of a process for adjusting (e.g., lowering) high confidence values for grids labeled as category A. In particular, FIG. 12 is a flow chart showing an example of a process 1200 for adjusting confidence values to provide for an improved PDAF focus performance for a camera (e.g., camera 402 of FIG. 4) . In one or more examples, one or more processors (e.g., processor 406 of FIG. 4, image signal processor 414 of FIG. 4, and / or processor 1410 of FIG. 14, or other processor (s) ) of a camera (e.g., camera 402 of FIG. 4) and / or a device (e.g., device 400 of FIG. 4) may perform the process 1200.

[0114] In FIG. 12, during operation of the process 1200, at block 1205, one or more processors (e.g., of a camera and / or a device) may obtain PD raw data (e.g., ROI data of a scene) . At block 1210, the ROI of one or more scenes (e.g., including one or more challenging scenes and / or non-challenging scenes for PDAF) can be configured (e.g., by the one or more processors) into a multiple window (MW) configuration including multiple grids in a matrix format (e.g., a 3x3 matrix, 5x5 matrix, etc. ) .

[0115] At block 1215, For each grid (e.g., sub-window) of the ROI of the one or more scenes, at all lens positions (e.g., beginning with lens position A) , the PDAF algorithm can perform a traditional PD calculation to determine the defocusing value, the confidence value, the lens position, and the focus value for that grid. At decision block 1220, the one or more processors can determine whether the calculated confidence value (e.g., traditional confidence value) for each grid is high (e.g., is greater than a confidence value threshold) . For each of the grids, if the one or more processors determine that the calculated confidence value (e.g., traditional confidence value) for a grid is not high (e.g., is low and is not greater than the confidence value threshold) , the process 1200 will proceed to block 1225 for that grid. For each of the grids, if the one or more processors determine that the calculated confidence value (e.g., traditional confidence value) for a grid is high (e.g., is greater than the confidence value threshold) , the process 1200 will proceed to block 1245 for that grid.

[0116] At block 1230, the PD raw data has been configured (e.g., by the one or more processors) into a multiple window (MW) configuration including multiple grids in a matrix format (e.g., which may in total be referred to as a split raw data) . At block 1235, the one or more processors can run an ML confidence model (e.g., which has been previously trained) using the split raw data as an input to the model. The ML confidence model can, based on its previous training (e.g., which was performed in block 980 of FIG. 9) , label (e.g., categorize) each grid with a label as category A (e.g., a first category) or category B (e.g., a second category) . Grids that are labeled as category A are determined by the ML confidence model to have incorrect defocusing values associated with high confidence values (e.g., confidence values that are greater than the confidence value threshold) . Grids that are labeled as category B are determined by the ML confidence model to have incorrect defocusing values associated with low confidence values (e.g., confidence values that are not greater than the confidence value threshold) , or to have correct defocusing values associated with high confidence values e.g., confidence values that are greater than the confidence value threshold) . At block 1240, the ML confidence model can output the grids along with their associated labels (e.g., category A or category B) .

[0117] At decision block 1245, the one or more processors can determine whether each of the grids is labeled as category A. For each of the grids, if the one or more processors determines that a grid is labeled as category A, the process 1200 proceeds to block 1250 for that grid. At block 1250, the one or more processors can adjust (e.g., lower) the high confidence values of the one or more grids labeled as category A to a low confidence value (e.g., a confidence value lower than the confidence value threshold) .

[0118] For each of the grids, if the one or more processors determines that a grid is not labeled as category A (e.g., is labeled as category B) , the process 1200 proceeds to block 1225 for that grid. At block 1225, the one or more processors can sort the grids based on the defocusing values and the associated confidence values. In one or more examples, the one or more processors can run the PDAF algorithm using the grids with high confidence values (e.g., not using the grids with low confidence values) to determine a position for the lens for the focusing of the camera. The one or more processors can then cause the lens to move to that determined position to focus the camera to produce a clear (not blurry) image.

[0119] FIG. 13 is a flow chart illustrating an example of a process 1300 for focusing a camera. The process 1300 can be performed by a camera and / or a device (e.g., camera 402 and / or device 400 of FIG. 4) or by a component or system (e.g., a chipset) of the camera and / or device. In one or more examples, the camera may be implemented within (e.g., housed within) , communicatively connected to, and / or associated with the device. The operations of the process  1300 may be implemented as software components that are executed and run on one or more processors (e.g., processor 406 of FIG. 4, image signal processor 414 of FIG. 4, and / or processor 1410 of FIG. 14, or other processor (s) ) , which may be implemented within the camera and / or the device.

[0120] At block 1310, the camera or device (or component thereof) can categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category (e.g., category A or category B, such as discussed with respect to FIG. 9 and / or FIG. 12) based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids. In some examples, the one or more images are associated with one or more scenes, such as a flat scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, a high contrast scene, any combination thereof, and / or other type of scene.

[0121] In some aspects, the camera or device (or component thereof) can configure the ROI of the one or more images into the plurality of grids. In some cases, the camera or device (or component thereof) can categorize each grid of the plurality of grids into one of the first category or the second category using a machine learning confidence model. In some examples, the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids. In some aspects, each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold. In some cases, one or more grids of the plurality of grids are categorized into the second category based on (or when) the one or more grids each have one of:a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; or a defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.

[0122] At block 1320, the camera or device (or component thereof) can adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold. For example, as described with respect to FIG. 12, the camera or device (or component thereof) can adjust (e.g., lower) the high confidence values of the one or more grids  labeled as category A to a low confidence value (e.g., a confidence value lower than the confidence value threshold) .

[0123] At block 1330, the camera or device (or component thereof) can determine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold. In some cases, the camera or device (or component thereof) can move the lens to the position to focus the camera. For example, as described with respect to FIG. 12, for each of the grids, if the camera or device (or component thereof) determines that a grid is not labeled as category A (e.g., is labeled as category B) , the camera or device (or component thereof) use the grids with high confidence values (e.g., not using the grids with low confidence values) to determine a position for the lens for the focusing of the camera. The camera or device (or component thereof) can then cause the lens to move to that determined position to focus the camera to produce a clear (not blurry) image. In some aspects, the camera or device (or component thereof) can determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids. In some cases, the camera or device (or component thereof) can determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids using a phase detection autofocus (PDAF) algorithm.

[0124] The camera (e.g., camera 402 of FIG. 4) and / or the device (e.g., device 400 of FIG. 4) may include various components, such as one or more input devices, one or more output devices, one or more processors, one or more microprocessors, one or more microcomputers, one or more cameras, one or more sensors, one or more receivers, transmitters, and / or transceivers, and / or other component (s) that are configured to carry out the steps of processes described herein. In some examples, the computing device may include a display, a network interface configured to communicate and / or receive the data, any combination thereof, and / or other component (s) . The network interface may be configured to communicate and / or receive Internet Protocol (IP) based data or other type of data.

[0125] The components of the camera and / or device configured to perform the process 1300 of FIG. 13 can be implemented in circuitry. For example, the components can include and / or can be implemented using electronic circuits or other electronic hardware, which can include one or more programmable electronic circuits (e.g., microprocessors, graphics processing units (GPUs) , digital signal processors (DSPs) , central processing units (CPUs) , and / or other suitable  electronic circuits) , and / or can include and / or be implemented using computer software, firmware, or any combination thereof, to perform the various operations described herein.

[0126] The process 1300 is illustrated as logical flow diagrams, the operation of which represents a sequence of operations that can be implemented in hardware, computer instructions, or a combination thereof. In the context of computer instructions, the operations represent computer-executable instructions stored on one or more computer-readable storage media that, when executed by one or more processors, perform the recited operations. Generally, computer-executable instructions include routines, programs, objects, components, data structures, and the like that perform particular functions or implement particular data types. The order in which the operations are described is not intended to be construed as a limitation, and any number of the described operations can be combined in any order and / or in parallel to implement the processes.

[0127] Additionally, the process 1300 and / or any other process described herein may be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors, by hardware, or combinations thereof. As noted above, the code may be stored on a computer-readable or machine-readable storage medium, for example, in the form of a computer program comprising a plurality of instructions executable by one or more processors. The computer-readable or machine-readable storage medium may be non-transitory.

[0128] FIG. 14 is a block diagram illustrating an example of a computing system 1400, which may be employed by the disclosed systems and techniques for improving PDAF focus performance. In particular, FIG. 14 illustrates an example of computing system 1400, which can be, for example, any computing device making up internal computing system, a remote computing system, a camera, or any component thereof in which the components of the system are in communication with each other using connection 1405. Connection 1405 can be a physical connection using a bus, or a direct connection into processor 1410, such as in a chipset architecture. Connection 1405 can also be a virtual connection, networked connection, or logical connection.

[0129] In some aspects, computing system 1400 is a distributed system in which the functions described in this disclosure can be distributed within a datacenter, multiple data centers, a peer  network, etc. In some aspects, one or more of the described system components represents many such components each performing some or all of the function for which the component is described. In some aspects, the components can be physical or virtual devices.

[0130] Example system 1400 includes at least one processing unit (CPU or processor) 1410 and connection 1405 that communicatively couples various system components including system memory 1415, such as read-only memory (ROM) 1420 and random access memory (RAM) 1425 to processor 1410. Computing system 1400 can include a cache 1412 of high-speed memory connected directly with, in close proximity to, or integrated as part of processor 1410.

[0131] Processor 1410 can include any general purpose processor and a hardware service or software service, such as services 1432, 1434, and 1436 stored in storage device 1430, configured to control processor 1410 as well as a special-purpose processor where software instructions are incorporated into the actual processor design. Processor 1410 may essentially be a completely self-contained computing system, containing multiple cores or processors, a bus, memory controller, cache, etc. A multi-core processor may be symmetric or asymmetric.

[0132] To enable user interaction, computing system 1400 includes an input device 1445, which can represent any number of input mechanisms, such as a microphone for speech, a touch-sensitive screen for gesture or graphical input, keyboard, mouse, motion input, speech, etc. Computing system 1400 can also include output device 1435, which can be one or more of a number of output mechanisms. In some instances, multimodal systems can enable a user to provide multiple types of input / output to communicate with computing system 1400.

[0133] Computing system 1400 can include communications interface 1440, which can generally govern and manage the user input and system output. The communication interface may perform or facilitate receipt and / or transmission wired or wireless communications using wired and / or wireless transceivers, including those making use of an audio jack / plug, a microphone jack / plug, a universal serial bus (USB) port / plug, an AppleTM LightningTM port / plug, an Ethernet port / plug, a fiber optic port / plug, a proprietary wired port / plug, 3G, 4G, 5G and / or other cellular data network wireless signal transfer, a BluetoothTM wireless signal transfer, a BluetoothTM low energy (BLE) wireless signal transfer, an IBEACONTM wireless signal transfer, a radio-frequency identification (RFID) wireless signal transfer, near-field communications (NFC) wireless signal transfer, dedicated short range communication (DSRC)  wireless signal transfer, 802.11 Wi-Fi wireless signal transfer, wireless local area network (WLAN) signal transfer, Visible Light Communication (VLC) , Worldwide Interoperability for Microwave Access (WiMAX) , Infrared (IR) communication wireless signal transfer, Public Switched Telephone Network (PSTN) signal transfer, Integrated Services Digital Network (ISDN) signal transfer, ad-hoc network signal transfer, radio wave signal transfer, microwave signal transfer, infrared signal transfer, visible light signal transfer, ultraviolet light signal transfer, wireless signal transfer along the electromagnetic spectrum, or some combination thereof.

[0134] The communications interface 1440 may also include one or more range sensors (e.g., light-based sensors, laser range finders, RF-based sensors, ultrasonic sensors, and infrared (IR) sensors) configured to collect data and provide measurements to processor 1410, whereby processor 1410 can be configured to perform determinations and calculations needed to obtain various measurements for the one or more range sensors. In some examples, the measurements can include time of flight, wavelengths, azimuth angle, elevation angle, range, linear velocity and / or angular velocity, or any combination thereof. The communications interface 1440 may also include one or more Global Navigation Satellite System (GNSS) receivers or transceivers that are used to determine a location of the computing system 1400 based on receipt of one or more signals from one or more satellites associated with one or more GNSS systems. GNSS systems include, but are not limited to, the US-based GPS, the Russia-based Global Navigation Satellite System (GLONASS) , the China-based BeiDou Navigation Satellite System (BDS) , and the Europe-based Galileo GNSS. There is no restriction on operating on any particular hardware arrangement, and therefore the basic features here may easily be substituted for improved hardware or firmware arrangements as they are developed.

[0135] Storage device 1430 can be a non-volatile and / or non-transitory and / or computer-readable memory device and can be a hard disk or other types of computer readable media which can store data that are accessible by a computer, such as magnetic cassettes, flash memory cards, solid state memory devices, digital versatile disks, cartridges, a floppy disk, a flexible disk, a hard disk, magnetic tape, a magnetic strip / stripe, any other magnetic storage medium, flash memory, memristor memory, any other solid-state memory, a compact disc read only memory (CD-ROM) optical disc, a rewritable compact disc (CD) optical disc, digital video disk (DVD) optical disc, a blu-ray disc (BDD) optical disc, a holographic optical disk, another optical medium, a secure digital (SD) card, a micro secure digital (microSD) card, a  Memory  card, a smartcard chip, a EMV chip, a subscriber identity module (SIM) card, a mini / micro / nano / pico SIM card, another integrated circuit (IC) chip / card, random access memory (RAM) , static RAM (SRAM) , dynamic RAM (DRAM) , read-only memory (ROM) , programmable read-only memory (PROM) , erasable programmable read-only memory (EPROM) , electrically erasable programmable read-only memory (EEPROM) , flash EPROM (FLASHEPROM) , cache memory (e.g., Level 1 (L1) cache, Level 2 (L2) cache, Level 3 (L3) cache, Level 4 (L4) cache, Level 5 (L5) cache, or other (L#) cache) , resistive random-access memory (RRAM / ReRAM) , phase change memory (PCM) , spin transfer torque RAM (STT-RAM) , another memory chip or cartridge, and / or a combination thereof.

[0136] The storage device 1430 can include software services, servers, services, etc., that when the code that defines such software is executed by the processor 1410, it causes the system to perform a function. In some aspects, a hardware service that performs a particular function can include the software component stored in a computer-readable medium in connection with the necessary hardware components, such as processor 1410, connection 1405, output device 1435, etc., to carry out the function. The term “computer-readable medium” includes, but is not limited to, portable or non-portable storage devices, optical storage devices, and various other mediums capable of storing, containing, or carrying instruction (s) and / or data. A computer-readable medium may include a non-transitory medium in which data can be stored and that does not include carrier waves and / or transitory electronic signals propagating wirelessly or over wired connections. Examples of a non-transitory medium may include, but are not limited to, a magnetic disk or tape, optical storage media such as compact disk (CD) or digital versatile disk (DVD) , flash memory, memory or memory devices. A computer-readable medium may have stored thereon code and / or machine-executable instructions that may represent a procedure, a function, a subprogram, a program, a routine, a subroutine, a module, a software package, a class, or any combination of instructions, data structures, or program statements. A code segment may be coupled to another code segment or a hardware circuit by passing and / or receiving information, data, arguments, parameters, or memory contents. Information, arguments, parameters, data, etc. may be passed, forwarded, or transmitted via any suitable means including memory sharing, message passing, token passing, network transmission, or the like.

[0137] Specific details are provided in the description above to provide a thorough understanding of the aspects and examples provided herein, but those skilled in the art will  recognize that the application is not limited thereto. Thus, while illustrative aspects of the application have been described in detail herein, it is to be understood that the inventive concepts may be otherwise variously embodied and employed, and that the appended claims are intended to be construed to include such variations, except as limited by the prior art. Various features and aspects of the above-described application may be used individually or jointly. Further, aspects can be utilized in any number of environments and applications beyond those described herein without departing from the broader scope of the specification. The specification and drawings are, accordingly, to be regarded as illustrative rather than restrictive. For the purposes of illustration, methods were described in a particular order. It should be appreciated that in alternate aspects, the methods may be performed in a different order than that described.

[0138] For clarity of explanation, in some instances the present technology may be presented as including individual functional blocks comprising devices, device components, steps or routines in a method embodied in software, or combinations of hardware and software. Additional components may be used other than those shown in the figures and / or described herein. For example, circuits, systems, networks, processes, and other components may be shown as components in block diagram form in order not to obscure the aspects in unnecessary detail. In other instances, well-known circuits, processes, algorithms, structures, and techniques may be shown without unnecessary detail in order to avoid obscuring the aspects.

[0139] Further, those of skill in the art will appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the aspects disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.

[0140] Individual aspects may be described above as a process or method which is depicted as a flowchart, a flow diagram, a data flow diagram, a structure diagram, or a block diagram.  Although a flowchart may describe the operations as a sequential process, many of the operations can be performed in parallel or concurrently. In addition, the order of the operations may be re-arranged. A process is terminated when its operations are completed, but could have additional steps not included in a figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc. When a process corresponds to a function, its termination can correspond to a return of the function to the calling function or the main function.

[0141] Processes and methods according to the above-described examples can be implemented using computer-executable instructions that are stored or otherwise available from computer-readable media. Such instructions can include, for example, instructions and data which cause or otherwise configure a general purpose computer, special purpose computer, or a processing device to perform a certain function or group of functions. Portions of computer resources used can be accessible over a network. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, firmware, source code. Examples of computer-readable media that may be used to store instructions, information used, and / or information created during methods according to described examples include magnetic or optical disks, flash memory, USB devices provided with non-volatile memory, networked storage devices, and so on.

[0142] In some aspects the computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bitstream and the like. However, when mentioned, non-transitory computer-readable storage media expressly exclude media such as energy, carrier signals, electromagnetic waves, and signals per se.

[0143] Those of skill in the art will appreciate that information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof, in some cases depending in part on the particular application, in part on the desired design, in part on the corresponding technology, etc.

[0144] The various illustrative logical blocks, modules, and circuits described in connection with the aspects disclosed herein may be implemented or performed using hardware, software,  firmware, middleware, microcode, hardware description languages, or any combination thereof, and can take any of a variety of form factors. When implemented in software, firmware, middleware, or microcode, the program code or code segments to perform the necessary tasks (e.g., a computer-program product) may be stored in a computer-readable or machine-readable medium. A processor (s) may perform the necessary tasks. Examples of form factors include laptops, smart phones, mobile phones, tablet devices or other small form factor personal computers, personal digital assistants, rackmount devices, standalone devices, and so on.Functionality described herein also can be embodied in peripherals or add-in cards. Such functionality can also be implemented on a circuit board among different chips or different processes executing in a single device, by way of further example.

[0145] The instructions, media for conveying such instructions, computing resources for executing them, and other structures for supporting such computing resources are example means for providing the functions described in the disclosure.

[0146] The techniques described herein may also be implemented in electronic hardware, computer software, firmware, or any combination thereof. Such techniques may be implemented in any of a variety of devices such as general purposes computers, wireless communication device handsets, or integrated circuit devices having multiple uses including application in wireless communication device handsets and other devices. Any features described as modules or components may be implemented together in an integrated logic device or separately as discrete but interoperable logic devices. If implemented in software, the techniques may be realized at least in part by a computer-readable data storage medium comprising program code including instructions that, when executed, performs one or more of the methods, algorithms, and / or operations described above. The computer-readable data storage medium may form part of a computer program product, which may include packaging materials. The computer-readable medium may comprise memory or data storage media, such as random access memory (RAM) such as synchronous dynamic random access memory (SDRAM) , read-only memory (ROM) , non-volatile random access memory (NVRAM) , electrically erasable programmable read-only memory (EEPROM) , FLASH memory, magnetic or optical data storage media, and the like. The techniques additionally, or alternatively, may be realized at least in part by a computer-readable communication medium that carries or communicates program code in the form of instructions or data structures and that can be accessed, read, and / or executed by a computer, such as propagated signals or waves.

[0147] The program code may be executed by a processor, which may include one or more processors, such as one or more digital signal processors (DSPs) , general purpose microprocessors, an application specific integrated circuits (ASICs) , field programmable logic arrays (FPGAs) , or other equivalent integrated or discrete logic circuitry. Such a processor may be configured to perform any of the techniques described in this disclosure. A general-purpose processor may be a microprocessor; but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. Accordingly, the term “processor, ” as used herein may refer to any of the foregoing structure, any combination of the foregoing structure, or any other structure or apparatus suitable for implementation of the techniques described herein.

[0148] One of ordinary skill will appreciate that the less than ( “<” ) and greater than ( “>” ) symbols or terminology used herein can be replaced with less than or equal to ( “≤” ) and greater than or equal to ( “≥” ) symbols, respectively, without departing from the scope of this description.

[0149] Where components are described as being “configured to” perform certain operations, such configuration can be accomplished, for example, by designing electronic circuits or other hardware to perform the operation, by programming programmable electronic circuits (e.g., microprocessors, or other suitable electronic circuits) to perform the operation, or any combination thereof.

[0150] The phrase “coupled to” or “communicatively coupled to” refers to any component that is physically connected to another component either directly or indirectly, and / or any component that is in communication with another component (e.g., connected to the other component over a wired or wireless connection, and / or other suitable communication interface) either directly or indirectly.

[0151] Claim language or other language reciting “at least one of” a set and / or “one or more” of a set indicates that one member of the set or multiple members of the set (in any combination) satisfy the claim. For example, claim language reciting “at least one of A and B” or “at least one of A or B” means A, B, or A and B. In another example, claim language reciting “at least  one of A, B, and C” or “at least one of A, B, or C” means A, B, C, or A and B, or A and C, or B and C, or A and B and C. The language “at least one of” a set and / or “one or more” of a set does not limit the set to the items listed in the set. For example, claim language reciting “at least one of A and B” or “at least one of A or B” can mean A, B, or A and B, and can additionally include items not listed in the set of A and B.

[0152] Claim language or other language reciting “at least one processor configured to, ” “at least one processor being configured to, ” “one or more processors configured to, ” “one or more processors being configured to, ” or the like indicates that one processor or multiple processors (in any combination) can perform the associated operation (s) . For example, claim language reciting “at least one processor configured to: X, Y, and Z” means a single processor can be used to perform operations X, Y, and Z; or that multiple processors are each tasked with a certain subset of operations X, Y, and Z such that together the multiple processors perform X, Y, and Z; or that a group of multiple processors work together to perform operations X, Y, and Z. In another example, claim language reciting “at least one processor configured to: X, Y, and Z” can mean that any single processor may only perform at least a subset of operations X, Y, and Z.

[0153] Where reference is made to one or more elements performing functions (e.g., steps of a method) , one element may perform all functions, or more than one element may collectively perform the functions. When more than one element collectively performs the functions, each function need not be performed by each of those elements (e.g., different functions may be performed by different elements) and / or each function need not be performed in whole by only one element (e.g., different elements may perform different sub-functions of a function) . Similarly, where reference is made to one or more elements configured to cause another element (e.g., an apparatus) to perform functions, one element may be configured to cause the other element to perform all functions, or more than one element may collectively be configured to cause the other element to perform the functions.

[0154] Where reference is made to an entity (e.g., any entity or device described herein) performing functions or being configured to perform functions (e.g., steps of a method) , the entity may be configured to cause one or more elements (individually or collectively) to perform the functions. The one or more components of the entity may include at least one memory, at least one processor, at least one communication interface, another component  configured to perform one or more (or all) of the functions, and / or any combination thereof. Where reference to the entity performing functions, the entity may be configured to cause one component to perform all functions, or to cause more than one component to collectively perform the functions. When the entity is configured to cause more than one component to collectively perform the functions, each function need not be performed by each of those components (e.g., different functions may be performed by different components) and / or each function need not be performed in whole by only one component (e.g., different components may perform different sub-functions of a function) .

[0155] Illustrative aspects of the disclosure include:

[0156] Aspect 1. An apparatus for focusing a camera, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and determine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0157] Aspect 2. The apparatus of Aspect 1, wherein the at least one processor is configured to configure the ROI of the one or more images into the plurality of grids.

[0158] Aspect 3. The apparatus of any one of Aspects 1 or 2, wherein the at least one processor is configured to determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids.

[0159] Aspect 4. The apparatus of Aspect 3, wherein the at least one processor is configured to determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids using a phase detection autofocus (PDAF) algorithm.

[0160] Aspect 5. The apparatus of any one of Aspects 1 to 4, wherein the one or more images are associated with one or more scenes, the one or more scenes including at least one of a flat  scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, or a high contrast scene.

[0161] Aspect 6. The apparatus of any one of Aspects 1 to 5, wherein the at least one processor is configured to categorize each grid of the plurality of grids into one of the first category or the second category using a machine learning confidence model.

[0162] Aspect 7. The apparatus of Aspect 6, wherein the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids.

[0163] Aspect 8. The apparatus of any one of Aspects 1 to 7, wherein each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold.

[0164] Aspect 9. The apparatus of any one of Aspects 1 to 8, wherein one or more grids of the plurality of grids are categorized into the second category, when the one or more grids each have one of: a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; or a defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.

[0165] Aspect 10. The apparatus of any one of Aspects 1 to 9, wherein the at least one processor is configured to move the lens to the position to focus the camera.

[0166] Aspect 11. A method for focusing a camera, the method comprising: categorizing each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; adjusting at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and determining a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0167] Aspect 12. The method of Aspect 11, further comprising configuring the ROI of the one or more images into the plurality of grids.

[0168] Aspect 13. The method of any one of Aspects 11 or 12, further comprising determining each defocusing value and each corresponding confidence value for each grid of the plurality of grids.

[0169] Aspect 14. The method of Aspect 13, wherein determining each defocusing value and each corresponding confidence value for each grid of the plurality of grids is performed using a phase detection autofocus (PDAF) algorithm.

[0170] Aspect 15. The method of any one of Aspects 11 to 14, wherein the one or more images are associated with one or more scenes, the one or more scenes including at least one of a flat scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, or a high contrast scene.

[0171] Aspect 16. The method of any one of Aspects 11 to 15, wherein categorizing each grid of the plurality of grids into one of the first category or the second category is performed by a machine learning confidence model.

[0172] Aspect 17. The method of Aspect 16, wherein the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids.

[0173] Aspect 18. The method of any one of Aspects 11 to 17, wherein each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold.

[0174] Aspect 19. The method of any one of Aspects 11 to 18, wherein one or more grids of the plurality of grids are categorized into the second category, when the one or more grids each have one of: a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; or a defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.

[0175] Aspect 20. The method of any one of Aspects 11 to 19, further comprising moving the lens to the position to focus the camera.

[0176] Aspect 21. A non-transitory computer-readable storage medium comprising instructions stored thereon which, when executed by at least one processor, cause the at least one processor to: categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids; adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; and determine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.

[0177] Aspect 22. The non-transitory computer-readable storage medium of Aspect 21, wherein the instructions, when executed by the at least one processor, cause the at least one processor to configure the ROI of the one or more images into the plurality of grids.

[0178] Aspect 23. The non-transitory computer-readable storage medium of any one of Aspects 21 or 22, wherein the instructions, when executed by the at least one processor, cause the at least one processor to determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids.

[0179] Aspect 24. The non-transitory computer-readable storage medium of Aspect 23, wherein each defocus value and each corresponding confidence value for each grid of the plurality of grids are determined using a phase detection autofocus (PDAF) algorithm.

[0180] Aspect 25. The non-transitory computer-readable storage medium of any one of Aspects 21 to 24, wherein the one or more images are associated with one or more scenes, the one or more scenes including at least one of a flat scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, or a high contrast scene.

[0181] Aspect 26. The non-transitory computer-readable storage medium of any one of Aspects 21 to 25, wherein each grid of the plurality of grids are categorized into one of the first category or the second category using a machine learning confidence model.

[0182] Aspect 27. The non-transitory computer-readable storage medium of Aspect 26, wherein the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids.

[0183] Aspect 28. The non-transitory computer-readable storage medium of any one of Aspects 21 to 27, wherein each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold.

[0184] Aspect 29. The non-transitory computer-readable storage medium of any one of Aspects 21 to 28, wherein one or more grids of the plurality of grids are categorized into the second category, when the one or more grids each have one of: a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; or a defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.

[0185] Aspect 30. The non-transitory computer-readable storage medium of any one of Aspects 21 to 29, wherein the instructions, when executed by the at least one processor, cause the at least one processor to move the lens to the position to focus the camera.

[0186] Aspect 31. An apparatus for focusing a camera, the apparatus comprising one or more means for performing operations according to any one of Aspects 11 to 20.

[0187] The previous description is provided to enable any person skilled in the art to practice the various aspects described herein. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects. Thus, the claims are not intended to be limited to the aspects shown herein, but is to be accorded the full scope consistent with the language claims, wherein reference to an element in the singular is not intended to mean “one and only one” unless specifically so stated, but rather “one or more. ”

Claims

1.An apparatus for focusing a camera, the apparatus comprising:at least one memory; andat least one processor coupled to the at least one memory and configured to:categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids;adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; anddetermine a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.2.The apparatus of claim 1, wherein the at least one processor is configured to configure the ROI of the one or more images into the plurality of grids.3.The apparatus of claim 1, wherein the at least one processor is configured to determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids.4.The apparatus of claim 3, wherein the at least one processor is configured to determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids using a phase detection autofocus (PDAF) algorithm.5.The apparatus of claim 1, wherein the one or more images are associated with one or more scenes, the one or more scenes including at least one of a flat scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, or a high contrast scene.6.The apparatus of claim 1, wherein the at least one processor is configured to categorize each grid of the plurality of grids into one of the first category or the second category using a machine learning confidence model.7.The apparatus of claim 6, wherein the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids.8.The apparatus of claim 1, wherein each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold.9.The apparatus of claim 1, wherein one or more grids of the plurality of grids are categorized into the second category, when the one or more grids each have one of:a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; ora defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.10.The apparatus of claim 1, wherein the at least one processor is configured to move the lens to the position to focus the camera.11.A method for focusing a camera, the method comprising:categorizing each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids;adjusting at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; anddetermining a position for a lens of the camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.12.The method of claim 11, further comprising configuring the ROI of the one or more images into the plurality of grids.13.The method of claim 11, further comprising determining each defocusing value and each corresponding confidence value for each grid of the plurality of grids.14.The method of claim 13, wherein determining each defocusing value and each corresponding confidence value for each grid of the plurality of grids is performed using a phase detection autofocus (PDAF) algorithm.15.The method of claim 11, wherein the one or more images are associated with one or more scenes, the one or more scenes including at least one of a flat scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, or a high contrast scene.16.The method of claim 11, wherein categorizing each grid of the plurality of grids into one of the first category or the second category is performed by a machine learning confidence model.17.The method of claim 16, wherein the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids.18.The method of claim 11, wherein each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold.19.The method of claim 11, wherein one or more grids of the plurality of grids are categorized into the second category, when the one or more grids each have one of:a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; ora defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.20.The method of claim 11, further comprising moving the lens to the position to focus the camera.21.A non-transitory computer-readable storage medium comprising instructions stored thereon which, when executed by at least one processor, cause the at least one processor to:categorize each grid of a plurality of grids of a region of interest (ROI) of one or more images into one of a first category or a second category based on a respective confidence value corresponding to a respective defocusing value for each grid of the plurality of grids;adjust at least one confidence value corresponding to at least one defocusing value for at least one grid of the plurality of grids categorized into the first category to be lower than a confidence value threshold; anddetermine a position for a lens of a camera based on defocusing values of the plurality of grids having corresponding confidence values that are higher than the confidence value threshold.22.The non-transitory computer-readable storage medium of claim 21, wherein the instructions, when executed by the at least one processor, cause the at least one processor to configure the ROI of the one or more images into the plurality of grids.23.The non-transitory computer-readable storage medium of claim 21, wherein the instructions, when executed by the at least one processor, cause the at least one processor to determine each defocusing value and each corresponding confidence value for each grid of the plurality of grids.24.The non-transitory computer-readable storage medium of claim 23, wherein each defocus value and each corresponding confidence value for each grid of the plurality of grids are determined using a phase detection autofocus (PDAF) algorithm.25.The non-transitory computer-readable storage medium of claim 21, wherein the one or more images are associated with one or more scenes, the one or more scenes  including at least one of a flat scene, a spotlight scene, a normal scene, a low light scene, a low texture scene, or a high contrast scene.26.The non-transitory computer-readable storage medium of claim 21, wherein each grid of the plurality of grids are categorized into one of the first category or the second category using a machine learning confidence model.27.The non-transitory computer-readable storage medium of claim 26, wherein the machine learning confidence model is trained based on a comparison of defocusing values of the plurality of grids with ideal defocusing values for the plurality of grids.28.The non-transitory computer-readable storage medium of claim 21, wherein each grid of the plurality of grids categorized into the first category includes a respective defocusing value that is incorrect and a corresponding confidence value that is higher than the confidence value threshold.29.The non-transitory computer-readable storage medium of claim 21, wherein one or more grids of the plurality of grids are categorized into the second category, when the one or more grids each have one of:a defocusing value that is correct and a confidence value that is higher than the confidence value threshold; ora defocusing value that is incorrect and a confidence value that is not higher than the confidence value threshold.30.The non-transitory computer-readable storage medium of claim 21, wherein the instructions, when executed by the at least one processor, cause the at least one processor to move the lens to the position to focus the camera.

Citation Information

Patent Citations

  • Autofocus with confidence measure

    CN102103248A

  • Focusing method and device, electronic equipment and computer readable storage medium

    CN112866552A

  • Automatic focusing method and device, shooting terminal and computer readable storage medium

    CN113923347A

  • Method and device for generating full-focus image

    CN115082352A

  • Apparatus, image capturing apparatus, method, and storage medium

    US20210360165A1

Cited By

  • A zoom lens correction method and device, electronic equipment and storage medium

    CN122534206A

  • A zoom lens correction method and device, electronic equipment and storage medium

    CN122534206B