Photographing method, apparatus and electronic device

By predicting the coordinates of objects entering the frame outside the main camera's field of view and adjusting the focus in advance, the problem of focus delay in high-speed dynamic object shooting is solved, achieving zero-delay capture effect.

CN122293992APending Publication Date: 2026-06-26VIVO MOBILE COMM CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
VIVO MOBILE COMM CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-26

Smart Images

  • Figure CN122293992A_ABST
    Figure CN122293992A_ABST
Patent Text Reader

Abstract

This application discloses a shooting method, apparatus, and electronic device, belonging to the field of electronic device technology. The method includes: acquiring N frames of images of a first region; the first region is a region outside the imaging field of view of a main camera; N is an integer greater than 1; determining the entry coordinates of a moving object in the first region based on the N frames of images; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view; determining a predicted focus position based on the entry coordinates; and controlling the main camera to perform exposure based on the predicted focus position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electronic equipment technology, specifically relating to a shooting method, apparatus, and electronic equipment. Background Technology

[0002] With the widespread use of mobile electronic devices such as smartphones and action cameras, users' demand for capturing fast-moving scenes is increasing, hoping to accurately capture the key moments when moving objects enter the frame.

[0003] In related technologies, an autofocus mechanism of "detect first, then focus" is employed. The electronic device triggers focus only after detecting a moving object entering the main camera's preview frame, a process that typically takes 200 to 500 milliseconds. However, high-speed moving objects such as race cars or athletes may cross the frame in just 0.5 seconds, resulting in out-of-focus images and failure to capture crucial moments. Therefore, the autofocus mechanism of these technologies lacks real-time performance when dealing with sudden high-speed moving objects, leading to focus delays. Summary of the Invention

[0004] The purpose of this application is to provide a shooting method, device, and electronic device that can shorten the focus response time and improve the success rate of snapshot.

[0005] Firstly, some embodiments of this application provide a shooting method, the method comprising: N frames of images of the first region are captured; the first region is the area outside the imaging field of view of the main camera; N is an integer greater than 1. Based on the N frames of images, the entry coordinates of the moving object in the first region are determined; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view. Based on the input coordinates, the predicted focus position is determined; Based on the predicted focus position, the main camera is controlled to adjust its exposure.

[0006] This embodiment, by acquiring images outside the main camera's field of view, can detect moving objects about to enter the shooting range in advance and pre-determine the focus position based on their entry coordinates. This transforms the focusing operation from "responding after the target appears" to "pre-loading before the target enters the frame," effectively shortening the focus response time and improving the success rate of capturing images. By predicting the entry coordinates and adjusting the focus parameters in advance, it ensures that the image is in the optimal focus position the instant the moving object enters the field of view, achieving a zero-delay effect for capturing and focusing.

[0007] Optionally, in some embodiments of this application, the method further includes: Based on the N frames of images, the entry time of the moving object is determined; the entry time is the predicted time when the moving object reaches the position corresponding to the entry coordinates. The step of controlling the main camera to perform exposure based on the predicted focus position includes: Before the system time reaches the frame entry time, control the focus motor of the main camera to move to the predicted focus position; When the moving object is detected to enter the imaging field of view, or when the system time reaches the moment of entry into the frame, the main camera is controlled to perform exposure.

[0008] This embodiment introduces the moment of entry into the frame, providing a precise time reference for focus adjustment and ensuring that the lens is in focus the instant the moving object enters the main camera's field of view. Simultaneously, this embodiment combines two exposure mechanisms: moving object entry detection and system time-triggered detection. This enables zero-delay capture in both cases of accurate prediction and actual entry into the frame, enhancing adaptability to different shooting scenarios. This strategy of predicting the moment of entry based on motion trajectory analysis and pre-activating the motor ensures that the image is in optimal focus the instant the moving object enters the main camera's field of view, achieving a zero-delay effect for capture and focus.

[0009] Optionally, in some embodiments of this application, the acquisition of N frames of images of the first region includes: In the case of a linear motion scene, N frames of images of the first region are captured by a secondary camera; the secondary camera is a wide-angle camera. In the case of a non-linear motion scene, N frames of images of the first region are captured through the edge pixel array of the main camera.

[0010] This embodiment adaptively selects the image acquisition method based on the linear characteristics of the motion trajectory: in linear scenes, it utilizes the wide-angle field of view of the secondary camera to expand the perception range; in nonlinear scenes, it utilizes the edge pixel array of the main camera to achieve accurate monitoring without increasing hardware costs, thereby optimizing the resource utilization of electronic equipment while ensuring monitoring effectiveness. Through the combination of multi-camera collaboration and high-magnification cropping technology, the focusing efficiency and accuracy of the camera system in dynamic scenes are significantly improved.

[0011] Optionally, in some embodiments of this application, when N frames of images of the first region are captured by a secondary camera, determining the entry coordinates of a moving object in the first region based on the N frames of images includes: Based on the N frames of images, a moving object in the first region, a first coordinate of the moving object in a first coordinate system, and a first motion vector are determined; the first coordinate system is the image coordinate system of the secondary camera. Based on the mapping relationship between the first coordinate system and the second coordinate system, the first coordinate and the first motion vector are transformed into the second coordinate system to obtain the second coordinate and the second motion vector; the second coordinate system is the image coordinate system of the main camera. The entry coordinates are determined based on the second coordinates, the second motion vector, and the boundary coordinates of the imaging field of view.

[0012] This embodiment utilizes the mapping relationship between the image coordinate systems of the primary and secondary cameras to accurately convert the position and motion information of moving objects detected by the secondary camera to the image coordinate system of the primary camera. This eliminates coordinate deviations caused by physical parallax and provides a unified and accurate spatial reference for subsequent image prediction. Through this coordinate mapping, the electronic device can determine from which boundary position of the imaging field of view the moving object will enter before it even enters the imaging field of view of the primary camera, providing precise spatial guidance for subsequent focus preloading.

[0013] Optionally, in some embodiments of this application, determining the entry coordinates based on the second coordinates, the second motion vector, and the boundary coordinates of the imaging field of view includes: Based on the second coordinate and the boundary coordinate of the imaging field of view, a first distance is determined; the first distance is the length of the perpendicular line from the second coordinate to the boundary of the imaging field of view. Based on the second motion vector, a first velocity component of the moving object is determined; the first velocity component is used to indicate the motion velocity of the moving object in a first direction; the first direction is the normal direction of the boundary of the imaging field of view. The moment of entry into the frame is determined based on the first distance and the first velocity component; The entry coordinates are determined based on the second coordinates, the second motion vector, and the entry time.

[0014] This embodiment combines the spatial position and motion state of a moving object with the geometric constraints of the main camera's imaging field of view boundary, enabling precise calculation of the moment and coordinates of entry into the frame. Through this calculation, the electronic device can accurately predict when and from which boundary position of the imaging field of view a moving object will enter before it has even entered the main camera's imaging field of view, providing a precise temporal and spatial reference for subsequent focus preloading.

[0015] Optionally, in some embodiments of this application, the first mapping relationship between the first coordinate system and the second coordinate system is determined in the following way: Within the overlapping field of view of the secondary camera and the primary camera, M feature points are extracted from the image captured by the secondary camera, and K feature points are extracted from the image captured by the primary camera. A corresponding feature descriptor is generated for each feature point to obtain a set of feature descriptors; M and K are both integers greater than 4. Based on the feature descriptor subset, T matching feature point pairs are selected between the M feature points and the K feature points; T is an integer greater than or equal to 4. Based on the T matched feature point pairs, determine the initial homography transformation matrix; From the T matched feature point pairs, S feature point pairs are eliminated, and the initial homography transformation matrix is ​​fitted and optimized to obtain the target homography transformation matrix; the S feature point pairs are mismatched feature point pairs, and the target homography transformation matrix is ​​used to characterize the first mapping relationship.

[0016] This embodiment, through feature extraction, matching, and iterative optimization, can establish a precise coordinate mapping relationship in real time based on the overlapping field of view of the main and secondary cameras during use. It is suitable for pre-shipment calibration and can also cope with minor displacements or optical changes that may occur during the use of electronic devices, ensuring the long-term accuracy of the mapping relationship.

[0017] Optionally, in some embodiments of this application, determining the predicted focus position based on the entrance coordinates includes: Based on the second mapping relationship between the object distance and the control quantity of the focusing motor, the first object distance corresponding to the entry coordinate is converted into the first control quantity of the focusing motor. Based on the first control quantity and the thermal drift compensation quantity, the second control quantity is determined; The focus position corresponding to the second control quantity is determined as the predicted focus position.

[0018] This embodiment converts spatial position information into precise focusing motor control parameters through a preset lens optical parameter mapping relationship, and introduces temperature compensation to correct deviations caused by environmental factors, ensuring that the lens can be accurately driven to the predicted focusing position under different temperature conditions.

[0019] Optionally, in some embodiments of this application, when N frames of images of a first region are acquired through the edge pixel array of the main camera, determining the entry coordinates of a moving object in the first region based on the N frames of images includes: Based on the N frames of images, determine all moving objects in the first region, the motion vector and acceleration of each moving object; From all the moving objects, P candidate moving objects are selected; the acceleration of the candidate moving objects is greater than the acceleration threshold; P is a positive integer; For each candidate moving object's historical trajectory points, polynomial fitting is performed to obtain P trajectory fitting curves; Based on the motion vector and trajectory fitting curve of each candidate moving object, the entry coordinates of each candidate moving object are determined.

[0020] This embodiment filters out random interference objects by using acceleration to focus on moving objects with shooting value, and uses polynomial fitting to describe their motion trajectory, thereby effectively reflecting complex motion laws such as acceleration, deceleration or turning, and improving the prediction accuracy in nonlinear scenes.

[0021] Optionally, in some embodiments of this application, determining the entry coordinates of each candidate moving object based on its motion vector and trajectory fitting curve includes: Based on the motion vector and trajectory fitting curve of each candidate motion object, the predicted motion trajectory of each candidate motion object is determined. The coordinates of the intersection point between the predicted motion trajectory of each candidate moving object and the boundary of the imaging field of view are respectively determined as the entry coordinates of each candidate moving object.

[0022] This embodiment combines long-term trajectory patterns with short-term motion states to construct a predicted trajectory that better reflects actual motion conditions, and solves for the intersection of this trajectory with the boundary of the main camera's imaging field of view, enabling precise determination of the entry coordinates in complex motion scenes.

[0023] Optionally, in some embodiments of this application, determining the predicted focus position based on the entrance coordinates includes: If at least two candidate moving objects exist in the first region, a motion salience score is calculated for each candidate moving object; the motion salience score is determined based on at least one of object type, acceleration, and entry time. The candidate moving object with the highest motion salience score is identified as the target focus object; Obtain the second object distance corresponding to the entrance coordinates of the target focus object; The focus position indicated by the second object distance is determined as the predicted focus position.

[0024] This embodiment uses a multi-dimensional scoring mechanism to intelligently select the most noteworthy moving object from multiple moving objects as the focus subject, avoiding decision-making conflicts in multi-object scenes and ensuring the capture of wonderful moments with shooting value.

[0025] Optionally, in some embodiments of this application, after detecting that the target focus object has entered the imaging field of view, and before controlling the main camera to perform exposure, the method further includes: Obtain the defocus amount of the main camera; Using the predicted focus position as the feedforward control quantity and the defocus amount as the feedback control quantity, the third control quantity of the focusing motor is calculated. The target focus position is determined based on the third control quantity; the target focus position is the focus position reached after the predicted focus position is moved according to the adjustment direction and magnitude indicated by the third control quantity. Control the focusing motor to move from the predicted focusing position to the target focusing position.

[0026] This embodiment uses a combined feedforward and feedback control mechanism to precisely fine-tune the preloaded focus position using real-time phase detection data after the target focus object enters the frame. This maintains the fast response advantage of preloading while correcting focus deviation caused by nonlinear motion prediction errors through closed-loop feedback, ensuring the final focus accuracy.

[0027] Optionally, in some embodiments of this application, controlling the focus motor of the main camera to move to the predicted focus position before the system time reaches the frame entry time includes: Obtain the setup time of the focus motor of the main camera; Based on the entry time and the setup time, a first moment is determined; the first moment is the moment when the focus motor is started to be controlled; the first moment is earlier than the second moment, or the first moment is the same as the second moment, and the second moment is the entry time minus the setup time; At the first moment, the focusing motor of the main camera is controlled to move toward the predicted focus position.

[0028] This embodiment ensures that the lens has completed its displacement and is in a stable state the instant the moving object enters the frame by accurately calculating the motor start time, thus eliminating the motor travel time during the focusing process and achieving a zero-delay capture effect of "focusing as soon as the target enters the frame".

[0029] Secondly, some embodiments of this application provide a shooting device, the device comprising: The processing module is used to acquire N frames of images of a first region; the first region is a region outside the imaging field of view of the main camera; N is an integer greater than 1; based on the N frames of images, determine the entry coordinates of a moving object in the first region; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view; based on the entry coordinates, determine the predicted focus position; based on the predicted focus position, control the main camera to perform exposure.

[0030] This embodiment, by acquiring images outside the main camera's field of view, can detect moving objects about to enter the shooting range in advance and pre-determine the focus position based on their entry coordinates. This transforms the focusing operation from "responding after the target appears" to "pre-loading before the target enters the frame," effectively shortening the focus response time and improving the success rate of capturing images. By predicting the entry coordinates and adjusting the focus parameters in advance, it ensures that the image is in the optimal focus position the instant the moving object enters the field of view, achieving a zero-delay effect for capturing and focusing.

[0031] Optionally, in some embodiments of this application, the processing module is specifically used to determine the entry time of the moving object based on the N frames of images; the entry time is the predicted time when the moving object reaches the position corresponding to the entry coordinates; before the system time reaches the entry time, control the focusing motor of the main camera to move to the predicted focusing position; when the moving object is detected to enter the imaging field of view, or when the system time reaches the entry time, control the main camera to perform exposure.

[0032] This embodiment introduces the moment of entry into the frame, providing a precise time reference for focus adjustment and ensuring that the lens is in focus the instant the moving object enters the main camera's field of view. Simultaneously, this embodiment combines two exposure mechanisms: moving object entry detection and system time-triggered detection. This enables zero-delay capture in both cases of accurate prediction and actual entry into the frame, enhancing adaptability to different shooting scenarios. This strategy of predicting the moment of entry based on motion trajectory analysis and pre-activating the motor ensures that the image is in optimal focus the instant the moving object enters the main camera's field of view, achieving a zero-delay effect for capture and focus.

[0033] Optionally, in some embodiments of this application, the processing module is specifically used to acquire N frames of images of the first region through a secondary camera when the shooting scene is a linear motion scene; the secondary camera is a wide-angle camera; and to acquire N frames of images of the first region through the edge pixel array of the main camera when the shooting scene is a non-linear motion scene.

[0034] This embodiment adaptively selects the image acquisition method based on the linear characteristics of the motion trajectory: in linear scenes, it utilizes the wide-angle field of view of the secondary camera to expand the perception range; in nonlinear scenes, it utilizes the edge pixel array of the main camera to achieve accurate monitoring without increasing hardware costs, thereby optimizing system resource utilization while ensuring monitoring effectiveness. The combination of multi-camera collaboration and high-magnification cropping technology significantly improves the focusing efficiency and accuracy of the camera system in dynamic scenes.

[0035] Optionally, in some embodiments of this application, the processing module is specifically used to determine, based on the N frames of images, a moving object in the first region, a first coordinate of the moving object in a first coordinate system, and a first motion vector; the first coordinate system is the image coordinate system of the secondary camera; based on the mapping relationship between the first coordinate system and the second coordinate system, the first coordinate and the first motion vector are transformed into the second coordinate system to obtain a second coordinate and a second motion vector; the second coordinate system is the image coordinate system of the main camera; and based on the second coordinate, the second motion vector, and the boundary coordinates of the imaging field of view, the entry coordinates are determined.

[0036] This embodiment utilizes the mapping relationship between the image coordinate systems of the primary and secondary cameras to accurately convert the position and motion information of moving objects detected by the secondary camera to the image coordinate system of the primary camera. This eliminates coordinate deviations caused by physical parallax and provides a unified and accurate spatial reference for subsequent image prediction. Through this coordinate mapping, the electronic device can determine from which boundary position of the imaging field of view the moving object will enter before it even enters the imaging field of view of the primary camera, providing precise spatial guidance for subsequent focus preloading.

[0037] Optionally, in some embodiments of this application, the processing module is specifically configured to: determine a first distance based on the second coordinate and the boundary coordinate of the imaging field of view; the first distance being the length of the perpendicular line from the second coordinate to the boundary of the imaging field of view; determine a first velocity component of the moving object based on the second motion vector; the first velocity component being used to indicate the motion velocity of the moving object in a first direction; the first direction being the normal direction of the boundary of the imaging field of view; determine the entry time based on the first distance and the first velocity component; and determine the entry coordinates based on the second coordinate, the second motion vector, and the entry time.

[0038] This embodiment combines the spatial position and motion state of a moving object with the geometric constraints of the main camera's imaging field of view boundary, enabling precise calculation of the moment and coordinates of entry into the frame. Through this calculation, the electronic device can accurately predict when and from which boundary position of the imaging field of view a moving object will enter before it has even entered the main camera's imaging field of view, providing a precise temporal and spatial reference for subsequent focus preloading.

[0039] Optionally, in some embodiments of this application, the processing module is further configured to extract M feature points from the image captured by the secondary camera and K feature points from the image captured by the primary camera within the overlapping field of view of the secondary camera and the primary camera, and generate a corresponding feature descriptor for each feature point to obtain a feature descriptor set; M and K are both integers greater than 4; based on the feature descriptor set, select T matching feature point pairs between the M feature points and the K feature points; T is an integer greater than or equal to 4; determine an initial homography transformation matrix according to the T matching feature point pairs; filter out S feature point pairs from the T matching feature point pairs, and perform fitting optimization processing on the initial homography transformation matrix to obtain a target homography transformation matrix; the S feature point pairs are mismatched feature point pairs, and the target homography transformation matrix is ​​used to characterize the first mapping relationship.

[0040] This embodiment, through feature extraction, matching, and iterative optimization, can establish a precise coordinate mapping relationship in real time based on the overlapping field of view of the main and secondary cameras during use. It is suitable for pre-shipment calibration and can also cope with minor displacements or optical changes that may occur during the use of electronic devices, ensuring the long-term accuracy of the mapping relationship.

[0041] Optionally, in some embodiments of this application, the processing module is specifically used to convert the first object distance corresponding to the entry coordinate into the first control quantity of the focusing motor based on the second mapping relationship between the object distance and the focusing motor control quantity; determine the second control quantity based on the first control quantity and the thermal drift compensation quantity; and determine the focusing position corresponding to the second control quantity as the predicted focusing position.

[0042] This embodiment converts spatial position information into precise focusing motor control parameters through a preset lens optical parameter mapping relationship, and introduces temperature compensation to correct deviations caused by environmental factors, ensuring that the lens can be accurately driven to the predicted focusing position under different temperature conditions.

[0043] Optionally, in some embodiments of this application, the processing module is specifically used to: determine all moving objects in the first region, the motion vector and acceleration of each moving object, based on the N frames of images; select P candidate moving objects from all moving objects; the acceleration of the candidate moving objects is greater than an acceleration threshold; P is a positive integer; perform polynomial fitting processing on the historical trajectory points of each candidate moving object to obtain P trajectory fitting curves; and determine the entry coordinates of each candidate moving object based on the motion vector and trajectory fitting curve of each candidate moving object.

[0044] This embodiment filters out random interference objects by using acceleration to focus on moving objects with shooting value, and uses polynomial fitting to describe their motion trajectory, thereby effectively reflecting complex motion laws such as acceleration, deceleration or turning, and improving the prediction accuracy in nonlinear scenes.

[0045] Optionally, in some embodiments of this application, the processing module is specifically used to determine the predicted motion trajectory of each candidate moving object based on the motion vector and trajectory fitting curve of each candidate moving object; and to determine the intersection coordinates of the predicted motion trajectory of each candidate moving object with the boundary of the imaging field of view as the entry coordinates of each candidate moving object.

[0046] This embodiment combines long-term trajectory patterns with short-term motion states to construct a predicted trajectory that better reflects actual motion conditions, and solves for the intersection of this trajectory with the boundary of the main camera's imaging field of view, enabling precise determination of the entry coordinates in complex motion scenes.

[0047] Optionally, in some embodiments of this application, the processing module is specifically used to calculate the motion saliency score of each candidate moving object when there are at least two candidate moving objects in the first region; the motion saliency score is determined based on at least one of object type, acceleration, and entry time; the candidate moving object with the highest motion saliency score is determined as the target focus object; the second object distance corresponding to the entry coordinates of the target focus object is obtained; and the focus position indicated by the second object distance is determined as the predicted focus position.

[0048] This embodiment uses a multi-dimensional scoring mechanism to intelligently select the most noteworthy moving object from multiple moving objects as the focus subject, avoiding decision-making conflicts in multi-object scenes and ensuring the capture of wonderful moments with shooting value.

[0049] Optionally, in some embodiments of this application, the processing module is further configured to: after detecting that the target focus object has entered the imaging field of view, and before controlling the main camera to perform exposure, acquire the defocus amount of the main camera; calculate a third control amount of the focusing motor using the predicted focus position as a feedforward control amount and the defocus amount as a feedback control amount; determine the target focus position based on the third control amount; the target focus position is the focus position reached after the predicted focus position moves according to the adjustment direction and amplitude indicated by the third control amount; and control the focusing motor to move from the predicted focus position to the target focus position.

[0050] This embodiment uses a combined feedforward and feedback control mechanism to precisely fine-tune the preloaded focus position using real-time phase detection data after the target focus object enters the frame. This maintains the fast response advantage of preloading while correcting focus deviation caused by nonlinear motion prediction errors through closed-loop feedback, ensuring the final focus accuracy.

[0051] Optionally, in some embodiments of this application, the processing module is specifically used to obtain the setup time of the focus motor of the main camera; determine a first moment based on the entry moment and the setup time; the first moment is the moment when the focus motor is started to be controlled; the first moment is earlier than the second moment, or the first moment is the same as the second moment, and the second moment is the entry moment minus the setup time; at the first moment, control the focus motor of the main camera to move towards the predicted focus position.

[0052] This embodiment ensures that the lens has completed its displacement and is in a stable state the instant the moving object enters the frame by accurately calculating the motor start time, thus eliminating the motor travel time during the focusing process and achieving a zero-delay capture effect of "focusing as soon as the target enters the frame".

[0053] Thirdly, some embodiments of this application provide an electronic device, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the shooting method as described in the first aspect.

[0054] Fourthly, some embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the shooting method as described in the first aspect.

[0055] Fifthly, some embodiments of this application provide a chip including a processor and a communication interface, the communication interface and the processor being coupled together, the processor being used to run programs or instructions to implement the steps of the shooting method as described in the first aspect.

[0056] In this embodiment, by acquiring images outside the imaging field of view of the main camera, a moving object about to enter the shooting range can be detected in advance, and the focus position can be pre-determined based on its entry coordinates. This transforms the focusing operation from "responding after the target appears" to "pre-loading before the target enters the frame," effectively shortening the focus response time and improving the success rate of capturing images. By predicting the entry coordinates and adjusting the focus parameters in advance, it ensures that the image is in the optimal focus position the instant the moving object enters the field of view, achieving a zero-delay effect for capturing and focusing. Attached Figure Description

[0057] Figure 1This is a flowchart illustrating a shooting method provided in some embodiments of this application; Figure 2 These are example diagrams illustrating a shooting method provided in some embodiments of this application; Figure 3 These are example diagrams illustrating a shooting method provided by some embodiments of this application; Figure 4 These are example diagrams illustrating a shooting method provided in some embodiments of this application; Figure 5 This is a flowchart illustrating a shooting method provided in some embodiments of this application; Figure 6 This is a structural block diagram of a shooting device provided in some embodiments of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in some embodiments of this application; Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0059] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0060] The shooting method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0061] The shooting method provided in this application can be applied to different shooting scenarios. One specific shooting scenario is a linear motion scenario, that is, a scenario where the moving object moves at high speed along an approximately linear trajectory, such as a soccer ball flying towards the goal, a basketball flying towards the hoop, or a race car entering a straight track. In this shooting scenario, the electronic device uses a secondary camera to capture the motion information of the moving object outside the imaging field of view of the main camera in advance, predicts its entry coordinates, and completes focusing in advance, so as to achieve clear capture as soon as the moving object enters the imaging field of view of the main camera.

[0062] Another specific shooting scenario is non-linear motion scenes, which are scenes where the trajectory of the moving object is complex and includes non-linear motion such as acceleration or turning, such as track and field races, car cornering, or multiple players running towards a soccer ball. In this shooting scenario, the electronic device uses the edge pixel array of the main camera sensor to monitor the motion information of multiple moving objects outside its imaging field of view in real time, predict their entry coordinates, and complete the focusing in advance, so as to achieve clear capture as soon as the moving object enters the imaging field of view of the main camera.

[0063] Figure 1 This is a flowchart illustrating a shooting method provided in some embodiments of this application, such as... Figure 1 As shown, the method includes at least the following steps: step 101, step 102, step 103 and step 104.

[0064] In step 101, N frames of images of the first region are acquired; the first region is the region outside the imaging field of view of the main camera; N is an integer greater than 1.

[0065] In some embodiments of this application, the imaging field of view of the main camera refers to the spatial area corresponding to the current preview image of the main camera, that is, the area of ​​the image seen by the user through the display screen. The first area refers to the spatial area outside the imaging field of view but that can be perceived by image acquisition means. These areas are located around the current preview image, such as the space outside the left, right, top, or bottom of the image.

[0066] In some embodiments of this application, N is an integer greater than 1. Acquiring multiple frames of images of the first region can obtain continuous positional change information of the moving object in a time series, providing a data foundation for subsequent motion analysis. The value of N can be determined according to the actual scene and computing resources, such as 30 frames, 60 frames, or a higher frame rate.

[0067] In some embodiments of this application, N frames of images of the first region can be captured by a secondary camera. The secondary camera is a wide-angle camera with a field of view (FOV) ≥ 120°, which can cover the area outside the imaging field of view of the main camera.

[0068] For example, such as Figure 2As shown, the field of view 20 of the secondary camera is much larger than the imaging field of view 23 of the primary camera. The imaging field of view 23 of the primary camera corresponds to a smaller equivalent field of view 21 within the field of view 20 of the secondary camera. The annular region between the field of view 20 and the equivalent field of view 21 is the first region, which is located outside the imaging field of view 23 of the primary camera. When the moving object 22 is outside the imaging field of view 23 of the primary camera, i.e., within the first region, the field of view 20 of the secondary camera can effectively cover the first region.

[0069] The secondary camera captures images of the first area in real time, allowing it to obtain the movement information of the moving object 22 before it appears in the main camera's preview screen. Taking a soccer match scene as an example, the soccer ball flies from the left side of the screen towards the goal at a speed of 15 meters per second. The continuous frame images captured by the secondary camera show that in the first frame, the center of the soccer ball is located at coordinates (320, 240) in the secondary camera's image coordinate system, with a horizontal distance of 150 pixels from the left edge of the main camera's field of view. In the second frame, the center of the soccer ball moves to (300, 242), meaning it has moved 20 pixels horizontally to the left and 2 pixels vertically between adjacent frames. Based on a frame rate of 30fps, the horizontal speed of the soccer ball is approximately 600 pixels per second, the vertical speed is approximately 60 pixels per second, and the angle between the direction of movement and the horizontal direction is approximately 5.7°. Through this method, the electronic device can accurately determine the position, speed, and direction of movement of the soccer ball before it enters the main camera's preview screen.

[0070] In some embodiments of this application, N frames of images of the first region can be acquired through the edge pixel array of the main camera sensor, that is, in the sensor full pixel readout mode, the field of view edge region beyond the preview image is sampled.

[0071] For example, such as Figure 3 As shown, the complete pixel array of the main camera sensor corresponds to a large field of view 30, while the current imaging field of view 31 of the main camera only corresponds to a smaller field of view covered by the central pixels of the sensor. The annular area between the field of view 30 and the imaging field of view 31 is the first region, which is located on the outer periphery of the current imaging field of view 31 of the main camera. When the moving object 32 is outside the imaging field of view 31 of the main camera, i.e., within the first region, the field of view corresponding to the edge pixel array of the main camera sensor can effectively cover the first region. By activating the full pixel readout mode of the sensor, while maintaining normal preview and output of the central imaging field of view 31, images within the first region can be acquired in parallel using the edge pixel array, thereby obtaining the motion information of the moving object 32 in advance before it appears in the main camera preview.

[0072] Taking a track and field race as an example, an athlete sprints towards the finish line from the left side of the screen at a speed of 8 meters per second. The continuous frame images captured by the edge pixel array of the main camera show that: in the first frame, the athlete's center is located at coordinates (180, 360) in the edge pixel array image coordinate system, with a horizontal distance of 120 pixels from the left edge of the main camera's field of view; in the second frame, the athlete's center coordinates have moved to (168, 361), meaning it has moved 12 pixels horizontally to the left and 1 pixel vertically between the two adjacent frames. Based on a frame rate of 60fps, the athlete's horizontal speed is approximately 720 pixels per second, the vertical speed is approximately 60 pixels per second, and the angle between the direction of movement and the horizontal direction is approximately 4.8°. In this way, the electronic device can accurately determine the athlete's position, speed, and direction of movement before the athlete even enters the main camera's preview screen.

[0073] In some embodiments of this application, the electronic device acquires a wider range of image information by utilizing the edge pixel array of the secondary camera or the main camera, thereby enabling real-time monitoring and analysis of moving objects outside the frame. It can acquire motion information of moving objects before they enter the main camera preview frame. By using high-magnification cropping technology to pre-analyze the content outside the frame, the ability to predict the motion behavior of moving objects in advance is improved.

[0074] In step 102, based on N frames of images, the entry coordinates of the moving object in the first region are determined; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view.

[0075] In some embodiments of this application, the electronic device analyzes N frames of images of the first region, identifies moving objects within them, and predicts the specific location from which the moving object will enter the imaging field of view from the boundary of the main camera's imaging field of view. The entry coordinates are the intersection of the moving object's trajectory and the boundary of the main camera's imaging field of view, typically represented as two-dimensional pixel coordinates in the image coordinate system.

[0076] In some embodiments of this application, the entry coordinates are determined based on the current position of the moving object, its motion vector, and the geometric constraints of the main camera's imaging field of view boundary. By tracking the positional changes of the moving object in consecutive frames, its motion direction and velocity are calculated, thereby predicting the intersection point of its motion trajectory and the imaging field of view boundary. These entry coordinates provide a spatial reference for the electronic device's focusing operation, enabling the electronic device to obtain the corresponding object distance information based on these coordinates, and thus determine the focusing parameters required at the moment the moving object enters the frame.

[0077] For example, such as Figure 4As shown, the moving object 32 gradually approaches from outside the imaging field of view 31 of the main camera during its movement. Based on N frames of images of the first region, the motion trajectory 33 of the moving object 32 is calculated by a motion trajectory prediction algorithm. This motion trajectory 33 intersects the boundary of the imaging field of view 31 of the main camera at a point, which is the critical position where the moving object 32 enters the imaging field of view 31 of the main camera. The critical position 34 is this intersection point, which is also the entry coordinate of the moving object 32.

[0078] Taking a track and field race as an example, continuing from the previous example, the athlete's current coordinates in the edge pixel array image coordinate system are (168, 361), with a horizontal movement speed of 720 pixels / second and a vertical movement speed of 60 pixels / second. The coordinates of the left boundary of the main camera's imaging field of view are x=50. According to the uniform motion model, the time required for the athlete to move from the current position to the left boundary is Δt=(168-50) / 720≈0.164 seconds, or approximately 164 milliseconds. Through linear extrapolation, the vertical coordinates y when the athlete reaches the left boundary are... entry =361 + 60 × 0.164 ≈ 371 pixels. Therefore, the entry coordinates are (50, 371), meaning the athlete will enter the main camera's field of view from the left edge of the preview screen at a position with a vertical coordinate of 371 pixels. Based on these entry coordinates, the electronic device can accurately determine the athlete's exact position within the frame.

[0079] In step 103, the predicted focus position is determined based on the entry coordinates.

[0080] In some embodiments of this application, the predicted focus position refers to the physical position that the focusing lens group of the main camera needs to reach in order to present a clear image when a moving object enters the imaging field of view of the main camera. This position is the lens position corresponding to the focusing motor control parameters, which is derived from the object distance information corresponding to the entry coordinates of the moving object through a preset lens optical parameter mapping relationship.

[0081] In some embodiments of this application, the predicted focus position is typically represented by the drive current value of the voice coil motor, the pulse count of the stepper motor, or the distance between the lens and the image sensor. The electronic device can convert the object distance information corresponding to the entrance coordinates into focus motor control parameters using a pre-calibrated lens optical parameter table, enabling the main camera lens to move to the predicted focus position in advance during subsequent steps. This method of pre-adjusting focus parameters based on the entrance coordinates achieves early prediction and projection of target motion behavior.

[0082] In step 104, the main camera is controlled to adjust its exposure based on the predicted focus position.

[0083] In some embodiments of this application, the electronic device controls the main camera to perform exposure to complete image acquisition based on the determined predicted focus position. When a moving object enters the imaging field of view of the main camera, since the focus position of the main camera has been adjusted to the predicted focus position in advance, the lens is in a focused state, thus enabling clear imaging to be completed the moment the moving object enters the imaging field of view.

[0084] As can be seen from the above embodiments, this embodiment, by acquiring images outside the main camera's field of view, can detect moving objects about to enter the shooting range in advance and pre-determine the focus position based on their entry coordinates. This transforms the focusing operation from the traditional "responding after the target appears" to "pre-loading before the target enters the frame," effectively shortening the focus response time and improving the success rate of capturing images. By predicting the entry coordinates and adjusting the focus parameters in advance, it ensures that the image is in the optimal focus position the instant the moving object enters the field of view, achieving a zero-delay effect for capturing and focusing.

[0085] Figure 5 This is a flowchart illustrating a shooting method provided in some embodiments of this application, such as... Figure 5 As shown, the method includes at least the following steps: step 501, step 502, step 503, step 504, step 505 and step 506.

[0086] In step 501, N frames of images of the first region are acquired; the first region is the region outside the imaging field of view of the main camera; N is an integer greater than 1.

[0087] In some embodiments of this application, the specific implementation of step 501 is the same as that of step 101, and will not be repeated here.

[0088] In step 502, based on N frames of images, the entry coordinates of the moving object in the first region are determined; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view.

[0089] In some embodiments of this application, the specific implementation of step 502 is the same as that of step 102, and will not be repeated here.

[0090] In step 503, based on N frames of images, the entry time of the moving object is determined; the entry time is the predicted time when the moving object reaches the position corresponding to the entry coordinates.

[0091] In some embodiments of this application, the moment of entry into the frame is a predicted value calculated using a motion trajectory prediction algorithm based on the moving object's current position, speed, and direction of motion, combined with its spatial distance from the boundary of the main camera's field of view. This moment of entry into the frame is used to provide a time reference for the electronic device's focusing operation.

[0092] For example, such as Figure 4 As shown, the moving object 32 moves from outside the main camera's imaging field of view 31 to inside the field of view along the motion trajectory 33. The position change of the moving object 32 is tracked in real time through N frames of images in the first region, its speed and direction are calculated, and combined with the distance between its current position and the boundary of the main camera's imaging field of view 31, the specific time point at which the moving object 32 reaches the frame entry coordinate 34 is predicted. This time point is the frame entry moment.

[0093] Taking a track and field race as an example, continuing from the previous example, the athlete is currently located at coordinates (168, 361) in the edge pixel array image coordinate system, with a horizontal movement speed of 720 pixels / second, and a horizontal distance of 118 pixels (168-50=118) from the left boundary of the main camera's field of view. According to the uniform motion model, the time required for the athlete to move from the current position to the left boundary is Δt = 118 / 720 ≈ 0.164 seconds, or approximately 164 milliseconds. Assume the current system time is t. current =12:00:00.000, then the time when the athlete reaches the frame's entry coordinates (50, 371) is T. entry =12:00:00.164. Based on this entry moment, the electronic device can accurately determine the time when the athlete enters the frame, providing a precise time reference for subsequent focus adjustments before the entry moment arrives.

[0094] In step 504, the predicted focus position is determined based on the entry coordinates.

[0095] In some embodiments of this application, the specific implementation of step 504 is the same as that of step 103, and will not be repeated here.

[0096] In step 505, before the system time reaches the frame entry time, the focus motor of the main camera is controlled to move to the predicted focus position.

[0097] In some embodiments of this application, the electronic device controls the main camera's focusing motor to begin moving in advance based on the predicted entry time. By precisely calculating the motor's start timing, it ensures that the main camera's lens has already reached the predicted focus position and is in a stable state when the entry time arrives. This preloading mechanism advances the focusing action, which originally occurred after the moving object appeared, to before the moving object appeared, solving the focusing delay problem of the "detect first, then focus" mode.

[0098] In step 506, when a moving object is detected entering the imaging field of view, or when the system time reaches the moment of entry into the frame, the main camera is controlled to perform exposure.

[0099] In some embodiments of this application, the electronic device can trigger exposure in two ways: one is based on actual detection, triggered when a moving object enters the imaging field of view of the main camera; the other is based on time prediction, triggered when the system time reaches the moment of entry into the frame. The main camera directly skips the conventional focus scanning and search steps and triggers exposure at a preset shutter speed. At this time, since the focus position of the main camera has been pre-adjusted to the predicted focus position, the lens is in a focused state, thus enabling clear imaging to be completed the moment the moving object enters the frame.

[0100] As can be seen from the above embodiments, this embodiment provides a precise time reference for focus adjustment by introducing the moment of entry into the frame, ensuring that the lens is in focus the instant the moving object enters the main camera's imaging field of view. Simultaneously, this embodiment combines two exposure mechanisms: moving object entry detection and system time-triggered detection. This enables zero-delay capture in both cases of accurate prediction and actual entry into the frame, enhancing adaptability to different shooting scenarios. This strategy of predicting the moment of entry based on motion trajectory analysis and pre-activating the motor ensures that the image is in optimal focus the instant the moving object enters the main camera's imaging field of view, achieving a zero-delay effect for capture and focus.

[0101] In some embodiments provided in this application, applicable to different motion scenarios, the above step 101 or step 501 may specifically include the following steps: step 1011 and step 1012.

[0102] In step 1011, when the shooting scene is a linear motion scene, N frames of images of the first region are captured by the secondary camera; the secondary camera is a wide-angle camera.

[0103] In some embodiments of this application, a linear motion scene refers to a shooting scene where a moving object moves at high speed along an approximately linear trajectory, such as a soccer ball flying towards the goal, a basketball flying towards the hoop, a tennis ball flying over the net, a race car entering a straight road, or an animal rushing into an open area. In such scenes, the moving object's direction of motion is stable and its acceleration changes little, satisfying the conditions for linear motion. The electronic device uses a secondary camera for image acquisition. The secondary camera is typically an ultra-wide-angle camera with a field of view (FOV) ≥ 120°, whose field of view can cover the blind spots of the main camera's imaging field of view.

[0104] In some embodiments of this application, the electronic device first collects the user's mode selection command and the device's underlying hardware status data, establishes a heterogeneous collaborative workflow between the main and secondary cameras, initializes the multi-concurrent channels of the image signal processor, and allocates a shared memory buffer to ensure that the images collected by the main and secondary cameras can be processed efficiently and synchronously. When the user activates the snapshot mode, the electronic device simultaneously activates the main and secondary cameras, marks the area in the secondary camera's field of view that exceeds the coverage of the main camera as a first area, and collects N frames of images within this first area in real time.

[0105] For example, taking a football match as an example, the user stands around the field, and the main camera is aimed at the goal area. The imaging field of view of the main camera corresponds to the preview image seen by the user on the screen, and the left boundary of the preview image is the left boundary of the imaging field of view. The football flies rapidly towards the goal from outside this left boundary along an approximately horizontal straight line, that is, the football is located in the first area outside the imaging field of view of the main camera. Because the imaging field of view of the main camera is limited, it cannot see the trajectory of the football in the first area in advance. However, the secondary camera, with its ultra-wide-angle field of view, can cover the area outside the imaging field of view of the main camera and can capture the process of the football flying from the side in advance. Taking the example data above, the secondary camera captures the coordinates of the football at (320, 240) in the first frame and (300, 242) in the second frame, with a horizontal speed of 600 pixels / second, a vertical speed of 60 pixels / second, and a distance of 150 pixels from the left boundary. The electronic device determines the entry coordinates of the soccer ball within the first region based on N frames of images captured by the secondary camera. These coordinates represent the predicted intersection point of the soccer ball and the left boundary of the main camera's field of view. The device also determines the moment the soccer ball reaches these entry coordinates. Based on these coordinates, the electronic device determines a predicted focus position and adjusts the main camera's focus to this position before the entry moment arrives. When the soccer ball actually enters the main camera's field of view, the lens is already in focus, enabling a clear capture as soon as the soccer ball enters the preview frame.

[0106] In step 1012, when the shooting scene is a non-linear motion scene, N frames of images of the first region are acquired through the edge pixel array of the main camera.

[0107] In some embodiments of this application, nonlinear motion scenes refer to shooting scenes where the trajectory of a moving object is complex and includes nonlinear motion such as acceleration, deceleration, or turning, such as track and field races, race cars turning into straightaways, multiple players running towards a soccer ball, and cyclists changing gears to overtake. In such scenes, the moving object has a large acceleration or its direction of motion changes continuously, exhibiting nonlinear motion characteristics. The electronic device uses the edge pixel array of the main camera sensor for image acquisition.

[0108] In some embodiments of this application, after the user triggers the capture mode, the electronic device activates the high-magnification readout mode of the main camera sensor to acquire raw RAW data or high-resolution YUV data in the full-pixel readout mode of the sensor. The image signal processor utilizes multi-channel concurrent processing capabilities to simultaneously process the central imaging area and activate a second low-latency processing channel. This channel is specifically designed for high-frequency sampling of the cropped area at the sensor edge, independent of the frame rate setting of the main image, ensuring real-time monitoring. This cropped area is defined as the first region, typically set as a ring-shaped or fan-shaped area extending 15% to 25% from the periphery of the central field of view. To compensate for the signal-to-noise ratio decrease caused by digital zoom, the image signal processing pipeline can also apply high-intensity sharpening and temporal noise reduction algorithms to this region, ensuring that clear edge features can still be extracted under low light or high-speed motion conditions.

[0109] For example, taking a track and field race as an example, a user stands in the stands, and the main camera is aimed at the center area of ​​the track. The imaging field of view of the main camera corresponds to the preview image seen by the user on the screen, and the left boundary of this preview image is the left boundary of the imaging field of view. Multiple athletes run towards the center area of ​​the track from outside this left boundary, that is, the athletes are located in the first area outside the imaging field of view of the main camera. During the sprint, the athletes continuously accelerate and adjust their strides, and their speed and direction of movement constantly change. Due to the limited imaging field of view of the main camera, the preview image cannot cover the process of the athletes running from a distance. However, the full pixel array of the main camera sensor corresponds to a larger field of view, in which the edge pixel array that exceeds the current imaging field of view can cover the first area. The electronic device activates the sensor's full pixel readout mode, which, while maintaining normal preview and output of the central imaging field of view, uses the edge pixel array to acquire images of the first area in parallel. Using the example data from the previous section, the edge pixel array captures the athlete's coordinates as (180, 360) in frame 1 and (168, 361) in frame 2, with a horizontal velocity of 720 pixels / second, a vertical velocity of 60 pixels / second, and a distance of 120 pixels from the left boundary. Based on the N frames of images captured from the first region, the electronic device determines the athlete's entry coordinates within the first region—that is, the predicted intersection coordinates of the athlete and the left boundary of the main camera's field of view—and determines the moment the athlete reaches these entry coordinates. The electronic device then determines the predicted focus position based on these entry coordinates and adjusts the main camera's focus position to this predicted focus position before the entry moment arrives. When the athlete actually enters the main camera's field of view, the lens is already in focus, enabling a clear capture as soon as the athlete enters the preview screen.

[0110] As can be seen from the above embodiments, this embodiment adaptively selects the image acquisition method based on the linear characteristics of the motion trajectory: in linear scenes, the wide-angle field of view of the secondary camera is used to expand the perception range; in nonlinear scenes, the edge pixel array of the main camera is used to achieve accurate monitoring without increasing hardware costs, thereby optimizing the resource utilization of electronic equipment while ensuring monitoring effectiveness. Through the combination of multi-camera collaboration and high-magnification cropping technology, the focusing efficiency and accuracy of the camera system in dynamic scenes are significantly improved.

[0111] In some embodiments provided in this application, it is applicable to linear motion scenes in which N frames of images of the first region are captured by a secondary camera. Accordingly, when N frames of images of the first region are captured by a secondary camera, the above step 102 or step 502 may specifically include the following steps: step 1021, step 1022 and step 1023.

[0112] In step 1021, based on N frames of images, the moving object in the first region, the first coordinate of the moving object in the first coordinate system, and the first motion vector are determined; the first coordinate system is the image coordinate system of the secondary camera.

[0113] In some embodiments of this application, the electronic device detects and extracts moving objects with motion attributes from the wide-angle image captured by the secondary camera, and determines their position coordinates in the secondary camera image coordinate system, i.e., the first coordinate (x... s ,y s Taking a soccer scene as an example, in the HSV color space, color thresholding combined with Hough circle transform can be used to identify a fast-moving soccer ball in the secondary camera's view and obtain its center position as the primary coordinate. Furthermore, the geometric and texture features of moving objects can be collected, and computer vision algorithms can be used to filter out valid moving objects from complex backgrounds and determine their position coordinates.

[0114] In some embodiments of this application, based on the Lucas-Kanade optical flow method or the Kalman filter algorithm, the position change of the centroid of a moving object between consecutive frames is tracked to obtain its instantaneous velocity scalar and normalized motion direction vector in the secondary camera image coordinate system, thereby obtaining the first motion vector v = (v xs ,v ys ), where v xs and v ys These represent the pixel displacements in the horizontal and vertical directions, respectively. This first motion vector reflects the direction and magnitude of the moving object's motion in the secondary camera's image coordinate system. Taking a soccer scene as an example, continuing from the previous data, the first coordinate is (300, 242), the first motion vector v = (-20, 2) pixels / frame, corresponding to a horizontal velocity of 600 pixels / second and a vertical velocity of 60 pixels / second.

[0115] In step 1022, based on the mapping relationship between the first coordinate system and the second coordinate system, the first coordinate and the first motion vector are transformed into the second coordinate system to obtain the second coordinate and the second motion vector; the second coordinate system is the image coordinate system of the main camera.

[0116] In some embodiments of this application, since there is a certain baseline distance between the main and secondary cameras, directly using the image coordinates of the secondary camera will lead to mapping errors. Therefore, it is necessary to establish a coordinate mapping relationship between the secondary camera and the main camera to ensure that the coordinates and motion information of the moving object detected by the secondary camera can be accurately mapped to the image coordinate system of the main camera.

[0117] In some embodiments of this application, the coordinate mapping relationship between the secondary camera and the primary camera can be pre-calibrated and stored in the electronic device, or it can be calculated in real time based on the overlapping field of view of the primary and secondary cameras during use. In the real-time calculation scenario, assuming that the moving object outside the imaging field of view is in an approximate plane or is far away from the camera, the influence of depth discontinuity caused by binocular parallax is ignored, a homography transformation model between the primary and secondary cameras is established, and the accurate coordinate mapping relationship is obtained by extracting feature points in the overlapping field of view and solving the homography transformation matrix.

[0118] In some embodiments of this application, based on the mapping relationship between the first coordinate system and the second coordinate system, such as the homography transformation matrix, the first coordinate (x, y) of the moving object in the secondary camera image coordinate system is determined. s ,y s Transform to the image coordinate system of the main camera to obtain the second coordinate (x) m ,y m Simultaneously, the first motion vector (v) xs ,v ys Similarly, this mapping relationship is used to transform the data and obtain the second motion vector (v) in the main camera image coordinate system. xm ,v ym For example, the homography transformation matrix H maps the secondary camera coordinates (300, 242) to the primary camera coordinates (168, 361), and the motion vector (-20, 2) to (-12, 1) pixels / frame, corresponding to a horizontal velocity of 720 pixels / second and a vertical velocity of 60 pixels / second in the primary camera coordinate system. Through this coordinate mapping, the coordinates and motion information of moving objects detected by the secondary camera can be accurately mapped to the image coordinate system of the primary camera.

[0119] In step 1023, the entry coordinates are determined based on the second coordinates, the second motion vector, and the boundary coordinates of the imaging field of view.

[0120] In some embodiments of this application, the electronic device combines the motion state of a moving object with the geometric constraints of the boundary of the main camera's imaging field of view to accurately predict its position entering the main camera's imaging field of view. By analyzing the relative angle between the moving object's motion direction and the boundary of the imaging field of view, it determines whether the moving object is about to enter the imaging field of view; simultaneously, based on the distance between the moving object and the boundary of the imaging field of view and its motion speed, it estimates the time required for the moving object to reach the boundary, thereby determining the coordinates of the intersection point between the motion trajectory and the boundary of the imaging field of view.

[0121] In some embodiments of this application, the angle between the motion direction of the moving object and the normal vector of the imaging field of view boundary is first calculated using the normal vector of the boundary. If the angle is less than a preset angle threshold, such as 30°, it indicates that the motion direction of the moving object is perpendicular or nearly perpendicular to the boundary of the imaging field of view, and the confidence level of determining that the moving object is about to enter the frame exceeds 90%. Based on this, the coordinates of the intersection point of the motion trajectory of the moving object and the boundary of the imaging field of view are further determined, which are the frame entry coordinates.

[0122] As can be seen from the above embodiments, this embodiment accurately transforms the position and motion information of the moving object detected by the secondary camera to the primary camera's image coordinate system through the mapping relationship between the primary and secondary camera image coordinate systems. This eliminates coordinate deviations caused by physical parallax and provides a unified and accurate spatial reference for subsequent image prediction. Through this coordinate mapping, the electronic device can determine from which boundary position of the imaging field of view the moving object will enter before it even enters the primary camera's imaging field of view, providing precise spatial guidance for subsequent focus preloading.

[0123] In some embodiments provided in this application, it is applicable to linear motion scenes in which N frames of images of the first region are captured by a secondary camera. Accordingly, the above step 1023 may specifically include the following steps: step 10231, step 10232, step 10233 and step 10234.

[0124] In step 10231, a first distance is determined based on the second coordinate and the boundary coordinate of the imaging field of view; the first distance is the length of the perpendicular line from the second coordinate to the boundary of the imaging field of view.

[0125] In some embodiments of this application, after coordinate mapping is completed, the second coordinate (x, y) of the moving object in the image coordinate system of the main camera is... m ,y m It is already known precisely that the boundary coordinates of the main camera's field of view are also known, for example, the left boundary x=x left Right boundary x=x right Upper boundary y=y top Lower boundary y=y bottomBased on the direction of the moving object's movement, determine which boundary it will enter the imaging field of view from, and calculate the vertical distance d1 from the object's second coordinate to that boundary, i.e., the first distance. For example, if the moving object is moving to the left and will enter the frame from the left boundary, then the distance d1 = |x m -x left This distance is measured in pixels, and its value depends on the sensor resolution and the actual distance between the moving object and the camera. Taking a track and field race scene as an example, the second coordinate x... m =168, left boundary x left =50, then the first distance d1 = |168-50| = 118 pixels.

[0126] In step 10232, a first velocity component of the moving object is determined based on the second motion vector; the first velocity component is used to indicate the motion velocity of the moving object in a first direction; the first direction is the normal direction of the boundary of the imaging field of view.

[0127] In some embodiments of this application, since a moving object may approach the boundary of the imaging field of view at any angle, there may be an angle α between its motion direction and the boundary normal. Only the velocity component perpendicular to the boundary direction determines how fast the moving object approaches the boundary, while the component parallel to the boundary only affects the entry position and not the entry time. Therefore, based on the second motion vector (v... xm ,v ym ), calculate the angle α between the direction of motion and the normal to the boundary of the imaging field of view, and then obtain the first velocity component v. eff =||v xm ||×cosα. For example, if the moving object enters the frame from the left boundary, and the boundary normal is horizontal to the right, then the first velocity component is v. eff =|v xm The first velocity component reflects the rate at which a moving object approaches the imaging field of view in a direction perpendicular to the boundary. Taking a track and field running scene as an example, the second motion vector horizontal component v... xm =-12 pixels / frame, corresponding to a speed of 720 pixels / second, then the first speed component v eff =720 pixels / second.

[0128] In step 10233, the moment of entry into the frame is determined based on the first distance and the first velocity component.

[0129] In some embodiments of this application, the time Δt=d1 / v required for a moving object to move from its current position to the boundary of the imaging field of view can be calculated based on a uniform motion model. eff Where d1 is the first distance, v eff This represents the first velocity component. Then, the current time t is obtained. currentCalculate the estimated entry time T of the moving object into the main camera's field of view. entry =t current +Δt. In practical calculations, time can also be converted into frame counts based on the image acquisition frame rate: first calculate the required number of frames N. frames =d1 / v eff Then, calculate the time interval Δt=N based on the frame rate f. frames ×(1 / f), and thus obtain the moment of entry into the frame. Taking a track and field race scene as an example, d1=118 pixels, v eff =720 pixels / second, Δt=118 / 720≈0.164 seconds, if the current time t current =12:00:00.000, then the entry time T entry =12:00:00.164.

[0130] In step 10234, the entry coordinates are determined based on the second coordinates, the second motion vector, and the entry time.

[0131] In some embodiments of this application, the second coordinate (x) of the moving object is used. m ,y m ), second motion vector (v xm ,v ym ) and the moment of entry into the frame T entry The position of the moving object at the moment of entry into the frame is calculated through linear extrapolation. Taking the moving object entering the frame from the left boundary as an example, the coordinates of the left boundary are x=x left When the moving object reaches the left boundary, its x-coordinate is already determined. left Its y-coordinate can be calculated using the equation of motion: y entry =y m +v ym ×(T entry -t current Therefore, the coordinates of the image entry are (x...). left , y entry Similarly, for the right boundary, upper boundary, and lower boundary, the corresponding intersection coordinates can be calculated respectively. Taking a track and field race scenario as an example, the second coordinate is (168, 361), and the vertical component of the second motion vector is v. ym =1 pixel / frame corresponds to 60 pixels / second, T entry -t current =0.164 seconds, then y entry =361+60×0.164≈371 pixels, the entry coordinates are (50,371).

[0132] As can be seen from the above embodiments, this embodiment combines the spatial position and motion state of the moving object with the geometric constraints of the main camera's imaging field of view boundary, achieving precise calculation of the entry time and coordinates. Through this calculation, the electronic device can accurately predict when and from which boundary position of the imaging field of view the moving object will enter before it has even entered the main camera's imaging field of view, providing a precise time and space reference for subsequent focus preloading.

[0133] In some embodiments provided in this application, the linear motion scene in which N frames of images of a first region are captured by a secondary camera is applied. Accordingly, the first mapping relationship between the first coordinate system and the second coordinate system is determined in the following manner: First, within the overlapping field of view of the secondary and primary cameras, M feature points are extracted from the image captured by the secondary camera, and K feature points are extracted from the image captured by the primary camera. A corresponding feature descriptor is generated for each feature point, resulting in a set of feature descriptors; M and K are both integers greater than 4. For example, M=150 feature points are extracted from the secondary camera image, and K=160 feature points are extracted from the primary camera image. Specifically, corner features can be extracted within the overlapping field of view of the primary and secondary cameras using either the scale-invariant feature transform algorithm or the ORB algorithm, respectively, to construct the set of feature descriptors.

[0134] Secondly, based on the feature descriptor set, T matching feature point pairs are selected between M and K feature points; T is an integer greater than or equal to 4. For example, T=85 matching feature point pairs are obtained through feature matching. Specifically, by calculating the similarity between feature descriptors, highly robust corresponding point pairs (xi, xi, xi) are selected. s ,y s )→(x m ,y m ), where (x s ,y s (x) represents the sub-camera coordinates. m ,y m () is the main camera coordinate.

[0135] Subsequently, based on the T matched feature point pairs, the initial homography transformation matrix is ​​determined. Assuming that the matched point pairs satisfy the homography transformation relationship, the following system of linear equations (1) can be established: (1) A system of linear equations is established based on at least four pairs of matching points. The 3×3 homography transformation matrix H is solved using singular value decomposition to obtain the initial homography transformation matrix.

[0136] Next, from the T matching feature point pairs, S feature point pairs are eliminated, and the initial homography transformation matrix is ​​fitted and optimized to obtain the target homography transformation matrix. The S feature point pairs are mismatched feature point pairs, and the target homography transformation matrix is ​​used to represent the first mapping relationship. Since the initial matching point pairs may contain erroneous matches, a random sampling consensus algorithm can be used to iteratively eliminate erroneous matches and refit the matrix H to ensure that the reprojection error is less than 0.5 pixels. For example, from 85 matching point pairs, S=12 erroneous point pairs are eliminated, leaving 73 pairs for optimization, and the final reprojection error is controlled within 0.3 pixels. Through multiple iterative optimizations, a homography transformation matrix with satisfactory accuracy is obtained.

[0137] Finally, the target homography transformation matrix is ​​determined as the first mapping relationship. Based on the optimized matrix H, a unified virtual coordinate system is established, enabling the coordinates of moving objects detected by the secondary camera to be converted into spatial coordinates relative to the optical axis of the primary camera in real time.

[0138] As can be seen from the above embodiments, this embodiment, through feature extraction, matching, and iterative optimization, can establish a precise coordinate mapping relationship in real time based on the overlapping field of view of the main and secondary cameras during use. It is suitable for pre-shipment calibration and can also cope with minor displacements or optical changes that may occur during the use of electronic devices, ensuring the long-term accuracy of the mapping relationship.

[0139] In some embodiments provided in this application, it is applicable to linear motion scenes in which N frames of images of the first region are captured by a secondary camera. When N frames of images of the first region are captured by a secondary camera, the above step 103 or step 504 may specifically include the following steps: step 1031, step 1032 and step 1033.

[0140] In step 1031, based on the second mapping relationship between the object distance and the control quantity of the focusing motor, the first object distance corresponding to the entry coordinate is converted into the first control quantity of the focusing motor.

[0141] In some embodiments of this application, the electronic device acquires a first object distance D corresponding to the entry coordinates of the moving object. This first object distance is the expected object distance of the moving object at the instant of entry, determined based on the entry coordinates. The electronic device calls a pre-calibrated lens optical parameter table to obtain the mapping relationship f(·) between the object distance and the control quantity of the focusing motor, and converts the first object distance D into a first control quantity f(D) of the main camera focusing motor. In practical applications, this mapping relationship is usually expressed as f(D) = DAC. inf -K / D form, where DAC inf Where D is the reference value for focusing motor control at infinity, and K is the lens characteristic coefficient. For example, when D = 5 meters, DAC... inf=500, K=2000, then f(5)=500-2000 / 5=500-400=100 DAC.

[0142] In step 1032, a second control quantity is determined based on the first control quantity and the thermal drift compensation quantity.

[0143] In some embodiments of this application, the refractive index and mechanical structure of the lens material undergo slight changes with temperature, causing a drift in the optimal focusing position corresponding to the same object distance. Therefore, temperature compensation is required. The electronic device obtains the current ambient temperature via a temperature sensor and compares it with the reference temperature used during lens calibration to calculate the thermal drift compensation amount Δtemp. Depending on the lens characteristics, the temperature compensation coefficient is typically -0.1DAC / °C to -0.3DAC / °C, meaning that for every 1°C increase in temperature, the focusing motor control value needs to be reduced accordingly. The first control quantity f(D) is added to the thermal drift compensation amount Δtemp to obtain the second control quantity DAC. target =f(D)+Δtemp. This second control quantity is the precise control quantity required to drive the main camera focusing motor to the predicted focus position. For example, if the current temperature is 25°C, the reference temperature is 20°C, and the compensation coefficient is -0.2DAC / °C, then Δtemp = -0.2 × 5 = -1 DAC. target =100-1=99 DAC.

[0144] In step 1033, the focus position corresponding to the second control quantity is determined as the predicted focus position.

[0145] In some embodiments of this application, the second control quantity DAC target Corresponding to a specific physical position of the focusing motor, the main camera lens will remain at a position that allows for clear imaging at object distance D under the control of this quantity. The electronic device determines this position as the predicted focus position for pre-loading adjustments of the focusing motor in subsequent steps.

[0146] As can be seen from the above embodiments, this embodiment converts spatial position information into precise focusing motor control parameters through a preset lens optical parameter mapping relationship, and introduces temperature compensation to correct deviations caused by environmental factors, ensuring that the lens can be accurately driven to the predicted focusing position under different temperature conditions.

[0147] In some embodiments provided in this application, it is applicable to nonlinear motion scenarios in which N frames of images of the first region are acquired through the edge pixel array of the main camera. Specifically, when N frames of images of the first region are acquired through the edge pixel array of the main camera, the above step 102 or step 502 may specifically include the following steps: step 1024, step 1025, step 1026 and step 1027.

[0148] In step 1024, based on N frames of images, all moving objects in the first region, the motion vector of each moving object, and the acceleration are determined.

[0149] In some embodiments of this application, the electronic device detects and extracts all moving objects from N frames of images of a first region acquired by the edge pixel array of the main camera sensor. Specifically, the electronic device can feed the image stream of the first region into a target detection model in real time, which outputs the bounding box and category information of each moving object. The model can identify all moving objects appearing in the first region in real time and classify them according to a preset label library, effectively filtering background interference. For example, in a track and field racing scenario, the model identifies 5 athletes in the first region, namely athletes A, B, C, D, and E.

[0150] In some embodiments of this application, a multi-target tracking algorithm can be used to assign a unique identifier to each moving object, ensuring continuous tracking even after the moving object is briefly occluded. Based on the position changes in consecutive frames, the instantaneous velocity vector v of each moving object in the current frame is calculated. k =(Δx / Δt,Δy / Δt), and acceleration vector a k =(v k -v k-1 The acceleration magnitude and direction of each moving object are obtained by calculating () / Δt. For example, if athlete A's velocity is (720,60) pixels / second in frame 5 and (730,62) pixels / second in frame 6, then the acceleration is (10,2) pixels / second², corresponding to an acceleration magnitude of approximately 10.2 pixels / second².

[0151] In step 1025, P candidate moving objects are selected from all moving objects; the acceleration of the candidate moving objects is greater than the acceleration threshold; P is a positive integer.

[0152] In some embodiments of this application, the magnitude of the acceleration of each moving object is compared with a preset acceleration threshold. For example, the acceleration threshold is 2 m / s². If the acceleration of a moving object is detected to be greater than 2 m / s², it indicates that the moving object is undergoing rapid acceleration or deceleration, and it is marked as a candidate moving object to exclude objects with stable or random motion, focusing on those moving objects with drastic changes in motion that are more valuable for filming. For example, among 5 athletes, athlete A has an acceleration of 3.2 m / s², and athlete C has an acceleration of 2.8 m / s², both greater than the threshold of 2 m / s², therefore P=2, and the candidate moving objects are athletes A and C.

[0153] In step 1026, polynomial fitting is performed on the historical trajectory points of each candidate moving object to obtain P trajectory fitting curves.

[0154] In some embodiments of this application, a second- or third-order polynomial function can be used to perform least-squares fitting on the historical trajectory points of each candidate moving object to obtain a trajectory fitting curve for each candidate moving object. After obtaining the polynomial coefficients through fitting, the coefficient of determination R² of the fitting curve is calculated to evaluate the fitting quality. If R² is greater than 0.85, the motion of the candidate moving object is considered to be regular, and the trajectory fitting curve can describe its motion trajectory well. Through polynomial fitting, the nonlinear motion characteristics of the candidate moving object during acceleration, deceleration, or turning can be captured. For example, performing second-order polynomial fitting on the trajectory points of athlete A over the past 20 frames yields the curve y = 0.01x² + 0.5x + 360, with R² = 0.92; fitting athlete C yields the curve y = 0.015x² + 0.4x + 358, with R² = 0.88.

[0155] In step 1027, the entry coordinates of each candidate moving object are determined based on the motion vector and trajectory fitting curve of each candidate moving object.

[0156] In some embodiments of this application, a model describing the motion pattern of a candidate moving object is established based on a trajectory fitting curve. This model reflects the motion characteristics of the candidate moving object during acceleration, deceleration, or turning. Simultaneously, the motion trend is comprehensively judged by combining the current real-time velocity vector of the candidate moving object. By solving the spatial positional relationship between this motion model and the boundary of the imaging field of view of the main camera, the intersection point between the candidate moving object and the boundary of the imaging field of view is determined, and the coordinates of this intersection point are determined as the entry coordinates of the candidate moving object. For example, for athlete A, combining its current velocity vector (730, 62) pixels / second and the fitting curve y = 0.01x² + 0.5x + 360, the intersection point with the left boundary x = 50 is solved, yielding the entry coordinates (50, 378); for athlete C, the entry coordinates are (50, 372).

[0157] As can be seen from the above embodiments, this embodiment eliminates random interference objects by using acceleration screening, focuses on moving objects with shooting value, and uses polynomial fitting to describe their motion trajectory, thereby effectively reflecting complex motion laws such as acceleration, deceleration or turning, and improving the prediction accuracy in nonlinear scenes.

[0158] In some embodiments provided in this application, it is applicable to nonlinear motion scenes in which N frames of images of the first region are acquired through the edge pixel array of the main camera. Specifically, step 1027 may include the following steps: step 10271 and step 10272.

[0159] In step 10271, the predicted motion trajectory of each candidate motion object is determined based on the motion vector and trajectory fitting curve of each candidate motion object.

[0160] In some embodiments of this application, the trajectory fitting curve describes the overall motion pattern of the candidate moving object over a period of time through polynomial fitting, reflecting the nonlinear motion characteristics of the candidate moving object during acceleration, deceleration, or turning. However, the fitting curve mainly reflects historical trends and responds slowly to sudden changes in motion state. Therefore, the current real-time motion vector of the candidate moving object is also introduced as a correction factor for short-term motion trends. By combining long-term trajectory patterns with the current motion state, a more accurate predicted motion trajectory is constructed. This trajectory retains the overall trend of the candidate moving object's historical motion and can be dynamically adjusted according to the latest motion state. For example, for athlete A, the fitted curve y = 0.01x² + 0.5x + 360 is combined with the current velocity vector (730, 62) pixels / second to generate a predicted motion trajectory: the current velocity dominates in the last 5 frames, and then gradually transitions to the fitted curve pattern.

[0161] In step 10272, the coordinates of the intersection point between the predicted motion trajectory of each candidate moving object and the boundary of the imaging field of view are determined as the entry coordinates of each candidate moving object.

[0162] In some embodiments of this application, the boundary coordinates of the imaging field of view of the main camera can be established, for example, the left boundary x=x left Right boundary x=x right Upper boundary y=y top Lower boundary y=y bottom Based on the predicted motion trajectory of each candidate moving object, the coordinates of the intersection point between this trajectory and the boundary of the imaging field of view are calculated, and these intersection point coordinates are determined as the entry coordinates of the candidate moving object. Subsequently, based on the motion equation of the predicted motion trajectory, the time required for the candidate moving object to move from its current position along the trajectory to this intersection point is calculated, yielding the entry time. For example, for athlete A, the intersection point of the predicted motion trajectory and the left boundary x=50 is calculated, yielding the entry coordinates (50, 377), and the entry time T. entry =12:00:00.158; For athlete C, the entry coordinates are (50, 371), and the entry time T is... entry =12:00:00.164.

[0163] As can be seen from the above embodiments, this embodiment combines long-term trajectory patterns with short-term motion states to construct a predicted trajectory that is more consistent with actual motion conditions, and solves the intersection point of the trajectory with the boundary of the main camera's imaging field of view, which can accurately determine the entry coordinates in complex motion scenes.

[0164] In some embodiments provided in this application, it is applicable to nonlinear motion scenarios in which N frames of images of the first region are acquired through the edge pixel array of the main camera. Specifically, when N frames of images of the first region are acquired through the edge pixel array of the main camera, the above step 103 or step 504 may specifically include the following steps: step 1034, step 1035, step 1036 and step 1037.

[0165] In step 1034, if there are at least two candidate moving objects in the first region, a motion saliency score is calculated for each candidate moving object; the motion saliency score is determined based on at least one of object type, acceleration, and entry time.

[0166] In some embodiments of this application, when multiple candidate moving objects exist in the first region, it is necessary to determine the most noteworthy subject to focus through quantitative evaluation. For example, in a track and field race scenario, there may be multiple athletes sprinting simultaneously in the first region, and it is necessary to select one athlete as the final subject to focus, i.e., the target subject to focus. To this end, a motion salience scoring mechanism is introduced to calculate a motion salience score for each candidate moving object.

[0167] In some embodiments of this application, the motion saliency score is calculated using a scoring function, which can be expressed as Score = w1·Type + w2·||a|| + w3·(1 / T) entry ), where Type represents the object type weight, assigned according to preset shooting preferences, for example, setting "human" = 1.0, "vehicle" = 0.8, and "animal" = 0.6; ||a|| represents the magnitude of the acceleration of the candidate moving object, reflecting the intensity of its movement; T entry The value represents the moment when the candidate moving object enters the frame; the smaller this value, the closer it is to the imaging field of view. w1, w2, and w3 are weighting coefficients that satisfy w1 + w2 + w3 = 1. For example, let w1 = 0.3, w2 = 0.4, w3 = 0.3, and athlete A's Type = 1.0, ||a|| = 3.2, T... entry =12:00:00.158, then Score A =0.3×1.0+0.4×3.2+0.3×(1 / 0.158)=0.3+1.28+1.90=3.48; Athlete C's Type=1.0, ||a||=2.8, T entry =12:00:00.164, then Score C =0.3+1.12+1.83=3.25.

[0168] In step 1035, the candidate moving object with the highest motion salience score is determined as the target focus object.

[0169] In some embodiments of this application, all candidate moving objects are sorted from highest to lowest motion salience score, and the candidate moving object with the highest score is determined as the target focus object. For example, in a track and field race scene, athletes accelerating towards the finish line usually receive the highest motion salience score due to their high acceleration and the tight time between entering the frame, and are therefore determined as the target focus object. For example, athlete A's score of 3.48 is higher than athlete C's score of 3.25, so athlete A is determined as the target focus object.

[0170] In step 1036, the second object distance corresponding to the entrance coordinates of the target focus object is obtained.

[0171] In some embodiments of this application, based on the entry coordinates of the target focusing object, the object distance information corresponding to those coordinates is obtained, that is, the expected distance between the target focusing object and the main camera at the moment of entry into the frame, and this object distance information is determined as the second object distance. For example, the entry coordinates of athlete A are (50, 377), and the corresponding object distance D2 = 6.2 meters.

[0172] In step 1037, the focus position indicated by the second object distance is determined as the predicted focus position.

[0173] In some embodiments of this application, based on a preset lens optical parameter table, the second object distance is converted into focusing motor control parameters. If necessary, temperature compensation can be used for correction to obtain the precise focusing position corresponding to the second object distance, which is then determined as the predicted focusing position. For example, substituting D2 = 6.2 meters into the mapping relationship f(6.2) = 500 - 2000 / 6.2 ≈ 500 - 323 = 177 DAC, after temperature compensation, the final control value is obtained as 176 DAC, and the corresponding focusing position is the predicted focusing position.

[0174] As can be seen from the above embodiments, this embodiment uses a multi-dimensional scoring mechanism to intelligently select the most noteworthy moving object as the focus subject among multiple moving objects, avoiding decision-making conflicts in multi-object scenes and ensuring the capture of wonderful moments with shooting value.

[0175] In some embodiments provided in this application, the provided imaging method is... Figure 5 Based on the embodiment shown, after detecting that the target object has entered the imaging field of view, and before controlling the main camera to expose, the following steps are also included: step 507 and step 508.

[0176] In step 507, the defocus amount of the main camera is obtained; the predicted focus position is used as the feedforward control quantity, and the defocus amount is used as the feedback control quantity to calculate the third control quantity of the focus motor.

[0177] In some embodiments of this application, when the target object enters the imaging field of view of the main camera according to the predicted result, there may be an error between the predicted focus position and the actual optimal focus position due to slight deviations in nonlinear motion or instantaneous changes in environmental factors. Therefore, the real-time phase detection function of the main camera is invoked to obtain the current focus state data and calculate the current defocus amount. This defocus amount reflects the degree of deviation between the current lens position and the position required for clear imaging of the target object. For example, when athlete A actually enters the frame, the phase detection yields a defocus amount e(t) = +5μm, indicating that the current lens position is 5 micrometers behind.

[0178] The predicted focus position is used as the feedforward control variable to provide the basic response speed of the focusing motor, enabling the lens to quickly reach the vicinity of the expected position. Simultaneously, the current defocus amount is used as the feedback control variable, and a proportional-integral-derivative (PID) algorithm is used to calculate the feedback correction. This composite control algorithm combines the predicted information with real-time feedback to calculate the third control variable for the focusing motor. For example, assuming Kp=0.8, Ki=0.1, Kd=0.05, uff=176 DAC, and e(t)=5, the calculated third control variable u(t) = 0.8×5 + 0.1×∫5dt + 0.05×de / dt + 176, after PID calculation, u(t) = 178 DAC.

[0179] In step 508, the target focus position is determined according to the third control quantity; the focus motor is controlled to move from the predicted focus position to the target focus position; the target focus position is the focus position reached after the predicted focus position moves according to the adjustment direction and magnitude indicated by the third control quantity.

[0180] In some embodiments of this application, the third control quantity is converted into a drive signal for the focusing motor, driving the lens to make fine adjustments from the predicted focus position, so that it moves precisely to the target focus position. At the instant the proportional-integral-derivative controller converges the focusing error to an allowable range, the lens is precisely focused, and the main camera can then be triggered to perform exposure. For example, the third control quantity 178 DAC drives the lens to move slightly forward from the position corresponding to 176 DAC, eventually reaching the precise focus position corresponding to 178 DAC, at which point the defocusing amount returns to zero.

[0181] As can be seen from the above embodiments, this embodiment uses a feedforward and feedback composite control mechanism to precisely fine-tune the preloaded focus position using real-time phase detection data after the target focus object enters the frame. This maintains the fast response advantage of preloading and corrects the focus deviation caused by nonlinear motion prediction error through closed-loop feedback, ensuring the final focus accuracy.

[0182] In some embodiments provided in this application, it is applicable to scenarios in which N frames of images of a first region are acquired through the edge pixel array of a secondary camera or a main camera. Specifically, step 505 may include the following steps: step 5051, step 5052 and step 5053.

[0183] In step 5051, the setup time of the main camera's focus motor is obtained.

[0184] In some embodiments of this application, the settling time of the focus motor refers to the time required for the lens to move from a stationary state after receiving a drive command, to reach a designated position and stabilize. This settling time depends on the physical characteristics of the motor, the weight of the lens assembly, and the response speed of the drive circuit, and is typically in the range of 10 to 20 milliseconds. The electronic device obtains the current settling time Q of the main camera's focus motor by reading underlying hardware parameters or preset lens characteristic data. For example, Q = 15 milliseconds.

[0185] In step 5052, a first moment is determined based on the entry moment and the setup time; the first moment is the moment when the focus motor is started to be controlled; the first moment is no later than the second moment, and the second moment is the entry moment minus the setup time.

[0186] In some embodiments of this application, the predicted entry time T is used... entry The settling time Q of the focusing motor is used to determine the first moment t when controlling the focusing motor begins. start The first moment satisfies t. start ≤T entry -Q, which means the first moment is no later than the moment of image entry minus the setup time. This calculation ensures that the focus motor starts moving at the first moment, and after a time interval Q, at the moment of image entry T... entry Reach the predicted focus position and remain stable. For example, T entry =12:00:00.164, Q=15 milliseconds=0.015 seconds, then t start ≤12:00:00.149, t can be taken start =12:00:00.140.

[0187] In step 5053, at the first moment, the focus motor of the main camera is controlled to move towards the predicted focus position.

[0188] In some embodiments of this application, when the system time reaches the first moment t start At this time, the electronic device sends a drive command to the main camera's focusing motor, controlling the focusing motor to move from its current position to the predicted focusing position. During the movement, the focusing motor runs at a predetermined speed to ensure that the image is captured at the predicted focusing position. entryThe displacement is completed and stabilized before arrival. For example, the motor is started at 12:00:00.140, and after 15 milliseconds, it reaches the predicted focus position and stabilizes at 12:00:00.155, earlier than the entry time of 12:00:00.164, ensuring that the camera is ready when athlete A enters the frame.

[0189] As can be seen from the above embodiments, this embodiment ensures that the lens has completed its displacement and is in a stable state the instant the moving object enters the frame by accurately calculating the motor start time, thus eliminating the motor travel time during the focusing process and achieving a zero-delay capture effect of "focusing as soon as the target enters the frame".

[0190] The shooting method provided in this application can be executed by a shooting device. This application uses a shooting device executing the shooting method as an example to illustrate the shooting device provided in this application.

[0191] Figure 6 This is a structural block diagram of a shooting device provided in an embodiment of this application, such as... Figure 6 As shown, the shooting device 600 may include a processing module 601.

[0192] The processing module 601 is used to acquire N frames of images of a first region; the first region is a region outside the imaging field of view of the main camera; N is an integer greater than 1; based on the N frames of images, determine the entry coordinates of a moving object in the first region; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view; based on the entry coordinates, determine the predicted focus position; based on the predicted focus position, control the main camera to perform exposure.

[0193] As can be seen from the above embodiments, this embodiment, by collecting image data outside the imaging field of view of the main camera, can detect moving objects about to enter the shooting range in advance and pre-determine the focus position based on their entry coordinates. This transforms the focusing operation from "responding after the target appears" to "pre-loading before the target enters the frame," effectively shortening the focus response time and improving the success rate of capturing images. By predicting the entry coordinates and adjusting the focus parameters in advance, it ensures that the image is in the optimal focus position the instant the moving object enters the field of view, achieving a zero-delay effect for capturing and focusing.

[0194] Optionally, in some embodiments of this application, the processing module 601 is specifically used to determine the entry time of the moving object based on the N frames of images; the entry time is the predicted time when the moving object reaches the position corresponding to the entry coordinates; before the system time reaches the entry time, control the focusing motor of the main camera to move to the predicted focusing position; when the moving object is detected to enter the imaging field of view, or when the system time reaches the entry time, control the main camera to perform exposure.

[0195] Optionally, in some embodiments of this application, the processing module 601 is specifically used to acquire N frames of images of the first region through a secondary camera when the shooting scene is a linear motion scene; the secondary camera is a wide-angle camera; and to acquire N frames of images of the first region through the edge pixel array of the main camera when the shooting scene is a non-linear motion scene.

[0196] Optionally, in some embodiments of this application, the processing module 601 is specifically used to determine, based on the N frames of images, a moving object in the first region, a first coordinate of the moving object in a first coordinate system, and a first motion vector; the first coordinate system is the image coordinate system of the secondary camera; based on the mapping relationship between the first coordinate system and the second coordinate system, the first coordinate and the first motion vector are transformed into the second coordinate system to obtain a second coordinate and a second motion vector; the second coordinate system is the image coordinate system of the main camera; and based on the second coordinate, the second motion vector, and the boundary coordinates of the imaging field of view, the entry coordinates are determined.

[0197] Optionally, in some embodiments of this application, the processing module 601 is specifically configured to: determine a first distance based on the second coordinate and the boundary coordinate of the imaging field of view; the first distance being the length of the perpendicular line from the second coordinate to the boundary of the imaging field of view; determine a first velocity component of the moving object based on the second motion vector; the first velocity component being used to indicate the motion velocity of the moving object in a first direction; the first direction being the normal direction of the boundary of the imaging field of view; determine the entry time based on the first distance and the first velocity component; and determine the entry coordinates based on the second coordinate, the second motion vector, and the entry time.

[0198] Optionally, in some embodiments of this application, the processing module 601 is further configured to extract M feature points from the image captured by the secondary camera and K feature points from the image captured by the primary camera within the overlapping field of view of the secondary camera and the primary camera, and generate a corresponding feature descriptor for each feature point to obtain a feature descriptor set; M and K are both integers greater than 4; based on the feature descriptor set, select T matching feature point pairs between the M feature points and the K feature points; T is an integer greater than or equal to 4; determine an initial homography transformation matrix according to the T matching feature point pairs; filter out S feature point pairs from the T matching feature point pairs, and perform fitting optimization processing on the initial homography transformation matrix to obtain a target homography transformation matrix; the S feature point pairs are mismatched feature point pairs, and the target homography transformation matrix is ​​used to characterize the first mapping relationship.

[0199] Optionally, in some embodiments of this application, the processing module 601 is specifically used to convert the first object distance corresponding to the entry coordinate into the first control quantity of the focusing motor based on the second mapping relationship between the object distance and the focusing motor control quantity; determine the second control quantity based on the first control quantity and the thermal drift compensation quantity; and determine the focusing position corresponding to the second control quantity as the predicted focusing position.

[0200] Optionally, in some embodiments of this application, the processing module 601 is specifically used to: determine all moving objects in the first region, the motion vector and acceleration of each moving object, based on the N frames of images; select P candidate moving objects from all moving objects; the acceleration of the candidate moving objects is greater than an acceleration threshold; P is a positive integer; perform polynomial fitting processing on the historical trajectory points of each candidate moving object to obtain P trajectory fitting curves; and determine the entry coordinates of each candidate moving object based on the motion vector and trajectory fitting curve of each candidate moving object.

[0201] Optionally, in some embodiments of this application, the processing module 601 is specifically used to determine the predicted motion trajectory of each candidate moving object based on the motion vector and trajectory fitting curve of each candidate moving object; and to determine the intersection coordinates of the predicted motion trajectory of each candidate moving object with the boundary of the imaging field of view as the entry coordinates of each candidate moving object.

[0202] Optionally, in some embodiments of this application, the processing module 601 is specifically used to calculate the motion saliency score of each candidate moving object when there are at least two candidate moving objects in the first region; the motion saliency score is determined based on at least one of object type, acceleration, and entry time; the candidate moving object with the highest motion saliency score is determined as the target focus object; the second object distance corresponding to the entry coordinates of the target focus object is obtained; and the focus position indicated by the second object distance is determined as the predicted focus position.

[0203] Optionally, in some embodiments of this application, the processing module 601 is further configured to: after detecting that the target focusing object has entered the imaging field of view, and before controlling the main camera to perform exposure, acquire the defocus amount of the main camera; calculate a third control amount of the focusing motor using the predicted focus position as a feedforward control amount and the defocus amount as a feedback control amount; determine the target focus position based on the third control amount; the target focus position is the focus position reached after the predicted focus position moves according to the adjustment direction and amplitude indicated by the third control amount; and control the focusing motor to move from the predicted focus position to the target focus position.

[0204] Optionally, in some embodiments of this application, the processing module 601 is specifically used to obtain the setup time of the focus motor of the main camera; determine a first moment based on the entry moment and the setup time; the first moment is the moment when the focus motor is started to be controlled; the first moment is earlier than the second moment, or the first moment is the same as the second moment, and the second moment is the entry moment minus the setup time; at the first moment, control the focus motor of the main camera to move towards the predicted focus position.

[0205] The shooting device in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0206] The shooting device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems, and this application embodiment does not specifically limit it.

[0207] The imaging device provided in this application embodiment can achieve... Figure 1 or Figure 5 To avoid repetition, the various processes implemented in the method embodiment shown will not be described again here.

[0208] Optionally, such as Figure 7 As shown, this application embodiment also provides an electronic device 700, including a processor 701, a memory 702, and a program or instructions stored in the memory 702 and executable on the processor 701. When the program or instructions are executed by the processor 701, they implement the various processes of the above-described shooting method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0209] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0210] Figure 8 This is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of this application. The electronic device 800 includes, but is not limited to, components such as: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810.

[0211] Those skilled in the art will understand that the electronic device 800 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 810 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0212] The processor 810 is configured to acquire N frames of images of a first region; the first region is a region outside the imaging field of view of the main camera; N is an integer greater than 1; based on the N frames of images, determine the entry coordinates of a moving object in the first region; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view; based on the entry coordinates, determine the predicted focus position; and based on the predicted focus position, control the main camera to perform exposure.

[0213] As can be seen from the above embodiments, this embodiment, by collecting image data outside the imaging field of view of the main camera, can detect moving objects about to enter the shooting range in advance and pre-determine the focus position based on their entry coordinates. This transforms the focusing operation from "responding after the target appears" to "pre-loading before the target enters the frame," effectively shortening the focus response time and improving the success rate of capturing images. By predicting the entry coordinates and adjusting the focus parameters in advance, it ensures that the image is in the optimal focus position the instant the moving object enters the field of view, achieving a zero-delay effect for capturing and focusing.

[0214] Optionally, in some embodiments of this application, the processor 810 is specifically configured to determine the entry time of the moving object based on the N frames of images; the entry time is a predicted time when the moving object reaches the position corresponding to the entry coordinates; before the system time reaches the entry time, control the focusing motor of the main camera to move to the predicted focusing position; and when the moving object is detected to enter the imaging field of view, or when the system time reaches the entry time, control the main camera to perform exposure.

[0215] Optionally, in some embodiments of this application, the processor 810 is specifically configured to acquire N frames of images of a first region through a secondary camera when the shooting scene is a linear motion scene; the secondary camera is a wide-angle camera; and to acquire N frames of images of the first region through the edge pixel array of the main camera when the shooting scene is a non-linear motion scene.

[0216] Optionally, in some embodiments of this application, the processor 810 is specifically configured to, based on the N frames of images, determine a moving object in the first region, a first coordinate of the moving object in a first coordinate system, and a first motion vector; the first coordinate system is the image coordinate system of the secondary camera; based on the mapping relationship between the first coordinate system and the second coordinate system, transform the first coordinate and the first motion vector into the second coordinate system to obtain a second coordinate and a second motion vector; the second coordinate system is the image coordinate system of the main camera; and determine the entry coordinates based on the second coordinate, the second motion vector, and the boundary coordinates of the imaging field of view.

[0217] Optionally, in some embodiments of this application, the processor 810 is specifically configured to: determine a first distance based on the second coordinates and the boundary coordinates of the imaging field of view; the first distance being the length of the perpendicular line from the second coordinates to the boundary of the imaging field of view; determine a first velocity component of the moving object based on the second motion vector; the first velocity component being used to indicate the motion velocity of the moving object in a first direction; the first direction being the normal direction of the boundary of the imaging field of view; determine the entry time based on the first distance and the first velocity component; and determine the entry coordinates based on the second coordinates, the second motion vector, and the entry time.

[0218] Optionally, in some embodiments of this application, the processor 810 is further configured to extract M feature points from the image captured by the secondary camera and K feature points from the image captured by the primary camera within the overlapping field of view of the secondary camera and the primary camera, and generate a corresponding feature descriptor for each feature point to obtain a feature descriptor set; M and K are both integers greater than 4; based on the feature descriptor set, select T matching feature point pairs between the M feature points and the K feature points; T is an integer greater than or equal to 4; determine an initial homography transformation matrix according to the T matching feature point pairs; filter out S feature point pairs from the T matching feature point pairs, and perform fitting optimization processing on the initial homography transformation matrix to obtain a target homography transformation matrix; the S feature point pairs are mismatched feature point pairs, and the target homography transformation matrix is ​​used to characterize the first mapping relationship.

[0219] Optionally, in some embodiments of this application, the processor 810 is specifically configured to convert the first object distance corresponding to the entry coordinate into the first control quantity of the focusing motor based on the second mapping relationship between the object distance and the focusing motor control quantity; determine the second control quantity based on the first control quantity and the thermal drift compensation quantity; and determine the focusing position corresponding to the second control quantity as the predicted focusing position.

[0220] Optionally, in some embodiments of this application, the processor 810 is specifically configured to: determine all moving objects in the first region, the motion vector and acceleration of each moving object, based on the N frames of images; select P candidate moving objects from all moving objects; the acceleration of the candidate moving objects is greater than an acceleration threshold; P is a positive integer; perform polynomial fitting processing on the historical trajectory points of each candidate moving object to obtain P trajectory fitting curves; and determine the entry coordinates of each candidate moving object based on the motion vector and trajectory fitting curve of each candidate moving object.

[0221] Optionally, in some embodiments of this application, the processor 810 is specifically configured to determine the predicted motion trajectory of each candidate moving object based on the motion vector and trajectory fitting curve of each candidate moving object; and to determine the intersection coordinates of the predicted motion trajectory of each candidate moving object with the boundary of the imaging field of view as the entry coordinates of each candidate moving object.

[0222] Optionally, in some embodiments of this application, the processor 810 is specifically configured to calculate a motion saliency score for each candidate moving object when there are at least two candidate moving objects in the first region; the motion saliency score is determined based on at least one of object type, acceleration, and entry time; the candidate moving object with the highest motion saliency score is determined as the target focus object; a second object distance corresponding to the entry coordinates of the target focus object is obtained; and the focus position indicated by the second object distance is determined as the predicted focus position.

[0223] Optionally, in some embodiments of this application, the processor 810 is further configured to: after detecting that the target focus object has entered the imaging field of view, and before controlling the main camera to perform exposure, acquire the defocus amount of the main camera; calculate a third control amount of the focusing motor using the predicted focus position as a feedforward control amount and the defocus amount as a feedback control amount; determine the target focus position based on the third control amount; the target focus position is the focus position reached after the predicted focus position moves according to the adjustment direction and amplitude indicated by the third control amount; and control the focusing motor to move from the predicted focus position to the target focus position.

[0224] Optionally, in some embodiments of this application, the processor 810 is specifically configured to obtain the setup time of the focus motor of the main camera; determine a first moment based on the entry moment and the setup time; the first moment is the moment when the focus motor is started to be controlled; the first moment is earlier than the second moment, or the first moment is the same as the second moment, and the second moment is the entry moment minus the setup time; at the first moment, control the focus motor of the main camera to move towards the predicted focus position.

[0225] It should be understood that, in this embodiment, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042. The GPU 8041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here. The memory 809 can be used to store software programs and various data, including but not limited to applications and operating systems. Processor 810 can integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 810.

[0226] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described shooting method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0227] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0228] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described shooting method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0229] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0230] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0231] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0232] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A shooting method, characterized in that, The method includes: N frames of images of the first region are captured; the first region is the area outside the imaging field of view of the main camera; N is an integer greater than 1. Based on the N frames of images, the entry coordinates of the moving object in the first region are determined; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view. Based on the input coordinates, the predicted focus position is determined; Based on the predicted focus position, the main camera is controlled to adjust its exposure.

2. The method according to claim 1, characterized in that, The method further includes: Based on the N frames of images, the entry time of the moving object is determined; the entry time is the predicted time when the moving object arrives at the position corresponding to the entry coordinates. The step of controlling the main camera to perform exposure based on the predicted focus position includes: Before the system time reaches the frame entry time, control the focus motor of the main camera to move to the predicted focus position; When the moving object is detected to enter the imaging field of view, or when the system time reaches the moment of entry into the frame, the main camera is controlled to perform exposure.

3. The method according to claim 1 or 2, characterized in that, The acquisition of N frames of images of the first region includes: In the case of a linear motion scene, N frames of images of the first region are captured by a secondary camera; the secondary camera is a wide-angle camera. In the case of a non-linear motion scene, N frames of images of the first region are acquired through the edge pixel array of the main camera.

4. The method according to claim 3, characterized in that, When N frames of images of a first region are captured by a secondary camera, determining the entry coordinates of a moving object in the first region based on the N frames of images includes: Based on the N frames of images, a moving object in the first region, a first coordinate of the moving object in a first coordinate system, and a first motion vector are determined; the first coordinate system is the image coordinate system of the secondary camera. Based on the mapping relationship between the first coordinate system and the second coordinate system, the first coordinate and the first motion vector are transformed into the second coordinate system to obtain the second coordinate and the second motion vector; the second coordinate system is the image coordinate system of the main camera. The entry coordinates are determined based on the second coordinates, the second motion vector, and the boundary coordinates of the imaging field of view.

5. The method according to claim 4, characterized in that, Determining the entry coordinates based on the second coordinates, the second motion vector, and the boundary coordinates of the imaging field of view includes: Based on the second coordinate and the boundary coordinate of the imaging field of view, a first distance is determined; the first distance is the length of the perpendicular line from the second coordinate to the boundary of the imaging field of view. Based on the second motion vector, a first velocity component of the moving object is determined; the first velocity component is used to indicate the motion velocity of the moving object in a first direction; the first direction is the normal direction of the boundary of the imaging field of view. The moment of entry into the frame is determined based on the first distance and the first velocity component; The entry coordinates are determined based on the second coordinates, the second motion vector, and the entry time.

6. The method according to claim 4, characterized in that, The first mapping relationship between the first coordinate system and the second coordinate system is determined in the following way: Within the overlapping field of view of the secondary camera and the primary camera, M feature points are extracted from the image captured by the secondary camera, and K feature points are extracted from the image captured by the primary camera. A corresponding feature descriptor is generated for each feature point to obtain a set of feature descriptors; M and K are both integers greater than 4. Based on the feature descriptor subset, T matching feature point pairs are selected between the M feature points and the K feature points; T is an integer greater than or equal to 4. Based on the T matched feature point pairs, determine the initial homography transformation matrix; From the T matched feature point pairs, S feature point pairs are eliminated, and the initial homography transformation matrix is ​​fitted and optimized to obtain the target homography transformation matrix; the S feature point pairs are mismatched feature point pairs, and the target homography transformation matrix is ​​used to characterize the first mapping relationship.

7. The method according to claim 4, characterized in that, The step of determining the predicted focus position based on the entry coordinates includes: Based on the second mapping relationship between the object distance and the control quantity of the focusing motor, the first object distance corresponding to the entry coordinate is converted into the first control quantity of the focusing motor. Based on the first control quantity and the thermal drift compensation quantity, the second control quantity is determined; The focus position corresponding to the second control quantity is determined as the predicted focus position.

8. The method according to claim 3, characterized in that, When N frames of images of a first region are acquired through the edge pixel array of the main camera, determining the entry coordinates of a moving object in the first region based on the N frames of images includes: Based on the N frames of images, determine all moving objects in the first region, the motion vector and acceleration of each moving object; From all the moving objects, P candidate moving objects are selected; the acceleration of the candidate moving objects is greater than the acceleration threshold; P is a positive integer; For each candidate moving object's historical trajectory points, polynomial fitting is performed to obtain P trajectory fitting curves; Based on the motion vector and trajectory fitting curve of each candidate moving object, the entry coordinates of each candidate moving object are determined.

9. The method according to claim 8, characterized in that, The process of determining the entry coordinates of each candidate moving object based on its motion vector and trajectory fitting curve includes: Based on the motion vector and trajectory fitting curve of each candidate motion object, the predicted motion trajectory of each candidate motion object is determined. The coordinates of the intersection point between the predicted motion trajectory of each candidate moving object and the boundary of the imaging field of view are respectively determined as the entry coordinates of each candidate moving object.

10. The method according to claim 8, characterized in that, The step of determining the predicted focus position based on the entry coordinates includes: If at least two candidate moving objects exist in the first region, a motion salience score is calculated for each candidate moving object; the motion salience score is determined based on at least one of object type, acceleration, and entry time. The candidate moving object with the highest motion salience score is identified as the target focus object; Obtain the second object distance corresponding to the entrance coordinates of the target focus object; The focus position indicated by the second object distance is determined as the predicted focus position.

11. The method according to claim 10, characterized in that, After detecting that the target object has entered the imaging field of view, and before controlling the main camera to perform exposure, the method further includes: Obtain the defocus amount of the main camera; Using the predicted focus position as the feedforward control quantity and the defocus amount as the feedback control quantity, the third control quantity of the focusing motor is calculated. The target focus position is determined based on the third control quantity; the target focus position is the focus position reached after the predicted focus position is moved according to the adjustment direction and magnitude indicated by the third control quantity. Control the focusing motor to move from the predicted focusing position to the target focusing position.

12. The method according to claim 2, characterized in that, The step of controlling the focus motor of the main camera to move to the predicted focus position before the system time reaches the frame entry time includes: Obtain the setup time of the focus motor of the main camera; Based on the entry time and the setup time, a first moment is determined; the first moment is the moment when the focus motor is started to be controlled; the first moment is earlier than the second moment, or the first moment is the same as the second moment, and the second moment is the entry time minus the setup time; At the first moment, the focusing motor of the main camera is controlled to move toward the predicted focus position.

13. A shooting device, characterized in that, The device includes: The processing module is used to acquire N frames of images of a first region; the first region is a region outside the imaging field of view of the main camera; N is an integer greater than 1; based on the N frames of images, determine the entry coordinates of a moving object in the first region; the entry coordinates are the predicted intersection coordinates of the moving object and the boundary of the imaging field of view; based on the entry coordinates, determine the predicted focus position; based on the predicted focus position, control the main camera to perform exposure.

14. The apparatus according to claim 13, characterized in that, The processing module is specifically used to determine the entry time of the moving object based on the N frames of images; the entry time is the predicted time when the moving object reaches the position corresponding to the entry coordinates; before the system time reaches the entry time, control the focus motor of the main camera to move to the predicted focus position; when the moving object is detected to enter the imaging field of view, or when the system time reaches the entry time, control the main camera to perform exposure.

15. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the shooting method as described in any one of claims 1-12.