Frame synchronization methods, apparatus and equipment
By acquiring parameters such as shooting mode, exposure mode, and motion speed, and rationally selecting the frame synchronization method, the contradiction between frame synchronization speed and computing resource consumption is resolved, achieving a smooth camera switching experience.
Patent Information
- Application Number
- CN202411935208.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-25
AI Technical Summary
In existing technologies, there is a contradiction between synchronization speed and computational resource consumption in frame synchronization methods. Frame header synchronization is fast but the image differences are large, while frame in-frame synchronization consumes more computational resources but is slow.
By acquiring parameters such as the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject, the target frame synchronization method is determined, and either frame header synchronization or frame in-frame synchronization method is selected for frame synchronization.
It balances synchronization speed and computing resource usage, providing a smooth camera switching experience and fully leveraging the advantages of each synchronization method.
Smart Images

Figure CN119767126B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of camera technology, specifically relating to a frame synchronization method, apparatus, and device. Background Technology
[0002] With the development of electronic devices and camera technology, multiple cameras are now installed in electronic devices. Multiple cameras enable long-distance shooting, wide-angle shooting, clear shooting in low-light environments, and improved image detail and color.
[0003] When using multiple cameras for shooting, it is necessary to synchronize the frames of the images captured by the multiple cameras to ensure that the image content is synchronized and that the cameras can be switched smoothly.
[0004] In related technologies, frame synchronization is performed using either frame header synchronization or frame-in-frame synchronization. However, while frame header synchronization is fast, simple to calculate, and requires less computational resources, the differences in images captured by each camera increase as the exposure time of the camera's image sensors varies. Frame-in-frame synchronization, on the other hand, can reduce the differences in images captured by each camera, but it consumes more computational resources and has a slower synchronization speed. Summary of the Invention
[0005] The purpose of this application is to provide a frame synchronization method, apparatus, and device that can perform frame synchronization using a reasonable frame synchronization method.
[0006] In a first aspect, embodiments of this application provide a frame synchronization method, including:
[0007] During the shooting process, a first parameter is acquired to determine the target frame synchronization method. The first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being shot. The electronic device includes a first camera and a second camera.
[0008] Based on the first parameter, determine the target frame synchronization method of the first camera and the second camera;
[0009] Frame synchronization is performed using the target frame synchronization method.
[0010] Secondly, embodiments of this application provide a frame synchronization device, comprising:
[0011] The acquisition module is used to acquire a first parameter for determining the target frame synchronization method during the shooting process, wherein the first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being shot, and the electronic device includes a first camera and a second camera.
[0012] The first determining module is used to determine the target frame synchronization method of multiple first cameras and second cameras based on the first parameter.
[0013] The synchronization module is used to perform frame synchronization using the target frame synchronization method.
[0014] Thirdly, embodiments of this application provide an electronic device, which includes a plurality of cameras, a processor, and a memory. The memory stores programs or instructions that can run on the processor, and when the programs or instructions are executed by the processor, they implement the steps of the frame synchronization method provided in embodiments of this application.
[0015] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the frame synchronization method provided in embodiments of this application are implemented.
[0016] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps of the frame synchronization method provided in embodiments of this application.
[0017] Sixthly, embodiments of this application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the steps of the frame synchronization method provided in embodiments of this application.
[0018] In this embodiment, during the shooting process, a first parameter is acquired to determine the target frame synchronization method. This first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being photographed. The electronic device includes a first camera and a second camera. Based on the first parameter, the target frame synchronization method for the first camera and the second camera is determined. Frame synchronization is then performed using this target frame synchronization method. This allows for the use of a reasonable frame synchronization method, balancing synchronization speed and computational resource usage, and fully leveraging the advantages of various frame synchronization methods to ensure a smooth camera switching experience for the user. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating a frame synchronization method provided in some embodiments of this application;
[0020] Figure 2 These are schematic diagrams illustrating the frame synchronization process provided in some embodiments of this application;
[0021] Figure 3 This is a schematic diagram of the frame synchronization device provided in some embodiments of this application;
[0022] Figure 4 These are schematic diagrams of the structure of an electronic device provided in some embodiments of this application;
[0023] Figure 5 This is a schematic diagram of the hardware structure of an electronic device that implements some embodiments of this application. Detailed Implementation
[0024] 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.
[0025] 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.
[0026] The frame synchronization method, apparatus, and device provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0027] The frame synchronization method and apparatus provided in this application can be applied to electronic devices including a first camera and a second camera. In this application, the first camera can be the camera corresponding to the preview image, and the second camera can be one camera or multiple cameras.
[0028] Figure 1 This is a flowchart illustrating the frame synchronization method provided in an embodiment of this application. The frame synchronization method may include:
[0029] Step 101: During the shooting process, acquire the first parameter used to determine the target frame synchronization method, wherein the first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being shot;
[0030] Step 102: Determine the target frame synchronization method of the first camera and the second camera based on the first parameter;
[0031] Step 103: Perform frame synchronization using the target frame synchronization method.
[0032] The specific implementation methods of the above steps will be described in detail below.
[0033] In this embodiment, during the shooting process, a first parameter is acquired to determine the target frame synchronization method. This first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being photographed. The electronic device includes a first camera and a second camera. Based on the first parameter, the target frame synchronization method for the first camera and the second camera is determined. Frame synchronization is then performed using this target frame synchronization method. This allows for the use of a reasonable frame synchronization method, balancing synchronization speed and computational resource usage, and fully leveraging the advantages of various frame synchronization methods to ensure a smooth camera switching experience for the user.
[0034] In some possible implementations of the embodiments of this application, the shooting modes in the embodiments of this application include, but are not limited to: professional mode, document mode, photo mode, portrait mode, night scene mode, panorama mode, etc.
[0035] The exposure modes in the embodiments of this application include, but are not limited to, single exposure mode and double exposure mode. In single exposure mode, one frame of image is exposed at a time, and in double exposure mode, at least two frames of image are exposed at a time.
[0036] In some possible implementations of the embodiments of this application, the motion speed of the subject can be determined by optical flow or a gyroscope. Specifically, the larger the optical flow value calculated by the optical flow method, the faster the motion speed of the subject, and the smaller the optical flow value, the slower the motion speed of the subject. Similarly, the larger the camera jitter frequency detected by the gyroscope, the faster the motion speed of the subject, and the smaller the jitter frequency, the slower the motion speed of the subject.
[0037] In some possible implementations of the embodiments of this application, a correspondence between optical flow value and motion speed or a correspondence between jitter frequency and motion speed can be established in advance. After the optical flow value is calculated or the jitter frequency of the camera is detected, the motion speed of the subject can be determined according to the pre-established correspondence.
[0038] In some possible implementations of the embodiments of this application, step 102 may include: when the shooting mode is the first shooting mode, determining the frame synchronization method as the target frame synchronization method, wherein the frame synchronization requirement of the first shooting mode is higher than that of other shooting modes, and other shooting modes are shooting modes other than the first shooting mode.
[0039] In some possible implementations of this application's embodiments, shooting modes that must use in-frame synchronization can be pre-selected from multiple shooting modes. It is understood that the shooting mode that must use in-frame synchronization is the first shooting mode with higher synchronization requirements than other shooting modes. For example, portrait mode requires extremely high synchronization requirements for bokeh operations, and the shooting mode selected from multiple shooting modes that must use in-frame synchronization is portrait mode. When the electronic device's shooting mode is portrait mode, in-frame synchronization is determined as the target frame synchronization method.
[0040] In some possible implementations of the embodiments of this application, step 102 may include: when the shooting mode is not the first shooting mode and the exposure mode of the first camera or the second camera is a dual exposure mode, determining the frame header synchronization method as the target frame synchronization method, wherein the synchronization requirement of the first shooting mode is higher than that of other shooting modes, and other shooting modes are shooting modes other than the first shooting mode; when the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes and the motion speed is greater than or equal to a first threshold, determining the frame synchronization method as the target frame synchronization method; when the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes and the motion speed is less than the first threshold, determining the frame header synchronization method as the target frame synchronization method.
[0041] In some possible implementations of the embodiments of this application, the first threshold can be set according to actual needs or calibrated in advance through experiments.
[0042] In some possible implementations of the embodiments of this application, when the camera's exposure mode is a double exposure mode, since the double exposure mode exposes at least two frames of images at a time, if the frame synchronization method is selected, it is difficult to decide which frame to choose as the reference for frame alignment when performing frame synchronization, which may lead to frame synchronization failure. Therefore, when the camera's exposure mode is a double exposure mode, the frame header synchronization method is determined as the target frame synchronization method.
[0043] For example, suppose the first shooting mode is portrait mode.
[0044] When the shooting mode is night mode and the first camera's exposure mode is double exposure mode, the frame header synchronization method is determined as the target frame synchronization method.
[0045] When the shooting mode is night mode and the second camera's exposure mode is double exposure mode, the frame header synchronization method is determined as the target frame synchronization method.
[0046] When the shooting mode is night scene mode, the exposure mode of the first camera and the second camera are both single exposure mode, and the motion speed is greater than or equal to the first threshold, the frame synchronization method is determined as the target frame synchronization method.
[0047] When the shooting mode is night scene mode, the exposure mode of the first camera and the second camera are both single exposure mode, and the motion speed is less than the first threshold, the frame header synchronization method is determined as the target frame synchronization method.
[0048] In some possible implementations of the embodiments of this application, before step 102, the frame synchronization method provided in the embodiments of this application may further include: determining whether the frame synchronization condition is met based on the zoom state of the first camera, the first exposure duration of the first camera, and the second exposure duration of the second camera;
[0049] The frame synchronization conditions include one of the following:
[0050] The zoom state is when the zoom is in progress and the exposure ratio is greater than or equal to the second threshold. The exposure ratio is the ratio of the third exposure duration to the fourth exposure duration. The third exposure duration is the minimum of the first exposure duration and the second exposure duration, and the fourth exposure duration is the maximum of the first exposure duration and the second exposure duration.
[0051] The zoom state is when zooming is in progress, the exposure ratio is less than the second threshold, and the first exposure duration is greater than the second exposure duration;
[0052] The zoom state is defined as being in the process of zooming, the exposure ratio being less than the second threshold, the first exposure duration being less than the second exposure duration, and the zoom urgency being less than the third threshold. The zoom urgency is determined based on the two most recent zoom ratios of the first camera, the first base magnification of the first camera, and the second base magnification of the second camera.
[0053] In some possible implementations of the embodiments of this application, the frame synchronization condition not being met includes one of the following:
[0054] The zoom state is not actually zooming;
[0055] The zoom state is when the zoom is in progress, the exposure ratio is less than the second threshold, the first exposure time is less than the second exposure time, but the urgency of zooming is greater than or equal to the third threshold.
[0056] In some possible implementations of the embodiments of this application, the zoom state in the embodiments of this application may include a zooming state and a non-zooming state, where the non-zooming state is not a zooming state. The various thresholds in the embodiments of this application can be set according to actual needs. When the zoom state is non-zooming, it means that only the image captured by the first camera needs to be displayed, and frame synchronization is not required; when the zoom state is zooming, it means that there may be a camera switching operation later, and frame synchronization is required.
[0057] In some possible implementations of this application's embodiments, a larger exposure ratio results in a closer similarity between the exposure duration of the first camera and the exposure duration of the second camera. When the frame rate of the first camera differs significantly from that of the second camera, a larger exposure ratio indicates that the significant frame rate difference is caused by the difference in exposure duration between the first and second cameras. Conversely, a smaller exposure ratio when the frame rate difference is significant indicates that the significant frame rate difference is due to reduced power consumption of the second camera to conserve power.
[0058] In some possible implementations of the embodiments of this application, the exposure ratio can be determined by the following formula (1):
[0059]
[0060] In formula (1), Re is the exposure ratio, E1 is the first exposure duration, E2 is the second exposure duration, min(E1,E2) is the third exposure duration, and max(E1,E2) is the fourth exposure duration.
[0061] In some possible implementations of the embodiments of this application, the frame synchronization method provided in the embodiments of this application may further include: calculating a first difference between a first zoom ratio and a second zoom ratio, wherein the first zoom ratio is the latter zoom ratio among the two most recent zoom ratios, and the second zoom ratio is the former zoom ratio among the two most recent zoom ratios; calculating a second difference between the first zoom ratio and a second base ratio; and determining the ratio of the absolute value of the second difference to the absolute value of the first difference as the zoom urgency level.
[0062] In some possible implementations of the embodiments of this application, the urgency of zoom can be determined by the following formula (2):
[0063]
[0064] In formula (2), D1 represents the urgency of zoom, Z0 represents the zoom ratio of the last two zoom ratios, Z1 represents the zoom ratio of the first zoom ratio of the last two zoom ratios, and X2 represents the second base ratio.
[0065] In some possible implementations of the embodiments of this application, before step 103, the frame synchronization method provided in the embodiments of this application may further include: increasing the frame rate of the second camera when the first frame rate of the first camera is greater than the second frame rate of the second camera; and decreasing the frame rate of the second camera when the first frame rate is less than the second frame rate.
[0066] In this embodiment of the application, by adjusting the frame rate of the second camera before frame synchronization, smooth switching of the camera can be ensured.
[0067] In some possible implementations of this application's embodiments, the second camera includes multiple cameras; the frame synchronization method provided in this application's embodiments may further include: determining a third base magnification from multiple base magnifications corresponding to multiple cameras, wherein, when the first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third base magnification is the base magnification among the multiple base magnifications that is greater than the first base magnification and has the smallest difference with the first base magnification; when the first difference is less than zero, the third base magnification is the base magnification among the multiple base magnifications that is less than the first base magnification and has the largest difference with the first base magnification; the first zoom magnification is the latter zoom magnification among the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification among the two most recent zoom magnifications; calculating a third difference between the first zoom magnification and the third base magnification; and determining the ratio of the absolute value of the third difference to the absolute value of the first difference as the zoom urgency level.
[0068] In some possible implementations of the embodiments of this application, the urgency of zoom can be determined by the following formula (3):
[0069]
[0070] In formula (3), D2 represents the zoom urgency level, Z0 represents the zoom ratio of the last two zoom ratios, Z1 represents the zoom ratio of the first zoom ratio of the last two zoom ratios, and Xi represents the third base ratio.
[0071] Assume the second camera system comprises n cameras, with base magnifications of X1, X2, ..., Xn. When Z0 - Z1 is greater than zero, it indicates the user is zooming in. In this case, the base magnification greater than the first camera's base magnification and having the smallest difference between them is selected as the third base magnification. When Z0 - Z1 is less than zero, it indicates the user is zooming out. In this case, the base magnification less than the first camera's base magnification and having the largest difference between them is selected as the third base magnification.
[0072] For example, assume the second camera includes four cameras with base magnifications of 2, 8, 5, and 7 respectively. The first camera has a base magnification of 6. When Z0-Z1 is greater than zero, 7 is selected as the third base magnification; when Z0-Z1 is less than zero, 5 is selected as the third base magnification.
[0073] In some possible implementations of the embodiments of this application, step 103 may include: using a target frame synchronization method to perform frame synchronization between the first camera and the camera corresponding to the third base magnification.
[0074] For example, the second camera includes four cameras with base magnifications of 2, 8, 5, and 7, respectively. When 5 is used as the third base magnification, the first camera is synchronized with the camera with a base magnification of 5 using a target frame synchronization method.
[0075] Figure 2 This is a schematic diagram illustrating the frame synchronization process provided in some embodiments of this application. The frame synchronization process includes the following steps:
[0076] Step 201: Determine whether the shooting mode of the electronic device is the first shooting mode. The frame synchronization requirement of the first shooting mode is higher than that of other shooting modes. Other shooting modes are shooting modes other than the first shooting mode. If yes, proceed to step 202; otherwise, proceed to step 203.
[0077] Step 202: Determine the frame synchronization method as the target frame synchronization method, and continue to execute step 211;
[0078] Step 203: Determine whether the first camera is in zoom mode. If yes, proceed to step 204; otherwise, end.
[0079] Step 204: Determine whether the exposure ratio is greater than or equal to the second threshold, where the exposure ratio is the ratio of the third exposure duration to the fourth exposure duration, the third exposure duration is the minimum of the first exposure duration and the second exposure duration, and the fourth exposure duration is the maximum of the first exposure duration and the second exposure duration. If yes, proceed to step 208; otherwise, proceed to step 205.
[0080] Step 205: Determine whether the first exposure time of the first camera is greater than or equal to the second exposure time of the second camera. If not, proceed to step 206; if yes, proceed to step 208.
[0081] Step 206: Determine the urgency of zooming based on the two most recent zoom ratios of the first camera, the first base zoom ratio of the first camera, and the second base zoom ratio of the second camera;
[0082] Step 207: Determine whether the urgency of zooming is less than or equal to the third threshold. If yes, proceed to step 208; otherwise, end.
[0083] Step 208: Determine whether there is a dual exposure mode in the exposure modes of the first camera and the second camera. If yes, proceed to step 209; otherwise, proceed to step 210.
[0084] Step 209: Set the frame header synchronization method as the target frame synchronization method, and continue to step 211;
[0085] Step 210: Determine whether the speed of the subject is greater than or equal to the first threshold. If yes, proceed to step 202; otherwise, proceed to step 209.
[0086] Step 211: Perform frame synchronization using the target frame synchronization method.
[0087] The frame synchronization method provided in this application can be executed by a frame synchronization device. This application uses the execution of the frame synchronization method by a frame synchronization device as an example to illustrate the frame synchronization device provided in this application.
[0088] Figure 3 This is a schematic diagram of the frame synchronization device provided in an embodiment of this application. The frame synchronization device 300 may include:
[0089] The acquisition module 301 is used to acquire a first parameter for determining the target frame synchronization method during the shooting process, wherein the first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being shot, and the electronic device includes a first camera and a second camera.
[0090] The first determining module 302 is used to determine the target frame synchronization method of the first camera and the second camera based on the first parameter;
[0091] Synchronization module 303 is used to perform frame synchronization using the target frame synchronization method.
[0092] In this embodiment, during the shooting process, a first parameter is acquired to determine the target frame synchronization method. This first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being photographed. The electronic device includes a first camera and a second camera. Based on the first parameter, the target frame synchronization method for the first camera and the second camera is determined. Frame synchronization is then performed using this target frame synchronization method. This allows for the use of a reasonable frame synchronization method, balancing synchronization speed and computational resource usage, and fully leveraging the advantages of various frame synchronization methods to ensure a smooth camera switching experience for the user.
[0093] In some possible implementations of the embodiments of this application, the first determining module 302 is specifically used for:
[0094] When the shooting mode is the first shooting mode, the frame synchronization method is determined as the target frame synchronization method. The frame synchronization requirement of the first shooting mode is higher than that of other shooting modes, which are shooting modes other than the first shooting mode.
[0095] In some possible implementations of the embodiments of this application, the first determining module 302 is specifically used for:
[0096] When the shooting mode is not the first shooting mode, or the exposure mode of the first or second camera is a double exposure mode, the frame header synchronization method is determined as the target frame synchronization method. Among them, the frame synchronization requirement of the first shooting mode is higher than that of other shooting modes, and other shooting modes are shooting modes other than the first shooting mode.
[0097] If the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes, and the motion speed is greater than or equal to the first threshold, the frame synchronization method will be determined as the target frame synchronization method.
[0098] If the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes, and the motion speed is less than the first threshold, the frame header synchronization method will be determined as the target frame synchronization method.
[0099] In some possible implementations of the embodiments of this application, the first camera is the camera corresponding to the preview image; the frame synchronization device 300 provided in the embodiments of this application further includes:
[0100] The second determining module is used to determine whether the frame synchronization condition is met based on the zoom state of the first camera, the first exposure time of the first camera, and the second exposure time of the second camera.
[0101] The frame synchronization conditions include one of the following:
[0102] The zoom state is when the zoom is in progress and the exposure ratio is greater than or equal to the second threshold. The exposure ratio is the ratio of the third exposure duration to the fourth exposure duration. The third exposure duration is the minimum of the first exposure duration and the second exposure duration, and the fourth exposure duration is the maximum of the first exposure duration and the second exposure duration.
[0103] The zoom state is when zooming is in progress, the exposure ratio is less than the second threshold, and the first exposure duration is greater than the second exposure duration;
[0104] The zoom state is defined as being in the process of zooming, the exposure ratio being less than the second threshold, the first exposure duration being less than the second exposure duration, and the zoom urgency being less than or equal to the third threshold. The second zoom urgency is determined based on the zoom ratios of the first camera's two most recent zooms, the first base magnification of the first camera, and the second base magnification of the second camera.
[0105] In some possible implementations of the embodiments of this application, the frame synchronization condition not being met includes one of the following:
[0106] The zoom state is not actually zooming;
[0107] The zoom state is when the zoom is in progress, the exposure ratio is less than the second threshold, the first exposure time is less than the second exposure time, but the urgency of zooming is greater than or equal to the third threshold.
[0108] In some possible implementations of the embodiments of this application, the frame synchronization device 300 provided in the embodiments of this application further includes:
[0109] The first calculation module is used to calculate the first difference between the first zoom ratio and the second zoom ratio, wherein the first zoom ratio is the latter zoom ratio among the two most recent zoom ratios, and the second zoom ratio is the former zoom ratio among the two most recent zoom ratios.
[0110] The second calculation module is used to calculate the second difference between the first zoom magnification and the second base magnification.
[0111] The third determining module is used to determine the zoom urgency level by the ratio of the absolute value of the second difference to the absolute value of the first difference.
[0112] In some possible implementations of the embodiments of this application, the frame synchronization device 300 provided in the embodiments of this application further includes:
[0113] The adjustment module is used to increase the frame rate of the second camera when the first frame rate of the first camera is greater than the second frame rate of the second camera, and to decrease the frame rate of the second camera when the first frame rate is less than the second frame rate.
[0114] In this embodiment of the application, by adjusting the frame rate of the second camera before frame synchronization, smooth switching of the camera can be ensured.
[0115] In some possible implementations of the embodiments of this application, the second camera includes multiple cameras, and the frame synchronization device 300 provided in the embodiments of this application further includes:
[0116] The fourth determining module is used to determine a third base magnification from multiple base magnifications corresponding to multiple cameras. Wherein, if the first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third base magnification is the base magnification among the multiple base magnifications that is greater than the first base magnification and has the smallest difference from the first base magnification; if the first difference is less than zero, the third base magnification is the base magnification among the multiple base magnifications that is less than the first base magnification and has the largest difference from the first base magnification; the first zoom magnification is the latter zoom magnification among the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification among the two most recent zoom magnifications.
[0117] The third calculation module is used to calculate the third difference between the first zoom magnification and the third base magnification.
[0118] The fifth determining module is used to determine the zoom urgency level by the ratio of the absolute value of the third difference to the absolute value of the first difference.
[0119] In some possible implementations of the embodiments of this application, the synchronization module 303 is specifically used for:
[0120] The first camera and the camera corresponding to the third base magnification are synchronized using the target frame synchronization method.
[0121] The frame synchronization device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0122] The frame synchronization device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0123] The frame synchronization device provided in this application embodiment can achieve... Figures 1 to 2 The various processes implemented in the frame synchronization method embodiment will not be described again here to avoid repetition.
[0124] Optionally, such as Figure 4 As shown, this application embodiment also provides an electronic device 400, including a processor 401, a memory 402, a first camera 403 and a second camera 404. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the frame synchronization method embodiment provided in this application embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0125] Figure 5 This is a schematic diagram of the hardware structure of an electronic device that implements some embodiments of this application.
[0126] The electronic device 500 includes, but is not limited to, components such as: radio frequency unit 501, network module 502, audio output unit 503, input unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, and processor 510.
[0127] Those skilled in the art will understand that the electronic device 500 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 510 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 5 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.
[0128] In some possible implementations of the embodiments of this application, the electronic device 500 may also include a first camera and a second camera.
[0129] The processor 510 is configured to: during the shooting process, acquire a first parameter for determining the target frame synchronization method, wherein the first parameter includes at least one of the following: shooting mode, camera exposure mode and the movement speed of the subject being shot; determine the target frame synchronization method of the first camera and the second camera based on the first parameter; and perform frame synchronization using the target frame synchronization method.
[0130] In this embodiment, during the shooting process, a first parameter is acquired to determine the target frame synchronization method. This first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being photographed. The electronic device includes a first camera and a second camera. Based on the first parameter, the target frame synchronization method for the first camera and the second camera is determined. Frame synchronization is then performed using this target frame synchronization method. This allows for the use of a reasonable frame synchronization method, balancing synchronization speed and computational resource usage, and fully leveraging the advantages of various frame synchronization methods to ensure a smooth camera switching experience for the user.
[0131] In some possible implementations of the embodiments of this application, the processor 510 is specifically used for:
[0132] When the shooting mode is the first shooting mode, the frame synchronization method is determined as the target frame synchronization method. The frame synchronization requirement of the first shooting mode is higher than that of other shooting modes, which are shooting modes other than the first shooting mode.
[0133] In some possible implementations of the embodiments of this application, the processor 510 is specifically used for:
[0134] When the shooting mode is not the first shooting mode, or the exposure mode of the first or second camera is a double exposure mode, the frame header synchronization method is determined as the target frame synchronization method. Among them, the frame synchronization requirement of the first shooting mode is higher than that of other shooting modes, and other shooting modes are shooting modes other than the first shooting mode.
[0135] If the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes, and the motion speed is greater than or equal to the first threshold, the frame synchronization method will be determined as the target frame synchronization method.
[0136] If the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes, and the motion speed is less than the first threshold, the frame header synchronization method will be determined as the target frame synchronization method.
[0137] In some possible implementations of the embodiments of this application, the first camera is the camera corresponding to the preview image; the processor 510 is further configured to: determine whether the frame synchronization condition is met based on the zoom state of the first camera, the first exposure duration of the first camera, and the second exposure duration of the second camera;
[0138] The frame synchronization conditions include one of the following:
[0139] The zoom state is when the zoom is in progress and the exposure ratio is greater than or equal to the second threshold. The exposure ratio is the ratio of the third exposure duration to the fourth exposure duration. The third exposure duration is the minimum of the first exposure duration and the second exposure duration, and the fourth exposure duration is the maximum of the first exposure duration and the second exposure duration.
[0140] The zoom state is when zooming is in progress, the exposure ratio is less than the second threshold, and the first exposure duration is greater than the second exposure duration;
[0141] The zoom state is defined as being in the process of zooming, the exposure ratio being less than the second threshold, the first exposure duration being less than the second exposure duration, and the zoom urgency being less than or equal to the third threshold. The zoom urgency is determined based on the two most recent zoom ratios of the first camera, the first base magnification of the first camera, and the second base magnification of the second camera.
[0142] In some possible implementations of embodiments of this application, the processor 510 is further configured to:
[0143] Calculate the first difference between the first zoom ratio and the second zoom ratio, where the first zoom ratio is the latter zoom ratio among the two most recent zoom ratios, and the second zoom ratio is the former zoom ratio among the two most recent zoom ratios; calculate the second difference between the first zoom ratio and the second base zoom ratio of the second camera; and determine the zoom urgency level by the ratio of the absolute value of the second difference to the absolute value of the first difference.
[0144] In some possible implementations of embodiments of this application, the processor 510 is further configured to:
[0145] If the first frame rate of the first camera is greater than the second frame rate of the second camera, increase the frame rate of the second camera; if the first frame rate is less than the second frame rate, decrease the frame rate of the second camera.
[0146] In this embodiment of the application, by adjusting the frame rate of the second camera before frame synchronization, smooth switching of the camera can be ensured.
[0147] In some possible implementations of embodiments of this application, the second camera includes multiple cameras, and the processor 510 is further configured to:
[0148] A third base magnification is determined from multiple base magnifications corresponding to multiple cameras. Wherein, if the first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third base magnification is the base magnification that is greater than the first base magnification and has the smallest difference from the first base magnification among the multiple base magnifications; if the first difference is less than zero, the third base magnification is the base magnification that is less than the first base magnification and has the largest difference from the first base magnification among the multiple base magnifications; the first zoom magnification is the latter zoom magnification among the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification among the two most recent zoom magnifications;
[0149] Calculate the third difference between the first zoom ratio and the third base zoom ratio;
[0150] The ratio of the absolute value of the third difference to the absolute value of the first difference is determined as the zoom urgency level.
[0151] In some possible implementations of the embodiments of this application, the processor 510 is specifically used for:
[0152] The first camera and the camera corresponding to the third base magnification are synchronized using the target frame synchronization method.
[0153] It should be understood that, in this embodiment, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The GPU 5041 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 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include a touch detection device and a touch controller. Other input devices 5072 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.
[0154] The memory 509 can be used to store software programs and various data. The memory 509 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 509 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 509 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0155] Processor 510 may include one or more processing units; optionally, processor 510 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 510.
[0156] 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 frame synchronization method provided in this application and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0157] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium, examples of which include non-transitory computer-readable media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0158] This application 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 frame synchronization method provided in this application and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0159] 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.
[0160] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the frame synchronization method embodiment provided in this application, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0161] 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.
[0162] 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) and includes 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.
[0163] 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 frame synchronization method, characterized in that, The method includes: During the shooting process, a first parameter is acquired to determine the target frame synchronization method. The first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being shot. The electronic device includes a first camera and a second camera. Based on the first parameter, determine the target frame synchronization method between the first camera and the second camera; Frame synchronization is performed using the target frame synchronization method.
2. The method according to claim 1, characterized in that, The step of determining the target frame synchronization method between the first camera and the second camera based on the first parameter includes: When the shooting mode is the first shooting mode, the frame synchronization method is determined as the target frame synchronization method, wherein the frame synchronization requirement of the first shooting mode is higher than that of other shooting modes, and the other shooting modes are shooting modes other than the first shooting mode.
3. The method according to claim 1, characterized in that, The step of determining the target frame synchronization method between the first camera and the second camera based on the first parameter includes: When the shooting mode is not the first shooting mode and the exposure mode of the first camera or the second camera is a double exposure mode, the frame header synchronization method is determined as the target frame synchronization method. The synchronization requirement of the first shooting mode is higher than that of other shooting modes. The other shooting modes are shooting modes other than the first shooting mode. If the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes, and the motion speed is greater than or equal to the first threshold, the frame synchronization method is determined as the target frame synchronization method. If the shooting mode is not the first shooting mode, the exposure modes of the first camera and the second camera are both single exposure modes, and the motion speed is less than the first threshold, the frame header synchronization method is determined as the target frame synchronization method.
4. The method according to claim 1, characterized in that, The first camera is the camera corresponding to the preview image; before determining the target frame synchronization method of the first camera and the second camera based on the first parameter, the method further includes: Based on the zoom state of the first camera, the first exposure time of the first camera, and the second exposure time of the second camera, determine whether the frame synchronization condition is met; The frame synchronization conditions include one of the following: The zoom state is in the zoom state and the exposure ratio is greater than or equal to the second threshold. The exposure ratio is the ratio of the third exposure duration to the fourth exposure duration. The third exposure duration is the minimum value between the first exposure duration and the second exposure duration, and the fourth exposure duration is the maximum value between the first exposure duration and the second exposure duration. The zoom state is in the zoom state, the exposure ratio is less than the second threshold, and the first exposure duration is greater than or equal to the second exposure duration; The zoom state is defined as being in the process of zooming, the exposure ratio being less than the second threshold, the first exposure duration being less than the second exposure duration, and the zoom urgency being less than the third threshold. The zoom urgency is determined based on the two most recent zoom ratios of the first camera, the first base magnification of the first camera, and the second base magnification of the second camera.
5. The method according to claim 4, characterized in that, The following are examples of conditions that do not meet frame synchronization requirements: The zoom state is not the zooming state in progress; The zoom state is in the process of zooming, the exposure ratio is less than the second threshold, the first exposure time is less than the second exposure time, but the urgency of zooming is greater than or equal to the third threshold.
6. The method according to claim 4, characterized in that, The method further includes: Calculate a first difference between the first zoom ratio and the second zoom ratio, wherein the first zoom ratio is the latter zoom ratio among the two most recent zoom ratios, and the second zoom ratio is the former zoom ratio among the two most recent zoom ratios. Calculate the second difference between the first zoom ratio and the second base ratio; The ratio of the absolute value of the second difference to the absolute value of the first difference is determined as the zoom urgency level.
7. The method according to claim 6, characterized in that, Before performing frame synchronization using the target frame synchronization method, the method further includes: If the first frame rate of the first camera is greater than the second frame rate of the second camera, increase the frame rate of the second camera; If the first frame rate is lower than the second frame rate, reduce the frame rate of the second camera.
8. The method according to claim 4, characterized in that, The second camera includes multiple cameras, and the method further includes: A third base magnification is determined from multiple base magnifications corresponding to the multiple cameras. Specifically, if the first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third base magnification is the base magnification among the multiple base magnifications that is greater than the first base magnification and has the smallest difference from the first base magnification; if the first difference is less than zero, the third base magnification is the base magnification among the multiple base magnifications that is less than the first base magnification and has the largest difference from the first base magnification; the first zoom magnification is the latter zoom magnification among the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification among the two most recent zoom magnifications. Calculate the third difference between the first zoom ratio and the third base ratio; The ratio of the absolute value of the third difference to the absolute value of the first difference is determined as the zoom urgency level.
9. The method according to claim 8, characterized in that, The frame synchronization using the target frame synchronization method includes: Using the target frame synchronization method, the first camera and the camera corresponding to the third base magnification are synchronized.
10. A frame synchronization device, characterized in that, The device includes: The acquisition module is used to acquire a first parameter for determining the target frame synchronization method during the shooting process, wherein the first parameter includes at least one of the following: the shooting mode of the electronic device, the exposure mode of the camera, and the movement speed of the subject being shot, wherein the electronic device includes a first camera and a second camera; The first determining module is used to determine the target frame synchronization method of the first camera and the second camera based on the first parameter; The synchronization module is used to perform frame synchronization using the target frame synchronization method.
11. An electronic device, characterized in that, The electronic device includes a first camera, a second camera, a processor, and a memory. The memory stores programs or instructions that can run on the processor. When the programs or instructions are executed by the processor, they implement the steps of the frame synchronization method as described in any one of claims 1-9.
Citation Information
Patent Citations
Multi-camera fusion method and device, computer readable storage medium and equipment
CN118784969A
Frame synchronization controller, and control method, multi-camera apparatus and storage medium
WO2024198431A1