Shooting method, electronic equipment and computer readable storage medium
By calling the shooting parameters of the first camera in the electronic device to optimize the real-time image acquired by the second camera, the problem of poor imaging effect during camera switching is solved, and high-quality image acquisition and fast parameter synchronization are achieved.
Patent Information
- Application Number
- CN202410009526.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-01-02
AI Technical Summary
When existing portable electronic devices switch cameras to acquire real-time images, they cannot quickly adapt to the shooting environment, resulting in poor imaging effects and cannot meet users' shooting needs.
By calling the shooting parameters of the real-time image data collected by the first camera, the real-time image collected by the second camera is optimized, and the synchronization of focus, exposure and white balance parameters is achieved to ensure the image quality captured by the second camera.
The image quality during camera switching is improved, so that it is consistent with the image collected by the first camera after optimization, meets the user's shooting needs, and completes parameter synchronization in a short time to avoid overexposure or underexposure.
Smart Images

Figure CN119277199A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of photographing technology, and in particular to a photographing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Existing portable electronic devices (such as mobile phones, tablet computers, etc.) generally have a camera function. In addition, in order to improve the camera effect of the electronic device, the electronic device is usually equipped with multiple cameras. During the shooting process, the electronic device can complete the automatic focus (Auto Focus, AF), automatic exposure (Auto Exposure, AE) and automatic white balance (Auto White Balance, AWB) of the activated camera to adapt to different shooting environments.
[0003] In response to the user's shooting operations under different shooting requirements, the electronic device can switch different cameras to capture real-time images.
[0004] However, when an electronic device switches different cameras to capture real-time images, the switched camera cannot quickly adapt to the shooting environment, resulting in poor imaging effects of the switched camera, which cannot meet the user's shooting needs. Summary of the invention
[0005] The embodiments of the present application provide a shooting method, an electronic device, and a computer-readable storage medium, which can call the shooting parameters of the first data channel for the second camera to capture the real-time image when displaying the real-time images captured by different cameras, optimize the real-time image captured by the second camera, and meet the user's shooting needs.
[0006] In order to achieve the above objectives, this application adopts the following technical solutions:
[0007] In the first aspect, the present application provides a shooting method, which is applied to an electronic device, and the electronic device includes a first camera and a second camera. In a first time interval, the electronic device uses the first camera to collect a first real-time image and displays the first real-time image. At this time, the first camera is a camera for collecting first-channel data, and the second camera is not working. The user performs a first operation on the interface of the electronic device. At the first moment, the electronic device receives the first operation of the user. In response to the received first operation of the user, the electronic device can simultaneously use the first camera and the second camera to collect real-time images, and display the second real-time image collected by the second camera. At this time, the first camera is still a camera for collecting first-channel data, and the second camera is a camera for collecting second-channel data. At the second moment when the second camera is started, the electronic device calls the shooting parameters of the first channel data for the second camera to collect real-time images, thereby optimizing the real-time image collected by the second camera. Among them, the first channel data can be called the main channel data stream, and the second channel data can be called the auxiliary channel data stream.
[0008] In the process of the electronic device using the first camera to collect the first real-time image, the electronic device continuously adjusts the shooting parameters of the first camera to optimize the imaging effect of the real-time image collected by the first camera. Therefore, at the second moment, the shooting parameters of the first data channel called by the electronic device can be understood as the shooting parameters of the first camera after the latest adjustment. And, in general, the electronic device can implement the process of calling the shooting parameters of the first data channel and synchronizing the shooting parameters of the first data channel to the second data channel. Based on this, between the first moment and the second moment, the electronic device uses the first camera as the camera for collecting the first data channel, and the second camera as the camera for collecting the second data channel. The electronic device calls the shooting parameters of the first data channel for the second camera to collect images, optimizes the shooting parameters of the second camera, so that the real-time image collected by the second camera is consistent with the imaging effect of the optimized first real-time image.
[0009] In a specific implementation manner, the shooting parameters of the electronic device include at least one of an automatic focus AF parameter, an automatic exposure AE parameter, and an automatic white balance AWB parameter.
[0010] When the electronic device calls the shooting parameters of the first data channel for the second camera to capture images, it can call one or more shooting parameters of the first data channel for the second camera to capture images, thereby optimizing one or more shooting parameters of the second camera.
[0011] In a specific implementation, at a third moment after the electronic device calls the shooting parameters of the first data channel, the electronic device determines that the real-time image captured by the second camera has been optimized and can switch the second camera to the camera that captures the first data channel.
[0012] After the electronic device completes the process of calling the shooting parameters of the first data, it promptly switches the second camera to the camera that collects the first data. When it is necessary to switch other cameras (such as the first camera, or a third camera in the electronic device other than the first camera and the second camera) to display the collected images in the future, the electronic device can call the shooting parameters of the first data for other cameras to collect real-time images. In other words, the shooting parameters of the second camera can be called for other cameras to collect real-time images, thereby optimizing the real-time images collected by other cameras, so that the real-time images collected by other cameras are consistent with the imaging effect of the real-time images collected by the optimized second camera.
[0013] In a specific implementation, the electronic device also includes a third camera.
[0014] At the fourth moment after the electronic device switches the second camera to the camera for collecting the first data channel, the electronic device receives the second operation of the user. The second operation may include an operation of adjusting the second zoom ratio to the third zoom ratio in the electronic device interface, and the third zoom ratio is not within the zoom ratio range of the second camera. In response to the second operation, the electronic device uses the third camera to collect the third real-time image and displays the third real-time image. At the fifth moment when the third camera is started, the electronic device can use the third camera as the camera for collecting the first data channel. That is, when the electronic device receives the second operation, it changes from displaying the real-time image collected by the first camera to displaying the real-time image collected by the third camera, and switches the third camera to the camera for collecting the first data channel. It should be understood that in the process of the electronic device using the third camera to collect the third real-time image, it is necessary to dynamically adjust the shooting parameters of the third camera according to the environmental parameters.
[0015] The time consumption of calling the shooting parameters of the first data channel is shorter than that of dynamically adjusting the shooting parameters of the camera, that is, the time interval between the fourth moment and the fifth moment is shorter than the time interval between the first moment and the third moment.
[0016] It should be understood that the process of the electronic device calling the shooting parameters of the first data channel takes a very short time. In this case, the naked eye can hardly see the process of the second camera changing from using the initial configuration shooting parameters to collect real-time images to calling the shooting parameters of the first data channel to collect image data. In other words, even if the second camera uses the initial configuration shooting parameters to collect real-time images and the phenomenon of overexposure or underexposure occurs during the process of calling the shooting parameters of the first data channel, the naked eye cannot see it. Therefore, the electronic device calls the shooting parameters of the first data channel for the second camera to collect real-time images, which can quickly meet the user's shooting needs while ensuring the imaging effect of the displayed image.
[0017] In a specific implementation, at a first moment, the electronic device starts the second camera in response to the first operation, at which time the second camera starts to continuously output frames. The electronic device can store the number of frames output by the second camera in a memory, and the starting value of the number of frames output by the second camera is 0.
[0018] The electronic device can determine whether the process of calling the shooting parameters of the first data path is completed according to the number of frames output by the second camera. Therefore, after the first moment, the electronic device can continuously read the number of frames output by the second camera after the first moment from the memory, thereby continuously monitoring the completion of the process of calling the shooting parameters of the first data path.
[0019] At the third moment, if the number of frames output by the second camera read from the memory by the electronic device after the first moment is greater than or equal to the first number, it can be determined that the process of calling the shooting parameters of the first data channel has been completed. Therefore, in response to determining that the number of frames output is greater than or equal to the first number, the electronic device can switch the second camera to the camera that collects the first data channel, and keep displaying the real-time image collected by the second camera. At this time, the imaging effect of the real-time image displayed by the electronic device can be consistent with the imaging effect of the real-time image collected by the first camera after optimization.
[0020] The electronic device monitors in real time the number of frames output by the second camera after the first moment, and measures whether the process of calling the shooting parameters of the first data channel for the second camera to collect real-time images is completed by the number of frames output. Once it is determined that the above calling process is completed, the electronic device immediately switches the second camera to the camera for collecting the first data channel, thereby ensuring that when the electronic device needs to display the real-time images collected by other cameras, it can quickly call the shooting parameters of the second camera from the first data channel, thereby optimizing the real-time images collected by other cameras.
[0021] In a specific implementation method, after a first moment, the electronic device can continuously read from the memory the number of frames output by the second camera after the first moment. Before a third moment when the process of the electronic device calling the shooting parameters of the first data channel has not been completed, the electronic device does not switch the second camera to the camera for collecting the first data channel, but continues to use the first camera as the camera for collecting the first data channel, and uses the second camera as the camera for collecting the second data channel, thereby ensuring the normal operation of the process of the electronic device calling the shooting parameters of the first data channel.
[0022] In a specific implementation, at the second moment, the electronic device may call the shooting parameters through a first function, wherein the first function has the function of calling the shooting parameters of the current first channel of data in the electronic device.
[0023] In some embodiments, the electronic device can only call the shooting parameters of the first data for the second data. Therefore, at the second moment, the electronic device can call the shooting parameters of the first data for the second data through the first function to optimize the shooting parameters of the second camera.
[0024] The electronic device can call the shooting parameters of the current first data in the electronic device through the first function, and implement the operation of calling the shooting parameters of the first data for the second camera to capture real-time images. That is to say, the shooting parameters of the second camera can be optimized based on the shooting parameters of the first data, thereby improving the imaging effect of the real-time image captured by the second camera.
[0025] In a specific implementation, each camera has its own zoom ratio range, and the electronic device can capture images of different zoom ratio ranges by starting different cameras. Exemplarily, the zoom ratio range of the first camera is [first zoom ratio value, second zoom ratio value], and when the first zoom ratio is less than the second zoom ratio and greater than the first zoom ratio, the electronic device uses the first camera to capture real-time images.
[0026] Correspondingly, within the first time interval, the interface displayed by the electronic device may include a shooting preview area, wherein the shooting preview area includes the first real-time image captured by the first camera.
[0027] Based on this, at the first moment, when the user's first operation includes an operation of adjusting the first zoom ratio to a second zoom ratio greater than the second zoom ratio value in the first interface, or includes an operation of adjusting the first zoom ratio to a second zoom ratio less than the first zoom ratio value, it is determined that the zoom ratio range of the first camera cannot meet the second zoom ratio. Therefore, in response to the first operation, the electronic device displays the real-time image captured by the second camera.
[0028] In response to the first operation of the user adjusting the zoom ratio, the electronic device can start the corresponding camera to collect real-time images at the second zoom ratio according to the zoom ratio range of the camera, so that when the user adjusts the zoom ratio, the electronic device can timely display the image that the user needs to shoot, meeting the user's shooting needs. At the same time, the electronic device uses the shooting parameters of the first data channel to collect real-time images with the second camera, optimizes the imaging effect of the image collected by the second camera at the second zoom ratio, and avoids overexposure or underexposure of the image displayed by the electronic device.
[0029] In a specific implementation, the electronic device can set a synchronization process switch parameter, which is used to indicate whether to execute the synchronization process of synchronizing the shooting parameters of the first data channel to the second data channel, which can also be understood as turning on the synchronization switch. Generally, the synchronization switch parameter is set to on.
[0030] After starting the second camera, the electronic device can collect synchronization switch parameters. When the electronic device determines that the synchronization switch parameters are on, it determines that the synchronization switch is turned on, and the electronic device can call the shooting parameters of the first data channel.
[0031] In a specific implementation, after the electronic device calls the shooting parameters of the first data channel, the electronic device can obtain the target shooting parameters based on the mapping relationship according to the called shooting parameters, and then the second camera can use the target shooting parameters to capture real-time images. The mapping relationship includes multiple zoom factors and the shooting parameters at each zoom factor.
[0032] Based on the mapping relationship, the electronic device can quickly map the called shooting parameters to obtain the target shooting parameters, thereby quickly adjusting the shooting parameters of the second camera and optimizing the real-time image captured by the second camera.
[0033] In a specific implementation, at a first moment, when the electronic device responds to a first operation and uses a second camera to capture real-time images, the initial configuration shooting parameters of the second camera can be queried from the memory, so that the second camera can capture real-time images using the initial configuration shooting parameters.
[0034] The electronic device sets corresponding initial configuration shooting parameters for each camera and stores them in the memory. When the electronic device starts the camera, the initial configuration shooting parameters corresponding to the started camera can be read from the memory to display the real-time image collected by the started camera using the initial configuration shooting parameters, thereby ensuring the continuity of the displayed image.
[0035] In a second aspect, the present application provides an electronic device, comprising a first camera, a second camera, a display screen, a memory and one or more processors; the first camera, the second camera, the display screen, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device implements the method described in the first aspect and any possible design method thereof.
[0036] In a third aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible design thereof.
[0037] In a fourth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible design thereof.
[0038] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second aspect, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect provided above can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 One of the mobile phone interface diagrams provided in the embodiment of the present application;
[0040] Figure 2 One of the display logic diagrams of the mobile phone provided in the embodiment of the present application;
[0041] Figure 3 The second mobile phone interface diagram provided in the embodiment of the present application;
[0042] Figure 4 The third mobile phone interface diagram provided in the embodiment of the present application;
[0043] Figure 5 A hardware structure diagram of a mobile phone provided in an embodiment of the present application;
[0044] Figure 6 A software architecture diagram of a mobile phone provided in an embodiment of the present application;
[0045] Figure 7 The second display logic diagram of the mobile phone provided in the embodiment of the present application;
[0046] Figure 8 The fourth mobile phone interface diagram provided in the embodiment of the present application;
[0047] Fig. 9 This is an interactive diagram for implementing the shooting method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. In the description of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0049] In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like are only used for descriptive purposes, and do not limit the quantity and execution order, nor can they be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more. And the words "first", "second" and the like are not necessarily different. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, "at least one" means one or more, and the meaning of "multiple" is two or more.
[0050] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0051] The embodiment of the present application provides a shooting method. For example, the embodiment of the present application can be applied to electronic devices supporting camera functions, such as mobile phones, tablet computers, desktop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), augmented reality (AR) or virtual reality (VR) devices, and the embodiment of the present application does not impose any special restrictions on the specific form of the electronic device.
[0052] In the following, the present application scheme will be mainly explained by taking the electronic device being a mobile phone as an example.
[0053] In the embodiment of the present application, the mobile phone may include a variety of applications (applications, APPs) that support taking photos or shooting videos. For example, a camera application, a beauty camera, TM , or social applications (such as WeChat TM ), shopping applications (such as Taobao TM , JD.com TM )wait.
[0054] For ease of understanding, the following article will mainly use the camera application as an example to explain in detail the process of taking photos with a mobile phone, in order to illustrate the problem that when the mobile phone switches cameras during the process of taking photos using conventional technology, the camera cannot provide good imaging effects.
[0055] In general, when a user clicks on the camera application icon on the mobile phone display, the mobile phone responds to the above-mentioned click operation, starts the camera application, and drives the camera of the mobile phone to start. At this time, the mobile phone completes the automatic focus (Auto Focus, AF), automatic exposure (Auto Exposure, AE) and automatic white balance (Auto White Balance, AWB) of the camera according to the collected environmental parameters such as ambient light and color temperature information, so as to adjust the shooting parameters initially configured in the camera (including at least one of the auto focus AF parameters, automatic exposure AE parameters and automatic white balance AWB parameters, hereinafter referred to as 3A parameters), and obtains new 3A parameters that are more suitable for the shooting environment, so that the image imaging effect of the camera based on the new 3A parameters is better. Exemplarily, the 3A parameters include white balance gain (WB Gain) and / or automatic exposure digital gain (AE igital Gain). For example, the AE parameters may include exposure, exposure time, etc.
[0056] After the camera collects image data based on the new 3A parameters, the mobile phone sends the image data collected by the camera based on the new 3A parameters to the display, and the mobile phone interface displays the image data collected by the camera based on the new 3A parameters. When the user clicks the shooting control on the camera application, the camera application responds to the user's click operation and uses the image data collected by the camera as the photo or video taken by the user.
[0057] The following uses the 3A parameter as an example of exposure to explain how to adjust the 3A parameter on a mobile phone.
[0058] When the mobile phone starts the camera, the initial exposure configured in the camera is exposure a. In some application scenarios, under the shooting environment, the image data collected by the camera with exposure a has the problem of too bright image brightness. The mobile phone can perform AE on the camera based on the collected environmental parameters such as ambient light and color temperature information, reduce the exposure, and obtain exposure b. The mobile phone adjusts the exposure of the camera from exposure a to exposure b, thereby reducing the overall brightness of the image data collected by the camera under the shooting environment.
[0059] In other application scenarios, in a shooting environment, the image data collected by the camera at exposure a has the problem of too dark image brightness. The mobile phone can perform AE on the camera based on the collected environmental parameters such as ambient light and color temperature information, increase the exposure, and obtain exposure c. The mobile phone adjusts the camera's exposure from exposure a to exposure c, thereby increasing the brightness of the image data collected by the camera in the shooting environment.
[0060] Usually, a mobile phone is equipped with multiple cameras. Each camera has its own zoom ratio range. The zoom ratio refers to the ratio of the image size of an object in the camera to the actual size of the object. The larger the zoom ratio, the greater the magnification of the image data. 1.0X means that the object can be captured by the camera at its actual size. By starting different cameras on the mobile phone, image data in different magnification ranges can be collected.
[0061] Take a mobile phone equipped with a wide-angle camera, a telephoto camera, and an ultra-wide-angle camera as an example: Generally, the zoom ratio range of the wide-angle camera is [1.0X, 2.5X], the zoom ratio range of the telephoto camera is greater than 2.5X, and the zoom ratio range of the ultra-wide-angle camera is less than 1.0X. Correspondingly, the magnification of the image data collected by the telephoto camera (greater than 2.5 times) is greater than the magnification of the image data collected by the wide-angle camera (1.0 times-2.5 times), and the magnification of the image data collected by the wide-angle camera (1.0 times-2.5 times) is greater than the magnification of the image data collected by the ultra-wide-angle camera (less than 1.0 times).
[0062] In this case, the mobile phone can set a camera that is started by default. At the same time, the mobile phone can pre-select a zoom ratio as the default zoom ratio according to the zoom ratio range of the camera that is started by default. When the mobile phone starts the camera, the above-mentioned default-started camera is started. At the default zoom ratio, the above-mentioned default-started camera collects image data based on the initially configured 3A parameters. In addition, the mobile phone can complete AE, AF, and AWB for the above-mentioned default-started camera based on the collected environmental parameters such as ambient light and color temperature information, and adjust the 3A parameters initially configured in the above-mentioned default-started camera to obtain new 3A parameters that are more adapted to the environmental parameters, so that the above-mentioned default-started camera can collect image data based on the new 3A parameters. Therefore, the mobile phone interface can display the image data collected by the above-mentioned default-started camera based on the new 3A parameters at the default zoom ratio.
[0063] For example, the phone sets the wide-angle camera as the default camera. Based on the zoom ratio range of the wide-angle camera, the phone sets 1.0X as the default zoom ratio. The phone can display Figure 1The interface 101 shown in the figure includes multiple application icons such as memo, settings, calculator, recorder, sports health, weather, information, contacts, phone and camera. When the user clicks the camera application icon in the mobile phone interface, the mobile phone starts the camera application, and the camera application drives the wide-angle camera to start (such as Figure 1 The phone can display the following: Figure 1 The interface 102 shown in FIG. 1 includes image data collected by the wide-angle camera at a default magnification of 1.0X. Figure 1 Camera 2), ultra-wide-angle camera (such as Figure 1 The camera in 3) is turned off.
[0064] Furthermore, in response to the user clicking the control 1021 in the mobile phone interface 102, the mobile phone can use the image data collected by the wide-angle camera at a magnification of 1.0 as the photo taken by the user. Figure 1 The photo shown in the image 103 in FIG. Wherein, the control 1021 is used to trigger the mobile phone to take a picture or video.
[0065] In some shooting scenarios, users may need to use a larger zoom ratio to shoot images, or need to use a smaller zoom ratio to shoot images. At this time, the user can adjust the zoom ratio in the mobile phone interface. However, the new zoom ratio may not be within the zoom ratio range of the cameras that have been activated at the current moment. Therefore, the mobile phone needs to start a new camera with a zoom ratio range that can meet the above new zoom ratio, and display the image captured by the new camera. At this time, the camera application can display the image data captured by the new camera at the new zoom ratio. For the sake of convenience, the above new zoom ratio can also be referred to as the second zoom ratio.
[0066] In other shooting scenarios, after the user adjusts the zoom ratio in the mobile phone interface, the mobile phone determines that the new zoom ratio is within the zoom ratio range of the activated camera at the current moment based on the user's operation of adjusting the ratio. Therefore, the mobile phone does not need to switch cameras. In addition, the mobile phone needs to adjust the 3A parameters of the activated camera according to the new zoom ratio to determine the new 3A parameters. At this time, the camera application can display the image data collected by the activated camera based on the new 3A parameters at the new zoom ratio.
[0067] The following describes the shooting method of a mobile phone when the new zoom ratio is not within the zoom ratio range of the activated camera:
[0068] In the camera switching scenario, the camera that is activated first in the mobile phone is called the first camera, and the camera that is activated later in the mobile phone is called the second camera.
[0069] like Figure 2As shown, after the mobile phone starts the first camera, the image data 1 collected by the first camera is sent for display. At this time, the mobile phone uses the image data 1 collected by the first camera as the main data stream. During the shooting process, the mobile phone can complete AE, AF, and AWB for the first camera, and adjust the 3A parameters of the first camera. When the new zoom ratio adjusted by the user is not within the zoom ratio range of the main camera, the mobile phone starts the second camera whose zoom ratio range can meet the new zoom ratio, and sends the image data 2 collected by the second camera for display. At this time, the mobile phone uses the image data 2 collected by the second camera as the main data stream. Furthermore, during the shooting process, the mobile phone can complete AE, AF, and AWB for the second camera, and adjust the 3A parameters of the second camera.
[0070] It should be understood that Figure 2 The long black bars represent the data streams used for display.
[0071] Generally, when a mobile phone starts a camera, it needs to complete the stream allocation operation for the camera (it can immediately complete the parameter initialization of the second camera, including the initialization of the 3A parameters). Therefore, when the mobile phone starts the second camera, the 3A parameters of the second camera are all initial configuration values, which may not adapt to the shooting environment, resulting in the following problems in the image data collected by the second camera based on the initial configuration 3A parameters:
[0072] 1. Image overexposure: The 3A parameters initially configured in the second camera cannot adapt to the shooting environment, resulting in the image data collected by the second camera based on the initially configured 3A parameters being too bright and white (hereinafter referred to as overexposure).
[0073] For example, a mobile phone interface such as Figure 3 As shown in interface 301 in , interface 301 includes image data collected by the wide-angle camera based on the new 3A parameters at a magnification of 1.0X. When the user adjusts the zoom ratio from 1.0X to 3.0X, the mobile phone determines that 3.0X is not within the zoom ratio range of the wide-angle camera, and selects the telephoto camera with a zoom ratio range greater than 2.5X as the second camera. The mobile phone starts the telephoto camera and sends the image data collected by the telephoto camera for display. At this time, the 3A parameters of the telephoto camera are the initial configuration values and cannot adapt to the shooting environment, resulting in overexposure of the image data collected by the telephoto camera at this time (such as Figure 3 (shown in the middle interface 302).
[0074] 2. Underexposure problem: The initial configuration 3A parameters of the second camera cannot adapt to the shooting environment, resulting in the image data captured by the second camera based on the initial configuration 3A parameters being too low in brightness and dark (hereinafter referred to as underexposure).
[0075] For example, a mobile phone interface such as Figure 4As shown in the middle interface 401, the interface 401 includes image data collected by the wide-angle camera based on the new 3A parameters at a magnification of 1.0X. When the user adjusts the zoom ratio from 1.0X to 0.5X, the mobile phone selects the ultra-wide-angle camera with a zoom ratio range of less than 1.0X as the second camera. The mobile phone starts the ultra-wide-angle camera and sends the image data collected by the ultra-wide-angle camera for display. At this time, the 3A parameters of the ultra-wide-angle camera are the initial configuration values and cannot adapt to the shooting environment, resulting in underexposure of the image data collected by the ultra-wide-angle camera (such as Figure 4 (as shown in the middle interface 402).
[0076] In view of the above problems, the embodiment of the present application provides a shooting method that can be applied to a mobile phone. When the mobile phone switches cameras, the mobile phone can synchronize the 3A parameters of the first camera to the second camera, so that the new 3A parameters of the second camera adapt to the shooting environment, and further make the second camera have better imaging effect based on the image data collected by the new 3A parameters.
[0077] See also Figure 5 , is a hardware structure diagram of a mobile phone provided in an embodiment of the present application.
[0078] The mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera module 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a touch sensor 180B, an ambient light sensor 180C, etc.
[0079] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0080] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0081] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0082] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display screen 194, the camera module 193, and the wireless communication module 160.
[0083] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0084] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0085] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0086] The wireless communication module 160 can provide wireless communication solutions for application in the mobile phone 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), ultra wide band (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.
[0087] The mobile phone 100 can realize the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0088] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the display screen 194 can display real-time images collected by the camera.
[0089] The mobile phone 100 can realize the camera function through the camera module 193, ISP, video codec, GPU, display screen 194, application processor AP, neural network processor NPU, etc.
[0090] The camera module 193 can be used to collect color image data and depth data of the photographed object. The ISP can be used to process the color image data collected by the camera module 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera module 193.
[0091] In some embodiments, the mobile phone may include one or more (two or more) cameras. For example, the mobile phone includes a wide-angle camera, a telephoto camera, an ultra-wide-angle camera, etc.
[0092] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card. Or files such as music and videos can be transferred from the mobile phone to the external memory card.
[0093] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional methods or data processing of the mobile phone 100 by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor.
[0094] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0095] The touch sensor 180B is also called a "touch control device". The touch sensor 180B can be set on the display screen 194, and the touch sensor 180B and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180B is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180B can also be set on the surface of the mobile phone 100, which is different from the position of the display screen 194.
[0096] The ambient light sensor 180C can be used to sense the ambient light brightness. The mobile phone 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180C can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180C can also cooperate with the proximity light sensor 180G to detect whether the mobile phone 100 is blocked, for example, the mobile phone is in a pocket. When it is detected that the mobile phone is blocked or in a pocket, some functions (such as the touch function) can be disabled to prevent misoperation.
[0097] The key 190 may include a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The mobile phone 100 may receive key inputs and generate key signal inputs related to user settings and function control of the mobile phone 100. For example, when the mobile phone receives key signal inputs of the power key and the volume key at the same time when the camera application is started, the command to capture an image is executed.
[0098] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (for example, taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example, time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0099] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the mobile phone 100 by inserting the SIM card interface 195 or pulling the SIM card interface 195 out. The mobile phone 100 can support one or more SIM card interfaces.
[0100] The software system in the mobile phone can adopt a layered architecture, an event-driven architecture or a cloud architecture. TM Taking the system as an example, the software structure of the mobile phone is illustrated.
[0101] Reference Figure 6 , which is a software architecture diagram of the mobile phone provided in an embodiment of the present application.
[0102] like Figure 6 As shown in FIG. 1 , the layered architecture can divide the software of the mobile phone into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, Android TM The system is divided into four layers, from top to bottom: application layer, application framework layer, system library and kernel layer.
[0103] The application layer 601 may include various application packages, such as camera, gallery, and information.
[0104] For example, applications such as camera can implement shooting services (such as shooting images, recording videos, etc.), applications such as gallery can implement data display services (such as displaying image data), and applications such as video can implement data playback services (such as playing videos).
[0105] The following will mainly use the camera application 6011 as an example to illustrate.
[0106] The camera application 6011 may send a startup notification to the kernel layer 604 to instruct the camera to start. The camera application 6011 may send a frame request to the kernel layer 604 to instruct the camera to collect new image data. Furthermore, the camera application 6011 may display the image data collected by the camera in the display interface.
[0107] Furthermore, the camera application 6011 may receive an operation a performed by the user on the display interface for adjusting the zoom ratio. In response to the operation a, the camera application 6011 may send a camera switching request to the kernel layer 604 .
[0108] The application framework layer (Framework) 602 provides an application programming interface (API) and a programming framework for the application layer. The application framework layer 602 includes some predefined functions. Figure 6 As shown, the application framework layer 602 can provide a camera service.
[0109] Among them, the camera service 6021 can interact with the camera hardware abstraction layer (Camera HAL) in the hardware abstraction layer (HAL) layer during operation.
[0110] Specifically, the camera API service 6021 can receive requests from the application layer 601 (such as the camera application 6011), such as a start request, a frame request, an AE request, an AF request, and an AWB request, and send them to the HAL layer 603.
[0111] The HAL layer 603 is used to connect the application framework layer 602 and the kernel layer 604. For example, the HAL layer 603 can transmit data between the application framework layer 602 and the kernel layer 604. Of course, the HAL layer 603 can also process the data from the bottom layer (such as the kernel layer 604) and then transmit it to the application framework layer 602.
[0112] The HAL layer 603 may receive a request sent by the camera service 6021 .
[0113] like Figure 6 As shown, the HAL layer 603 may include a camera hardware abstraction layer (Camera Provider).
[0114] In some embodiments, the camera hardware abstraction layer 6031 may process requests from the camera application 6011 and send the processed requests to the underlying layer (eg, the kernel layer 604).
[0115] For example, the camera hardware abstraction layer 6031 can send the 3A parameter adjustment request from the camera application 6011 to the bottom layer (such as the kernel layer 604), drive the kernel layer 604 to collect environmental parameters such as ambient light and color temperature information, and the camera hardware abstraction layer 6031 uses the 3A algorithm to determine new 3A parameters based on the environmental parameters such as ambient light and color temperature information. The camera hardware abstraction layer 6031 generates a 3A parameter optimization request based on the determined new 3A parameters and sends it to the kernel layer 604. The kernel layer 604 can optimize the 3A parameters of the camera according to the 3A parameter optimization request.
[0116] In addition, the camera hardware abstraction layer 6031 can also report the image data uploaded by the bottom layer (such as the kernel layer 604) to the application layer (such as the camera application 6011) for display.
[0117] The kernel layer 604 includes a camera driver 6041, an image signal processor ISP 6042, and a camera device 6043. The camera device 6043 may include multiple cameras, each of which includes a lens and an image sensor.
[0118] The camera driver 6041 may receive a notification from the application layer (eg, a notification indicating starting or shutting down a camera), and send a function processing parameter stream to the Camera device 6043 based on the notification.
[0119] ISP6042 is used to process the data fed back by Camera device 6043 .
[0120] For example, when taking a photo, the shutter is opened, and the light from the shooting environment is transmitted to the camera sensor through the lens. The light signal is converted into an electrical signal, and the camera sensor transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0121] In some embodiments, ISP6042 can also adjust the 3A parameters of the camera.
[0122] Taking the 3A parameter as exposure as an example, ISP6042 can update the exposure of the camera according to the new exposure sent by the camera hardware abstraction layer 6031.
[0123] It can be understood that the image signal processor ISP 6042 and the camera device 6043 are the main devices for shooting videos or pictures. The light signal reflected by the shooting environment can be converted into an electrical signal after being irradiated on the image sensor through the camera lens. The electrical signal is processed by the image signal processor ISP 6042 and can be used as a raw data stream and transmitted from the camera driver 6041 to the application layer 601. For example, the image data collected by the wide-angle camera and processed by the ISP is sent to the camera application 6011 by the camera driver 6041 as the raw data stream of the wide-angle camera, and the camera application 6011 displays the image data corresponding to the raw data stream.
[0124] The shooting method provided in the embodiment of the present application can be implemented in a mobile phone having the above-mentioned hardware structure and software structure.
[0125] In an embodiment of the present application, the mobile phone displays the first image data collected by the first camera. At this time, the 3A parameter of the first camera is the first 3A parameter after completing AE, AF, and AWB. In other words, the mobile phone interface can display the first image data collected by the first camera based on the first 3A parameter. After the user performs the operation of adjusting the magnification, the mobile phone starts the second camera in the process of switching the second camera, and displays the second image data collected by the second camera. At this time, the mobile phone interface can display the second image data collected by the second camera based on the initial configuration 3A parameters. At the same time, the mobile phone keeps the first camera continuously framing (that is, the first camera continuously outputs the collected first image data, but is not used for display). The mobile phone calls the first 3A parameter carried by the first image data to determine the second 3A parameter. The mobile phone updates the initial configuration 3A parameter of the second camera to the second 3A parameter, so that the second camera can collect the second image data based on the second 3A parameter. At this time, the mobile phone displays the third image data collected by the second camera based on the second 3A parameter.
[0126] The following describes the specific implementation process of the mobile phone synchronizing the 3A parameters of the first camera to the second camera in the scenario of switching cameras on the mobile phone:
[0127] The larger the zoom ratio of the camera, the greater the magnification of the image data collected by the camera, and the smaller the range of objects can be collected. In different zoom ratio ranges, the mobile phone needs to open different cameras to collect image data of corresponding magnification.
[0128] For example, the mobile phone interface may display: Figure 3 The interface 301 shown includes image data collected by the first camera based on the first 3A parameters, wherein the brightness of the image data collected by the first camera based on the first 3A parameters is not too dark or too bright, and the boundaries of objects in the image data are clear.
[0129] It should be understood that during the shooting process, the mobile phone performs AE, AF, and AWB processing on the first camera based on the collected environmental parameters such as ambient light and color temperature information. Only after obtaining the 3A parameters of the first camera that adapt to the environmental parameters can the image captured by the first camera be as shown in interface 301, with balanced brightness and clear object boundaries.
[0130] After the user adjusts the magnification, the phone starts the second camera and the phone interface is as follows: Figure 3 As shown in interface 301, or as Figure 4 As shown in interface 401, interface 301 or interface 401 includes image data collected by the second camera at different magnifications. However, during the process of switching cameras on the mobile phone, the second camera collects image data based on the 3A parameters of the initial configuration. In this case, the 3A parameters of the initial configuration in the second camera have not been adjusted and cannot adapt to the environmental parameters, resulting in the image data collected by the second camera based on the 3A of the initial configuration, which may appear as follows Figure 3 The overexposure phenomenon shown in the middle interface 302 may appear as Figure 4 The underexposure phenomenon shown in the middle interface 402.
[0131] Based on this, when the mobile phone switches cameras, the first 3A parameters of the first camera can be synchronized to the second camera, so that the second 3A parameters in the second camera after synchronization can adapt to the shooting environment parameters. Furthermore, the image data collected by the second camera based on the second 3A parameters can achieve an imaging effect with balanced brightness and clear object boundaries, without overexposure or underexposure.
[0132] It should be noted that in the mobile phone, the camera service in the application framework layer, the camera hardware abstraction layer, or the camera driver in the kernel layer can perform the above-mentioned action of synchronizing the 3A parameters of the first camera to the second camera. The embodiment of the present application does not specifically limit this.
[0133] The following describes in detail the specific implementation of synchronizing the 3A parameters of the first camera to the second camera so that the imaging effect of the image captured by the second camera is consistent with the imaging effect of the image captured by the first camera:
[0134] After starting the first camera, the mobile phone completes AE, AF, and AWB for the first camera, and obtains the first 3A parameters adapted to the environmental parameters, so that the image data collected by the first camera based on the first 3A parameters will not be overexposed or underexposed. The mobile phone can send the first image data collected by the first camera for display, and use the first image data collected by the first camera as the main data stream. In the process of switching cameras, the mobile phone starts the second camera, sends the second image data collected by the second camera for display, and uses the second image data collected by the second camera as the auxiliary data stream. At the same time, the mobile phone synchronizes the first 3A parameters of the first image data in the main data stream to the second image data in the auxiliary data stream, that is, determines the second 3A parameters of the second camera. The image data collected by the second camera based on the second 3A parameters has the same imaging effect as the image data collected by the first camera based on the first 3A parameters. For the sake of convenience, the above-mentioned main data stream can also be called the first data, the auxiliary data stream can also be called the second data, and the image data collected by the camera can be called the real-time image collected by the camera.
[0135] For example, the display logic of the mobile phone switching camera process can be as follows: Figure 7 As shown. First, the mobile phone displays the image data 1 collected by the first camera, and at this time the image data 1 collected by the first camera is used as the main data stream. When the second camera is started. The mobile phone displays the image data 2 collected by the second camera, and at this time the mobile phone uses the image data 2 collected by the second camera as the auxiliary data stream. Moreover, the mobile phone still uses the image data 1 collected by the first camera as the main data stream, and at this time the image data collected by the first camera is not used for display. At the same time, the mobile phone synchronizes the 3A parameters of the main data stream to the auxiliary data stream. In other words, the 3A parameters of the first camera are synchronized to the second camera. After completing the 3A parameter synchronization process, the mobile phone switches the image data 2 collected by the second camera to the main data stream, while keeping the image data 2 collected by the second camera displayed.
[0136] It should be understood that Figure 7 The black blocks in the figure represent the data streams sent for display, and the white blocks represent the data streams not used for display.
[0137] Below Figure 8 Taking the mobile phone interfaces (i.e., interface 801 and interface 802) as an example, the effect that can be achieved by synchronizing the 3A parameters of the first camera to the second camera during the process of switching cameras is described:
[0138] The mobile phone interface is shown in interface 801, and interface 801 includes image data collected by the first camera at a magnification of 1.0x. The user completes the magnification adjustment operation on the mobile phone interface and adjusts the zoom magnification from 1.0X to 3.0X. Since 3.0X is not within the zoom magnification range of the first camera, the mobile phone can start the second camera whose zoom magnification range includes 3.0X. At the same time, the mobile phone synchronizes the 3A parameters of the first camera to the second camera, so that the second camera can collect image data based on the synchronized second 3A parameters. At this time, the mobile phone interface is shown in interface 802, and interface 802 includes image data collected by the second camera based on the second 3A parameters at a magnification of 3.0x, without overexposure or underexposure, and the boundaries of objects are clear.
[0139] In some embodiments, the mobile phone records the above-mentioned process of switching cameras in an offline log.
[0140] For example, the offline log can be used to record the image data transmission process of each frame in the mobile phone. For example, the mobile phone can obtain the offline log shown in Table 1 below:
[0141] Table 1
[0142]
[0143] In some embodiments, each camera has a unique identifier, such as a unique Camera ID. For example, in Table 1 above, Camera ID: 1 represents the first camera, and Camera ID: 2 represents the second camera. Role is used to characterize which data stream the image data collected by the camera is used as; wherein, Role: 1 represents the image data collected by the camera as the main data stream, and Role: 2 represents the image data collected by the camera as the auxiliary data stream. Frame is used to represent the camera's display frame, and the data after Frame is used to represent the number of display frames output by the camera, and the starting value of the number of display frames output by the camera is 0. For example, a camera can output 30 frames of data in 1 second, corresponding to the camera display. The camera's display frames recorded in the offline log include Frame: 0, Frame: 1,…, Frame: 29.
[0144] Based on this, the display logic of the mobile phone can be determined by combining the three parameters of Camera ID, Role and Frame. For example, Camera ID: 1, Role: 1, Frame: Display frame number, which means that the mobile phone uses the image data collected by the first camera as the auxiliary data stream, and the mobile phone displays the image data collected by the first camera. Camera ID: 2, Role: 2, Frame: Display frame number, which means that the mobile phone uses the image data collected by the second camera as the main data stream, and the mobile phone displays the image data collected by the second camera.
[0145] Exemplarily, according to Table 1, the display sending process of the mobile phone includes: at the initial moment, the display sending logic of the mobile phone is to send the image data collected by the first camera to the display, and the image data collected by the first camera is used as the main data stream. Then, in the process of switching cameras of the mobile phone, when the mobile phone starts the second camera, the display sending logic of the mobile phone changes to sending the image data collected by the second camera to the display, and the image data collected by the second camera is used as the auxiliary data stream. At the same time, the mobile phone calls the 3A parameter synchronization function to synchronize the 3A parameters in the main data stream to the auxiliary data stream, that is, to synchronize the 3A parameters of the first camera to the second camera. At the end of the 3A parameter synchronization, the mobile phone stops calling the 3A parameter synchronization function, updates the image data collected by the second camera to the main data stream, and continues to send the image data collected by the second camera. Among them, the 3A parameter synchronization function can be a set.aux.info() function, which can only realize the work of synchronizing the 3A parameters in the main data stream to the auxiliary data stream. For the convenience of explanation, the above-mentioned 3A parameter synchronization function can also be referred to as the first function.
[0146] According to the offline log, the process of switching the main and auxiliary data streams in the mobile phone can be determined, as well as the process of calling the 3A parameter synchronization function to synchronize the 3A parameters of the first image data in the main data stream to the second image data in the auxiliary data stream.
[0147] In some embodiments, combined with the software and hardware structure of the mobile phone, this embodiment can be implemented as follows: Fig. 9 The steps shown implement a method for synchronizing 3A parameters.
[0148] After the mobile phone starts the first camera, the first camera works.
[0149] S901. The camera hardware abstraction layer determines that image data collected by a first camera is a main data stream.
[0150] When the first camera is started, the camera hardware abstraction layer uses the first camera as the main data stream, sends the image data collected by the first camera to the display, and uses the image data collected by the first camera as the main data stream.
[0151] When the camera application is running in the foreground, the camera application can continuously send frame requests according to the frame rate.
[0152] S902: The camera application sends a first frame request to the camera hardware abstraction layer, where the first frame request is used to instruct the first camera to collect image data.
[0153] The camera application sends a first frame request to the hardware abstraction layer to instruct the first camera to collect image data.
[0154] It should be noted that when the mobile phone is equipped with multiple cameras, the camera application needs to send a frame request to the camera that is sent to the display. For example, when the mobile phone sends the image data collected by the first camera to the display, the camera application sends a frame request for the first camera.
[0155] In some embodiments, the frame request carries the identification of the camera. For example, the frame request of the first camera sent by the camera application carries the identification of the first camera, and the frame request of the second camera sent by the camera application carries the identification of the second camera.
[0156] S903: The hardware abstraction layer sends a first frame request to the ISP.
[0157] Exemplarily, after receiving the frame request, the camera hardware abstraction layer can determine the camera targeted by the frame request based on the camera identifier carried in the frame request, and then send the frame request to the ISP for processing.
[0158] S904: The ISP reads a first initial configuration 3A parameter of the first camera from the memory.
[0159] After the camera hardware abstraction layer starts the camera and instructs the camera to frame (i.e. output the collected image data), the camera first collects image data based on the initial configuration 3A parameters. Therefore, when the ISP receives the frame request, it first reads the first initial configuration 3A parameters of the first camera from the memory.
[0160] S905. The ISP sends a first frame request and a first initial configuration 3A parameter to the first camera.
[0161] The ISP sends the first frame request to the first camera to instruct the first camera to collect image data. At the same time, the ISP sends the first initial 3A parameter read from the memory to the first camera.
[0162] S906. The first camera collects image data a according to the first initial configuration 3A parameters.
[0163] When the first camera receives the first frame request and the first initial configuration 3A parameter, it collects image data based on the first initial configuration 3A parameter. Here, the image data collected by the first camera based on the first initial configuration 3A parameter is referred to as image data a.
[0164] S907: The first camera sends image data a to the camera hardware abstraction layer.
[0165] It should be understood that the image data collected by the first camera is generally in the form of electrical signals, and the ISP needs to convert the electrical signals into images visible to the naked eye, and then the ISP sends the images to the camera hardware abstraction layer, which is a simplified description here. This process can be referred to the description of the software architecture embodiment of the aforementioned mobile phone, and will not be repeated here.
[0166] S908. The camera hardware abstraction layer sends the image data a collected by the first camera to the display.
[0167] When the camera hardware abstraction layer receives the image data a collected by the first camera, it can determine that the image data a is the main data stream, and the main data stream is used for display. Therefore, the camera hardware abstraction layer sends the image data a for display.
[0168] S909. The camera application displays a first interface; the first interface includes image data a collected by the first camera.
[0169] After the camera application receives the image data a collected by the first camera, it displays a first interface through the mobile phone interface, and the first interface includes the image data a collected by the first camera.
[0170] It is understandable that the first interface also includes controls for magnification, shooting mode, etc. Among them, the magnification control can be used to adjust the zoom magnification, for example, to adjust a larger zoom magnification, or to adjust a smaller zoom magnification. The shooting mode control can be used to adjust the shooting mode of the camera, for example, to enter a video recording mode, or to enter a time-lapse shooting mode, etc.
[0171] S910. The camera application sends a 3A parameter update request to the camera hardware abstraction layer, where the 3A parameter update request is used to adjust the 3A parameters of the first camera.
[0172] Since the initial configuration 3A parameters of the first camera may not adapt to the environmental parameters, resulting in poor imaging effect of the image data a collected by the first camera, the camera application may generate a 3A parameter update request during the shooting process to adjust the 3A parameters of the camera to obtain 3A parameters that are more adapted to the environmental parameters, so that the imaging effect of the image data collected by the camera after adjustment is better.
[0173] In some embodiments, the 3A parameter update request carries the identification of the camera. For example, the 3A parameter update request for the first camera sent by the camera application carries the identification of the first camera, and the 3A parameter update request for the second camera sent by the camera application carries the identification of the second camera.
[0174] After receiving the 3A parameter update request, the camera hardware abstraction layer needs to determine the camera targeted by the 3A parameter update request based on the camera identifier carried in the 3A parameter update request, and then send the 3A parameter update request to the ISP for processing.
[0175] S911. The camera hardware abstraction layer determines a 3A parameter update value.
[0176] When the camera hardware abstraction layer receives the 3A parameter update request from the first camera, it can calculate the 3A parameter update value that is more suitable for the environmental parameters based on the 3A algorithm based on the environmental parameters such as the ambient light and color temperature information. This article will not go into details about the 3A algorithm.
[0177] S912: The camera hardware abstraction layer stores the 3A parameter update value in the memory.
[0178] Each time the camera hardware abstraction layer determines the 3A parameter update value of the camera, it needs to store the 3A parameter update value in the memory so that the subsequent ISP can read it from the memory and implement further 3A parameter adjustment operations.
[0179] S913. The camera hardware abstraction layer sends a 3A parameter update value to the ISP.
[0180] The camera hardware abstraction layer receives a 3A parameter update request for the first camera and, when the 3A parameter update value is calculated, sends the 3A parameter update value to the ISP.
[0181] S914: The ISP updates the first initial configuration 3A parameter to a 3A parameter update value.
[0182] When receiving the 3A parameter update value, the ISP updates the first initial 3A parameter of the first camera to the 3A parameter update value.
[0183] S915. The ISP sends a 3A parameter update value to the first camera.
[0184] S916. The first camera collects image data b according to the 3A parameter update value.
[0185] After receiving the 3A parameter update value, the first camera can collect image data b according to the 3A parameter update value.
[0186] S917. The first camera sends image data b to the camera hardware abstraction layer.
[0187] S918. The camera hardware abstraction layer sends the image data b collected by the first camera to the display.
[0188] S919. The camera application displays a second interface; the second interface includes image data b collected by the first camera.
[0189] Since the image data b is the image data collected by the first camera based on the 3A parameter update value, the imaging effect of the image data b is better than that of the image data a.
[0190] It is understandable that during the process from step S906 to step S922, the first camera continuously collects image data and outputs it to the camera hardware abstraction layer. Correspondingly, the camera hardware abstraction layer continuously displays the image data collected by the first camera.
[0191] During the shooting process, the user may need to use a larger zoom ratio to shoot an image, or may need to use a smaller zoom ratio to shoot an image. Correspondingly, the user can perform a zoom ratio adjustment operation a on the mobile phone interface.
[0192] For example, when a user needs to adjust the zoom ratio, he or she can complete the adjustment of the ratio by touching, sliding, or performing other operations on the ratio control on the mobile phone interface.
[0193] S920: The camera application receives an operation a from the user.
[0194] S921. The camera application sends operation a to the camera hardware abstraction layer.
[0195] When the camera application receives the user's operation a, it sends the user's operation a to the camera hardware abstraction layer.
[0196] S922. The camera hardware abstraction layer determines whether the camera needs to be switched according to operation a.
[0197] Since each camera has its own zoom ratio range, the zoom ratio adjusted by the user may be within the zoom ratio range of the first camera, or may not be within the zoom ratio range of the camera. When the new zoom ratio adjusted by the user is within the zoom ratio range of the first camera, S9231 is executed and the first camera continues to work.
[0198] In this case, the camera hardware abstraction layer continues to use the image data collected by the first camera as the main data stream, and the main data stream is used for display.
[0199] In addition, the camera hardware abstraction layer can adjust the 3A parameters of the first camera based on the new zoom ratio by using the 3A algorithm.
[0200] If the new zoom ratio is not within the zoom ratio range of the first camera, the mobile phone needs to switch cameras. Execute S9232, the camera hardware abstraction layer stops sending the image data collected by the first camera for display.
[0201] When the camera hardware abstraction layer determines according to operation a that the new zoom ratio is not within the zoom ratio range of the first camera, it stops sending the image data collected by the first camera for display.
[0202] It should be noted that at this time, the first camera continues to output frames (that is, the first camera continues to output the collected image data), that is, the image data collected by the first camera is still the main data stream, but the main data stream is not used for display.
[0203] Generally, the camera hardware abstraction layer can only map the 3A parameters of the main data stream to the auxiliary data stream. Therefore, it is necessary to use the image data collected by the first camera as the main data stream and the image data collected by the second camera as the auxiliary data stream to facilitate the process of synchronizing the 3A parameters of the first camera to the 3A parameters of the second camera.
[0204] S924: The camera hardware abstraction layer starts the second camera.
[0205] After the camera hardware abstraction layer determines according to operation a that the new zoom ratio is not within the zoom ratio range of the first camera, the first camera is kept outputting frames while starting the second camera whose zoom ratio range can meet the new zoom ratio.
[0206] In one embodiment, when the mobile phone starts the second camera, it is necessary to allocate the second camera to realize the parameter initialization of the second camera (including 3A parameter initialization). After the mobile phone completes the parameter initialization of the second camera, the second camera starts to work normally, and the number of sensors in the mobile phone in working state is updated to 2 (used to indicate that two cameras are working at this time). In this case, the mobile phone starts the dual-stream working mode.
[0207] It can be understood that the dual-stream working mode refers to a mode in which the first camera and the second camera work simultaneously, wherein the image data collected by the first camera is used as the main data stream (not sent to display), and the image data collected by the second camera is used as the auxiliary data stream (sent to display).
[0208] In some embodiments, if the user performs another zoom adjustment operation while the mobile phone is implementing streaming for the second camera, and the zoom magnification of the second adjustment is within the zoom magnification range of the first camera, it is determined that the second camera does not need to be started. The mobile phone stops the streaming operation for the second camera, turns off the second camera, and does not start the dual-stream working mode. At this time, the number of sensors in the mobile phone that are in working state is still 1.
[0209] S925. The camera hardware abstraction layer determines that the image data collected by the second camera is an auxiliary data stream.
[0210] After the second camera completes the stream allocation, the camera hardware abstraction layer determines that the image data collected by the second camera is the auxiliary data stream and immediately starts the dual-stream working mode. While the mobile phone keeps the first camera continuously outputting frames, it uses the image data collected by the second camera as the auxiliary data stream and sends the image data collected by the second camera to the display to ensure that the mobile phone interface can immediately display the image data collected by the second camera at the new zoom ratio to meet the user's shooting needs.
[0211] S926: The camera hardware abstraction layer reads a delay parameter of the first camera from the first camera.
[0212] When the mobile phone stops the first camera from displaying and starts the second camera, it starts marking the number of frames continuously output by the first camera as a delay parameter. The delay parameter is used to characterize the duration of synchronizing the 3A parameters of the first camera to the second camera.
[0213] S927: The camera hardware abstraction layer determines that the delay parameter does not satisfy the delay frame number.
[0214] The camera hardware abstraction layer can pre-set a delay frame number as a time standard for measuring whether the 3A parameter synchronization process is completed. When the delay parameter meets (such as greater than or equal to) the delay frame number, it is determined that the duration of the 3A parameter synchronization of the first camera to the second camera is sufficient to complete the 3A parameter synchronization process.
[0215] When the delay parameter does not meet (such as being less than) the delay frame number, it is determined that the duration of synchronizing the 3A parameters of the first camera to the second camera is insufficient to complete the 3A parameter synchronization process, and it is necessary to continue synchronizing the 3A parameters of the first camera to the second camera.
[0216] Correspondingly, the camera hardware abstraction layer should continue to read the delay parameters of the first camera after stopping the first camera from sending the display, and continuously monitor whether the 3A parameter synchronization process is completed.
[0217] S928. The camera application sends a second frame request to the camera hardware abstraction layer, where the second frame request is used to instruct the second camera to collect image data.
[0218] After starting the second camera, the camera application needs to instruct the second camera to collect image data to maintain the continuity of image output.
[0219] In some embodiments, the second frame request carries an identifier of the second camera.
[0220] It should be noted that there is no execution order between step S926 and step S938, and they can be performed simultaneously. Exemplarily, when the second camera is started, the camera application sends a second frame request, and the camera hardware abstraction layer reads the delay parameter of the first camera.
[0221] S929: The camera hardware abstraction layer sends a second frame request to the ISP.
[0222] When the camera hardware abstraction layer reads the second frame request, it sends the second frame request to the ISP.
[0223] Exemplarily, after receiving the second frame request, the camera hardware abstraction layer can determine the second camera targeted by the second frame request based on the second camera identifier carried in the second frame request, and then send the second frame request to the ISP for processing.
[0224] S930. The ISP reads a second initial configuration 3A parameter of the second camera.
[0225] S931. The ISP sends a second frame request and a second initial configuration parameter to the second camera.
[0226] S932. The second camera collects image data c according to the 3A parameters of the second initial configuration.
[0227] S933. The second camera sends image data c to the camera hardware abstraction layer.
[0228] S934. The camera hardware abstraction layer sends the image data c collected by the second camera to the display.
[0229] S935. The camera application displays a third interface; the third interface includes image data c collected by the second camera.
[0230] After the camera is started, when the camera hardware abstraction layer instructs the camera to output a frame (i.e., output the collected image data), the camera first collects image data based on the initial configuration 3A parameters. Therefore, when the ISP receives a frame request, it first reads the second initial configuration 3A parameters of the second camera from the memory.
[0231] The ISP sends the second frame request to the second camera to instruct the second camera to collect image data. At the same time, the ISP sends the second initial 3A parameter read from the memory to the second camera.
[0232] When the second camera receives the second frame request and the second initial configuration 3A parameter, it collects image data based on the second initial configuration 3A parameter. Here, the image data collected by the second camera based on the second initial configuration 3A parameter is referred to as image data c.
[0233] The second camera sends the image data c to the camera hardware abstraction layer, the camera hardware abstraction layer displays the image data c collected by the second camera, and the camera application displays a third interface including the image data c collected by the second camera.
[0234] It should be noted that the second initial configuration 3A parameters of the second camera may not be able to adapt to the environmental parameters. Therefore, the image data c displayed by the camera application may be overexposed or underexposed. In order to solve this problem, this embodiment can immediately synchronize the 3A parameters in the main data stream to the auxiliary data stream when the second camera is started, that is, synchronize the 3A parameters of the first camera to the second camera. Since the 3A parameters of the first camera at this time are the 3A parameters adapted to the environmental parameters determined after the 3A parameter adjustment operation is completed. Therefore, the 3A parameters of the second camera obtained based on the synchronization of the 3A parameters of the first camera can also adapt to the environmental parameters. That is, the imaging effect of the image captured by the second camera based on the synchronized 3A parameters can be consistent with the imaging effect of the image captured by the first camera.
[0235] The specific implementation process of synchronizing the 3A parameters of the first camera to the second camera is described in detail below:
[0236] S936. The camera hardware abstraction layer reads the synchronization process switch parameters in the memory.
[0237] S937. The camera hardware abstraction layer determines that the synchronization process switch parameter is turned on.
[0238] In one embodiment, a synchronization process switch parameter is set in the memory. The synchronization process switch parameter is used to indicate whether it is necessary to execute the synchronization process of synchronizing the first 3A parameter of the first camera to the second camera. In general, the mobile phone can set the synchronization process switch parameter to be turned on (exemplarily, the synchronization process switch parameter is true, indicating that the synchronization process is turned on, and the synchronization process switch parameter is false, indicating that the synchronization process is turned off).
[0239] Correspondingly, when the second camera is started, the camera hardware abstraction layer can read the synchronization process switch parameter in the memory to determine whether to execute the process of synchronizing the first 3A parameter of the first camera to the second camera according to whether the synchronization process switch parameter is turned on. If the camera hardware abstraction layer determines that the synchronization process switch parameter is turned on, the process of synchronizing the first 3A parameter of the first camera to the second camera is executed.
[0240] In some embodiments, when the synchronization process switch parameter read into the memory by the camera hardware abstraction layer is closed, it can be determined that there is no need to execute the process of synchronizing the first 3A parameter of the first camera to the second camera. At this time, the image data collected by the second camera is updated to the main data stream.
[0241] S938. The camera hardware abstraction layer reads a first 3A parameter from the memory, where the first 3A parameter is a 3A parameter update value of the first camera updated last time.
[0242] It is understandable that, in step S910 and thereafter, the camera hardware abstraction layer continues to complete the operation of adjusting the 3A parameters of the first camera, so the 3A parameter update value is continuously updated. Correspondingly, the camera hardware abstraction layer can use the 3A parameter update value of the first camera updated last time as the first 3A parameter of the first camera.
[0243] In some embodiments, the 3A parameter update value may be in timestamp order, and the camera hardware abstraction layer may update the 3A parameter value of the first camera closest to the current moment in timestamp order, which may be referred to as the last updated 3A parameter.
[0244] In some embodiments, the 3A parameter update value carries the identification of the camera. Correspondingly, when the camera hardware abstraction layer determines that the last updated 3A parameter update value carries the identification of the first camera, the camera hardware abstraction layer uses the last updated 3A parameter update value as the first 3A parameter of the first camera.
[0245] S939. The camera hardware abstraction layer determines a second 3A parameter according to the first 3A parameter.
[0246] Because the 3A parameters required for the camera to adapt to the shooting environment are different at different magnifications. It is known that at a first magnification, when the imaging effect of the image data collected by the first camera based on the first 3A parameters is good, after starting the second camera, the mobile phone can map the second 3A parameters at the second magnification based on the first 3A parameters of the first camera at the first magnification based on the mapping relationship. The mobile phone updates the 3A parameters initially configured for the second camera to the second 3A parameters. The image data collected by the second camera based on the second 3A parameters can also achieve good imaging effects. Among them, the mapping relationship includes multiple zoom magnifications, and 3A parameters at each zoom magnification. For ease of explanation, the above-mentioned second 3A parameters may also be referred to as target shooting parameters.
[0247] Taking the 3A parameter as exposure as an example, the first exposure of the first camera at the first magnification is exposure a. After the second camera is started, the mobile phone can map the exposure a at the first magnification to obtain the exposure b at the second magnification based on the mapping relationship, and update the exposure parameter of the second camera to exposure b. Therefore, the exposure effect of the image data collected by the second camera based on the exposure b at the second magnification can be consistent with the exposure effect of the image data collected by the first camera.
[0248] S940. The camera hardware abstraction layer stores the second 3A parameter in the memory.
[0249] S941. The camera hardware abstraction layer sends a second 3A parameter to the ISP.
[0250] S942. The ISP updates the second initial configuration 3A parameters to second 3A parameters.
[0251] The camera hardware abstraction layer stores the second 3A parameters in the memory, sends the second 3A parameters to the ISP, and the ISP updates the second initial configuration 3A parameters of the second camera to the second 3A parameters. Based on this, the process of synchronizing the 3A parameters of the first camera to the second camera is completed.
[0252] In some embodiments, the second 3A parameters can also be understood as the 3A parameters of the second camera that were last updated. Based on this, after the camera hardware abstraction layer stores the second 3A parameters in the memory, when the camera application needs to adjust the 3A parameters of the second camera, the ISP can read the second 3A parameters from the memory. Alternatively, when the camera hardware abstraction layer uses the second camera as the main data stream and needs to synchronize the 3A parameters of other cameras based on the 3A parameters of the second camera, it is convenient for the ISP to read the second 3A parameters from the memory.
[0253] S943: The camera hardware abstraction layer determines that the delay parameter satisfies the delay frame number.
[0254] When the camera hardware abstraction layer continuously reads the delay parameters, when it is determined that the delay parameters meet the delay frame number, it can be determined that the duration of synchronizing the 3A parameters of the first camera to the second camera is sufficient to complete the process of synchronizing the 3A parameters of the first camera to the second camera, that is, the 3A parameter synchronization process is completed. The delay frame number can be determined based on the time taken by the 3A parameter synchronization process. For example, the delay frame number is 3 frames, or the delay frame number is 4 frames.
[0255] It should be understood that the above-mentioned delay parameter can also be the number of frames output by the second camera when the mobile phone starts the second camera (that is, after the first moment), and the above-mentioned delayed frame number can also be called the first number.
[0256] It should be noted that the time taken to synchronize the first 3A parameters of the first camera in the main data stream to the second camera is shorter than the time taken to adjust the 3A parameters of the second camera according to the 3A algorithm. Therefore, during the camera switching process, the image captured by the second camera can be prevented from being overexposed or underexposed.
[0257] Generally, the camera can output dozens of frames of image data per second, and it only takes three frames to synchronize the first 3A parameters of the first camera in the main data stream to the second camera. In this case, the naked eye can hardly see the process of the second camera switching from collecting image data based on the initial configuration 3A parameters to collecting image data based on the second 3A parameters. In other words, even if the image data collected by the second camera is overexposed or underexposed during the synchronization of the first 3A parameters of the first camera to the second camera, it is not visible to the naked eye.
[0258] S944: The camera hardware abstraction layer updates the image data collected by the second camera as the main data stream.
[0259] When the 3A parameter synchronization process is completed, the camera hardware abstraction layer can use the second camera as the main camera and update the image data collected by the second camera to the main data stream.
[0260] Normally, after the camera hardware abstraction layer uses the second camera as the primary camera, the first camera can stop working.
[0261] S945. The camera application sends a third frame request to the camera hardware abstraction layer, where the third frame request is used to instruct the second camera to collect image data.
[0262] S946: The camera hardware abstraction layer sends a third frame request to the ISP.
[0263] S947. The ISP sends a third frame request and a second 3A parameter to the second camera.
[0264] S948. The second camera collects image data d according to the second 3A parameter.
[0265] S949. The second camera sends image data d to the camera hardware abstraction layer.
[0266] S950. The camera hardware abstraction layer sends the image data d collected by the second camera to the display.
[0267] S951. The camera application displays a fourth interface; the fourth interface includes image data d collected by the second camera.
[0268] The camera hardware abstraction layer uses the image data collected by the second camera as the main data stream and sends the image data collected by the second camera to the display. At this time, the camera corresponding to the main data stream is the display camera.
[0269] It should be noted that during step 906 to step 944, the first camera is operating normally (such as continuously acquiring image data and transmitting it to the camera hardware abstraction layer). Also, during step 928 to step 951, the second camera is operating normally (such as continuously acquiring image data and transmitting it to the camera hardware abstraction layer). This embodiment only uses the first camera as the main data stream, the second camera as the auxiliary data stream, synchronizes the 3A parameters of the first camera to the second camera, and then switches the second camera to the main data stream as an example for illustration, and is not intended to limit the normal operating procedures of the first camera and the second camera.
[0270] It should be understood that the process of steps S945-S951 is the normal working process of the mobile phone sending the image data collected by the second camera for display after the mobile phone uses the image data collected by the second camera as the main data stream. Please refer to the process of the aforementioned steps S902-S935 and will not be repeated here.
[0271] It can be understood that, since the first 3A parameter of the first camera is a 3A parameter that has been adjusted and can adapt to the environmental parameters, and the second 3A parameter is obtained by mapping based on the first 3A parameter of the first camera. Therefore, the second 3A parameter can also adapt to the environmental parameters, and the imaging effect of the image data d collected by the second camera based on the second 3A parameter can be consistent with the imaging effect of the image data collected by the first camera based on the first 3A parameter.
[0272] Some other embodiments of the present application provide an electronic device, which may include: a memory and one or more processors. The memory is coupled to the processor. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device may perform each step in the above method embodiment. The structure of the electronic device can refer to Figure 5 The structure shown.
[0273] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each step in the above-mentioned method embodiment.
[0274] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each step in the above method embodiment.
[0275] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0276] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0277] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0278] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0279] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0280] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A shooting method, characterized in that: Applied to an electronic device, the electronic device includes a first camera and a second camera, and the method includes: In a first time interval, the electronic device uses the first camera to collect a first real-time image and displays the first real-time image, the first camera is a camera for collecting first-channel data, and the second camera does not work; At a first moment, receiving a first operation of a user; In response to the first operation, the electronic device uses the first camera and the second camera to capture real-time images and displays a second real-time image captured by the second camera; At a second moment, the electronic device calls the shooting parameters of the first data channel for the second camera to collect a real-time image; Among them, between the first moment and the second moment, the second camera is a camera for collecting second-channel data, and the first camera is a camera for collecting first-channel data.
2. The method according to claim 1, characterized in that The shooting parameters include at least one of the following: an automatic focus AF parameter, an automatic exposure AE parameter, and an automatic white balance AWB parameter.
3. The method according to claim 1, characterized in that After the electronic device calls the shooting parameters of the first data channel, the method further includes: At a third moment, the electronic device switches the second camera to a camera for collecting the first channel of data.
4. The method according to claim 3, characterized in that The electronic device further includes a third camera, After the electronic device switches the second camera to a camera for collecting the first channel of data at the third moment, the method further includes: At a fourth moment, receiving a second operation of the user; In response to the second operation, the electronic device uses the third camera to collect a third real-time image and displays the third real-time image; wherein, starting from the fifth moment, the third camera is the camera that collects the first channel of data; The time interval between the fourth moment and the fifth moment is smaller than the time interval between the first moment and the third moment.
5. The method according to claim 3 or 4, characterized in that: At the third moment, the electronic device switches the second camera to a camera for collecting the first channel of data, including: At the third moment, the electronic device determines that the number of frames output by the second camera after the first moment is greater than or equal to the first number; In response to determining that the number of frames is greater than or equal to the first number, the electronic device switches the second camera to a camera for collecting the first channel of data.
6. The method according to claim 5, characterized in that The method further comprises: Between the first moment and the third moment, the electronic device determines that the number of frames is less than the first number, and the electronic device does not switch the second camera to the camera for collecting the first channel of data.
7. The method according to any one of claims 1 to 4, characterized in that The electronic device calls the shooting parameters of the first data path, including: The electronic device calls the shooting parameters through a first function, and the first function has a function of calling the shooting parameters of the current first data in the electronic device.
8. The method according to any one of claims 1 to 4, characterized in that The displaying of the first real-time image comprises: The electronic device displays a first interface, the first interface includes a shooting preview area, and the shooting preview area includes the first real-time image; Among them, the first operation includes an operation of adjusting the first zoom ratio to the second zoom ratio in the first interface; the first zoom ratio is less than the second zoom ratio value, and the second zoom ratio is greater than the second zoom ratio value; or, the first zoom ratio is greater than the first zoom ratio value, and the second zoom ratio is less than the first zoom ratio value; the first zoom ratio value is less than the second zoom ratio value.
9. The method according to claim 3 or 4, characterized in that: The electronic device calls the shooting parameters of the first data path, including: In response to determining that the synchronization switch is turned on, the electronic device calls the shooting parameters of the first data.
10. The method according to any one of claims 1 to 4, characterized in that After the electronic device calls the shooting parameters of the first data channel, the method further includes: The electronic device generates target shooting parameters according to the called shooting parameters, and the target shooting parameters are used for the second camera to collect real-time images.
11. The method according to claim 10, characterized in that Before the electronic device calls the shooting parameters of the first data channel, the method further includes: The electronic device queries for initial configuration shooting parameters, and the initial configuration shooting parameters are used for the second camera to capture real-time images.
12. An electronic device, characterized in that: The electronic device includes a first camera, a second camera, a display screen, a memory and one or more processors; the first camera, the second camera, the display screen, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method described in any one of claims 1-11.
13. A computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for setting camera starting configuration and electronic equipment
CN113438408A
Shooting method, shooting device and electronic equipment
CN114286003A
Camera switching method and device, electronic equipment and storage medium
CN116095476A
Shooting method and electronic equipment
CN117278850A