Frame synchronization method, device and equipment
By dynamically determining the target frame synchronization method, combining shooting mode, exposure mode and motion speed, the problem of difficult frame synchronization method in multi-camera systems to take into account synchronization speed and computing resource usage, achieving more efficient image synchronization and smooth camera switching.
Patent Information
- Application Number
- CN202411935208.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-25
AI Technical Summary
In multi-camera systems, existing frame synchronization methods are difficult to take into account synchronization speed and computing resources, resulting in image differences and switching fluency problems.
By obtaining parameters such as shooting mode, exposure mode and motion speed, dynamically determine the target frame synchronization method, and select appropriate frame head synchronization or in-frame synchronization methods to adapt to different shooting conditions.
It achieves a balance between ensuring synchronization speed and computing resource occupation, and improves image synchronization consistency and camera switching smoothness.
Smart Images

Figure CN119767126A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of camera technology, and specifically relates to a frame synchronization method, device and equipment. Background Art
[0002] With the development of electronic devices and camera technology, multiple cameras are installed in electronic devices. Multiple cameras can achieve long-distance shooting, wide-angle shooting, provide clear shooting effects in dark environments, and improve picture details and colors.
[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 the cameras can be switched smoothly when switching.
[0004] In the related art, frame synchronization is performed by adopting a frame header synchronization method or a frame mid-synchronization method. However, the frame header synchronization method has a fast synchronization speed, simple calculation, and low required computing resources. However, as the difference in exposure time of the camera's image sensor increases, the difference in images collected by each camera becomes larger. Although the frame mid-synchronization method can reduce the difference in images collected by each camera, it will occupy more computing resources and the synchronization speed is slower. Summary of the invention
[0005] The purpose of the embodiments of the present 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, an embodiment of the present application provides a frame synchronization method, including:
[0007] During the shooting process, a first parameter for determining a target frame synchronization mode is obtained, wherein the first parameter includes at least one of the following: a shooting mode of the electronic device, an exposure mode of the camera, and a moving speed of the shooting object, and the electronic device includes a first camera and a second camera;
[0008] Determine a target frame synchronization mode of the first camera and the second camera according to the first parameter;
[0009] Frame synchronization is performed using the target frame synchronization method.
[0010] In a second aspect, an embodiment of the present application provides a frame synchronization device, including:
[0011] An acquisition module is used to acquire a first parameter for determining a target frame synchronization mode during shooting, wherein the first parameter includes at least one of the following: a shooting mode of the electronic device, an exposure mode of the camera, and a moving speed of the shooting object, and the electronic device includes a first camera and a second camera;
[0012] A first determination module, configured to determine a target frame synchronization mode of the plurality of first cameras and the second camera according to a first parameter;
[0013] The synchronization module is used for performing frame synchronization using a target frame synchronization method.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising multiple cameras, a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the frame synchronization method provided in the embodiment of the present application are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the frame synchronization method provided in the embodiment of the present application are implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the frame synchronization method provided in the embodiment of the present application.
[0017] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the frame synchronization method provided in the embodiment of the present application.
[0018] In an embodiment of the present application, during the shooting process, a first parameter for determining a target frame synchronization method is obtained, 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 shooting object, and the electronic device includes a first camera and a second camera; according to the first parameter, the target frame synchronization method of the first camera and the second camera is determined; and frame synchronization is performed using the target frame synchronization method. In this way, a reasonable frame synchronization method can be used for frame synchronization, taking into account the synchronization speed and the occupation of computing resources, and the advantages of various frame synchronization methods can be fully utilized to ensure that a smooth camera switching experience is provided to the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flowchart of a frame synchronization method provided by some embodiments of the present application;
[0020] Figure 2 is a schematic diagram of a frame synchronization process provided by some embodiments of the present application;
[0021] Figure 3 is a structural diagram of a frame synchronization device provided in some embodiments of the present application;
[0022] Figure 4 is a schematic diagram of the structure of an electronic device provided by some embodiments of the present application;
[0023] Figure 5 It is a schematic diagram of the hardware structure of an electronic device implementing some embodiments of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0025] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0026] The frame synchronization method, apparatus and device provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0027] The frame synchronization method and device provided in the embodiment of the present application can be applied to an electronic device including a first camera and a second camera. The first camera in the embodiment of the present application can be a camera corresponding to the preview image, and the second camera can be one camera or multiple cameras.
[0028] Figure 1 : is a flow chart of a frame synchronization method provided in an embodiment of the present application. The frame synchronization method may include:
[0029] Step 101: During the shooting process, a first parameter for determining a target frame synchronization mode is obtained, wherein the first parameter includes at least one of the following: a shooting mode of the electronic device, an exposure mode of the camera, and a moving speed of the shooting object;
[0030] Step 102: Determine a target frame synchronization mode of the first camera and the second camera according to the first parameter;
[0031] Step 103: Perform frame synchronization using the target frame synchronization method.
[0032] The specific implementation of the above steps will be described in detail below.
[0033] In an embodiment of the present application, during the shooting process, a first parameter for determining a target frame synchronization method is obtained, 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 shooting object, and the electronic device includes a first camera and a second camera; according to the first parameter, the target frame synchronization method of the first camera and the second camera is determined; and frame synchronization is performed using the target frame synchronization method. In this way, a reasonable frame synchronization method can be used for frame synchronization, taking into account the synchronization speed and the occupation of computing resources, and the advantages of various frame synchronization methods can be fully utilized to ensure that a smooth camera switching experience is provided to the user.
[0034] In some possible implementations of the embodiments of the present application, the shooting modes in the embodiments of the present application include but are not limited to: professional mode, document mode, photo mode, portrait mode, night scene mode, panoramic mode, etc.
[0035] The exposure modes in the embodiments of the present application include but are not limited to a single exposure mode and a double exposure mode, wherein the single exposure mode refers to exposing one frame of image at a time, and the double exposure mode refers to exposing at least two frames of image at a time.
[0036] In some possible implementations of the embodiments of the present application, the moving speed of the photographed object may be determined by an optical flow method or a gyroscope. The larger the optical flow value calculated by the optical flow method, the faster the moving speed of the photographed object, and the smaller the optical flow value, the slower the moving speed of the photographed object; the larger the camera shaking frequency detected by the gyroscope, the faster the moving speed of the photographed object, and the smaller the shaking frequency, the slower the moving speed of the photographed object.
[0037] In some possible implementations of the embodiments of the present application, a correspondence between the optical flow value and the motion speed or a correspondence between the jitter frequency and the 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 is determined based on the pre-established correspondence.
[0038] In some possible implementations of the embodiments of the present application, step 102 may include: when the shooting mode is a 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 the other shooting modes are shooting modes other than the first shooting mode.
[0039] In some possible implementations of the embodiments of the present application, a shooting mode that must use the in-frame synchronization method can be pre-screened from multiple shooting modes. It can be understood that the shooting mode that must use the in-frame synchronization method is the first shooting mode with a higher synchronization requirement than other shooting modes. Exemplarily, the portrait mode requires extremely high synchronization requirements for blurring operations, and the shooting mode that must use the in-frame synchronization method screened out from multiple shooting modes is the portrait mode. When the shooting mode of the electronic device is the portrait mode, the in-frame synchronization method is determined as the target frame synchronization method.
[0040] In some possible implementations of the embodiments of the present 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 the dual exposure mode, determining the frame header synchronization mode as the target frame synchronization mode, wherein the 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; 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 movement speed is greater than or equal to a first threshold, determining the mid-frame synchronization mode as the target frame synchronization 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 movement speed is less than the first threshold, determining the frame header synchronization mode as the target frame synchronization mode.
[0041] In some possible implementations of the embodiments of the present application, the first threshold value can be set according to actual needs or calibrated in advance through experiments.
[0042] In some possible implementations of the embodiments of the present application, when the exposure mode of the camera is the double exposure mode, since the double exposure mode will expose at least two frames of images at a time, if the mid-frame synchronization mode is selected, it is difficult to decide which frame to select as a reference for frame alignment during frame synchronization, which may cause frame synchronization failure. Therefore, when the exposure mode of the camera is the double exposure mode, the frame header synchronization mode is determined as the target frame synchronization mode.
[0043] Exemplarily, it is assumed that the first shooting mode is a portrait mode.
[0044] When the shooting mode is the night scene mode and the exposure mode of the first camera is the double exposure mode, the frame header synchronization mode is determined as the target frame synchronization mode.
[0045] When the shooting mode is the night scene mode and the exposure mode of the second camera is the double exposure mode, the frame header synchronization mode is determined as the target frame synchronization mode.
[0046] When the shooting mode is the night scene 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 mode is determined as the target frame synchronization mode.
[0047] When the shooting mode is the night scene 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 mode is determined as the target frame synchronization mode.
[0048] In some possible implementations of the embodiments of the present application, before step 102, the frame synchronization method provided by the embodiments of the present application may further include: determining whether a frame synchronization condition is met according to a zoom state of the first camera, a first exposure duration of the first camera, and a second exposure duration of the second camera;
[0049] The frame synchronization condition includes one of the following:
[0050] The zoom state is a zooming state, and the exposure ratio is greater than or equal to a second threshold, wherein the exposure ratio is a ratio of a third exposure duration to a fourth exposure duration, the third exposure duration is a minimum value between the first exposure duration and the second exposure duration, and the fourth exposure duration is a maximum value between the first exposure duration and the second exposure duration;
[0051] The zoom state is zooming, 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 a zooming state, the exposure ratio is less than a second threshold, the first exposure time is less than the second exposure time, and the zoom urgency is less than a third threshold, wherein the zoom urgency is determined based on the two most recent zoom magnifications of the first camera, the first basic magnification of the first camera, and the second basic magnification of the second camera.
[0053] In some possible implementations of the embodiments of the present application, not satisfying the frame synchronization condition includes one of the following:
[0054] The zoom state is not zooming;
[0055] The zoom state is a zooming state, the exposure ratio is less than a second threshold, the first exposure duration is less than the second exposure duration, but the zoom urgency is greater than or equal to a third threshold.
[0056] In some possible implementations of the embodiments of the present application, the zoom state in the embodiments of the present application may include a zooming state and an unzoomed state, and the unzoomed state is not a zooming state. The various thresholds in the embodiments of the present application can be set according to actual needs. When the zoom state is the unzoomed state, it means that only the image captured by the first camera needs to be displayed, and frame synchronization may not be performed at this time; when the zoom state is the zooming state, it means that there may be a subsequent camera switching operation, and frame synchronization is required at this time.
[0057] In some possible implementations of the embodiments of the present application, the greater the exposure ratio, the closer the exposure duration of the first camera is to the exposure duration of the second camera. When the frame rate of the first camera differs greatly from the frame rate of the second camera, if the exposure ratio is large, it means that the large frame rate difference is caused by the exposure duration of the first camera and the exposure duration of the second camera; when the frame rate difference is large, if the exposure ratio is small, it means that the large frame rate difference is caused by reducing the power consumption of the second camera in order to save power consumption.
[0058] In some possible implementations of the embodiments of the present application, the exposure ratio may be determined by the following formula (1):
[0059]
[0060] Wherein, in formula (1), Re is the exposure ratio, E1 is the first exposure time, E2 is the second exposure time, min(E1, E2) is the third exposure time, and max(E1, E2) is the fourth exposure time.
[0061] In some possible implementations of the embodiments of the present application, the frame synchronization method provided by the embodiments of the present application may also 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 of two most recent zoom ratios, and the second zoom ratio is the former zoom ratio of 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.
[0062] In some possible implementations of the embodiments of the present application, the zoom urgency may be determined by the following formula (2):
[0063]
[0064] In formula (2), D1 is the zoom urgency, Z0 is the latter zoom magnification of the two most recent zoom magnifications, Z1 is the former zoom magnification of the two most recent zoom magnifications, and X2 is the second basic magnification.
[0065] In some possible implementations of the embodiments of the present application, before step 103, the frame synchronization method provided by the embodiments of the present application may also include: when the first frame rate of the first camera is greater than the second frame rate of the second camera, increasing the frame rate of the second camera; when the first frame rate is less than the second frame rate, reducing the frame rate of the second camera.
[0066] In the embodiment of the present application, before frame synchronization, by adjusting the frame rate of the second camera, smooth switching of the camera can be ensured.
[0067] In some possible implementations of the embodiments of the present application, the second camera includes multiple cameras; the frame synchronization method provided by the embodiments of the present application may also include: determining a third basic magnification from multiple basic magnifications corresponding to the multiple cameras, wherein, when a first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third basic magnification is a basic magnification among the multiple basic magnifications that is greater than the first basic magnification and has the smallest difference with the first basic magnification; when the first difference is less than zero, the third basic magnification is a basic magnification among the multiple basic magnifications that is less than the first basic magnification and has the largest difference with the first basic magnification; the first zoom magnification is the latter zoom magnification of the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification of the two most recent zoom magnifications; calculating a third difference between the first zoom magnification and the third basic 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.
[0068] In some possible implementations of the embodiments of the present application, the zoom urgency may be determined by the following formula (3):
[0069]
[0070] In formula (3), D2 is the zoom urgency, Z0 is the latter zoom magnification of the two most recent zoom magnifications, Z1 is the former zoom magnification of the two most recent zoom magnifications, and Xi is the third basic magnification.
[0071] Assume that the second camera includes n cameras, and the basic magnifications of the n cameras are X1, X2, ..., Xn respectively. When Z0-Z1 is greater than zero, it means that the user is zooming in. At this time, a basic magnification greater than the basic magnification of the first camera and having the smallest difference with the basic magnification of the first camera is selected from the n basic magnifications as the third basic magnification; when Z0-Z1 is less than zero, it means that the user is zooming out. At this time, a basic magnification less than the basic magnification of the first camera and having the largest difference with the basic magnification of the first camera is selected from the n basic magnifications as the third basic magnification.
[0072] Exemplarily, it is assumed that the second camera includes 4 cameras, and the basic magnifications of the 4 cameras are 2, 8, 5, and 7 respectively. The basic magnification of the first camera is 6. When Z0-Z1 is greater than zero, 7 is selected as the third basic magnification, and when Z0-Z1 is less than zero, 5 is selected as the third basic magnification.
[0073] In some possible implementations of the embodiments of the present application, step 103 may include: using a target frame synchronization method to perform frame synchronization on the first camera and a camera corresponding to the third basic magnification.
[0074] Exemplarily, the second camera includes 4 cameras, and the basic magnifications of the 4 cameras are respectively 2, 8, 5, and 7. When 5 is used as the third basic magnification, the first camera is frame synchronized with the camera with the basic magnification of 5 by using the target frame synchronization method.
[0075] Figure 2 1 is a schematic diagram of a frame synchronization process provided by some embodiments of the present application. The frame synchronization process includes the following steps:
[0076] Step 201: determining whether the shooting mode of the electronic device is the first shooting mode, 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. If yes, executing step 202; if no, executing step 203;
[0077] Step 202: determine the frame synchronization mode as the target frame synchronization mode, and continue to execute step 211;
[0078] Step 203: Determine whether the zoom state of the first camera is in the zooming state, if yes, execute step 204, if no, end;
[0079] Step 204: Determine whether the exposure ratio is greater than or equal to a second threshold, wherein the exposure ratio is a ratio of the third exposure duration to the fourth exposure duration, the third exposure duration is the minimum value of the first exposure duration and the second exposure duration, and the fourth exposure duration is the maximum value of the first exposure duration and the second exposure duration. If yes, execute step 208; if no, execute 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, execute step 206, if yes, execute step 208;
[0081] Step 206: Determine the zoom urgency according to the two most recent zoom magnifications of the first camera, the first basic magnification of the first camera, and the second basic magnification of the second camera;
[0082] Step 207: Determine whether the zoom urgency is less than or equal to a third threshold, if yes, execute step 208, if no, end;
[0083] Step 208: Determine whether there is a double exposure mode in the exposure modes of the first camera and the second camera, if yes, execute step 209, if no, execute step 210;
[0084] Step 209: determine the frame header synchronization mode as the target frame synchronization mode, and continue to execute step 211;
[0085] Step 210: Determine whether the moving speed of the photographed object is greater than or equal to a first threshold, if yes, execute step 202, if no, execute step 209;
[0086] Step 211: Perform frame synchronization using the target frame synchronization method.
[0087] The frame synchronization method provided in the embodiment of the present application can be executed by a frame synchronization device. In the embodiment of the present application, the frame synchronization device provided in the embodiment of the present application is described by taking the frame synchronization method executed by the frame synchronization device as an example.
[0088] Figure 3 300 is a schematic diagram of the structure of a frame synchronization device provided in an embodiment of the present application. The frame synchronization device 300 may include:
[0089] The acquisition module 301 is used to acquire a first parameter for determining a target frame synchronization mode during shooting, wherein the first parameter includes at least one of the following: a shooting mode of the electronic device, an exposure mode of the camera, and a moving speed of the shooting object, and the electronic device includes a first camera and a second camera;
[0090] A first determination module 302 is used to determine a target frame synchronization mode of the first camera and the second camera according to a first parameter;
[0091] The synchronization module 303 is used to perform frame synchronization using a target frame synchronization method.
[0092] In an embodiment of the present application, during the shooting process, a first parameter for determining a target frame synchronization method is obtained, 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 shooting object, and the electronic device includes a first camera and a second camera; according to the first parameter, the target frame synchronization method of the first camera and the second camera is determined; and frame synchronization is performed using the target frame synchronization method. In this way, a reasonable frame synchronization method can be used for frame synchronization, taking into account the synchronization speed and the occupation of computing resources, and the advantages of various frame synchronization methods can be fully utilized to ensure that a smooth camera switching experience is provided to the user.
[0093] In some possible implementations of the embodiment of the present application, the first determining module 302 is specifically configured to:
[0094] When the shooting mode is a 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.
[0095] In some possible implementations of the embodiment of the present application, the first determining module 302 is specifically configured to:
[0096] When the shooting mode is not the first shooting mode and the exposure mode of the first camera or the second camera is the dual exposure mode, determining the frame header synchronization mode as the target frame synchronization mode, 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;
[0097] 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 the first threshold, determining the frame synchronization mode as the target frame synchronization mode;
[0098] 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, the frame header synchronization mode is determined as the target frame synchronization mode.
[0099] In some possible implementations of the embodiment of the present application, the first camera is a camera corresponding to the preview image; the frame synchronization device 300 provided in the embodiment of the present application further includes:
[0100] A second determination module is used to determine whether a frame synchronization condition is met according to a zoom state of the first camera, a first exposure time of the first camera, and a second exposure time of the second camera;
[0101] The frame synchronization condition includes one of the following:
[0102] The zoom state is a zooming state, and the exposure ratio is greater than or equal to a second threshold, wherein the exposure ratio is a ratio of a third exposure duration to a fourth exposure duration, the third exposure duration is a minimum value between the first exposure duration and the second exposure duration, and the fourth exposure duration is a maximum value between the first exposure duration and the second exposure duration;
[0103] The zoom state is zooming, 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 in the zooming state, the exposure ratio is less than the second threshold, the first exposure time is less than the second exposure time, and the zoom urgency is less than or equal to the third threshold, wherein the second zoom urgency is determined based on the two most recent zoom magnifications of the first camera, the first basic magnification of the first camera, and the second basic magnification of the second camera.
[0105] In some possible implementations of the embodiments of the present application, not satisfying the frame synchronization condition includes one of the following:
[0106] The zoom state is not zooming;
[0107] The zoom state is a zooming state, the exposure ratio is less than a second threshold, the first exposure duration is less than the second exposure duration, but the zoom urgency is greater than or equal to a third threshold.
[0108] In some possible implementations of the embodiment of the present application, the frame synchronization device 300 provided in the embodiment of the present application further includes:
[0109] A first calculation module, configured to calculate a first difference between a first zoom ratio and a second zoom ratio, wherein the first zoom ratio is a later zoom ratio of two most recent zoom ratios, and the second zoom ratio is a previous zoom ratio of the two most recent zoom ratios;
[0110] A second calculation module, used for calculating a second difference between the first zoom magnification and the second basic magnification;
[0111] The third determining module is used to determine the ratio of the absolute value of the second difference to the absolute value of the first difference as the zoom urgency.
[0112] In some possible implementations of the embodiment of the present application, the frame synchronization device 300 provided in the embodiment of the present 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 reduce the frame rate of the second camera when the first frame rate is less than the second frame rate.
[0114] In the embodiment of the present application, before frame synchronization, by adjusting the frame rate of the second camera, smooth switching of the camera can be ensured.
[0115] In some possible implementations of the embodiment of the present application, the second camera includes multiple cameras, and the frame synchronization device 300 provided in the embodiment of the present application further includes:
[0116] a fourth determination module, configured to determine a third basic magnification from a plurality of basic magnifications corresponding to a plurality of cameras, wherein, when a first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third basic magnification is a basic magnification greater than the first basic magnification and having the smallest difference with the first basic magnification among the plurality of basic magnifications; when the first difference is less than zero, the third basic magnification is a basic magnification less than the first basic magnification and having the largest difference with the first basic magnification among the plurality of basic magnifications; the first zoom magnification is the latter zoom magnification of the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification of the two most recent zoom magnifications;
[0117] A third calculation module, used for calculating a third difference between the first zoom magnification and the third basic magnification;
[0118] The fifth determining module is used to determine the ratio of the absolute value of the third difference to the absolute value of the first difference as the zoom urgency.
[0119] In some possible implementations of the embodiments of the present application, the synchronization module 303 is specifically used to:
[0120] The first camera is synchronized with the camera corresponding to the third basic magnification by using the target frame synchronization method.
[0121] The frame synchronization device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0122] The frame synchronization device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0123] The frame synchronization device provided in the embodiment of the present application can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented in the frame synchronization method embodiment are not described here.
[0124] Alternatively, if Figure 4 As shown, an embodiment of the present application further provides an electronic device 400, including a processor 401, a memory 402, a first camera 403 and a second camera 404, and the memory 402 stores a program or instruction that can be executed on the processor 401. When the program or instruction is executed by the processor 401, the various steps of the frame synchronization method embodiment provided in the embodiment of the present application are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0125] Figure 5 It is a schematic diagram of the hardware structure of an electronic device implementing some embodiments of the present application.
[0126] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, and a processor 510.
[0127] Those skilled in the art will appreciate that the electronic device 500 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 510 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0128] In some possible implementations of the embodiments of the present application, the electronic device 500 may further include a first camera and a second camera.
[0129] Among them, the processor 510 is used to: during the shooting process, obtain a first parameter for determining a target frame synchronization method, wherein the first parameter includes at least one of the following: a shooting mode, an exposure mode of the camera, and a movement speed of the shooting object; used to 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 an embodiment of the present application, during the shooting process, a first parameter for determining a target frame synchronization method is obtained, 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 shooting object, and the electronic device includes a first camera and a second camera; according to the first parameter, the target frame synchronization method of the first camera and the second camera is determined; and frame synchronization is performed using the target frame synchronization method. In this way, a reasonable frame synchronization method can be used for frame synchronization, taking into account the synchronization speed and the occupation of computing resources, and the advantages of various frame synchronization methods can be fully utilized to ensure that a smooth camera switching experience is provided to the user.
[0131] In some possible implementations of the embodiments of the present application, the processor 510 is specifically configured to:
[0132] When the shooting mode is a 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.
[0133] In some possible implementations of the embodiments of the present application, the processor 510 is specifically configured to:
[0134] When the shooting mode is not the first shooting mode and the exposure mode of the first camera or the second camera is the dual exposure mode, determining the frame header synchronization mode as the target frame synchronization mode, 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;
[0135] 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 the first threshold, determining the frame synchronization mode as the target frame synchronization mode;
[0136] 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, the frame header synchronization mode is determined as the target frame synchronization mode.
[0137] In some possible implementations of the embodiments of the present application, the first camera is a camera corresponding to the preview image; the processor 510 is further used to: determine whether the frame synchronization condition is met according to the zoom state of the first camera, the first exposure time of the first camera, and the second exposure time of the second camera;
[0138] The frame synchronization condition includes one of the following:
[0139] The zoom state is a zooming state, and the exposure ratio is greater than or equal to a second threshold, wherein the exposure ratio is a ratio of a third exposure duration to a fourth exposure duration, the third exposure duration is a minimum value between the first exposure duration and the second exposure duration, and the fourth exposure duration is a maximum value between the first exposure duration and the second exposure duration;
[0140] The zoom state is zooming, 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 a zooming state, the exposure ratio is less than a second threshold, the first exposure time is less than the second exposure time, and the zoom urgency is less than or equal to a third threshold, wherein the zoom urgency is determined based on the two most recent zoom magnifications of the first camera, the first basic magnification of the first camera, and the second basic magnification of the second camera.
[0142] In some possible implementations of the embodiments of the present application, the processor 510 is further configured to:
[0143] Calculate a first difference between a first zoom ratio and a second zoom ratio, wherein the first zoom ratio is the latter zoom ratio of the two most recent zoom ratios and the second zoom ratio is the former zoom ratio of the two most recent zoom ratios; calculate a second difference between the first zoom ratio and a second base ratio of the second camera; and determine the ratio of the absolute value of the second difference to the absolute value of the first difference as the zoom urgency.
[0144] In some possible implementations of the embodiments of the present application, the processor 510 is further configured to:
[0145] When the first frame rate of the first camera is greater than the second frame rate of the second camera, the frame rate of the second camera is increased; when the first frame rate is less than the second frame rate, the frame rate of the second camera is reduced.
[0146] In the embodiment of the present application, before frame synchronization, by adjusting the frame rate of the second camera, smooth switching of the camera can be ensured.
[0147] In some possible implementations of the embodiment of the present application, the second camera includes a plurality of cameras, and the processor 510 is further configured to:
[0148] Determine a third basic magnification from a plurality of basic magnifications corresponding to a plurality of cameras, wherein, when a first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third basic magnification is a basic magnification greater than the first basic magnification and having the smallest difference with the first basic magnification among the plurality of basic magnifications; when the first difference is less than zero, the third basic magnification is a basic magnification less than the first basic magnification and having the largest difference with the first basic magnification among the plurality of basic magnifications; the first zoom magnification is the latter zoom magnification of the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification of the two most recent zoom magnifications;
[0149] calculating a third difference between the first zoom magnification and the third basic magnification;
[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.
[0151] In some possible implementations of the embodiments of the present application, the processor 510 is specifically configured to:
[0152] The first camera is synchronized with the camera corresponding to the third basic magnification by using the target frame synchronization method.
[0153] It should be understood that in the embodiment of the present application, the input unit 504 may include a graphics processor (GPU) 5041 and a microphone 5042, and the graphics processor 5041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 507 includes a touch panel 5071 and at least one of other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include two parts: a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0154] The memory 509 can be used to store software programs and various data. The memory 509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 509 may include a volatile memory or a non-volatile memory, or the memory 509 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 509 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0155] The processor 510 may include one or more processing units; optionally, the processor 510 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 510.
[0156] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the frame synchronization method embodiment provided in the embodiment of the present application are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0157] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, and examples of computer-readable storage media include non-transitory computer-readable media, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0158] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the frame synchronization method embodiment provided in the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0159] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0160] An embodiment of the present application also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the frame synchronization method embodiment provided in the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0161] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0162] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0163] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A frame synchronization method, characterized in that: The method comprises: During the shooting process, a first parameter for determining a target frame synchronization mode is obtained, wherein the first parameter includes at least one of the following: a shooting mode of the electronic device, an exposure mode of a camera, and a moving speed of a shooting object, and the electronic device includes a first camera and a second camera; Determining a target frame synchronization mode between the first camera and the second camera according to the first parameter; Frame synchronization is performed using the target frame synchronization method.
2. The method according to claim 1, characterized in that The step of determining a target frame synchronization mode between the first camera and the second camera according to the first parameter includes: When the shooting mode is a first shooting mode, a frame synchronization mode is determined as the target frame synchronization mode, 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 a target frame synchronization mode between the first camera and the second camera according to 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 the dual exposure mode, determining a frame header synchronization mode as the target frame synchronization mode, wherein the 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; 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 in-frame synchronization mode as the target frame synchronization 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 movement speed is less than the first threshold, the frame header synchronization mode is determined as the target frame synchronization mode.
4. The method according to claim 1, characterized in that: The first camera is a camera corresponding to the preview image; before determining the target frame synchronization mode of the first camera and the second camera according to the first parameter, the method further includes: Determining whether a frame synchronization condition is met according to a zoom state of the first camera, a first exposure time of the first camera, and a second exposure time of the second camera; The frame synchronization condition includes one of the following: The zoom state is a zooming state, and the exposure ratio is greater than or equal to a second threshold, wherein the exposure ratio is a ratio of a third exposure duration to a fourth exposure duration, the third exposure duration is a minimum value between the first exposure duration and the second exposure duration, and the fourth exposure duration is a maximum value between the first exposure duration and the second exposure duration; The zoom state is a zooming 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 a zooming state, the exposure ratio is less than the second threshold, the first exposure duration is less than the second exposure duration, and the zoom urgency is less than a third threshold, wherein the zoom urgency is determined based on the two most recent zoom magnifications of the first camera, the first basic magnification of the first camera, and the second basic magnification of the second camera.
5. The method according to claim 4, characterized in that Failure to meet the frame synchronization condition includes one of the following: The zoom state is not a zooming state; The zoom state is a zooming state, the exposure ratio is less than the second threshold, the first exposure duration is less than the second exposure duration, but the zoom urgency is greater than or equal to the third threshold.
6. The method according to claim 4, characterized in that The method further comprises: Calculating a first difference between a first zoom ratio and a second zoom ratio, wherein the first zoom ratio is a later zoom ratio of the two most recent zoom ratios, and the second zoom ratio is a previous zoom ratio of the two most recent zoom ratios; Calculating a second difference between the first zoom magnification and the second basic magnification; A ratio of an absolute value of the second difference to an absolute value of the first difference is determined as the zoom urgency.
7. The method according to claim 6, characterized in that Before performing frame synchronization using the target frame synchronization mode, the method further includes: When a first frame rate of the first camera is greater than a second frame rate of the second camera, increasing the frame rate of the second camera; When the first frame rate is lower than the second frame rate, the frame rate of the second camera is reduced.
8. The method according to claim 4, characterized in that The second camera includes a plurality of cameras, and the method further includes: Determine a third basic magnification from a plurality of basic magnifications corresponding to the plurality of cameras, wherein, when a first difference between the first zoom magnification and the second zoom magnification is greater than zero, the third basic magnification is a basic magnification greater than the first basic magnification and having the smallest difference with the first basic magnification among the plurality of basic magnifications; when the first difference is less than zero, the third basic magnification is a basic magnification less than the first basic magnification and having the largest difference with the first basic magnification among the plurality of basic magnifications; the first zoom magnification is the latter zoom magnification of the two most recent zoom magnifications, and the second zoom magnification is the former zoom magnification of the two most recent zoom magnifications; calculating a third difference between the first zoom magnification and the third basic magnification; A ratio of an absolute value of the third difference to an absolute value of the first difference is determined as the zoom urgency.
9. The method according to claim 8, characterized in that The using the target frame synchronization mode to perform frame synchronization includes: The target frame synchronization method is used to perform frame synchronization on the first camera and the camera corresponding to the third basic magnification.
10. A frame synchronization device, characterized in that: The device comprises: An acquisition module is used to acquire a first parameter for determining a target frame synchronization mode during shooting, wherein the first parameter includes at least one of the following: a shooting mode of the electronic device, an exposure mode of a camera, and a moving speed of a shooting object, and the electronic device includes a first camera and a second camera; A first determination module, configured to determine a target frame synchronization mode of the first camera and the second camera according to the first parameter; A 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, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the frame synchronization method as described in any one of claims 1-9 are implemented.
Citation Information
Patent Citations
Method for synchronizing frame head by transmission equipment and apparatus thereof
CN101500183A
Multi-camera synchronous working method and device, medium and electronic equipment
CN111182226A
Shooting frame rate control method, electronic equipment, chip system and readable storage medium
CN116347224A
Multi-camera fusion method and device, computer readable storage medium and equipment
CN118784969A
Frame synchronizer, optical communication device and frame synchronization method
JP2019213218A