Focusing processing method and electronic device
By using a UWB ranging module to acquire distance information of the target object while the electronic device is stationary, the image acquisition device is assisted in focusing. This solves the problem of inaccurate focusing in traditional focusing methods at long distances and in poor lighting conditions, improves focusing speed and accuracy, and enhances the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LENOVO (BEIJING) LTD
- Filing Date
- 2026-02-24
- Publication Date
- 2026-06-02
Smart Images

Figure CN122138043A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more specifically to a focusing processing method and electronic device. Background Technology
[0002] When using image acquisition devices to photograph objects or the environment, the device (such as a camera) needs to focus on the subject to ensure a clear image. However, when photographing moving objects, if there is no face in the frame or the face is not recognized, the device may not be able to focus correctly on the corresponding person, resulting in a less clear image and impacting the user experience. Summary of the Invention
[0003] In view of the above, this application provides the following technical solution:
[0004] A focusing processing method, comprising:
[0005] If the motion state of the electronic device meets the stationary condition, the second ranging data generated by the second ranging module of the electronic device is obtained;
[0006] If the target conditions are met, the electronic device controls the image acquisition device to focus on the target object based on the second ranging data;
[0007] The second ranging data represents the distance information of at least one object around the electronic device that meets the motion state conditions relative to the electronic device.
[0008] Optionally, the target condition indicates that the relative distance between the electronic device and the target object is within the target distance range and / or the lighting environment information of the electronic device is within the target lighting environment.
[0009] Optionally, the relative distance range between the electronic device and the target object within the target distance range includes: determining the current distance value and confidence level of the target object based on the first focus data generated by the first ranging module of the electronic device;
[0010] In response to the confidence level being lower than the confidence level threshold, it is determined that the current distance value falls within a distance range that satisfies the target distance range.
[0011] Optionally, controlling the image acquisition device of the electronic device to focus on the target object based on the second ranging data includes:
[0012] Based on the second ranging data, the distance range of the target object relative to the electronic device is determined;
[0013] Based on the distance range, the image acquisition device of the electronic device is controlled to focus on the target object.
[0014] Optionally, controlling the image acquisition device of the electronic device to focus on the target object based on the distance range includes:
[0015] Obtain the motion intensity information of the target object;
[0016] Based on the motion intensity information, determine the application confidence level of the second ranging data;
[0017] Based on the application confidence level, the image acquisition device of the electronic device is controlled to focus on the target object.
[0018] Optionally, the step of controlling the image acquisition device of the electronic device to focus on the target object based on the application confidence level is selected from one of the following:
[0019] In response to the application confidence being greater than a first confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on a first strategy. The first strategy represents the target focusing distance determined based on the distance range represented by the second ranging data, and the image acquisition device is controlled to focus on the target object at the target focusing distance.
[0020] In response to the application confidence level being no greater than the first confidence threshold and greater than the second confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on the second strategy; the second strategy represents using the distance range as the focus search range, and controlling the image acquisition device to focus on the target object based on the first focus data within the focus search range, wherein the first focus data is data generated by the first ranging module;
[0021] In response to the application confidence level not being greater than the second confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on a third strategy; the third strategy represents focusing based on the first focus data.
[0022] Optionally, obtaining the motion intensity information of the target object includes:
[0023] The target object is identified in multiple consecutively acquired images to obtain the positional change of the target object in the consecutive image frames;
[0024] Based on the change in position and the image acquisition frame rate, the motion intensity information of the target object is determined.
[0025] Optionally, the first focusing data obtained by the first ranging module represents ranging information associated with the identity and position of the target object in the field of view of the image acquisition device; the second ranging data obtained by the second ranging module represents a distance value associated with an object in at least one motion event in the environment surrounding the electronic device, and is used as a distance reference for focusing processing.
[0026] An electronic device, comprising:
[0027] The second ranging module is used to generate second ranging data; wherein the second ranging data represents the distance information of at least one object around the electronic device that meets the motion state conditions relative to the electronic device.
[0028] Image acquisition device, used to acquire images of target objects;
[0029] A control device is used to obtain second ranging data if the motion state of the electronic device meets the stationary condition; and to generate control commands based on the second ranging data in response to the target condition being met.
[0030] The image acquisition device is also used to focus on the target object based on the control command.
[0031] Optionally, it also includes:
[0032] A first ranging module is used to generate first focus data; wherein the target conditions are associated with the relative distance range between the electronic device and the target object and / or the lighting environment information of the electronic device, determined based on the first focus data;
[0033] The control device is further configured to determine whether the target condition is met based on the first focus data. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0035] Figure 1 A schematic flowchart of a focusing process provided in an embodiment of this application;
[0036] Figure 2 A schematic diagram of the processing flow for an application scenario provided in this application embodiment;
[0037] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] The terms "first" and "second," etc., used in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units may include steps or units not listed, but may include steps or units not listed.
[0040] This application provides a focusing processing method and an electronic device. This focusing processing method can be applied to the autofocus process of image acquisition devices such as smartphones and digital cameras in complex shooting scenarios (such as long-distance focusing, low-light or backlight environments). When the movement state of the electronic device meets the condition of being stationary, second ranging data generated by a second ranging module is obtained. When the target conditions related to the shooting scene are met, the image acquisition device is assisted in focusing based on this second ranging data. By introducing second ranging data, which is unaffected by ambient light, as a focusing reference, the problem of insufficient confidence in traditional focusing methods under conditions such as long distance and low light is solved, improving focusing speed, success rate, and tracking stability. It is particularly suitable for accurate focusing when shooting moving targets.
[0041] See Figure 1 The diagram illustrates a flow chart of a focusing processing method provided in an embodiment of this application, which may include steps S101 and S102.
[0042] S101. If the motion state of the electronic device meets the static condition, obtain the second ranging data generated by the second ranging module of the electronic device.
[0043] The motion state of an electronic device refers to its displacement, shaking, and other states during filming. This motion state can be obtained through sensors within the electronic device to determine whether it is stationary. For example, data from the device's gravity sensor or OIS (Optical Image Stabilization) can be used to determine its motion state. The stationary condition refers to pre-set conditions used to determine whether the electronic device is in a stable filming state. For instance, when the displacement or angle change of the electronic device is within a set range, the stationary condition is met.
[0044] For example, relevant data can be acquired through the electronic device's built-in gravity sensor and OIS (Optical Image Stabilization) module. The gyroscope data from the gravity sensor is read, and the variance of the gyroscope data between the current and previous frames is calculated. It is then determined whether this variance is less than a set threshold. Simultaneously, the OIS data is read, and the change in OIS angle between the current and previous frames is calculated to be less than a set threshold. When both the gyroscope data variance and the OIS angle change meet the condition of being less than the set threshold, the electronic device is determined to be in a stationary state; if either condition is not met, the electronic device is determined to be in a moving state.
[0045] The second ranging module of an electronic device represents a ranging module with long-distance ranging capability that is unaffected by environmental pipelines, such as a UWB (Ultra-Wideband) ranging module. This second ranging module obtains second ranging data, which represents the distance information of at least one object around the electronic device that meets the motion state condition relative to the electronic device. This data can be a single distance reference value used to help narrow the focusing search range. When the electronic device meets the stationary condition, the second ranging module (such as a UWB module) is activated. This module emits an ultra-wideband signal, receives the reflected signal, and calculates the signal propagation time to obtain the distance information between the electronic device and objects around it that meet the motion state condition. Objects meeting the motion state condition refer to objects in motion (such as running people, moving vehicles, etc.). The second ranging module can identify and determine the distance to such objects.
[0046] By determining the motion state of the electronic device, auxiliary data applied to the focusing process can be selected more accurately, thereby improving the focusing effect. The second ranging module is unaffected by light and can achieve long-distance ranging, providing reliable distance data support for subsequent focusing and accuracy reduction.
[0047] S102. When the target conditions are met, based on the second ranging data, the image acquisition device of the electronic device is controlled to focus on the target object.
[0048] The target condition is used to determine whether to activate the second ranging data-assisted focusing mechanism. It can be set based on factors such as distance and lighting conditions in the shooting scene. The image acquisition device is a component in an electronic device used to acquire images, such as a camera module, including a lens and image sensor. The target condition can be preset. After acquiring the second ranging data, it is determined whether the scene characteristics of the current shooting scene meet the target condition. If they do, the second ranging data is transmitted to the image acquisition device of the electronic device. The autofocus system in the image acquisition device adjusts the lens focal length of the image acquisition device according to the distance information represented in the second ranging data to achieve focus on the target object. If the target condition is not met, the second ranging data is not used, and focusing can be performed using a transmission focusing method, such as PDAF (Phase Detection Auto Focus) or CAF (Contrast Auto Focus) to automatically focus on the target object.
[0049] In scenarios where the motion state of an electronic device meets the conditions of stillness and the target conditions are met, using second ranging data to assist focusing can solve the focusing deviation problem of the transmission focusing method in scenarios where the target object's face is not recognized or in long-distance scenarios, thereby improving focusing speed and accuracy.
[0050] For example, a user is filming a pet dog running at a distance (approximately 7 meters) in an outdoor park. The scene is outdoor and at a distance, the dog is a moving object, and there is no clearly identifiable human face in the frame. The user holds the phone steadily, and the phone, through its gravity sensor and OIS module, detects a Gyro data variance of 0.2 (less than the set threshold of 0.5) and an OIS angle change of 0.5° (less than the set threshold of 1°), thus meeting the stationary condition. Subsequently, the phone's UWB Radar module activates, measuring the distance between the dog and the phone at 7.2 meters (second distance measurement data). This distance is determined to be within the preset target distance range (5-10 meters), meeting the target condition. After receiving the 7.2-meter distance data, the phone's image acquisition device's focusing system quickly adjusts the camera lens focus, accurately focusing on the dog, avoiding the problem of traditional PDAF focusing on the center of the image, achieving fast and accurate focusing.
[0051] This application provides a focusing method in which, if the motion state of an electronic device meets the stationary condition, second ranging data generated by the second ranging module of the electronic device is obtained; in response to meeting the target condition, the image acquisition device of the electronic device is controlled to focus on the target object based on the second ranging data. By determining the stationary state of the electronic device to ensure the reliability of the ranging data, and by utilizing the second ranging module, which is unaffected by light and has strong long-distance ranging capabilities, to obtain the distance data of the target object, and by combining the target condition to activate the data to assist focusing, the method effectively solves the problems of inaccuracy and slow speed of traditional focusing methods in outdoor long-distance scenes, and in scenes without faces or without face recognition. This improves the focusing performance of electronic devices in complex shooting scenes and enhances the user's shooting experience.
[0052] The relevant technical features of the focusing processing method provided in the embodiments of this application are described below.
[0053] In some embodiments of this application, the target condition characterizes the relative distance range between the electronic device and the target object as being within the target distance range and / or the lighting environment information of the electronic device as being within the target lighting environment. The target distance range is a pre-set distance interval suitable for enabling second ranging data-assisted focusing, which can be set by combining the ranging capability of the second ranging module (e.g., within 10 meters) and the focusing processing errors that occur in traditional ranging modules (e.g., focusing failure beyond 5 meters). The lighting environment information characterizes the light intensity information of the shooting environment of the electronic device, which can be obtained through the light sensor of the electronic device. Correspondingly, the target lighting environment is a pre-set lighting condition suitable for enabling second ranging data-assisted focusing, such as a low-light environment, a strong light interference environment, etc., i.e., a lighting environment where the ranging accuracy of the traditional ranging module is affected.
[0054] Specifically, the relative distance between the electronic device and the target object can be obtained through the ranging module of the electronic device (such as a first ranging module and a second ranging module), and it can be determined whether the distance falls within a preset target distance range. The target distance range can be set according to the actual application scenario, for example, set to 5-10 meters. When the measured relative distance is within this range, the condition is met. The light intensity data (e.g., in lux) of the current shooting environment is collected through the light sensor built into the electronic device. A preset light intensity range corresponding to the target lighting environment (e.g., a low-light environment with light intensity less than 100 lux, a strong-light environment with light intensity greater than 10000 lux) is used to determine whether the collected light intensity data is within this range. If it is, the condition is met. In this embodiment, the determination can be made through distance range and / or lighting environment, which can accurately identify scenes where traditional focusing processing has defects, and then reasonably use the second ranging data to assist focusing, making the focusing strategy more targeted and further improving the accuracy and adaptability of focusing in different scenarios. In actual application scenarios, the target conditions can be flexibly adapted according to the characteristics of the specific shooting environment. For example, in purely distance-dependent scenarios (such as tracking distant mountains or people in the distance), assisted focusing can be triggered solely based on whether the relative distance between the electronic device and the target object exceeds the effective focusing range. In purely abnormal lighting scenarios (such as nighttime, backlighting, or direct strong light), the assisted focusing process can be initiated solely based on whether the ambient light is below or above a set threshold. In complex mixed scenarios (such as long-distance tracking at dusk or moving targets in low indoor light), both distance and lighting conditions can be comprehensively assessed to achieve more accurate and robust assisted focusing decisions. This configurable target condition mechanism allows it to be widely adapted to various real-world shooting scenarios.
[0055] In some implementations, the relative distance range between the electronic device and the target object within the target distance range includes: determining the current distance value of the target object and its confidence level based on the first focus data generated by the first ranging module of the electronic device; and determining that the distance range in which the current distance value is located satisfies the target distance range in response to the confidence level being lower than a confidence level threshold.
[0056] In this embodiment, the first ranging module represents a traditional ranging module in an electronic device, such as a ToF (Time of Flight) ranging module, a PDAF (Phase Detection Auto Focus) module, or a CAF (Contrast Auto Focus) module. The first ranging module generates first focus data, which represents distance-related information of the target object. This data may include the current distance value and the confidence level of that distance value. The confidence level represents the reliability of the current distance value in the first focus data, and its value ranges from 0 to 1. The closer the value is to 1, the more reliable the distance value. The confidence threshold is a pre-set critical value used to determine the reliability of the first focus data, such as 0.6. When the confidence level is lower than this threshold, it indicates that the ranging result of the first ranging module is unreliable.
[0057] Specifically, the first ranging module (such as a TOF module or a PDAF module) is activated. The TOF module obtains the current distance value of the target object by emitting near-infrared light and measuring the round-trip time, while calculating the confidence level of this distance value based on factors such as light reflection intensity and environmental interference. The PDAF module obtains the current distance value by detecting the phase difference of light rays and determines the confidence level based on factors such as the sharpness of the phase difference detection and ambient light. The electronic device receives the first focusing data transmitted by the first ranging module and extracts the current distance value and the corresponding confidence level from it. Then, the confidence level is compared with a confidence level threshold. If the confidence level is lower than the confidence level threshold, it means that the ranging result of the first ranging module is unreliable. In this case, it is determined that the current distance value falls within the target distance range (i.e., the scene is suitable for using the second ranging data to assist focusing). If the confidence level is not lower than the confidence level threshold, it means that the ranging result of the first ranging module is reliable, the current distance value does not fall within the target distance range, and there is no need to use the second ranging data.
[0058] In this embodiment, by comparing the confidence level of the first focus data generated by the first ranging module used in the traditional focusing process with the confidence level threshold, the reliability of the traditional ranging module is accurately determined, thereby determining whether the target distance range condition is met. This ensures that the second ranging data is only used in scenarios where the traditional ranging module is unreliable, thus solving the defects of the traditional ranging module, avoiding unnecessary resource waste, and improving the flexibility and reliability of the focusing strategy.
[0059] In some embodiments of this application, the image acquisition device of the electronic device is controlled to focus on the target object based on the second ranging module, including: determining the distance range of the target object relative to the electronic device based on the second ranging data; and controlling the image acquisition device of the electronic device to focus on the target object based on the distance range.
[0060] The target object refers to the object that the image acquisition device of the electronic device needs to capture. The second ranging data is the distance value generated by the second ranging module (such as a UWB Radar). The change between two consecutive measurements can be used to determine whether there is a moving object around the electronic device. This moving object may or may not be the target object. This second ranging data can serve as a reference distance for focusing on the target object. The distance range of the target object relative to the electronic device is based on the second ranging data, combined with the distance interval set by the ranging accuracy of the second ranging module, used to narrow the focus search range. Alternatively, the second ranging module can detect the distance of a reference object from the target object to the electronic device, and then determine the distance range of the target object relative to the electronic device based on the positional relationship between the reference object and the target object. For example, if the target object is the first object, and the second ranging module detects a moving second object at a distance of 5 meters from the electronic device, and then determines the relative distance between the first and second objects to be approximately 1 meter based on the image, then the distance range can be determined to be between 4 and 6 meters.
[0061] The determined distance range is sent to the image acquisition device of the electronic device. The focusing system in the image acquisition device controls the lens drive mechanism to adjust the lens focal length to the range corresponding to that distance. This eliminates the need to search for focus across the entire focal length range, quickly locating the approximate focus position. If further accuracy is required, fine-tuning can be performed within this distance range to achieve precise focusing. This embodiment determines the distance range of the target object using second ranging data and controls focusing based on this range, narrowing the focus search interval. This improves focusing speed while ensuring focusing accuracy, effectively solving the problems of large search range, slow speed, and easy deviation in traditional focusing methods, further optimizing the focusing experience.
[0062] In some embodiments of this application, controlling the image acquisition device of an electronic device to focus on a target object based on a distance range includes: acquiring motion intensity information of the target object; determining the application confidence level of the second ranging data based on the motion intensity information; and controlling the image acquisition device of the electronic device to focus on the target object according to the application confidence level.
[0063] The motion intensity information of the target object represents the degree of motion of the target object to be focused. The focus-aiding application value of the second ranging data (i.e., the reference distance) is determined by the motion intensity of the target object, and this value is set as the application confidence level of the second ranging data. Then, by combining the application confidence level, the second ranging data, and the first focus data, the focus strategy to be executed is determined, and the target object is then focused.
[0064] In this embodiment, the motion intensity of the target object can be obtained by estimating its actual speed in three-dimensional space using an inertial measurement unit built into the electronic device in conjunction with image visual information. Alternatively, a pre-trained neural network model can be used to analyze image sequences to obtain the motion state of the target object. In some embodiments of this application, obtaining the motion intensity information of the target object includes: identifying the target object in multiple consecutively acquired images to obtain the change in the target object's position in the consecutive image frames; and determining the motion intensity information of the target object based on the change in position and the image acquisition frame rate.
[0065] An image sequence can be obtained by continuously capturing images at a preset frame rate (e.g., 30 frames / second) using an electronic device's image acquisition device. This image sequence consists of multiple continuously acquired frames. The change in position of a target object within consecutive image frames represents the change in pixel coordinates of the target object within consecutive image frames, including horizontal and vertical displacement. The image acquisition frame rate represents the number of image frames captured by the image acquisition device per unit time. For example, a target recognition algorithm can be used to process each continuously acquired frame to identify and lock onto the target object (such as a person, vehicle, pet, etc.), and record the pixel coordinates of the target object in each frame (e.g., a coordinate system with the top left corner of the image as the origin, the horizontal to the right as the x-axis, and the vertical downward as the y-axis). The difference in the target object's coordinates between two adjacent frames is calculated to obtain the horizontal and vertical displacements, and then the change in position is calculated. Alternatively, the total displacement of the target object across multiple frames can be calculated as the change in position. The image acquisition frame rate is a known parameter, and the motion speed represents the ratio of the change in position to time, where time is the ratio of the number of frames to the frame rate. Motion intensity is categorized based on the magnitude of motion speed, for example, into high, medium, and low intensity categories, to determine the motion intensity information of the target object. This embodiment uses a target recognition algorithm to obtain the positional change of the target object in consecutive image frames, combines this with the image acquisition frame rate to calculate the motion speed, and then determines the motion intensity information. This method is simple, efficient, accurate, and reliable, objectively reflecting the motion state of the target object and providing a solid foundation for determining application confidence levels, ensuring the rationality of subsequent focusing strategy selection.
[0066] Correspondingly, in this embodiment of the application, the image acquisition device of the electronic device is controlled to focus on the target object based on the application confidence level, and one of the following is selected:
[0067] In response to an application confidence level greater than a first confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on a first strategy. The first strategy represents the target focusing distance determined by the distance range represented by the second ranging data, and controls the image acquisition device to focus on the target object at the target focusing distance.
[0068] In response to an application confidence level that is no greater than a first confidence threshold and greater than a second confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on a second strategy. The second strategy represents using a distance range as the focus search range, controlling the image acquisition device to focus on the target object within the focus search range based on first focus data, where the first focus data is the data generated by the first ranging module.
[0069] In response to the application confidence level not being greater than the second confidence level threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on the third strategy, which represents focusing based on the first focus data.
[0070] In this embodiment, the application confidence level is a quantitative indicator, ranging from 0 to 1, or divided into "high," "medium," and "low" levels. It comprehensively reflects the reliability of the "distance range" determined based on the second ranging data (such as UWB data) at the current moment. A higher confidence level indicates that the UWB data is more likely to accurately reflect the distance to the actual focusing target. Two confidence thresholds can be preset according to the actual application scenario, such as a first confidence threshold and a second confidence threshold, where the first confidence threshold is greater than the second confidence threshold. When the application confidence level is greater than the first confidence threshold, the specific distance value represented by the second ranging data (such as 5.2 meters measured by UWB), or the midpoint (5.2 meters) of the distance range (such as [5.0, 5.4] meters), is determined as the target focusing distance. The autofocus system of the image acquisition device is controlled to drive the focusing lens directly to the motor position corresponding to the target focusing distance.
[0071] When the confidence level is no greater than the first confidence threshold but greater than the second confidence threshold, the focus search range is determined based on the second ranging data (e.g., [7.0, 9.0] meters as indicated by UWB). The autofocus system is controlled to limit the lens's search travel to this focus search range. Within this limited range, the first focus data generated by the first ranging module (e.g., TOF) or image sensor (PDAF) is primarily relied upon for precise focus position search and confirmation. For example, when filming a jogger in a park, the target is moving, and UWB data can provide a general distance range but is not precise enough. The system employs a second strategy, narrowing the PDAF search range from the entire distance to an area of about 8 meters, thereby avoiding invalid searches on nearby plants and distant buildings and greatly accelerating focus locking speed.
[0072] When the confidence level is no greater than the second confidence threshold, the electronic device's processing system can determine that the second ranging data is unreliable and abandon its use as focusing reference data. Instead, it controls the focusing system in the image acquisition device to perform focusing processing based on the first focusing data generated by the first ranging module. For example, when photographing a football player dribbling rapidly, the target's movement is extremely rapid and its direction is constantly changing, meaning the instantaneous ranging value from UWB may be lagging or have large errors. In this case, the system employs a third strategy: temporarily disabling UWB assistance and relying entirely on high-performance PDAF and AI tracking algorithms to ensure focus and prevent UWB erroneous data from interfering with focus loss.
[0073] In this embodiment, under high-confidence scenarios, the data generated by the second ranging module is fully utilized as focusing assistance data. Under medium-confidence scenarios, the second ranging data is used as the search range, significantly reducing the search space of traditional focusing and improving focusing efficiency and battery life. Under low-confidence scenarios, it can safely switch back to a mature and reliable pure image focusing solution, ensuring that the basic performance of the focusing system does not degrade under any circumstances.
[0074] It should be noted that, in this embodiment, the first focusing data obtained by the first ranging module represents ranging information associated with the identity and position of the target object in the field of view of the image acquisition device. The second ranging data obtained by the second ranging module represents a distance value associated with an object in at least one moving event in the environment surrounding the electronic device, and is used as a distance reference for focusing processing.
[0075] The first focusing data is pixel-level data, bound to the target object (determined by the target's position in the image), and can be physical distance (TOF) or lens movement distance (PDAF), serving as the core data for focusing. The second ranging data represents the distance value, confirming the presence of moving objects by analyzing changes in the data. Its function is to provide a reference distance and narrow down the focusing search range. For example, when a user is shooting a target outdoors (a cyclist locked in the image), the first ranging module (TOF) outputs the first ranging data "physical distance 7.5 meters (corresponding to the cyclist)" based on the cyclist's pixel position in the image; the second ranging module (UWB Radar) outputs "7.2 meters," comparing it to the previous 6.7 meters (a difference of 0.5 meters), confirming the presence of a moving object, but not determining whether 7.2 meters corresponds to the cyclist or a nearby runner. During focusing, a search range of 7.0-7.4 meters is set using 7.2 meters as a reference, and then, based on the first ranging data of 7.5 meters (accommodating slight errors), the focus is quickly adjusted within this range to achieve precise focusing.
[0076] See Figure 2The illustration shows a schematic diagram of an application scenario provided by an embodiment of this application, in which a user uses a mobile phone to photograph a person running (moving target) in an outdoor scene. In this scenario, the first ranging module consists of a TOF (Time-of-Flight) ranging module and a PDAF (Phase-Detection Autofocus) module equipped in the mobile phone, which work together to output data on the physical distance of the target object and the distance the lens moves. The second ranging module is a UWB Radar (Ultra-Wideband Radar) module built into the mobile phone, used to output long-distance reference distance data that is not affected by light.
[0077] First, determine if the phone is in a stationary shooting state. Read the Gyro data from the phone's built-in gravity sensor and calculate the variance of the Gyro data between the current and previous frames. Determine if this variance is less than a preset threshold (e.g., a preset threshold of 0.5, with an actual calculated variance of 0.3). If the Gyro data meets the condition, continue reading the angle data from the OIS (Optical Image Stabilization) module and calculate the change in OIS angle between the current and previous frames. Determine if this change is less than a preset threshold (e.g., a preset threshold of 1°, with an actual change of 0.8°). If both checks meet the condition, the phone is determined to be in a stationary shooting state, and the subsequent focusing process begins. If either condition is not met (e.g., phone shaking causing a Gyro variance of 0.6), UWB-assisted focusing is temporarily disabled.
[0078] Then, the motion intensity of the moving target is analyzed to determine the confidence level of the UWB data. After the mobile phone continuously captures multiple frames through the image acquisition device, the motion intensity and UWB confidence level determination process is executed: each frame image is evenly divided into M×N blocks (e.g., 3×3 blocks), and the brightness and color information of each block is statistically analyzed; the brightness and color differences of each block in the current frame and the previous frame are compared to calculate the degree of difference in the overall image; the motion intensity is divided into three levels: "low," "medium," and "high" according to the size of the difference: if the displacement of the runner between frames is small (e.g., 50 pixels per second), the motion intensity is determined to be low, and the corresponding confidence level of the UWB data is low; if the displacement is at a medium level (e.g., 150 pixels per second), the motion intensity is determined to be medium, and the corresponding confidence level of the UWB data is medium; if the runner moves quickly (e.g., 300 pixels per second), the motion intensity is determined to be high, and the corresponding confidence level of the UWB data is high.
[0079] Finally, combining UWB confidence level and TOF / PDAF data, precise focusing is achieved. Distance data measured by the UWB Radar (e.g., the distance to the area where the runner is located is measured to be 8 meters) is read and combined with the aforementioned confidence level to execute a corresponding focusing strategy: If the confidence level is high: the 8 meters measured by UWB is directly used as the focusing distance, and the camera lens is controlled to adjust to the focal length corresponding to 8 meters to quickly complete focusing; if the confidence level is medium, the confidence level of the TOF / PDAF module is compared. If the TOF / PDAF confidence level is low (e.g., the TOF distance measurement confidence level is 0.4 under strong light), the 8 meters measured by UWB is used as an approximate range, and then CAF (Contrast Autofocus) is used to search for a precise focus position within this range; if the TOF / PDAF confidence level is high, TOF / PDAF data is used as the primary focus source; if the confidence level is low, UWB data is not used, and focusing is directly based on TOF / PDAF data (such as the lens movement distance measured by PDAF). Through the above process, the mobile phone can quickly and accurately focus on a runner in outdoor bright light and moving target scenarios without a clear face, combining the long-distance anti-interference advantage of UWB and motion intensity analysis, avoiding the problem of traditional PDAF only focusing on the center of the image.
[0080] In another embodiment of this application, an electronic device is also provided, see [link to relevant documentation]. Figure 3 The electronic device may include:
[0081] The second ranging module 301 is used to generate second ranging data; wherein the second ranging data represents the distance information of at least one object around the electronic device that meets the motion state conditions relative to the electronic device.
[0082] Image acquisition device 302 is used to acquire images of target objects;
[0083] The control device 303 is used to obtain second ranging data if the motion state of the electronic device meets the stationary condition; and to generate control commands based on the second ranging data in response to the target condition being met.
[0084] The image acquisition device 302 is also used to focus on the target object based on the control command.
[0085] In some embodiments, the electronic device further includes:
[0086] A first ranging module is used to generate first focus data; wherein the target conditions are associated with the relative distance range between the electronic device and the target object and / or the lighting environment information of the electronic device, determined based on the first focus data;
[0087] The control device is further configured to determine whether the target condition is met based on the first focus data.
[0088] It should be noted that the specific implementation of each functional module in the electronic device in this embodiment can be referred to the corresponding content above, and will not be described in detail here.
[0089] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0090] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0091] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0092] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A focusing processing method, comprising: If the motion state of the electronic device meets the stationary condition, the second ranging data generated by the second ranging module of the electronic device is obtained; If the target conditions are met, the electronic device is controlled to focus on the target object based on the second ranging data; The second ranging data represents the distance information of at least one object around the electronic device that meets the motion state conditions relative to the electronic device.
2. The method according to claim 1, wherein the target condition characterizes the relative distance range between the electronic device and the target object being within the target distance range and / or the illumination environment information of the electronic device being within the target illumination environment.
3. The method according to claim 2, wherein the relative distance range between the electronic device and the target object within the target distance range includes: Based on the first focus data generated by the first ranging module of the electronic device, the current distance value and confidence level of the target object are determined; In response to the confidence level being lower than the confidence level threshold, it is determined that the current distance value falls within a distance range that satisfies the target distance range.
4. The method according to claim 1, wherein controlling the image acquisition device of the electronic device to focus on the target object based on the second ranging data includes: Based on the second ranging data, the distance range of the target object relative to the electronic device is determined; Based on the distance range, the image acquisition device of the electronic device is controlled to focus on the target object.
5. The method according to claim 4, wherein controlling the image acquisition device of the electronic device to focus on the target object based on the distance range includes: Obtain the motion intensity information of the target object; Based on the motion intensity information, determine the application confidence level of the second ranging data; Based on the application confidence level, the image acquisition device of the electronic device is controlled to focus on the target object.
6. The method according to claim 5, wherein controlling the image acquisition device of the electronic device to focus on the target object based on the application confidence level is selected from one of the following: In response to the application confidence being greater than a first confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on a first strategy. The first strategy represents the target focusing distance determined based on the distance range represented by the second ranging data, and the image acquisition device is controlled to focus on the target object at the target focusing distance. In response to the application confidence level being no greater than the first confidence threshold and greater than the second confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on the second strategy; The second strategy represents using the distance range as the focus search range, controlling the image acquisition device to focus on the target object within the focus search range based on the first focus data, where the first focus data is data generated by the first ranging module; In response to the application confidence level not being greater than the second confidence threshold, the image acquisition device of the electronic device is controlled to focus on the target object based on the third strategy; The third strategy characterizes focusing based on the first focusing data.
7. The method according to claim 5, wherein obtaining the motion intensity information of the target object includes: The target object is identified in multiple consecutively acquired images to obtain the positional change of the target object in the consecutive image frames; Based on the change in position and the image acquisition frame rate, the motion intensity information of the target object is determined.
8. The method according to claim 3, wherein the first focusing data obtained by the first ranging module represents ranging information associated with the identity and position of the target object in the field of view of the image acquisition device; and the second ranging data obtained by the second ranging module represents a distance value associated with an object in at least one motion event in the environment surrounding the electronic device, used as a distance reference for focusing processing.
9. An electronic device, comprising: The second ranging module is used to generate second ranging data; wherein the second ranging data represents the distance information of at least one object around the electronic device that meets the motion state conditions relative to the electronic device. Image acquisition device, used to acquire images of target objects; A control device is used to obtain second ranging data if the motion state of the electronic device meets the stationary condition; and to generate control commands based on the second ranging data in response to the target condition being met. The image acquisition device is also used to focus on the target object based on the control command.
10. The electronic device according to claim 9, further comprising: A first ranging module is used to generate first focus data; wherein the target conditions are associated with the relative distance range between the electronic device and the target object and / or the lighting environment information of the electronic device, determined based on the first focus data; The control device is further configured to determine whether the target condition is met based on the first focus data.