Camera switching method and device and electronic equipment
By using the application layer and the communication modules on the bottom layer in the Android camera system to determine the second camera in advance, and directly switch the camera when the magnification conversion input is completed, the lag caused by multi-camera switching is solved, and the picture fluency is improved.
Patent Information
- Application Number
- CN202411840790.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-25
AI Technical Summary
In Android camera systems, multiple cameras are likely to cause lag when switching, especially when zoom switching and magnification changes, frame rate limit and exposure time adjustment lead to discontinuity of the picture, jump and lag.
The application layer receives the magnification conversion input, and uses the communication module to determine the second camera at the bottom layer in advance, reduces the switching waiting time, and directly switches the camera when the magnification conversion input is completed, avoiding discontinuous changes in frame rate and exposure time.
It effectively reduces the camera switching time, reduces the risk of lag, improves the smoothness of the picture, and achieves a smooth transition of magnification changes through function fitting model and exposure time adjustment.
Smart Images

Figure CN119697488A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to a camera switching method, device and electronic equipment. Background Art
[0002] At present, the camera of mobile phones is no longer just a simple single-camera photo function, but uses multiple cameras to cover different focal lengths to improve the image quality of different focal lengths. The current Android camera system supports switching between different cameras at will when using multiple cameras, and there are many situations that cause switching to be stuck. For example: when switching cameras with zoom, it takes several frames to open the camera, and there is no new picture during this period, which will cause stuck; when the camera user interface (UI) magnification changes due to zoom, due to frame rate restrictions, the magnification value can only be changed at fixed time intervals, resulting in discontinuous magnification values. When applied to zooming in or out of the picture, there will be jumps, causing stuck. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a camera switching method, device and electronic device, which can solve the problem of lag caused by switching between different cameras.
[0004] In a first aspect, an embodiment of the present application provides a camera switching method, comprising:
[0005] Shooting through a first camera corresponding to a first magnification;
[0006] Receiving, through the application layer, a magnification conversion input for converting from the first magnification to a second magnification, transmitting, through a communication module, magnification conversion information corresponding to the magnification conversion input from the application layer to the bottom layer, and determining, through the bottom layer, a second camera corresponding to the second magnification;
[0007] When the magnification conversion input is completed, the first camera is switched to the second camera for shooting through the bottom layer.
[0008] In a second aspect, an embodiment of the present application provides a camera switching device, comprising:
[0009] A shooting module, used for shooting through a first camera corresponding to a first magnification;
[0010] a processing module, configured to receive a magnification conversion input for converting the first magnification into a second magnification through an application layer, transmit magnification conversion information corresponding to the magnification conversion input from the application layer to a bottom layer through a communication module, and determine a second camera corresponding to the second magnification through the bottom layer;
[0011] A switching module is used to switch the first camera to the second camera for shooting through the bottom layer when the magnification conversion input is completed.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0014] In a fifth aspect, an embodiment of the present application provides a chip, comprising 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 method described in the first aspect.
[0015] 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 method described in the first aspect.
[0016] In the embodiment of the present application, the first camera and the second camera are two cameras with different magnifications. First, the first camera corresponding to the first magnification is used for shooting. If the application layer receives the magnification conversion input from the user to change from the first magnification to the second magnification, the magnification conversion information corresponding to the magnification conversion input is transmitted from the application layer to the bottom layer through the communication module, so that the second camera corresponding to the second magnification is determined in advance by the bottom layer, and there is no need to wait for a period of time to determine the second camera of the second magnification, thereby reducing the camera switching time. In addition, when the magnification conversion input is completed, the first camera is switched to the second camera for shooting. Since the second camera is determined in advance, it can be directly switched from the first camera to the second camera, which reduces the time for the zoom switching camera to wait for the frame, thereby reducing the risk of jamming and further improving the smoothness of the picture. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of a camera switching method provided in an embodiment of the present application;
[0018] Figure 2 is a schematic diagram of the position of the target object and the magnification conversion control provided in an embodiment of the present application;
[0019] Figure 3 is a comparison diagram of the process of determining the second camera in the prior art provided by the embodiment of the present application and the present application;
[0020] Figure 4 It is a schematic diagram of the change of the magnification of the prior art provided in the embodiment of the present application and a fitting curve diagram of the magnification value according to the function fitting model;
[0021] Figure 5 This is one of the schematic diagrams of exposure time changes during camera switching provided in an embodiment of the present application;
[0022] Figure 6 This is the second schematic diagram of exposure time change during camera switching provided in an embodiment of the present application;
[0023] Figure 7 This is the third schematic diagram of exposure time change during camera switching provided in an embodiment of the present application;
[0024] Figure 8 is a structural schematic diagram of a camera switching device provided in an embodiment of the present application;
[0025] Fig. 9 is a structural block diagram of an electronic device provided in an embodiment of the present application;
[0026] Fig.10 It is a structural block diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] 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.
[0028] 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.
[0029] The camera switching method provided in the embodiment of the present application is described below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0030] like Figure 1As shown, an embodiment of the present application provides a camera switching method, which can be applied to an electronic device, where a plurality of cameras are arranged on the electronic device. The camera switching method can specifically include the following steps:
[0031] Step 101: photographing using a first camera corresponding to a first magnification.
[0032] Currently, the electronic device is shooting through a first camera, and the magnification corresponding to the first camera is a first magnification (for example, 1.0x magnification).
[0033] Step 102, receiving a magnification conversion input from the first magnification to a second magnification through the application layer, transmitting magnification conversion information corresponding to the magnification conversion input from the application layer to the bottom layer through the communication module, and determining a second camera corresponding to the second magnification through the bottom layer.
[0034] In order to solve the problem of time difference, a communication module is established. The application layer and the bottom layer transmit information through the communication module. The specific implementation process is as follows:
[0035] The electronic device takes pictures via the first camera. When the application layer receives the user's magnification change input from the first magnification to the second magnification, the camera application layer sends the magnification change information corresponding to the magnification change input (such as: the first magnification, the first camera corresponding to the first magnification, the second magnification, the second camera corresponding to the second magnification, etc.) to the bottom layer through the communication module. As a result, the bottom layer can determine in advance that the second camera corresponding to the second magnification (for example: 3.0x magnification) will not be turned on, so as to reduce the waiting time for determining the second camera.
[0036] Furthermore, the ratio conversion input in step 102 includes but is not limited to one of the following:
[0037] The first item: The target object is in contact with the magnification conversion control of the current display interface;
[0038] Second item: the target object moves in a direction close to the current display interface, and the target object is closest to a magnification conversion control among multiple controls on the current display interface.
[0039] Specifically, in the first item, the target object may be the user's finger, and a magnification conversion control (e.g., a 3.0x magnification control) is displayed on the current display interface of the electronic device. There is a certain time difference (e.g., 100ms) from the time when the user's finger touches the magnification conversion control to the time when the user's finger moves away from the magnification conversion control. Figure 2As shown, during the time difference, the camera application layer sends the first magnification to the bottom layer through the middle layer. When the user's finger moves away from the magnification change control, the camera application layer will send the second magnification to the bottom layer through the middle layer. After the bottom layer receives the second magnification information, it will determine the second camera corresponding to the second magnification. Therefore, after receiving the magnification change input, the electronic device needs to wait for a while to determine the second camera of the second magnification.
[0040] The magnification conversion input in the embodiment of the present application refers to the user's finger touching the magnification conversion control, and the user's finger touching the magnification conversion control triggers the magnification conversion input. When the user's finger touches the magnification conversion control, the magnification conversion information corresponding to the magnification conversion input is immediately transmitted from the application layer to the bottom layer through the communication module in advance, and the second camera is determined in advance by the bottom layer, which can reduce the waiting time for determining the second camera.
[0041] The following is a specific example to illustrate the process of determining the second camera in the prior art and the present application:
[0042] For example: Figure 3 As shown, the first magnification is 1.0x, and the second magnification is 3.0x. Before shooting the 99th frame, the user's finger touches the magnification conversion control, and the camera application layer sends the 1.0x magnification of the 99th frame to the bottom layer through the middle layer, and the camera application layer sends the 1.0x magnification of the 100th frame to the bottom layer through the middle layer; when shooting the 101st frame, the user's finger moves away from the magnification conversion control, and the camera application layer sends the 3.0x magnification of the 101st frame to the bottom layer through the middle layer, and there is a delay of 100ms from the 99th frame to the 101st frame.
[0043] like Figure 3 As shown, the first magnification is 1.0x, and the second magnification is 3.0x. Before shooting the 99th frame, the user's finger touches the magnification change control, and the camera application layer directly sends the magnification change information (i.e., 3.0x magnification of the 99th frame, etc.) to the bottom layer through the communication module, so that the bottom layer can know the magnification data of the 99th frame in advance, thereby determining the second camera in advance without time difference.
[0044] In the second item, the target object may be the user's finger, and a magnification change control is displayed on the current display interface of the electronic device. The electronic device may detect the distance between the user's finger and the current display interface and the moving direction of the user's finger through sensors and the like. When the user's finger moves toward the current display interface, the distance between the user's finger and each of the multiple controls on the current display interface is calculated. If the closest control is a magnification change control, it means that the target control of the user's finger is the magnification change control. At this time, the camera application layer sends the magnification change information to the bottom layer in advance through the communication module, and the bottom layer can determine the second camera corresponding to the second magnification in advance to reduce the waiting time for determining the second camera.
[0045] Step 103, when the magnification conversion input is completed, the first camera is switched to the second camera for shooting through the bottom layer.
[0046] When the electronic device receives a magnification conversion input from the user to change from the first magnification to the second magnification, it determines in advance that the second camera corresponding to the second magnification is waiting to be opened. If the magnification conversion input is completed, the first camera is directly switched to the second camera without waiting time, which reduces the time for the zoom switching camera to wait for the frame, thereby reducing the risk of freeze and further improving the smoothness of the picture.
[0047] In the embodiment of the present application, the first camera and the second camera are two cameras with different magnifications. First, the first camera corresponding to the first magnification is used for shooting. If the application layer receives the magnification conversion input from the user to change from the first magnification to the second magnification, the magnification conversion information corresponding to the magnification conversion input is transmitted from the application layer to the bottom layer through the communication module, so that the second camera corresponding to the second magnification is determined in advance by the bottom layer, and there is no need to wait for a period of time to determine the second camera of the second magnification, thereby reducing the camera switching time. In addition, when the magnification conversion input is completed, the first camera is switched to the second camera for shooting. Since the second camera is determined in advance, it can be directly switched from the first camera to the second camera, which reduces the time for the zoom switching camera to wait for the frame, thereby reducing the risk of jamming and further improving the smoothness of the picture.
[0048] As an optional specific embodiment, in step 103, when the magnification conversion input is completed, before switching the first camera to the second camera for shooting through the bottom layer, the method further includes:
[0049] When the target object is away from the magnification conversion control, the application layer determines that the magnification conversion input is completed.
[0050] When the electronic device receives the magnification conversion input from the user to change from the first magnification to the second magnification, it determines in advance that the second camera corresponding to the second magnification is waiting to be opened. And the application layer determines whether the contact time between the target object and the magnification conversion control is less than the preset time. If the contact time between the target object and the magnification conversion control is less than the preset time, it can wait for the target object to move away from the magnification conversion control. When the target object moves away from the magnification conversion control, the application layer can determine that the magnification conversion input is completed. The application layer sends the information that the magnification conversion input is completed to the bottom layer through the communication module, so that the bottom layer knows that the magnification conversion input is completed.
[0051] The preset time is a time threshold used to determine whether the contact time between the target object and the magnification change control meets the magnification change condition, and can be set as needed.
[0052] As another optional specific embodiment, in step 103, when the magnification conversion input is completed, after the first camera is switched to the second camera for shooting through the bottom layer, the method further includes:
[0053] The bottom layer updates the function fitting model according to the first magnification, the second magnification and the brightness of the shooting environment, and determines the number of interpolated images between two adjacent frames of the second camera and the third magnification corresponding to each interpolated image;
[0054] The first magnification is converted into the second magnification through the bottom layer based on the number of interpolated frame images, the third magnification corresponding to each interpolated frame image, and the updated function fitting model.
[0055] After the bottom layer of the electronic device determines the second magnification, if the image is directly cropped, the image at the second magnification and the image at the first magnification will be greatly changed, so that the user feels that the image jumps. Figure 4 As shown in the figure above. Therefore, first obtain the current shooting environment brightness, and then adjust the function fitting model based on the current shooting environment brightness, the first magnification before the transformation, and the second magnification after the transformation, so that the fitting process of the function fitting model can be applicable to the current shooting environment and magnification change. And, based on the current shooting environment brightness, the first magnification before the transformation, and the second magnification after the transformation, determine the number of interpolated images between two adjacent frames of the second camera and the third magnification corresponding to each interpolated image. The number of interpolated images and the third magnification corresponding to each interpolated image can be known through the number of interpolated images that need to be inserted between two adjacent frames of images and the third magnification corresponding to each interpolated image, so that the function fitting can be better performed, thereby allowing the first magnification to be smoothly converted to the second magnification, such as Figure 4As shown in the figure below (the figure pointed by the arrow), this promotes smooth transition of the picture and thus improves fluency.
[0056] As another optional specific embodiment, in step 103, when the magnification conversion input is completed, after the first camera is switched to the second camera for shooting through the bottom layer, the method may further include:
[0057] Step 104, when the brightness of the shooting environment is less than a preset brightness, obtaining a first exposure time corresponding to the first camera and a second exposure time corresponding to the second camera;
[0058] Step 105: adjust the frame rate of the second camera according to the first exposure time and the second exposure time.
[0059] Specifically, if the brightness of the shooting environment is lower than the preset brightness, it means that the current shooting environment is in a dark environment, and the frame rate inconsistency of different cameras may occur easily. Even if the magnification value changes smoothly according to the function fitting model, there will still be a freeze due to the frame rate jump when the camera is switched by zoom. Therefore, it is necessary to obtain the first exposure time corresponding to the first camera and the second exposure time corresponding to the second camera, and adjust the frame rate based on the first exposure time and the second exposure time to maintain a stable frame rate, thereby improving the smoothness of the picture.
[0060] The process of adjusting the frame rate when the first exposure time is less than the second exposure time in step 105 is described below by using a specific embodiment:
[0061] Embodiment 1:
[0062] When the first exposure time is less than the second exposure time, the second exposure time of the second camera is updated to the first exposure time, and the frame rate of the second camera is adjusted by image signal processor gain (Image Signal Processor Gain, ISP Gain) and super-resolution algorithm.
[0063] Specifically, if the electronic device switches from a first camera with a short exposure time to a second camera with a long exposure time, the exposure time required by the second camera with a long exposure time can be dynamically reduced, thereby maintaining a stable frame rate when switching cameras, thereby improving the smoothness of the picture. In addition, the frame rate of the second camera is adjusted through the image signal processor gain ISPGain and the super-resolution algorithm to restore the image quality.
[0064] For example: Figure 5As shown in the figure, the first exposure time is 30ms and the second exposure time is 50ms. The exposure time corresponding to the 99th and 100th frames is 30ms, and the exposure time corresponding to the 101st and 102nd frames is 50ms. The exposure time corresponding to the 101st and 102nd frames is adjusted from 50ms to 30ms, so that the frame rate can be maintained stable when switching cameras, thereby improving the smoothness of the picture.
[0065] Embodiment 2:
[0066] When the first exposure time is less than the second exposure time, obtaining the number of interpolated images between two adjacent frames of images of the second camera;
[0067] Determine a third exposure time according to the number of interpolated images and the first exposure time, wherein the third exposure time is greater than the second exposure time and is a multiple of the first exposure time;
[0068] Updating the second exposure time of the second camera to the third exposure time;
[0069] Two adjacent frame images of the second camera are fused to obtain frame images of the number of interpolated frame images, and frame images of the number of interpolated frame images are inserted between the two adjacent frame images to adjust the frame rate of the second camera.
[0070] Specifically, if the electronic device switches from a first camera with a short exposure time to a second camera with a long exposure time, the number of interpolated images between two adjacent frames of the second camera can be obtained, and based on the number of interpolated images and the first exposure time, the third exposure time can be determined, and the second exposure time of the second camera can be updated to a multiple of the first exposure time (such as 1 times, 2 times, 3 times, etc.), and interpolated images with a corresponding number of interpolated images can be inserted between two adjacent frames, so that the exposure time between the two adjacent frames after interpolation is the first exposure time. In this way, the frame rate can be maintained stable when switching cameras, thereby improving the smoothness of the picture.
[0071] For example: Figure 6 As shown, the first exposure time is 30ms, the second exposure time is 50ms, and the number of interpolated images is 1, that is, an interpolated image needs to be inserted between two adjacent frames of the second camera. The exposure time corresponding to the 99th and 100th frames is 30ms, and the exposure time corresponding to the 101st and 102nd frames is 50ms. Since the number of interpolated images is 1, the second exposure time of 50ms needs to be updated to the third exposure time of 60ms, so that 60ms is a multiple of 30ms.
[0072] The 100th frame image and the 101th frame image are fused to obtain an interpolated frame image (e.g., named as the 100.5th frame image), so that the exposure time between the 100th frame image, the 100.5th frame image, and the 101st frame image is 30ms. The 101st frame image and the 102nd frame image are fused to obtain an interpolated frame image (e.g., named as the 101.5th frame image), so that the exposure time between the 101st frame image, the 101.5th frame image, and the 102nd frame image is 30ms. In this way, the frame rate can be kept stable when switching cameras, thereby improving the smoothness of the picture.
[0073] The process of adjusting the frame rate when the first exposure time is greater than the second exposure time in step 105 is described below by using a specific embodiment:
[0074] When the first exposure time is greater than the second exposure time, determining a time interval between two adjacent frames of images of the second camera, the time interval being the sum of the second exposure time and a waiting time, the waiting time being a time difference between the first exposure time and the second exposure time;
[0075] The frame rate of the second camera is adjusted according to the time interval between two adjacent frames of images of the second camera.
[0076] Specifically, if the electronic device switches from a first camera with a long exposure time to a second camera with a short exposure time, the camera with a short exposure time cannot directly extend the exposure time, which will cause irreparable loss of details. Therefore, while keeping the exposure time unchanged, the waiting time can be increased to ensure that the time interval between two adjacent frames is the same, thereby ensuring a stable frame rate.
[0077] For example: Figure 7 As shown, the first exposure time is 50ms, and the second exposure time is 30ms. The exposure time corresponding to the 101st frame image and the 102nd frame image is 50ms, and the exposure time corresponding to the 103rd frame image and the 104th frame image is 30ms. A waiting time of 20ms is added to the 30ms exposure time between the 102nd frame image and the 103rd frame image, and a waiting time of 20ms is added to the 30ms exposure time between the 103rd frame image and the 104th frame image. Therefore, the time interval between the 102nd frame image and the 103rd frame image is 50ms, and the time interval between the 103rd frame image and the 104th frame image is 50ms. In this way, the frame rate can be maintained stable when switching cameras, thereby improving the smoothness of the picture.
[0078] In summary, in the embodiment of the present application, the first camera and the second camera are cameras of two different magnifications. If a magnification conversion input is received from the user to change from the first magnification to the second magnification, the second camera corresponding to the second magnification is first determined in advance, and there is no need to wait for a period of time to determine the second camera of the second magnification, thereby reducing the camera switching time. In addition, when the magnification conversion input is completed, the first camera is switched to the second camera for shooting. Since the second camera is determined in advance, it can be directly switched from the first camera to the second camera, reducing the time for the zoom switching camera to wait for the frame, thereby reducing the risk of jamming and further improving the smoothness of the picture. In addition, the first magnification is smoothly changed to the second magnification according to the law of the function fitting model to promote smooth transition of the picture, thereby improving the smoothness of the picture. In addition, in a dark environment, the frame rate is adjusted by inserting a frame image or modifying the exposure time, or by increasing the waiting time between frame images with a short exposure time, so that the frame rate is maintained at a stable level, thereby promoting a stable frame rate and further improving the smoothness of the picture.
[0079] The camera switching method provided in the embodiment of the present application can be executed by a camera switching device. In the embodiment of the present application, the camera switching device executing the camera switching method is taken as an example to illustrate the camera switching device provided in the embodiment of the present application.
[0080] like Figure 8 As shown, the embodiment of the present application further provides a camera switching device 800, which specifically includes:
[0081] A shooting module 801, configured to shoot using a first camera corresponding to a first magnification;
[0082] The processing module 802 is used to receive a magnification conversion input from the first magnification to a second magnification through the application layer, transmit magnification conversion information corresponding to the magnification conversion input from the application layer to the bottom layer through the communication module, and determine a second camera corresponding to the second magnification through the bottom layer;
[0083] The switching module 803 is used to switch the first camera to the second camera for shooting through the bottom layer when the magnification conversion input is completed.
[0084] Optionally, the device further comprises:
[0085] An update determination module, configured to update the function fitting model through the bottom layer according to the first magnification, the second magnification and the brightness of the shooting environment, and determine the number of interpolated images between two adjacent frames of the second camera and the third magnification corresponding to each interpolated image;
[0086] A conversion module is used to convert the first magnification into the second magnification through the bottom layer based on the number of interpolated images, the third magnification corresponding to each interpolated image, and the updated function fitting model.
[0087] Optionally, the ratio conversion input includes one of the following:
[0088] The target object contacts the magnification conversion control of the current display interface;
[0089] The target object moves in a direction approaching the current display interface, and the target object is closest to a magnification conversion control among a plurality of controls on the current display interface.
[0090] Optionally, the device further comprises:
[0091] A determination module is used to determine, through the application layer, that the magnification conversion input is completed when the target object is far away from the magnification conversion control.
[0092] Optionally, the device further comprises:
[0093] an acquisition module, configured to acquire a first exposure time corresponding to the first camera and a second exposure time corresponding to the second camera when the brightness of the shooting environment is less than a preset brightness;
[0094] An adjustment module is used to adjust the frame rate of the second camera according to the first exposure time and the second exposure time.
[0095] Optionally, the adjustment module is specifically used to:
[0096] When the first exposure time is less than the second exposure time, the second exposure time of the second camera is updated to the first exposure time, and the frame rate of the second camera is adjusted by the image signal processor gain ISP Gain and the super-resolution algorithm.
[0097] Optionally, the adjustment module is specifically used to:
[0098] When the first exposure time is less than the second exposure time, obtaining the number of interpolated images between two adjacent frames of images of the second camera;
[0099] Determine a third exposure time according to the number of interpolated images and the first exposure time, wherein the third exposure time is greater than the second exposure time and is a multiple of the first exposure time;
[0100] Updating the second exposure time of the second camera to the third exposure time;
[0101] Two adjacent frame images of the second camera are fused to obtain frame images of the number of interpolated frame images, and frame images of the number of interpolated frame images are inserted between the two adjacent frame images to adjust the frame rate of the second camera.
[0102] Optionally, the adjustment module is specifically used to:
[0103] When the first exposure time is greater than the second exposure time, determining a time interval between two adjacent frames of images of the second camera, the time interval being the sum of the second exposure time and a waiting time, the waiting time being a time difference between the first exposure time and the second exposure time;
[0104] The frame rate of the second camera is adjusted according to the time interval between two adjacent frames of images of the second camera.
[0105] In summary, in the embodiment of the present application, the first camera and the second camera are cameras of two different magnifications. If a magnification conversion input is received from the user to change from the first magnification to the second magnification, the second camera corresponding to the second magnification is first determined in advance, and there is no need to wait for a period of time to determine the second camera of the second magnification, thereby reducing the camera switching time. In addition, when the magnification conversion input is completed, the first camera is switched to the second camera for shooting. Since the second camera is determined in advance, it can be directly switched from the first camera to the second camera, reducing the time for the zoom switching camera to wait for the frame, thereby reducing the risk of jamming and further improving the smoothness of the picture. In addition, the first magnification is smoothly changed to the second magnification according to the law of the function fitting model to promote smooth transition of the picture, thereby improving the smoothness of the picture. In addition, in a dark environment, the frame rate is adjusted by inserting a frame image or modifying the exposure time, or by increasing the waiting time between frame images with a short exposure time, so that the frame rate is maintained at a stable level, thereby promoting a stable frame rate and further improving the smoothness of the picture.
[0106] The camera switching 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 it can be 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. It 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.
[0107] The camera switching 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.
[0108] The camera switching device provided in the embodiment of the present application can achieve Figures 1 to 7 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0109] Alternatively, if Fig. 9 As shown, an embodiment of the present application further provides an electronic device 900, including a processor 901 and a memory 902, wherein the memory 902 stores a program or instruction that can be executed on the processor 901, and when the program or instruction is executed by the processor 901, each step of the above-mentioned camera switching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0110] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0111] Fig.10 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0112] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0113] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 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.
[0114] The processor 1010 is configured to shoot using a first camera corresponding to a first magnification;
[0115] Receiving, through the application layer, a magnification conversion input for converting from the first magnification to a second magnification, transmitting, through a communication module, magnification conversion information corresponding to the magnification conversion input from the application layer to the bottom layer, and determining, through the bottom layer, a second camera corresponding to the second magnification;
[0116] When the magnification conversion input is completed, the first camera is switched to the second camera for shooting through the bottom layer.
[0117] Optionally, when the magnification conversion input is completed, after the processor 1010 switches the first camera to the second camera for shooting through the bottom layer, it is further configured to:
[0118] The bottom layer updates the function fitting model according to the first magnification, the second magnification and the brightness of the shooting environment, and determines the number of interpolated images between two adjacent frames of the second camera and the third magnification corresponding to each interpolated image;
[0119] The first magnification is converted into the second magnification through the bottom layer based on the number of interpolated frame images, the third magnification corresponding to each interpolated frame image, and the updated function fitting model.
[0120] Optionally, the ratio conversion input includes one of the following:
[0121] The target object contacts the magnification conversion control of the current display interface;
[0122] The target object moves in a direction approaching the current display interface, and the target object is closest to a magnification conversion control among a plurality of controls on the current display interface.
[0123] Optionally, when the magnification conversion input is completed, before switching the first camera to the second camera for shooting through the bottom layer, the processor 1010 is further configured to:
[0124] When the target object is away from the magnification conversion control, the application layer determines that the magnification conversion input is completed.
[0125] Optionally, when the magnification conversion input is completed, after the processor 1010 switches the first camera to the second camera for shooting through the bottom layer, it is further configured to:
[0126] When the brightness of the shooting environment is less than a preset brightness, obtaining a first exposure time corresponding to the first camera and a second exposure time corresponding to the second camera;
[0127] Adjust the frame rate of the second camera according to the first exposure time and the second exposure time.
[0128] Optionally, when the processor 1010 adjusts the frame rate of the second camera according to the first exposure time and the second exposure time, it is specifically configured to:
[0129] When the first exposure time is less than the second exposure time, the second exposure time of the second camera is updated to the first exposure time, and the frame rate of the second camera is adjusted by the image signal processor gain ISP Gain and the super-resolution algorithm.
[0130] Optionally, when the processor 1010 adjusts the frame rate of the second camera according to the first exposure time and the second exposure time, it is specifically configured to:
[0131] When the first exposure time is less than the second exposure time, obtaining the number of interpolated images between two adjacent frames of images of the second camera;
[0132] Determine a third exposure time according to the number of interpolated images and the first exposure time, wherein the third exposure time is greater than the second exposure time and is a multiple of the first exposure time;
[0133] Updating the second exposure time of the second camera to the third exposure time;
[0134] Two adjacent frame images of the second camera are fused to obtain frame images of the number of interpolated frame images, and frame images of the number of interpolated frame images are inserted between the two adjacent frame images to adjust the frame rate of the second camera.
[0135] Optionally, when the processor 1010 adjusts the frame rate of the second camera according to the first exposure time and the second exposure time, it is specifically configured to:
[0136] When the first exposure time is greater than the second exposure time, determining a time interval between two adjacent frames of images of the second camera, the time interval being the sum of the second exposure time and a waiting time, the waiting time being a time difference between the first exposure time and the second exposure time;
[0137] The frame rate of the second camera is adjusted according to the time interval between two adjacent frames of images of the second camera.
[0138] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0139] The memory 1009 can be used to store software programs and various data. The memory 1009 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 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 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 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0140] The processor 1010 may include one or more processing units; optionally, the processor 1010 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 1010.
[0141] 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, each process of the above-mentioned camera switching method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0142] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0143] An embodiment of the present application further 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 above-mentioned camera switching method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0144] 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.
[0145] An embodiment of the present application 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 above-mentioned camera switching method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0146] 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.
[0147] 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.
[0148] 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 camera switching method, characterized in that: include: Shooting through a first camera corresponding to a first magnification; Receiving, through the application layer, a magnification conversion input for converting from the first magnification to a second magnification, transmitting, through a communication module, magnification conversion information corresponding to the magnification conversion input from the application layer to the bottom layer, and determining, through the bottom layer, a second camera corresponding to the second magnification; When the magnification conversion input is completed, the first camera is switched to the second camera for shooting through the bottom layer.
2. The method according to claim 1, characterized in that When the magnification conversion input is completed, after the first camera is switched to the second camera for shooting through the bottom layer, the method further includes: The bottom layer updates the function fitting model according to the first magnification, the second magnification and the brightness of the shooting environment, and determines the number of interpolated images between two adjacent frames of the second camera and the third magnification corresponding to each interpolated image; The first magnification is converted into the second magnification through the bottom layer based on the number of interpolated frame images, the third magnification corresponding to each interpolated frame image, and the updated function fitting model.
3. The method according to claim 1, characterized in that The magnification conversion input includes one of the following: The target object contacts the magnification conversion control of the current display interface; The target object moves in a direction close to the current display interface, and the target object is closest to a magnification conversion control among multiple controls on the current display interface.
4. The method according to claim 3, characterized in that When the magnification conversion input is completed, before the first camera is switched to the second camera for shooting through the bottom layer, the method further includes: When the target object is away from the magnification conversion control, the application layer determines that the magnification conversion input is completed.
5. The method according to claim 1, characterized in that When the magnification conversion input is completed, after the first camera is switched to the second camera for shooting through the bottom layer, the method further includes: When the brightness of the shooting environment is less than a preset brightness, obtaining a first exposure time corresponding to the first camera and a second exposure time corresponding to the second camera; Adjust the frame rate of the second camera according to the first exposure time and the second exposure time.
6. The method according to claim 5, characterized in that The adjusting the frame rate of the second camera according to the first exposure time and the second exposure time includes: When the first exposure time is less than the second exposure time, the second exposure time of the second camera is updated to the first exposure time, and the frame rate of the second camera is adjusted by the image signal processor gain ISP Gain and the super-resolution algorithm.
7. The method according to claim 5, characterized in that The adjusting the frame rate of the second camera according to the first exposure time and the second exposure time includes: When the first exposure time is less than the second exposure time, obtaining the number of interpolated images between two adjacent frames of images of the second camera; Determine a third exposure time according to the number of interpolated images and the first exposure time, wherein the third exposure time is greater than the second exposure time and is a multiple of the first exposure time; Updating the second exposure time of the second camera to the third exposure time; Two adjacent frame images of the second camera are fused to obtain frame images of the number of interpolated frame images, and frame images of the number of interpolated frame images are inserted between the two adjacent frame images to adjust the frame rate of the second camera.
8. The method according to claim 5, characterized in that The adjusting the frame rate of the second camera according to the first exposure time and the second exposure time includes: When the first exposure time is greater than the second exposure time, determining a time interval between two adjacent frames of images of the second camera, the time interval being the sum of the second exposure time and a waiting time, the waiting time being a time difference between the first exposure time and the second exposure time; The frame rate of the second camera is adjusted according to the time interval between two adjacent frames of images of the second camera.
9. A camera switching device, characterized in that: include: A shooting module, used for shooting through a first camera corresponding to a first magnification; a processing module, configured to receive a magnification conversion input for converting the first magnification into a second magnification through an application layer, transmit magnification conversion information corresponding to the magnification conversion input from the application layer to a bottom layer through a communication module, and determine a second camera corresponding to the second magnification through the bottom layer; A switching module is used to switch the first camera to the second camera for shooting through the bottom layer when the magnification conversion input is completed.
10. An electronic device, characterized in that: It includes a processor and a memory, 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 camera switching method as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Camera switching method and device, terminal and computer storage medium
CN111726528A
Photographing method and electronic equipment
CN116708954A
Zoom method and device, electronic equipment and readable storage medium
CN117793534A
Shooting method and related equipment
CN118450275A
Frame insertion method and device and electronic equipment
CN118474539A