Using multiple exposures for phase detection

By generating a phase-detection-pixel map from multiple exposures to select properly exposed pixels, the method addresses autofocus inefficiencies in existing technologies, enhancing focus accuracy and reducing power consumption.

WO2025217753A1PCT designated stage Publication Date: 2025-10-23QUALCOMM INC +4
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/087718
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-15
Publication Date
2025-10-23

AI Technical Summary

Technical Problem

Existing autofocus technologies in cameras, such as active AF and CDAF, struggle with focusing in low-light or high-light conditions and require additional sensors, leading to inefficiencies and power consumption, while PDAF may fail to properly focus due to under or overexposed phase-detection pixels.

Method used

A method and apparatus for determining lens position using a phase-detection-pixel map generated from both short and long exposures to select properly exposed phase-detection pixels, improving autofocus accuracy by combining phase-detection pixels from multiple exposures to determine optimal lens positioning.

Benefits of technology

Enhances autofocus accuracy by selecting properly exposed phase-detection pixels, reducing power consumption and latency, and improving focus in various lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024087718_23102025_PF_FP_ABST
    Figure CN2024087718_23102025_PF_FP_ABST
Patent Text Reader

Abstract

Systems and techniques are described herein for processing image data. For instance, a method for processing image data is provided. The method may include obtaining a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; obtaining a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; generating a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; and determining, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.
Need to check novelty before this filing date? Find Prior Art

Description

USING MULTIPLE EXPOSURES FOR PHASE DETECTIONTECHNICAL FIELD

[0001] The present disclosure generally relates to processing image data. For example, aspects of the present disclosure include systems and techniques for determining phase-detection data to focus a lens of a camera.BACKGROUND

[0002] A camera can receive light and capture image frames, such as still images or video frames, using an image sensor. Cameras can be configured with a variety of image-capture settings and / or image-processing settings to alter the appearance of images captured thereby. Image-capture settings may be determined and applied before and / or while an image is captured, such as ISO, exposure time (also referred to as exposure, exposure duration, or shutter speed) , aperture size, (also referred to as f / stop) , focus, and gain (including analog and / or digital gain) , among others. Moreover, image-processing settings can be configured for post-processing of an image, such as alterations to contrast, brightness, saturation, sharpness, levels, curves, and colors, among others.

[0003] 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. In some cameras, focus is adjusted manually by the photographer, typically via a dial along the camera that the photographer rotates clockwise or counter-clockwise to move the lens forward or backward. Some cameras are capable of automatically focusing.

[0004] In some cases, a camera can capture multiple images of a scene using different image-capture settings and can combine the captured images into a single image frame. For example, the camera may capture two images of a scene, the first using a short exposure and the second using a long exposure. The camera may combine pixels of the short-exposure image that are not underexposed with pixels of the long-exposure image that are not overexposed to generate a composite image.SUMMARY

[0005] 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 presents 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.

[0006] Systems and techniques are described for processing image data. According to at least one example, a method is provided for processing image data. The method includes: obtaining a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; obtaining a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; generating a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; and determining, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.

[0007] In another example, an apparatus for processing image data is provided that includes at least one memory and at least one processor (e.g., configured in circuitry) coupled to the at least one memory. The at least one processor configured to: obtain a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; obtain a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; generate a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel  values; and determine, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.

[0008] In another example, a non-transitory computer-readable medium is provided that has stored thereon instructions that, when executed by one or more processors, cause the one or more processors to: obtain a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; obtain a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; generate a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; and determine, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.

[0009] In another example, an apparatus for processing image data is provided. The apparatus includes: means for obtaining a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; means for obtaining a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; means for generating a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; and means for determining, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.

[0010] In some aspects, one or more of the apparatuses described herein is, can be part of, or can include an extended reality device (e.g., a virtual reality (VR) device, an augmented reality (AR) device, or a mixed reality (MR) device) , a vehicle (or a computing device, system, or component of a vehicle) , a mobile device (e.g., a mobile telephone or so-called “smart phone” , a tablet computer, or other type of mobile device) , a smart or connected device (e.g., an Internet-of-Things (IoT) device) , a wearable device, a personal computer, a laptop computer, a video server, a television (e.g., a network-connected television) , a robotics device or system, or other device. In some aspects, each apparatus can include an image sensor (e.g., a camera) or multiple image sensors (e.g., multiple cameras) for capturing one or more images. In some aspects, each apparatus can include one or more displays for displaying one or more images, notifications, and / or other displayable data. In some aspects, each apparatus can include one or more speakers, one or more light-emitting devices, and / or one or more microphones. In some aspects, each apparatus can include one or more sensors. In some cases, the one or more sensors can be used for determining a location of the apparatuses, a state of the apparatuses (e.g., a tracking state, an operating state, a temperature, a humidity level, and / or other state) , and / or for other purposes.

[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.

[0012] The foregoing, together with other features and aspects, will become more apparent upon referring to the following specification, claims, and accompanying drawings.BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Illustrative examples of the present application are described in detail below with reference to the following figures:

[0014] FIG. 1 is a block diagram illustrating an example architecture of an image processing system, according to various aspects of the present disclosure;

[0015] FIG. 2A is a diagram illustrating an example Phase Detection Auto Focus (PDAF) camera system in a state in phase and therefore in focus;

[0016] FIG. 2B is a diagram illustrating the example PDAF camera system of FIG. 2A in a state that is out of phase with a front focus;

[0017] FIG. 2C is a diagram illustrating the example PDAF camera system of FIG. 2A in a state that is out of phase with a back focus;

[0018] FIG. 3A is a diagram illustrating a top-down view of an example pixel array configuration of an image sensor with masks partially covering focus pixel photodiodes;

[0019] FIG. 3B includes a legend identifying elements of FIG. 3A, FIG. 3C, and FIG. 3D;

[0020] FIG. 3C is a diagram illustrating a top-down view of another example pixel array configuration of an image sensor with masks partially covering focus pixel photodiodes;

[0021] FIG. 3D is a diagram illustrating a top-down view of another pixel array configuration of an image sensor with masks partially covering focus pixel photodiodes;

[0022] FIG. 4 includes two images with different exposures used to create a composite image;

[0023] FIG. 5 is a block diagram illustrating an example system for determining a phase-detection (PD) -pixel map, according to various aspects of the present disclosure;

[0024] FIG. 6 includes a representation of an example pixel array, an example image, and a representation of PD pixels to illustrate various aspects of the present disclosure;

[0025] FIG. 7A is a block diagram illustrating an example system for processing image data, according to various aspects of the present disclosure;

[0026] FIG. 7B is a block diagram illustrating another view of example system for processing image data, according to various aspects of the present disclosure;

[0027] FIG. 8 is an example logic diagram illustrating an example of logic that may be used by the combiner of FIG. 5, FIG. 7A and FIG. 7B for processing image data, according to various aspects of the present disclosure;

[0028] FIG. 9 is a flow diagram illustrating another example process for processing image data, in accordance with aspects of the present disclosure;

[0029] FIG. 10 is a block diagram illustrating an example computing-device architecture of an example computing device which can implement the various techniques described herein.DETAILED DESCRIPTION

[0030] Certain aspects of this disclosure are provided below. Some of these aspects 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 aspects of the application. However, it will be apparent that various aspects may be practiced without these specific details. The figures and description are not intended to be restrictive.

[0031] The ensuing description provides example aspects only, and is not intended to limit the scope, applicability, or configuration of the disclosure. Rather, the ensuing description of the exemplary aspects will provide those skilled in the art with an enabling description for implementing an exemplary aspect. 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.

[0032] The terms “exemplary” and / or “example” are used herein to mean “serving as an example, instance, or illustration. ” Any aspect described herein as “exemplary” and / or “example” is not necessarily to be construed as preferred or advantageous over other aspects. Likewise, the term “aspects of the disclosure” does not require that all aspects of the disclosure include the discussed feature, advantage, or mode of operation.

[0033] Electronic devices (e.g., mobile phones, wearable devices (e.g., smart watches, smart glasses, etc. ) , tablet computers, extended reality (XR) devices (e.g., virtual reality (VR) devices, augmented reality (AR) devices, mixed reality (MR) devices, and the like) , connected devices, laptop computers, etc. ) are increasingly equipped with cameras to capture image frames, such as still images and / or video frames, for consumption. For example, an electronic device can include a camera to allow the electronic device to capture a video or image of a scene, a person, an object, etc. Additionally, cameras themselves are used in a number of configurations (e.g., handheld digital cameras, digital single-lens-reflex (DSLR) cameras, worn camera (including body-mounted cameras and head-borne cameras) , stationary cameras (e.g., for security and / or monitoring) , vehicle-mounted cameras, etc. ) .

[0034] A camera can receive light and capture image frames (e.g., still images or video frames) using an image sensor (which may include an array of photosensors) . In some examples, a camera may include one or more processors, such as image signal processors (ISPs) , that can process one or more image frames captured by an image sensor. For example, a raw image frame captured by an image sensor can be processed by an image signal processor (ISP) of a camera to generate a final image. In some cases, a camera, or an electronic device implementing a camera, can further process a captured image or video for certain effects (e.g., compression, image enhancement, image restoration, scaling, framerate conversion, etc. ) and / or certain applications such as computer vision, extended reality (e.g., augmented reality, virtual reality, and the like) , object detection, image recognition (e.g., face recognition, object recognition, scene recognition, etc. ) , feature extraction, authentication, and automation, among others.

[0035] Cameras can be configured with a variety of image-capture settings and / or image-processing settings to alter the appearance of an image. Image-capture settings can be determined and applied before or while an image is captured, such as ISO, exposure time (also referred to as exposure, exposure duration, and / or shutter speed) , aperture size (also referred to as f / stop) , focus, and gain, among others. Image-processing settings can be configured for post-processing of an image, such as alterations to a contrast, brightness, saturation, sharpness, levels, curves, and colors, among others.

[0036] Some 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.

[0037] 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.

[0038] 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’s pixels 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.

[0039] 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.

[0040] In photography, the term “exposure, ” relating to an image captured by a camera, refers to the amount of light per unit area that reaches a photographic film, or in modern cameras, an electronic image sensor (e.g., including an array of photodiodes) . The exposure is based on certain image-capture settings such as, for example, exposure time, and / or lens aperture, as well as the luminance of the scene being photographed. Because of the relationship between the amount of light that reaches an image sensor and the duration of time the image sensors is allowed to capture the light, in the present disclosure, the terms “exposure, ” “exposure duration, ” and “exposure time” may refer to a duration of time during which the electronic image sensor is exposed to light (e.g., while the electronic image sensor is capturing an image) and / or an amount of time during which light reaching an image sensor is recorded as a single image frame.

[0041] Many cameras are equipped with an automatic exposure or “auto exposure” mode, where the image-capture settings (e.g., exposure time, lens aperture, etc. ) of the camera may be automatically adjusted to match, as closely as possible, the luminance of a scene or subject being photographed. In some cases, an automatic exposure control (AEC) engine can perform AEC to determine image-capture settings for an image sensor. An AEC engine may seek to limit a number of pixels in an image frame that are overexposed and a number of pixels in an image frame that are underexposed. For example, an AEC engine may examine a first image, and determine image-capture settings for a subsequent image based on the exposure of the first image. For example, when a camera is capturing video data, the AEC engine may examine each frame and determine image-capture settings for each frame based on the exposure of the preceding frames. As another example, a camera may capture test frames (which may be displayed, for example, as preview frames to a user as they are composing a shot) , and the AEC engine may determine image-capture settings based on the exposure of test frames.

[0042] In photography and videography, a technique called high dynamic range (HDR) allows the dynamic range of image frames captured by a camera to be increased beyond the native capability of the camera. In this context, the term “dynamic range” refers to the range of luminosity between the brightest area and the darkest area of the scene or image frame. For example, a high dynamic range means there is large variation in light levels within a scene or an image frame. HDR can involve capturing multiple image frames of a scene with  different exposures and combining captured image frames into a single image frame. The combination of image frames with different exposures can result in an image with a dynamic range higher than that of each individual image frame captured and combined to form the HDR image frame. For example, the electronic device can create a high dynamic image frame by combining two or more image frames with different exposures into a single frame. HDR is a feature often used by electronic devices, such as smartphones and mobile devices, for various purposes. For example, in some cases, a smartphone can use HDR to achieve a better image quality or an image quality similar to the image quality achieved by a digital single-lens reflex (DSLR) camera.

[0043] In the present disclosure, the term “combine, ” and like terms, with reference to images or image data, may refer to any suitable techniques for using information (e.g., pixels) from two or more images to generate an image (e.g., a “composite” image) . For example, pixels from a first image and pixels from a second image may be combined to generate a composite image. In such cases some of the pixels of the composite image may be from the first image and others of the pixels of the composite image may be from the second image. In some cases, some of the pixels from the first image and the second image may be merged, fused, or blended. For example, color and / or intensity values for pixels of the composite image may be based on respective pixels from both the first image and the second image. For instance, a given pixel of the composite image may be based on an average, or a weighted average, between a corresponding pixel of the first image and a corresponding pixel of the second image (e.g., the corresponding pixels of the first image and the second image may be blended) . As one example, a central region of a first image may be included in a composite image. Further, an outer region of a second of a second image may be included in the composite image. Pixels surrounding the central region in the composite image may be based on weighted averages between corresponding pixels of the first image and corresponding pixels of the second image. In other words, pixels of the first image surrounding the central region may be merged, fused, or blended with pixels of the second image inside the outer region.

[0044] In some cases, an imaging device can generate an HDR image by combining multiple images that captured with different image-capture settings. For instance, an imaging device can generate an HDR image by combining a short-exposure image captured with a short exposure time and a long-exposure image captured with a long exposure time that is longer than the short  exposure time. As another example, the imaging device can create an HDR image using a short-exposure image, a medium exposure image (that is capture with a medium exposure time that is between the short exposure time and the long exposure time) , and a long-exposure image.

[0045] Because short-exposure images are generally dark, they preserve the most detail in the highlights (bright areas) of a photographed scene. Medium-exposure images and the long-exposure images are generally brighter than short-exposure images, and may be overexposed (e.g., too bright to make out details) in the highlight portions (bright areas) of the scene. Because long-exposure images generally include bright portions, they may preserve detail in the shadows (dark areas) of a photographed scene. Medium-exposure images and the short-exposure images are generally darker than long-exposure images, and may be underexposed (e.g., too dark to make out details in) in the shadow portions (dark areas) of the scene, making their depictions of the shadows too dark to observe details. To generate an HDR image, the imaging device may, for example, use portions of the short-exposure image to depict highlights (bright areas) of the photographed scene, use portions of the long-exposure image depicting shadows (dark areas) of the scene, and use portions of the medium-exposure image depicting other areas (other than highlights and shadows) of a scene.

[0046] When focusing a lens to capture images that will be composited (e.g., into an HDR image) , an autofocus technique (e.g., PDAF) may position the lens in one position. When determining the lens position, the autofocus technique may use phase-detection pixels captured during an exposure. Some techniques may select phase-detection pixels captured during either a long exposure or a short exposure.

[0047] For example, a camera may capture several frames for HDR. For instance, the camera may alternately capture long-exposure images and short-exposure images and perform HDR on the captured images to generate video data, each frame of the video data having been processed according to HDR. As another example, the camera may capture image data prior to a shutter button being pressed (e.g., to autofocus the lens) . The camera may display the captured image data (e.g., as an image preview to allow a photographer to preview an image before capturing the image) . The camera may alternately capture long-exposure images and short-exposure images and perform HDR on the captured images to generate the preview data, each frame of the video data having been processed according to HDR.

[0048] In any case, the autofocus technique may dynamically adjust a focus of the camera based on previous exposures. For example, the autofocus technique may adjust the focus while the video data is being captured. For instance the autofocus technique may adjust the focus for each frame based on phase-detection pixels of prior exposures. Additionally or alternatively, the autofocus technique may dynamically adjust the focus while exposing the image sensor to light prior to the shutter button being pressed (e.g., while generating preview data or autofocusing the lens) .

[0049] Some techniques may select to autofocus the lens based on phase-detection pixels of one of a pair of exposures (e.g., including a short exposure and a long exposure) . For example, such techniques may determine the focus of the lens (for subsequent images) based on phase-detection pixels captured during either a long-exposure or a short-exposure (e.g., corresponding to a previously-captured pair of images) .

[0050] By focusing the lens according to phase-detection pixels captured during one or the other of a short exposure or a long exposure, such techniques may select noisy phase-detection pixels. For example, if an autofocus technique defaults to selecting phase-detection pixels from a long exposure, the autofocus technique may use overexposed phase-detection pixels to determine the focus. Alternatively, if an autofocus technique defaults to selecting phase-detection pixels from a short exposure, the autofocus technique may use underexposed phase-detection pixels to determine the focus. Determining a focus using overexposed pixels or underexposed pixels may result in a worse focus determination than determining the focus using properly exposed pixels. For example, overexposed pixels may be too bright, and it may be difficult or impossible to determine a phase a difference between such overexposed pixels. Alternatively, underexposed pixels may be too dark, and it may be difficult or impossible to determine a phase a difference between such under exposed pixels.

[0051] Systems, apparatuses, methods (also referred to as processes) , and computer-readable media (collectively referred to herein as “systems and techniques” ) are described herein for processing image data. For example, the systems and techniques described herein may determine a phase-detection-pixel map based on phase-detection pixels from both a short exposure and a long exposure. The phase-detection-pixel map may indicate phase-detection pixels of the short exposure and phase-detection pixels of the long exposure to use when determining a focus for the lens. Additionally or alternatively, the systems and techniques may determine a lens position  for a lens based on the phase-detection-pixel map. Additionally, the systems and techniques may capture images (e.g., during a short exposure and during a long exposure) with the lens positioned in the lens position and generate a composite image based on the captured images.

[0052] By determining which phase-detection pixels to use from both a short exposure and a long exposure, the systems and techniques may improve the results of phase-detection-autofocus techniques. For example, the systems and techniques may determine to use phase-detection pixels from a short exposure image that have values that exceed a threshold (e.g., phase-detection pixels that are not underexposed) . Additionally or alternatively, the systems and techniques may determine to use phase-detection pixels from a long exposure image that have values that are less than a threshold (e.g., phase-detection pixels that are not overexposed) . By providing the phase-detection-autofocus technique with properly exposed phase-detection pixels (e.g., not overexposed pixels and not underexposed pixels) , the systems and techniques may improve the ability of the phase-detection-autofocus technique to properly focus the lens.

[0053] Various aspects of the application will be described with respect to the figures below.

[0054] FIG. 1 is a block diagram illustrating an example architecture of an image-processing system 100, according to various aspects of the present disclosure. The image-processing system 100 includes various components that are used to capture and process images, such as an image of a scene 106. The image-processing system 100 can capture image frames (e.g., still images or video frames) . In some cases, the lens 108 and image sensor 118 (which may include an analog-to-digital converter (ADC) ) can be associated with an optical axis. In one illustrative example, the photosensitive area of the image sensor 118 (e.g., the photodiodes) and the lens 108 can both be centered on the optical axis.

[0055] In some examples, the lens 108 of the image-processing system 100 faces a scene 106 and receives light from the scene 106. The lens 108 bends incoming light from the scene toward the image sensor 118. The light received by the lens 108 then passes through an aperture of the image-processing system 100. In some cases, the aperture (e.g., the aperture size) is controlled by one or more control mechanisms 110. In other cases, the aperture can have a fixed size.

[0056] The one or more control mechanisms 110 can control exposure, focus, and / or zoom based on information from the image sensor 118 and / or information from the image processor 124. In some cases, the one or more control mechanisms 110 can include multiple mechanisms  and components. For example, the control mechanisms 110 can include one or more exposure-control mechanisms 112, one or more focus-control mechanisms 114, and / or one or more zoom-control mechanisms 116. The one or more control mechanisms 110 may also include additional control mechanisms besides those illustrated in FIG. 1. For example, in some cases, the one or more control mechanisms 110 can include control mechanisms for controlling analog gain, flash, HDR, depth of field, and / or other image capture properties.

[0057] The focus-control mechanism 114 of the control mechanisms 110 can obtain a focus setting. In some examples, focus-control mechanism 114 stores the focus setting in a memory register. Based on the focus setting, the focus-control mechanism 114 can adjust the position of the lens 108 relative to the position of the image sensor 118. For example, based on the focus setting, the focus-control mechanism 114 can move the lens 108 closer to the image sensor 118 or farther from the image sensor 118 by actuating a motor or servo (or other lens mechanism) , thereby adjusting the focus. In some cases, additional lenses may be included in the image-processing system 100. For example, the image-processing system 100 can include one or more microlenses over each photodiode of the image sensor 118. The microlenses can each bend the light received from the lens 108 toward the corresponding photodiode before the light reaches the photodiode.

[0058] In some examples, the focus setting may be determined via contrast detection autofocus (CDAF) , phase detection autofocus (PDAF) , hybrid autofocus (HAF) , or some combination thereof. The focus setting may be determined using the control mechanism 110, the image sensor 118, and / or the image processor 124. The focus setting may be referred to as an image capture setting and / or an image processing setting. In some cases, the lens 108 can be fixed relative to the image sensor and the focus-control mechanism 114.

[0059] The exposure-control mechanism 112 of the control mechanisms 110 can obtain an exposure setting. In some cases, the exposure-control mechanism 112 stores the exposure setting in a memory register. Based on the exposure setting, the exposure-control mechanism 112 can control a size of the aperture (e.g., aperture size or f / stop) , a duration of time for which the aperture is open (e.g., exposure time or shutter speed) , a duration of time for which the sensor collects light (e.g., exposure time or electronic shutter speed) , a sensitivity of the image sensor 118 (e.g., ISO speed or film speed) , analog gain applied by the image sensor 118, or any  combination thereof. The exposure setting may be referred to as an image capture setting and / or an image processing setting.

[0060] The zoom-control mechanism 116 of the control mechanisms 110 can obtain a zoom setting. In some examples, the zoom-control mechanism 116 stores the zoom setting in a memory register. Based on the zoom setting, the zoom-control mechanism 116 can control a focal length of an assembly of lens elements (lens assembly) that includes the lens 108 and one or more additional lenses. For example, the zoom-control mechanism 116 can control the focal length of the lens assembly by actuating one or more motors or servos (or other lens mechanism) to move one or more of the lenses relative to one another. The zoom setting may be referred to as an image capture setting and / or an image processing setting. In some examples, the lens assembly may include a parfocal zoom lens or a varifocal zoom lens. In some examples, the lens assembly may include a focusing lens (which can be lens 108 in some cases) that receives the light from the scene 106 first, with the light then passing through a focal zoom system between the focusing lens (e.g., lens 108) and the image sensor 118 before the light reaches the image sensor 118. The focal zoom system may, in some cases, include two positive (e.g., converging, convex) lenses of equal or similar focal length (e.g., within a threshold difference of one another) with a negative (e.g., diverging, concave) lens between them. In some cases, the zoom-control mechanism 116 moves one or more of the lenses in the focal zoom system, such as the negative lens and one or both of the positive lenses. In some cases, zoom-control mechanism 116 can control the zoom by capturing an image from an image sensor of a plurality of image sensors (e.g., including image sensor 118) with a zoom corresponding to the zoom setting. For example, the image-processing system 100 can include a wide-angle image sensor with a relatively low zoom and a telephoto image sensor with a greater zoom. In some cases, based on the selected zoom setting, the zoom-control mechanism 116 can capture images from a corresponding sensor.

[0061] The image sensor 118 includes one or more arrays of photodiodes or other photosensitive elements. Each photodiode measures an amount of light that eventually corresponds to a particular pixel in the image produced by the image sensor 118. In some cases, different photodiodes may be covered by different filters. In some cases, different photodiodes can be covered in color filters, and may thus measure light matching the color of the filter covering the photodiode. Various color filter arrays can be used such as, for example and without limitation, a Bayer color filter array, a quad color filter array (QCFA) , and / or any other color filter array.

[0062] In some cases, the image sensor 118 may alternately or additionally include opaque and / or reflective masks that block light from reaching certain photodiodes, or portions of certain photodiodes, at certain times and / or from certain angles. In some cases, opaque and / or reflective masks may be used for phase detection autofocus (PDAF) . In some cases, the opaque and / or reflective masks may be used to block portions of the electromagnetic spectrum from reaching the photodiodes of the image sensor (e.g., an infrared (IR) cut filter, an ultraviolet (UV) cut filter, a band-pass filter, low-pass filter, high-pass filter, or the like) . The image sensor 118 may also include an analog gain amplifier to amplify the analog signals output by the photodiodes and / or an analog to digital converter (ADC) to convert the analog signals output of the photodiodes (and / or amplified by the analog gain amplifier) into digital signals. In some cases, certain components or functions discussed with respect to one or more of the control mechanisms 110 may be included instead or additionally in the image sensor 118. The image sensor 118 may be a charge-coupled device (CCD) sensor, an electron-multiplying CCD (EMCCD) sensor, an active-pixel sensor (APS) , a complimentary metal-oxide semiconductor (CMOS) , an N-type metal-oxide semiconductor (NMOS) , a hybrid CCD / CMOS sensor (e.g., sCMOS) , or some other combination thereof.

[0063] The image processor 124 may include one or more processors, such as one or more image signal processors (ISPs) (including ISP 128) , one or more host processors (including host processor 126) , and / or one or more of any other type of processor discussed with respect to the computing-device architecture 1000 of FIG. 10. The host processor 126 can be a digital signal processor (DSP) and / or other type of processor. In some implementations, the image processor 124 is a single integrated circuit or chip (e.g., referred to as a system-on-chip or SoC) that includes the host processor 126 and the ISP 128. In some cases, the chip can also include one or more input / output ports (e.g., input / output (I / O) ports 130) , central processing units (CPUs) , graphics processing units (GPUs) , broadband modems (e.g., third generation (3G) , fourth generation (4G) or long-term evolution (LTE) , fifth generation (5G) , etc. ) , memory, connectivity components (e.g., BluetoothTM, Global Positioning System (GPS) , etc. ) , any combination thereof, and / or other components. The I / O ports 130 can include any suitable input / output ports or interface according to one or more protocol or specification, such as an Inter-Integrated Circuit 2 (I2C) interface, an Inter-Integrated Circuit 3 (I3C) interface, a Serial Peripheral Interface (SPI) interface, a serial General-Purpose Input / Output (GPIO) interface, a Mobile Industry Processor Interface (MIPI) (such as a MIPI CSI-2 physical (PHY) layer port or interface, an Advanced  High-performance Bus (AHB) bus, any combination thereof, and / or other input / output port. In one illustrative example, the host processor 126 can communicate with the image sensor 118 using an I2C port, and the ISP 128 can communicate with the image sensor 118 using an MIPI port.

[0064] The image processor 124 may perform a number of tasks, such as de-mosaicing, color space conversion, image frame downsampling, pixel interpolation, automatic exposure (AE) control, automatic gain control (AGC) , CDAF, PDAF, automatic white balance, merging of image frames to form an HDR image, image recognition, object recognition, feature recognition, receipt of inputs, managing outputs, managing memory, or some combination thereof. The image processor 124 may store image frames and / or processed images in random-access memory (RAM) 120, read-only memory (ROM) 122, a cache, a memory unit, another storage device, or some combination thereof.

[0065] Various input / output (I / O) devices 132 may be connected to the image processor 124. The I / O devices 132 can include a display screen, a keyboard, a keypad, a touchscreen, a trackpad, a touch-sensitive surface, a printer, any other output devices, any other input devices, or any combination thereof. In some cases, a caption may be input into the image-processing device 104 through a physical keyboard or keypad of the I / O devices 132, or through a virtual keyboard or keypad of a touchscreen of the I / O devices 132. The I / O devices 132 may include one or more ports, jacks, or other connectors that enable a wired connection between the image-processing system 100 and one or more peripheral devices, over which the image-processing system 100 may receive data from the one or more peripheral device and / or transmit data to the one or more peripheral devices. The I / O devices 132 may include one or more wireless transceivers that enable a wireless connection between the image-processing system 100 and one or more peripheral devices, over which the image-processing system 100 may receive data from the one or more peripheral device and / or transmit data to the one or more peripheral devices. The peripheral devices may include any of the previously-discussed types of the I / O devices 132 and may themselves be considered I / O devices 132 once they are coupled to the ports, jacks, wireless transceivers, or other wired and / or wireless connectors.

[0066] In some cases, the image-processing system 100 may be a single device. In some cases, the image-processing system 100 may be two or more separate devices, including an image-capture device 102 (e.g., a camera) and an image-processing device 104 (e.g., a computing device  coupled to the camera) . In some implementations, the image-capture device 102 and the image-capture device 102 may be coupled together, for example via one or more wires, cables, or other electrical connectors, and / or wirelessly via one or more wireless transceivers. In some implementations, the image-capture device 102 and the image-processing device 104 may be disconnected from one another.

[0067] As shown in FIG. 1, a vertical dashed line divides the image-processing system 100 of FIG. 1 into two portions that represent the image-capture device 102 and the image-processing device 104, respectively. The image-capture device 102 includes the lens 108, control mechanisms 110, and the image sensor 118. The image-processing device 104 includes the image processor 124 (including the ISP 128 and the host processor 126) , the RAM 120, the ROM 122, and the I / O device 132. In some cases, certain components illustrated in the image-capture device 102, such as the ISP 128 and / or the host processor 126, may be included in the image-capture device 102. In some examples, the image-processing system 100 can include one or more wireless transceivers for wireless communications, such as cellular network communications, 802.11 wi-fi communications, wireless local area network (WLAN) communications, or some combination thereof.

[0068] The image-processing system 100 can be part of, or implemented by, a single computing device or multiple computing devices. In some examples, the image-processing system 100 can be part of an electronic device (or devices) such as a camera system (e.g., a digital camera, an internet protocol (IP) camera, a video camera, a security camera, etc. ) , a telephone system (e.g., a smartphone, a cellular telephone, a conferencing system, etc. ) , a laptop or notebook computer, a tablet computer, a set-top box, a smart television, a display device, a game console, an XR device (e.g., an head-mounted device (HMD) , smart glasses, etc. ) , an IoT (Internet-of-Things) device, a smart wearable device, a video streaming device, an Internet Protocol (IP) camera, or any other suitable electronic device (s) .

[0069] While the image-processing system 100 is shown to include certain components, one of ordinary skill will appreciate that the image-processing system 100 can include more components than those shown in FIG. 1. The components of the image-processing system 100 can include software, hardware, or one or more combinations of software and hardware. For example, in some implementations, the components of the image-processing system 100 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, GPUs, DSPs, 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. The software and / or firmware can include one or more instructions stored on a computer-readable storage medium and executable by one or more processors of the electronic device implementing the image-processing system 100.

[0070] In some examples, the computing-device architecture 1000 shown in FIG. 10 and further described below can include the image-processing system 100, the image-capture device 102, the image-processing device 104, or a combination thereof.

[0071] FIG. 2A is a diagram illustrating an example Phase Detection Auto Focus (PDAF) camera system 202 in a state 222 in phase and therefore in focus. Rays of light 214 may travel from an object 220 (e.g., an apple) through a lens 206 that focuses light 214 from a scene onto an image sensor (not pictured in its entirety) . The image sensor may include an example focus photodiode 212a and an example focus photodiode 212b. Focus photodiode 212a and focus photodiode 212b may correspond to focus pixels. Focus photodiode 212a and focus photodiode 212b may be associated with one or two focus pixels (e.g., focus photodiode 212a and focus photodiode 212b may be two photodiodes of a single focus pixel sharing a single microlens 210 or focus photodiode 212a may be associated with a first focus pixel and focus photodiode 212b may be associated with a second focus pixel, both focus pixels sharing a single microlens 210) of the pixel array of the image sensor. In some cases, light 214 may travel through microlens 210 before falling on focus photodiode 212a and focus photodiode 212b. When camera system 202 is in the “in focus” state 222 of FIG. 2A, rays of light 214 may ultimately converge at a plane that corresponds to the position of focus photodiode 212a and focus photodiode 212b. When camera system 202 is in the “in focus” state 222 of FIG. 2A, rays of light 214 may also converge at a focal plane 208 (also known as an image plane) after passing through the lens 206 but before reaching the microlens 210 and / or focus photodiode 212a and focus photodiode 212b.

[0072] Because the camera system 202 of FIG. 2A is in an in-focus state 222, data from focus photodiode 212a and focus photodiode 212b is aligned. The alignment of data from focus photodiode 212a and focus photodiode 212b is represented by an image 224 showing a clear and sharp representation of object 220 due to the alignment. In contrast FIG. 2B includes an image 234 which includes two misaligned representations of object 220 based on camera system 202  being in a “front focus” state 232 in FIG. 2B. Similar to FIG. 2B, FIG. 2C includes an image 244 which includes two misaligned representations of object 220 based on camera system 202 being in a “back focus” state 242 in FIG. 2C. The in-focus state 222 may also be referred to as an “in-phase” state, as the data from focus photodiode 212a and focus photodiode 212b have no phase disparity, or have very little phase disparity (e.g., phase disparity falling below a predetermined phase disparity threshold) .

[0073] FIG. 2B is a diagram illustrating the example the PDAF camera system 202 of FIG. 2A in a state 232 that is out of phase with a front focus. The PDAF camera system 202 of FIG. 2B is the same as the PDAF camera system 202 of FIG. 2A, but lens 206 is moved closer to object 220 and farther from the focus photodiode 212a and focus photodiode 212b. Camera system 202 is therefore in a “front focus” state 232. The lens position for the “in focus” state 232 is illustrated in FIG. 2B as a dotted outline for reference, with a double-sided arrow indicating movement of the lens between the “front focus” lens position of state 232 and the “in focus” lens position of state 222.

[0074] When the camera system 202 is in the “front focus” state 232 of FIG. 2B, rays of light 214 may ultimately converge at a plane (denoted by a dashed line) before the position of focus photodiode 212a and focus photodiode 212b, that is, between the microlens 210 and focus photodiode 212a and focus photodiode 212b. Rays of light 214 may also converge at a position (denoted by another dashed line) before focal plane 208 after passing through the lens 206 but before reaching the microlens 210 and / or focus photodiode 212a and focus photodiode 212b. Because light 214 in camera system 202 of FIG. 2B is out of phase in the “front focus” state 232, data from focus photodiode 212a and focus photodiode 212b is misaligned. The misalignment of data from focus photodiode 212a and focus photodiode 212b is represented by image 234 showing misaligned black-colored and white-colored representations of object 220, where the direction of misalignment in the image 234 is related to the front focus state 232, and the distance of misalignment in the image 234 is related to the distance of the lens 206 from its position in the focused state 222.

[0075] FIG. 2C is a diagram illustrating the example the PDAF camera system 202 of FIG. 2A in a state 242 that is out of phase with a back focus. The PDAF camera system 202 of FIG. 2C is the same as the PDAF camera system 202 of FIG. 2A, but lens 206 is moved farther from object 220 and closer to the focus photodiode 212a and focus photodiode 212b. Therefore camera  system 202 is in a “back focus” state 242 (also known as a “rear focus” state) . The lens position for the “in focus” state 222 is illustrated as a dotted outline for reference, with a double-sided arrow indicating movement of the lens between the “back focus” lens position of state 242 and the “in focus” lens position of state 222.

[0076] When camera system 202 is in the “back focus” state 242 of FIG. 2C, rays of light 214 may ultimately converge at a plane (denoted by a dashed line) beyond the position of the focus photodiode 212a and focus photodiode 212b. Rays of light 214 may also converge at a position (denoted by another dashed line) beyond the focal plane 208 after passing through the lens 206 but before reaching the microlens 210 and / or focus photodiode 212a and focus photodiode 212b. Because light 214 in camera system 202 of FIG. 2C is out of phase in the “back focus” state 242, data from focus photodiode 212a and focus photodiode 212b is misaligned. The misalignment of data from focus photodiode 212a and focus photodiode 212b is represented by image 244 showing misaligned black-colored and white colored representations of object 220, where the direction of misalignment in image 244 is related to the back focus state 242, and the distance of misalignment in image 244 is related to the distance of the lens 206 from its position in the focused state 222.

[0077] When rays of light 214 converge before the plane of focus photodiode 212a and focus photodiode 212b as in front focus state 232 of FIG. 2B or beyond the plane of focus photodiode 212a and focus photodiode 212b as in back focus state 242 of FIG. 2C, 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, lens 206 can be moved forward (toward object 220 and away from focus photodiode 212a and focus photodiode 212b) if lens 206 is in the back focus state 242, or can be moved backward (away from object 220 and toward focus photodiode 212a and focus photodiode 212b) if the lens is in the front focus state 232. Lens 206 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 camera system 202. Camera system 202, or a computing system therein, may determine a distance and direction of adjusting the position of lens 206 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 photodiode 212a and focus photodiode 212b. The direction of movement of lens 206 may correspond to a direction in which the data from the focus photodiode 212a and focus photodiode  212b is determined to be out of phase, or whether the phase disparity is positive or negative. The distance of movement of lens 206 may correspond to a degree or amount to which the data from the focus photodiode 212a and focus photodiode 212b is determined to be out of phase, or the absolute value of the phase disparity.

[0078] Camera system 202 may include motors and / or actuators (not pictured) that move lens 206 between lens positions corresponding to the different states (e.g., state 222, state 232, and / or state 242) . Camera system 202 of FIG. 2A, FIG. 2B, and FIG. 2C 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 photodiode 212a and focus photodiode 212b 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.

[0079] FIG. 3A is a diagram illustrating a top-down view of a pixel array 300 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 pixel array 300 of FIG. 3A. Pixel array 300 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 318 as identified in the legend 310 of FIG. 3B. Photodiodes of focus pixels are also partially covered by masks 320 in pixel array 300 of FIG. 3A.

[0080] FIG. 3B includes a legend 310 identifying elements of FIG. 3A, FIG. 3C, and FIG. 3D. Legend 310 identifies that a circle represents a microlens 318 of a single pixel, and that a dark shaded rectangle represents a mask 320. legend 310 of FIG. 3B also identifies that squares with three different patterns each represent color filters 312, 314, and 316, 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 312 for a first color, which may for example be green; squares of the second pattern represent a color filter 314 for a second color, which may for example be blue; and squares of the third pattern represent a color filter 316 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 300, 330, and 340 of FIG. 3A, FIG. 3C, and FIG. 3D respectively. The colors (and  number of colors) identified in legend 310 of FIG. 3B, and the arrangements of color filters illustrated in the pixel arrays 300, 330, and 340 of FIG. 3A, FIG. 3C, and FIG. 3D, 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 312 in higher proportion than the color filters 314 and 316 in the pixel arrays 300, 330, and 340 of FIG. 3A, FIG. 3C, and FIG. 3D. 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 legend 310 of FIG. 3B lists precisely three color filters 312, 314, and 316, 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.

[0081] Pixel array 300 of FIG. 3A 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 304. In pixel array 300 of FIG. 3A, any pixel without a mask 320 is an imaging pixel 304, even though only two imaging pixels 304 are specifically labeled. While two focus pixels are illustrated in pixel array 300 of FIG. 3A, 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.

[0082] The two focus pixels illustrated in FIG. 3A are both partially covered by masks 320, the two masks 320 labeled as mask 302a and mask 302b, respectively. Each of the masks 320 may be a mask or shield made of an opaque and / or reflective material, such as a metal. Each mask 320 limits the amount and direction of light that strikes the photodiode of the focus pixel that is partially covered by the mask. The mask 302a and mask 302b 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 302a 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 302b 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 320, 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.

[0083] 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 304. 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 302a and 302b are shown within pixel array 300 as masking left and right portions of the focus pixel photodiodes, this is for exemplary purposes only. Focus pixel masks 320 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 320 over a left side of one focus pixel, a mask 320 over a right side of a second focus pixel, a mask 320 over a top side of a third focus pixel, a mask 320 over a bottom side of a fourth focus pixel, and optionally more focus pixels with any of these types of masks 320. Using focus pixels with masks 320 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 320 along multiple axes is because use of masks 320 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 320) , and use of masks 320 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 320) .

[0084] Some PDAF camera systems do not use masks 320 on focus pixels as in FIG. 3A, but instead cover multiple pixels under a single microlens, which may alternately be referred to as an on-chip lens (OCL) . FIG. 3C 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. 3D 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 330 and 340 of FIG. 3C and FIG. 3D can also be interpreted based on legend 310 of FIG. 3B.

[0085] Referring to FIG. 3C and FIG. 3D, the 2-pixel-by-1-pixel microlens 332 of FIG. 3C and the 2-pixel-by-2-pixel microlens 342 of FIG. 3D 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 332 of FIG. 3C covers two horizontally-adjacent focus pixels of a pixel array 330, 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 330, 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 330. While the microlens 332 is shown within pixel array 330 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 332 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.

[0086] Similarly, the microlens 342 of FIG. 3D covers a 2-pixel-by-2-pixel square of four adjacent focus pixels of a pixel array 340, 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. 3D) representing light approaching from the upper-left of the pixel array 340, focus pixel data from an upper-right pixel (labelled “UR” in FIG. 3D) representing light approaching from the upper-right of the pixel array 340, focus pixel data from a bottom-left pixel (labeled “BL” in FIG. 3D) representing light approaching from the bottom-left of the pixel array 340, and focus pixel data from a bottom right pixel (labeled “BR” in FIG. 3D) representing light approaching from the bottom right of the pixel array 340. The configurations of pixel arrays 330 and 340 of FIG. 3C and FIG. 3D 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 332, one or more vertically-oriented (up-down) 2-pixel-by-1-pixel microlenses 332, one or more 2-pixel-by-2-pixel microlenses 342, or different combinations thereof.

[0087] Again referring to FIG. 3C and FIG. 3D, 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 342 as in FIG. 3D 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.

[0088] While the focus pixels under the 2-pixel-by-1-pixel microlens 332 of FIG. 3C and the focus pixels under the 2-pixel-by-2-pixel microlens 342 of FIG. 3D are all illustrated having the color filter 312 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 332 and / or under a 2-pixel-by-2-pixel microlens 342.

[0089] In some examples, image-processing system 100 of FIG. 1 can create an HDR image using multiple image frames with different exposures. For example, image-processing system 100 can create a composite image (e.g., a high dynamic range (HDR) image) using a short exposure (SE) image, a medium exposure (ME) image, and a long exposure (LE) image. As another example, image-processing system 100 can create an HDR image using an SE image and an LE image. In some cases, image-processing system 100 can write the different image frames from one or more camera frontend engines to a memory device, such as a DDR memory device or any other memory device (e.g., ROM 122) . A post-processing engine can then retrieve the image frames and fuse (e.g., merge, combine) them into a single image.

[0090] FIG. 4 illustrates multiple example images with different exposures used to create a composite image (e.g., composite image 412) . For example, FIG. 4 shows a short-exposure image 402, a long-exposure image 408, and composite image 412 generated by combining pixels from short-exposure image 402 and long-exposure image 408. Short-exposure image 402 includes under-exposed pixels 404, and long-exposure image 408 includes over-exposed pixels 410. As shown in FIG. 4, under-exposed pixels 404 of short-exposure image 402 and over-exposed pixels 410 of the long-exposure image 408 do not contribute to the pixels of the composite image 412.

[0091] FIG. 5 is a block diagram illustrating an example system 500 for determining a phase-detection (PD) -pixel map 508, according to various aspects of the present disclosure. For example, system 500 may obtain PD pixels 502. PD pixels 502 may be, or may include, phase-detection pixel values from phase-detection pixels of an image sensor. For example, PD pixels 502 may be captured by PD pixels of pixel array 300 of FIG. 3A, pixel array 330 of FIG. 3C or pixel array 340 of FIG. 3D. PD pixels 502 may be captured by the phase-detection pixels during a first exposure (e.g., a short exposure) . System 500 may obtain PD pixels 504. PD pixels 504 may be, or may include, phase-detection pixel values from the phase-detection pixels of the image sensor. PD pixels 504 may be captured by the phase-detection pixels during a second exposure that is greater than the first exposure (e.g., a long exposure) .

[0092] Combiner 506 may generate phase-detection-pixel map 508 based PD pixels 502 and PD pixels 504. For example, combiner 506 may include, in phase-detection-pixel map 508, pixel values from PD pixels 502 that are greater than a first threshold. For instance, combiner 506 may include pixel values of PD pixels 502 that are not underexposed in phase-detection-pixel map 508. Additionally or alternatively, combiner 506 may include, in phase-detection-pixel map 508, pixel values from PD pixels 504 that are less than a second threshold. For instance combiner 506 may include pixel values of PD pixels 504 that are not underexposed in phase-detection-pixel map 508.

[0093] A phase-detection autofocus (PDAF) module 510 may determine, based on phase-detection-pixel map 508, whether to use at least one of a phase-detection pixel of PD pixels 502 or a phase-detection pixel of PD pixels 504 to determine a lens position 512 for capturing at least one image. PDAF module 510 may be implemented in control mechanism 110 of FIG. 1, for example, in focus-control mechanism 114 of FIG. 1. In some aspects, system 500 may position a lens (e.g., lens 108) based on lens position 512.

[0094] FIG. 6 includes a representation of an example pixel array 602, an example image 610, and a representation of PD pixels 608 to illustrate various aspects of the present disclosure. For example, pixel array 602 may include image pixels 606 and PD pixels 608 of an image sensor. Image pixels 606 may be used to capture light intensity values as pixel values. The pixel values generated by image pixels 606 may make up an image, such as image 610. PD pixels 608 may be interspersed in image pixels 606, for example, between image pixels 606. PD pixels 608 at the right side of FIG. 6 are illustrated without any intervening image pixels 606. PD pixels 608  may capture light intensity values as pixel values. The pixel values generated by PD pixels 608 may be used to determine a focus, for example, according to a PDAF technique.

[0095] For example, an image-capture device (e.g., image-processing device 104 of FIG. 1) may capture light at image pixels 606 and PD pixels 608 (e.g., of image sensor 118 of FIG. 1) . The light captured by image pixels 606 may be stored as pixel values that may represent image 610. Additionally, the light captured by PD pixels 608 may be stored as phase-detection pixel values that may be used by the PDAF technique (e.g., of focus-control mechanism 114) to determine a lens position for a lens (e.g., lens 108 of FIG. 1) .

[0096] The pixel values captured by PD pixels 608 during a first exposure (e.g., a short exposure) may be an example of PD pixels 502 of FIG. 5. The pixel values captured by PD pixels 608 during a second exposure (e.g., a long exposure) may be an example of PD pixels 504 of FIG. 5.

[0097] FIG. 7A is a block diagram illustrating an example system 700 for processing image data, according to various aspects of the present disclosure. System 700 may determine a lens position 512 for a lens for capturing images for generating a composite image.

[0098] System 700 may obtain image 702 and image 712. Image 702 is given as an example of an image captured during a first exposure. In particular, image 702 is given as an example of a long-exposure image. Pixels at the right side of image 702 are overexposed and pixels at the left side of image 702 are properly exposed (e.g., not overexposed and not underexposed) . Image 712 is given as an example of an image captured during a second exposure. In particular, image 712 is given as an example of a short-exposure image. Pixels at the left side of image 712 are under exposed and pixels at the right side of image 712 are properly exposed (e.g., not overexposed and not underexposed) .

[0099] During the first exposure both image pixel values 704 and PD pixel values 706 may be captured. For example, during the first exposure, image pixels 606 of FIG. 6 may capture image pixel values 704 and PD pixels 608 of FIG. 6 may capture PD pixel values 706. During the second exposure both image pixel values 714 and PD pixel values 716 may be captured. For example, during the second exposure, image pixels 606 of FIG. 6 may capture image pixel values 714 and PD pixels 608 of FIG. 6 may capture PD pixel values 716.

[0100] In some aspects, a high dynamic resolution (HDR) HDR module 720 may generate a composite image 722 based on image pixel values 704 and image pixel values 714. For example, system 700 may generate high-dynamic-resolution video data (e.g., by generating a series of composite image 722 based on corresponding series of sets of image 702 and image 712) .

[0101] Additionally, combiner 506 may generate phase-detection-pixel map 508 based on PD pixel values 706 and PD pixel values 716. Combiner 506 may select PD pixel values of PD pixel values 706 and PD pixel values of PD pixel values 716 to generate phase-detection-pixel map 508. For example, combiner 506 may select PD pixel values 706 that are less than a first threshold (e.g., a brightness threshold) for inclusion in phase-detection-pixel map 508. For instance, combiner 506 may select PD pixel values 706 that are not overexposed for inclusion in phase-detection-pixel map 508. Additionally, combiner 506 may select PD pixel values 716 that are greater than a second threshold (e.g., a darkness threshold) for inclusion in phase-detection-pixel map 508. For instance, combiner 506 may select PD pixel values 716 that are not underexposed for inclusion in phase-detection-pixel map 508.

[0102] In some aspects, combiner 506 may combine (e.g., blend, such as using alpha blending) pixel values of PD pixel values 706 with corresponding pixel values of PD pixel values 716 to determine corresponding pixel values of phase-detection-pixel map 508. For example, an example PD pixel value of PD pixel values 706 may be less than a first threshold. A corresponding PD pixel value of PD pixel values 716 may be greater than a second threshold. combiner 506 may blend the PD pixel value of PD pixel values 706 with the corresponding PD pixel value of PD pixel values 716 to generate a corresponding PD pixel value of phase-detection-pixel map 508.

[0103] PDAF module 510 may determine lens position 512 based on phase-detection-pixel map 508. Additionally or alternatively, PDAF module 510 may move a lens to lens position 512. In some aspects, system 700 may obtain one or more subsequent images based on an image-capture device using lens position 512. HDR module 720 may generate subsequent composite images based on the subsequent images. For example, after moving the lens of the image-capture device, the image capture-device may capture additional instances of image 702 and image 712 and HDR module 720 may determine instances of composite image 722 based on the additional instances of image 702 and image 712.

[0104] By determining to include, in phase-detection-pixel map 508, phase-detection pixels of PD pixel values 706 that are less than the first threshold (e.g., that are not overexposed) and phase-detection pixels of PD pixel values 716 that are greater than the second threshold (e.g., that are not underexposed) , combiner 506 may generate phase-detection-pixel map 508 to include pixels that are not overexposed and are not underexposed. PDAF module 510 may make a better determination regarding lens position 512 using phase-detection-pixel map 508 than PDAF module 510 could make using either of PD pixel values 706 or PD pixel values 716.

[0105] In some aspects, composite image 722 may be processed at confidence determiner 726 to determine confidence values 728. Confidence values 728 may be, or may include, a confidence value for each of several regions of composite image 722. The several regions may correspond to PD pixels. For example, the regions may be related to image pixels 606 around corresponding ones of PD pixels 608. As such, confidence values 728 may relate to PD pixel values of phase-detection-pixel map 508. Although not illustrated in FIG. 7A, in some aspects, combiner 506 may determine phase-detection-pixel map 508 based in part on confidence values 728. For instance, confidence determiner 726 may provide feedback (in the form of confidence values 728) to combiner 506 regarding lens position 512 and combiner 506 may determine future instances of phase-detection-pixel map 508 based on the feedback. For example, combiner 506 may implement confidence thresholds. For instance, for a given PD pixel, of phase-detection-pixel map 508, combiner 506 may determine whether a corresponding PD pixel of PD pixel values 706 satisfies a first threshold (e.g., a darkness threshold) , whether a corresponding PD pixel of PD pixel values 716 satisfies a second threshold (e.g., a brightness threshold) , and whether a prior PD pixel value of phase-detection-pixel map 508 correlated with a confidence value of confidence values 728 that exceeds a confidence threshold.

[0106] A user may select a desired focal depth for an image. For example, a user may tap a region of a screen displaying a preview image to indicate an object or a portion of the preview image that the user wants the camera to focus on when capturing an image. Additionally or alternatively, an autofocus technique may select a focal depth for an image based on objects in the scene (e.g., that are determined to be likely of interest to the user) .

[0107] If a focal depth corresponding to autofocus area 730 is selected (e.g., by a user or autofocus technique) , PDAF module 510 may determine lens position 512 based on short-exposure PD pixel values 740. If a focal depth corresponding to autofocus area 732 is selected,  PDAF module 510 may determine lens position 512 based on long-exposure PD pixel values 742. If a focal depth corresponding to autofocus area 734 is selected, PDAF module 510 may determine lens position 512 based on blended PD pixel values 744 (which may be based on a blend of corresponding ones of PD pixel values 706 and PD pixel values 716) .

[0108] FIG. 7B is a block diagram illustrating another view of example system 700 for processing image data, according to various aspects of the present disclosure. System 700 may determine a lens position 512 for a lens for capturing images for generating a composite image.

[0109] In FIG. 7B, composite image 722 is illustrated. composite image 722 includes an autofocus area 730 and an autofocus area 732. Autofocus area 730 is in a bright portion of composite image 722. The pixels of autofocus area 730 may have been selected from image 712. Autofocus area 732 is in a dark portion of composite image 722. The pixels of autofocus area 732 may have been selected from image 702. Autofocus area 730 depicts objects relatively distant from the camera which captured image 702 and image 712 and autofocus area 732 depicts objects relatively close to the camera. Thus, a lens position for capturing images (e.g., image 702 and image 712) based on a focal depth for capturing subjects in autofocus area 732, may be different from a lens position for capturing images based on a focal depth for capturing subjects in autofocus area 730. In FIG. 7B, PD pixel values 706 and PD pixel values 716 are illustrated with a rough outline of autofocus area 732 and autofocus area 730 for descriptive purposes.

[0110] In FIG. 7B, phase-detection-pixel map 508 including blended PD pixel values 744, short-exposure PD pixel values 740, and long-exposure PD pixel values 742. For example, combiner 506 may blend PD pixel values of PD pixel values 706 and PD pixel values 716 to generate blended PD pixel values 744. Combiner 506 may select short-exposure PD pixel values 740 from PD pixel values 716 based on short-exposure PD pixel values 740 satisfying a first threshold (e.g., a brightness threshold) . Combiner 506 may select long-exposure PD pixel values 742 from PD pixel values 706 based on long-exposure PD pixel values 742 satisfying a second threshold (e.g., a darkness threshold) .

[0111] FIG. 8 is an example logic diagram illustrating example logic 800 that may be used by combiner 506 of FIG. 5, FIG. 7A and FIG. 7B for processing image data, according to various aspects of the present disclosure. For example, a comparer 802 (e.g., a differential amplifier) , may compare a first PD pixel value (e.g., a long-exposure PD pixel value) (e.g., one of PD pixel  values 706 of FIG. 7A and FIG. 7B) to a first threshold (e.g., a long-exposure threshold) . Comparer 802 may output a 0 or a 1 based on whether the first PD pixel value satisfies the first threshold (e.g., based on whether the first PD pixel value is overexposed) . For example, comparer 802 may output a 1 if the PD pixel values is valid (e.g., not overexposed) and a 0 if the PD pixel value is overexposed.

[0112] A comparer 804 (e.g., a differential amplifier) , may compare a second PD pixel value (e.g., a short-exposure PD pixel value) (e.g., one of PD pixel values 716 of FIG. 7A and FIG. 7B) to a second threshold (e.g., a short-exposure threshold) . Comparer 804 may output a 0 or a 1 based on whether the second PD pixel value satisfies the second threshold (e.g., based on whether the PD pixel value is underexposed) . For example, comparer 804 may output a 1 if the second PD pixel values is valid (e.g., not underexposed) and a 0 if the PD pixel value is underexposed.

[0113] A multiplexer ( “mux” ) 806 may obtain the first PD pixel value, the second PD pixel value, the 0 or 1 output by comparer 802, and the 0 or 1 output by comparer 804. Mux 806 may determine a PD pixel value to output (e.g., a PD pixel value of phase-detection-pixel map 508) based on first PD pixel value, the second PD pixel value, the 0 or 1 output by comparer 802, and the 0 or 1 output by comparer 804. For example, mux 806 may operate according to the following table:

[0114] For example, in cases in which the long-exposure PD pixel value is valid (e.g., as indicated by the output of comparer 802) , mux 806 may output the long-exposure PD pixel value. In cases in which the long-exposure PD pixel value is not valid (e.g., as indicated by the output of comparer 802) , and the short-exposure PD pixel value is valid (e.g., as indicated by the output of comparer 804) , mux 806 may output the short-exposure PD pixel value. In cases in which neither the long-exposure PD pixel value nor the short-exposure PD pixel value are valid, mux 806 may default to outputting one or the other of the long-exposure PD pixel value or the short-exposure PD pixel value. For example, as illustrated in the table, mux 806 may default to outputting the long-exposure PD pixel value.

[0115] Alternatively, in some aspects, mux 806 may blend PD pixel values. For example, mux 806 may operate according to the following table:

[0116] For example, when both the long-exposure PD pixel value and the short-exposure PD pixel value are valid, mux 806 may blend the long-exposure PD pixel value and the short-exposure PD pixel value. mux 806 may blend the long-exposure PD pixel value and the short-exposure PD pixel value based on a blending factor α, which may be based on the long-exposure PD pixel value and the short-exposure PD pixel value.

[0117] FIG. 9 is a flow diagram illustrating a process 900 for processing image data, in accordance with aspects of the present disclosure. One or more operations of process 900 may be performed by a computing device (or apparatus) or a component (e.g., a chipset, codec, etc. ) of the computing device. The computing device may be a mobile device (e.g., a mobile phone) , a network-connected wearable such as a watch, an extended reality (XR) device such as a virtual reality (VR) device or augmented reality (AR) device, a vehicle or component or system of a vehicle, a desktop computing device, a tablet computing device, a server computer, a robotic device, and / or any other computing device with the resource capabilities to perform the process 900. The one or more operations of process 900 may be implemented as software components that are executed and run on one or more processors.

[0118] At block 902, a computing device (or one or more components thereof) may obtain a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure. For example, combiner 506 of FIG. 5, FIG. 7A, and / or FIG. 7B may obtain PD pixels 502 of FIG. 5 and / or PD pixel values 716 of FIG. 7A and / or FIG. 7B. PD pixels 502 and / or PD pixel values 716 may be captured by PD pixels 608 of FIG. 6 during a first exposure.

[0119] At block 904, the computing device (or one or more components thereof) may obtain a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure. For example, combiner 506 may obtain PD pixels 504 of FIG. 5 and / or PD pixel values 706 of FIG. 7A and / or FIG. 7B. PD pixels 504 and / or PD pixel values 706 may be captured by PD pixels 608 during a second exposure.

[0120] In some aspects, the first plurality of phase-detection pixels are the same as the second plurality of phase-detection pixels. In other aspects, the first plurality of phase-detection pixels are different from the second plurality of phase-detection pixels.

[0121] In some aspects, the computing device (or one or more components thereof) may cause an image sensor to capture, during the first exposure, first image pixel values and the first plurality of phase-detection pixel values; and cause the image sensor to capture, during the  second exposure, second image pixel values the second plurality of phase-detection pixel values. For example, system 500 of FIG. 5 may cause image-capture device 102 of FIG. 1, including image sensor 118 of FIG. 1, to capture image pixel values 714 of FIG. 7A during the first exposure and image pixel values 704 of FIG. 7A during the second exposure.

[0122] In some aspects, the computing device (or one or more components thereof) may generate a composite image based on the first image pixel values and the second image pixel values. For example, HDR module 720 may generate composite image 722 based on image pixel values 714 and image pixel values 704.

[0123] At block 906, the computing device (or one or more components thereof) may generate a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values. For example, combiner 506 may generate phase-detection-pixel map 508 of FIG. 5, FIG. 7A, and / or FIG. 7B based on PD pixels 502 and PD pixels 504 and / or based on PD pixel values 716 and PD pixel values 706.

[0124] In some aspects, to, generate the phase-detection-pixel map, the computing device (or one or more components thereof) may: include, in the phase-detection-pixel map, first phase-detection pixel values from the first plurality of phase-detection pixel values that are greater than a first threshold; and include, in the phase-detection-pixel map, second phase-detection pixel values from the second plurality of phase-detection pixel values that are less than a second threshold. For example, combiner 506 may include, in phase-detection-pixel map 508, PD pixels 502 and / or PD pixel values 716 that are greater than a first threshold. Additionally, combiner 506 may include, in phase-detection-pixel map 508, PD pixels 504 and / or PD pixel values 706 that are less than a second threshold.

[0125] In some aspects, the second threshold may be greater than the first threshold. In other aspects, the second threshold may be less than the first threshold.

[0126] In some aspects, to, generate the phase-detection-pixel map, the computing device (or one or more components thereof) may blend at least one of the first phase-detection pixel values with at least one of the second phase-detection pixel values. For example, combiner 506 may blend at least some of PD pixels 502 with at least some of PD pixels 504 or at least some of PD pixel values 716 with at least some of PD pixel values 706.

[0127] At block 908, the computing device (or one or more components thereof) may determine, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image. For example, PDAF module 510 of FIG. 5, FIG. 7A, and / or FIG. 7B may determine whether to use at least one of PD pixels 502, PD pixels 504, PD pixel values 716, or PD pixel values 706 to determine lens position 512 of FIG. 5, FIG. 7A, and / or FIG. 7B.

[0128] In some aspects, the computing device (or one or more components thereof) may cause at least one actuator to move a lens from a previous lens position to the lens position; obtain a first image based on the lens in the lens position; obtain a second image based on the lens in the lens position; and generate a composite image based on the first image and the second image. For example, HDR module 720 of FIG. 7A and / or FIG. 7B may cause a lens to move according to lens position 512. After moving the lens, short-exposure image 402 of FIG. 4 and long-exposure image 408 of FIG. 4 may be captured with the lens at lens position 512. Further, HDR module 720 may generate composite image 412 of FIG. 4 based on short-exposure image 402 and long-exposure image 408.

[0129] In some aspects, the computing device (or one or more components thereof) may determine a focus confidence based on the composite image; and generate an updated phase-detection-pixel map based on the focus confidence. For example, composite image 722 of FIG. 7A may be an example of composite image 412 generated based on short-exposure image 402 and long-exposure image 408. Confidence determiner 726 of FIG. 7A may determine confidence values 728 of FIG. 7A based on composite image 722. Combiner 506 may determine an updated phase-detection-pixel map 508 based on confidence values 728.

[0130] In some examples, as noted previously, the methods described herein (e.g., process 900 of FIG. 9, and / or other methods described herein) can be performed, in whole or in part, by a computing device or apparatus. In one example, one or more of the methods can be performed by image-processing system 100 of FIG. 1, image-processing device 104 of FIG. 1, image processor 124 of FIG. 1, system 500 of FIG. 5, combiner 506 of FIG. 5, FIG. 7A, and / or FIG. 7B, system 700 of FIG. 7A or FIG. 7B, logic 800 of FIG. 8, or by another system or device. In another example, one or more of the methods (e.g., process 900 of FIG. 9, and / or other methods described herein) can be performed, in whole or in part, by the computing-device architecture  1000 shown in FIG. 10. For instance, a computing device with the computing-device architecture 1000 shown in FIG. 10 can include, or be included in, the components of the image-processing system 100, image-processing device 104, image processor 124, system 500, combiner 506, system 700, and / or logic 800 and can implement the operations of process 900, and / or other process described herein. In some cases, the computing device or apparatus can 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, and / or other component (s) that are configured to carry out the steps of processes described herein. In some examples, the computing device can 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 can be configured to communicate and / or receive Internet Protocol (IP) based data or other type of data.

[0131] The components of the computing device 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.

[0132] Process 900, and / or other process described herein are 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.

[0133] Additionally, process 900, and / or other process described herein can be performed under the control of one or more computer systems configured with executable instructions and can 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 can 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 can be non-transitory.

[0134] FIG. 10 illustrates an example computing-device architecture 1000 of an example computing device which can implement the various techniques described herein. In some examples, the computing device can include a mobile device, a wearable device, an extended reality device (e.g., a virtual reality (VR) device, an augmented reality (AR) device, or a mixed reality (MR) device) , a personal computer, a laptop computer, a video server, a vehicle (or computing device of a vehicle) , or other device. For example, the computing-device architecture 1000 may include, implement, or be included in any or all of image-processing system 100 of FIG. 1, image-processing device 104 of FIG. 1, image processor 124 of FIG. 1, system 500 of FIG. 5, combiner 506 of FIG. 5, FIG. 7A, and / or FIG. 7B, system 700 of FIG. 7A or FIG. 7B, logic 800 of FIG. 8, and / or other devices, modules, or systems described herein. Additionally or alternatively, computing-device architecture 1000 may be configured to perform process 900, and / or other process described herein.

[0135] The components of computing-device architecture 1000 are shown in electrical communication with each other using connection 1012, such as a bus. The example computing-device architecture 1000 includes a processing unit (CPU or processor) 1002 and computing device connection 1012 that couples various computing device components including computing device memory 1010, such as read only memory (ROM) 1008 and random-access memory (RAM) 1006, to processor 1002.

[0136] Computing-device architecture 1000 can include a cache of high-speed memory connected directly with, in close proximity to, or integrated as part of processor 1002. Computing-device architecture 1000 can copy data from memory 1010 and / or the storage device 1014 to cache 1004 for quick access by processor 1002. In this way, the cache can provide a performance boost that avoids processor 1002 delays while waiting for data. These and other modules can control or be configured to control processor 1002 to perform various actions. Other computing device memory 1010 may be available for use as well. Memory 1010 can include  multiple different types of memory with different performance characteristics. Processor 1002 can include any general-purpose processor and a hardware or software service, such as service 1 1016, service 2 1018, and service 3 1020 stored in storage device 1014, configured to control processor 1002 as well as a special-purpose processor where software instructions are incorporated into the processor design. Processor 1002 may be a self-contained system, containing multiple cores or processors, a bus, memory controller, cache, etc. A multi-core processor may be symmetric or asymmetric.

[0137] To enable user interaction with the computing-device architecture 1000, input device 1022 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 and so forth. Output device 1024 can also be one or more of a number of output mechanisms known to those of skill in the art, such as a display, projector, television, speaker device, etc. In some instances, multimodal computing devices can enable a user to provide multiple types of input to communicate with computing-device architecture 1000. Communication interface 1026 can generally govern and manage the user input and computing device output. 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.

[0138] Storage device 1014 is a non-volatile memory 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, random-access memories (RAMs) 1006, read only memory (ROM) 1008, and hybrids thereof. Storage device 1014 can include services 1016, 1018, and 1020 for controlling processor 1002. Other hardware or software modules are contemplated. Storage device 1014 can be connected to the computing device connection 1012. In one aspect, a hardware module 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 1002, connection 1012, output device 1024, and so forth, to carry out the function.

[0139] The term “substantially, ” in reference to a given parameter, property, or condition, may refer to a degree that one of ordinary skill in the art would understand that the given parameter, property, or condition is met with a small degree of variance, such as, for example, within acceptable manufacturing tolerances. By way of example, depending on the particular parameter,  property, or condition that is substantially met, the parameter, property, or condition may be at least 90%met, at least 95%met, or even at least 99%met.

[0140] Aspects of the present disclosure are applicable to any suitable electronic device (such as security systems, smartphones, tablets, laptop computers, vehicles, drones, or other devices) including or coupled to one or more active depth sensing systems. While described below with respect to a device having or coupled to one light projector, aspects of the present disclosure are applicable to devices having any number of light projectors and are therefore not limited to specific devices.

[0141] The term “device” is not limited to one or a specific number of physical objects (such as one smartphone, one controller, one processing system and so on) . As used herein, a device may be any electronic device with one or more parts that may implement at least some portions of this disclosure. While the below description and examples use the term “device” to describe various aspects of this disclosure, the term “device” is not limited to a specific configuration, type, or number of objects. Additionally, the term “system” is not limited to multiple components or specific aspects. For example, a system may be implemented on one or more printed circuit boards or other substrates and may have movable or static components. While the below description and examples use the term “system” to describe various aspects of this disclosure, the term “system” is not limited to a specific configuration, type, or number of objects.

[0142] Specific details are provided in the description above to provide a thorough understanding of the aspects and examples provided herein. However, it will be understood by one of ordinary skill in the art that the aspects may be practiced without these specific details. For clarity of explanation, in some instances the present technology may be presented as including individual functional blocks including functional blocks including 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.

[0143] 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.

[0144] 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, etc.

[0145] 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, magnetic or optical disks, USB devices provided with non-volatile memory, networked storage devices, any suitable combination thereof, among others. 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.

[0146] In some aspects the computer-readable storage devices, mediums, and memories can include a cable or wireless signal containing a bit stream 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.

[0147] Devices implementing processes and methods according to these disclosures can include 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. Typical 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.

[0148] 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.

[0149] In the foregoing description, aspects of the application are described with reference to specific aspects thereof, 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 spirit and 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.

[0150] 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.

[0151] 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.

[0152] The phrase “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.

[0153] 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, A and B and C, or any duplicate information or data (e.g., A and A, B and B, C and C, A and A and B, and so on) , or any other ordering, duplication, or combination of A, 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” may mean A, B, or A and B, and may additionally include items not listed in the set of A and B. The phrases “at least one” and “one or more” are used interchangeably herein.

[0154] 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.

[0155] 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.

[0156] 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) .

[0157] 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, firmware, or combinations thereof. 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 application.

[0158] 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 including program code including instructions that, when executed, performs one or more of the methods 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 include 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.

[0159] 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, such as, 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.

[0160] Illustrative aspects of the disclosure include:

[0161] Aspect 1. An apparatus for processing image data, the apparatus comprising: at least one memory; and at least one processor coupled to the at least one memory and configured to: obtain a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; obtain a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; generate a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; and determine, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.

[0162] Aspect 2. The apparatus of aspect 1, wherein the at least one processor is configured to: cause at least one actuator to move a lens from a previous lens position to the lens position; obtain a first image based on the lens in the lens position; obtain a second image based on the lens in the lens position; and generate a composite image based on the first image and the second image.

[0163] Aspect 3. The apparatus of aspect 2, wherein the at least one processor is configured to: determine a focus confidence based on the composite image; and generate an updated phase-detection-pixel map based on the focus confidence.

[0164] Aspect 4. The apparatus of any one of aspects 1 to 3, wherein to, generate the phase-detection-pixel map, the at least one processor is configured to: include, in the phase-detection-pixel map, first phase-detection pixel values from the first plurality of phase-detection pixel values that are greater than a first threshold; and include, in the phase-detection-pixel map,  second phase-detection pixel values from the second plurality of phase-detection pixel values that are less than a second threshold.

[0165] Aspect 5. The apparatus of aspect 4, wherein the second threshold is greater than the first threshold.

[0166] Aspect 6. The apparatus of aspect 4, wherein the second threshold is less than the first threshold.

[0167] Aspect 7. The apparatus of any one of aspects 4 to 6, wherein to, generate the phase-detection-pixel map, the at least one processor is configured to blend at least one of the first phase-detection pixel values with at least one of the second phase-detection pixel values.

[0168] Aspect 8. The apparatus of any one of aspects 1 to 7, further comprising an image sensor, wherein the image sensor is configured to: capture, during the first exposure, first image pixel values and the first plurality of phase-detection pixel values; and capture, during the second exposure, second image pixel values the second plurality of phase-detection pixel values.

[0169] Aspect 9. The apparatus of aspect 8, wherein the at least one processor is configured to generate a composite image based on the first image pixel values and the second image pixel values.

[0170] Aspect 10. The apparatus of any one of aspects 1 to 9, wherein the first plurality of phase-detection pixels are the same as the second plurality of phase-detection pixels.

[0171] Aspect 11. The apparatus of any one of aspects 1 to 9, wherein the first plurality of phase-detection pixels are different from the second plurality of phase-detection pixels.

[0172] Aspect 12. A method for processing image data, the method comprising: obtaining a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure; obtaining a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure; generating a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the  second plurality of phase-detection pixel values; and determining, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.

[0173] Aspect 13. The method of aspect 12, further comprising: causing at least one actuator to move a lens from a previous lens position to the lens position; obtaining a first image based on the lens in the lens position; obtaining a second image based on the lens in the lens position; and generating a composite image based on the first image and the second image.

[0174] Aspect 14. The method of aspect 13, further comprising: determining a focus confidence based on the composite image; and generating an updated phase-detection-pixel map based on the focus confidence.

[0175] Aspect 15. The method of any one of aspects 12 to 14, wherein generating the phase-detection-pixel map comprises: including, in the phase-detection-pixel map, first phase-detection pixel values from the first plurality of phase-detection pixel values that are greater than a first threshold; and including, in the phase-detection-pixel map, second phase-detection pixel values from the second plurality of phase-detection pixel values that are less than a second threshold.

[0176] Aspect 16. The method of aspect 15, wherein the second threshold is greater than the first threshold.

[0177] Aspect 17. The method of aspect 15, wherein the second threshold is less than the first threshold.

[0178] Aspect 18. The method of any one of aspects 15 to 17, wherein generating the phase-detection-pixel map comprises blending at least one of the first phase-detection pixel values with at least one of the second phase-detection pixel values.

[0179] Aspect 19. The method of any one of aspects 12 to 18, further comprising: capturing, at an image sensor, during the first exposure, first image pixel values and the first plurality of phase-detection pixel values; and capturing, at the image sensor, during the second exposure, second image pixel values the second plurality of phase-detection pixel values.

[0180] Aspect 20. The method of aspect 19, further comprising generating a composite image based on the first image pixel values and the second image pixel values.

[0181] Aspect 21. The method of any one of aspects 12 to 20, wherein the first plurality of phase-detection pixels are the same as the second plurality of phase-detection pixels.

[0182] Aspect 22. The method of any one of aspects 12 to 20, wherein the first plurality of phase-detection pixels are different from the second plurality of phase-detection pixels.

Claims

1.An apparatus for processing image data, the apparatus comprising:at least one memory; andat least one processor coupled to the at least one memory and configured to:obtain a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure;obtain a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure;generate a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; anddetermine, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.2.The apparatus of claim 1, wherein the at least one processor is configured to:cause at least one actuator to move a lens from a previous lens position to the lens position;obtain a first image based on the lens in the lens position;obtain a second image based on the lens in the lens position; andgenerate a composite image based on the first image and the second image.3.The apparatus of claim 2, wherein the at least one processor is configured to:determine a focus confidence based on the composite image; andgenerate an updated phase-detection-pixel map based on the focus confidence.4.The apparatus of claim 1, wherein to, generate the phase-detection-pixel map, the at least one processor is configured to:include, in the phase-detection-pixel map, first phase-detection pixel values from the first plurality of phase-detection pixel values that are greater than a first threshold; andinclude, in the phase-detection-pixel map, second phase-detection pixel values from the second plurality of phase-detection pixel values that are less than a second threshold.5.The apparatus of claim 4, wherein the second threshold is greater than the first threshold.6.The apparatus of claim 4, wherein the second threshold is less than the first threshold.7.The apparatus of claim 4, wherein to, generate the phase-detection-pixel map, the at least one processor is configured to blend at least one of the first phase-detection pixel values with at least one of the second phase-detection pixel values.8.The apparatus of claim 1, further comprising an image sensor, wherein the image sensor is configured to:capture, during the first exposure, first image pixel values and the first plurality of phase-detection pixel values; andcapture, during the second exposure, second image pixel values the second plurality of phase-detection pixel values.9.The apparatus of claim 8, wherein the at least one processor is configured to generate a composite image based on the first image pixel values and the second image pixel values.10.The apparatus of claim 1, wherein the first plurality of phase-detection pixels are the same as the second plurality of phase-detection pixels.11.The apparatus of claim 1, wherein the first plurality of phase-detection pixels are different from the second plurality of phase-detection pixels.12.A method for processing image data, the method comprising:obtaining a first plurality of phase-detection pixel values from a first plurality of phase-detection pixels of an image sensor, the first plurality of phase-detection pixel values being captured by the first plurality of phase-detection pixels during a first exposure;obtaining a second plurality of phase-detection pixel values from a second plurality of phase-detection pixels of the image sensor, the second plurality of phase-detection pixel values being captured by the second plurality of phase-detection pixels during a second exposure that is greater than the first exposure;generating a phase-detection-pixel map based on the first plurality of phase-detection pixel values and the second plurality of phase-detection pixel values; anddetermining, based on the phase-detection-pixel map, whether to use at least one of a phase-detection pixel of the first plurality of phase-detection pixels or a phase-detection pixel of the second plurality of phase-detection pixels to determine a lens position for capturing at least one image.13.The method of claim 12, further comprising:causing at least one actuator to move a lens from a previous lens position to the lens position;obtaining a first image based on the lens in the lens position;obtaining a second image based on the lens in the lens position; andgenerating a composite image based on the first image and the second image.14.The method of claim 13, further comprising:determining a focus confidence based on the composite image; andgenerating an updated phase-detection-pixel map based on the focus confidence.15.The method of claim 12, wherein generating the phase-detection-pixel map comprises:including, in the phase-detection-pixel map, first phase-detection pixel values from the first plurality of phase-detection pixel values that are greater than a first threshold; andincluding, in the phase-detection-pixel map, second phase-detection pixel values from the second plurality of phase-detection pixel values that are less than a second threshold.16.The method of claim 15, wherein the second threshold is greater than the first threshold.17.The method of claim 15, wherein the second threshold is less than the first threshold.18.The method of claim 15, wherein generating the phase-detection-pixel map comprises blending at least one of the first phase-detection pixel values with at least one of the second phase-detection pixel values.19.The method of claim 12, further comprising:capturing, at an image sensor, during the first exposure, first image pixel values and the first plurality of phase-detection pixel values; andcapturing, at the image sensor, during the second exposure, second image pixel values the second plurality of phase-detection pixel values.20.The method of claim 19, further comprising generating a composite image based on the first image pixel values and the second image pixel values.

Citation Information

Patent Citations

  • Imaging apparatus and electronic device

    CN110770906A

  • Image sensor and operation method thereof

    CN111741242A

  • Image processing method and device, electronic equipment and readable storage medium

    CN113676674A

  • QUAD color filter array camera sensor configurations

    US20200280659A1