Method and electronic device for controlling camera frame rate
By independently controlling the camera frame rate, the problem of power loss when multiple cameras are combined for imaging is solved, achieving the effect of reducing power consumption and increasing imaging speed while ensuring the shooting effect.
Patent Information
- Application Number
- CN202211032087.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-08-26
AI Technical Summary
When multiple cameras are combined for imaging, how to reduce power consumption while ensuring the shooting effect?
By independently controlling the frame rates of the main camera and the secondary camera, the image of the main camera is only used for preview interface display during the photo preview stage. The secondary camera outputs images at a lower frame rate, and the frame rate of the secondary camera is increased when taking pictures. Same as the main camera to achieve image synthesis and reduce power consumption.
Without affecting the shooting effect, the power loss when multiple cameras are combined for imaging is reduced, the imaging quality is ensured, and the response speed of the sub-camera during the imaging stage is improved.
Smart Images

Figure CN117641116B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a method and electronic device for controlling a camera frame rate. Background Art
[0002] As people have higher and higher requirements for imaging quality, electronic devices (for example, mobile phones) usually integrate multiple cameras (also called lenses), such as wide-angle lenses, telephoto lenses, ultra-wide-angle lenses, black and white lenses, macro lenses, computer vision (CV) lenses, etc. Multiple cameras can be combined to form images to improve the shooting quality in different scenes. When multiple cameras are combined for imaging, one of the multiple cameras is the main camera (referred to as the main camera), and the remaining one or more are auxiliary cameras (referred to as auxiliary cameras). The images output by the main camera and the auxiliary camera are synthesized according to the set rules to achieve shooting effects in different scenes; however, the output image of the camera will cause power loss. How to reduce power loss while ensuring the shooting effect is a problem that needs to be solved. Summary of the invention
[0003] The present application provides a method and electronic device for controlling the frame rate of a camera, which can reduce the power loss when multiple cameras are combined for imaging without affecting the shooting effect.
[0004] In order to achieve the above objectives, this application adopts the following technical solutions:
[0005] In a first aspect, an electronic device is provided, comprising: a processor, a display, a first camera, and a second camera; an operating system of the electronic device is run on the processor, and a camera application is installed in the operating system; wherein the processor is used to receive a first message indicating that a user has started an operation of starting a camera application; and is also used to start the first camera and the second camera in response to receiving the first message; the first camera is used to output images to the processor at a first frame rate; the second camera is used to output images to the processor at a second frame rate, and the second frame rate is less than the first frame rate; the processor is also used to transmit the image output by the first camera to the camera application; the display is used to display a preview interface of the camera application, and the preview interface includes the image output by the first camera.
[0006] In this solution, when multiple cameras (camera 1 and camera 2) are started for combined imaging, the frame rates of camera 1 and camera 2 are controlled separately. During the photo preview stage, only the image captured by the main camera is used for display on the preview interface, and the image output by the secondary camera is not used for display. The secondary camera outputs images at a lower frame rate than the main camera, which can reduce power consumption during photo preview.
[0007] According to the first aspect, in some embodiments, the processor is further configured to, after starting the first camera and the second camera, notify the first camera to capture images at a first frame rate, and notify the second camera to capture images at a second frame rate.
[0008] In the method, the processor controls the frame rates of images captured by the first camera and the second camera.
[0009] According to the first aspect, in some embodiments, the processor is used to send an image output request message to the first camera at a first frequency; and is also used to send an image output request message to the second camera at a second frequency; wherein the image output request message is used to request the camera to output a frame of image, the first frequency is equal to the first frame rate, and the second frequency is equal to the second frame rate.
[0010] In this method, each time the processor sends a request message for image output to the camera, the camera can be triggered to transmit a frame of image to the camera. The processor sends a request message for image output to the first camera at a first frequency equal to the first frame rate, which can trigger the first camera to output the captured image to the processor at the first frame rate. The processor sends a request message for image output to the second camera at a second frequency equal to the second frame rate, which can trigger the second camera to output the captured image to the processor at the second frame rate. In this way, the first camera can output images to the processor at the first frame rate; and the second camera can output images to the processor at the second frame rate.
[0011] According to the first aspect, in some embodiments, the processor is further configured to notify the second camera to capture images at an initial frame rate before notifying the second camera to capture images at a second frame rate; wherein the initial frame rate is the first frame rate.
[0012] According to the first aspect, in some implementations, the processor is further configured to, after receiving the first message, determine to start the first camera and the second camera according to the camera configuration of the electronic device and a preset strategy.
[0013] According to the first aspect, in some implementations, the processor is further configured to obtain the camera configuration of the electronic device after receiving the first message, so that the latest camera configuration can be obtained each time and a suitable camera can be selected to start.
[0014] According to the first aspect, in some embodiments, the processor is further used to receive a second message, the second message being used to indicate that an operation of starting photo-taking and imaging by a user in the preview interface has been received; the processor is further used to notify the second camera to output images at a first frame rate in response to receiving the second message; the second camera is further used to output images to the processor at the first frame rate; the processor is further used to synthesize a photo by combining the output image of the first camera and the output image of the second camera; wherein the first camera outputs images at the first frame rate.
[0015] In this solution, when taking photos, the secondary camera outputs images at the same frame rate as the primary camera, which can be used to synthesize the output image of the first camera and the output image of the second camera into a photo to ensure image quality.
[0016] The processor is specifically used to: combine M frames of images output by the first camera and N frames of images output by the second camera into a photo; wherein M>=1, N>=1.
[0017] In some embodiments, the second frame rate is greater than 0. For example, the second frame rate is half of the first frame rate. The second frame rate is greater than 0, that is, the secondary camera keeps outputting images during the photo preview stage instead of stopping outputting images; compared with the method in which the secondary camera does not output images during the preview stage, the method in which the secondary camera keeps outputting images at a lower frame rate, because the secondary camera is always outputting images, but the image output frame rate is lower than that of the main camera, the AF, AE and AWB functions of the secondary camera are always in a low power working state; when the image output frame rate of the secondary camera is adjusted upward (for example, adjusted to the first frame rate) during the photo imaging stage, a quick response can be achieved to avoid affecting the imaging speed or quality.
[0018] In a second aspect, a method for controlling a camera frame rate is provided, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the method includes: receiving an operation by a user to start a camera application; in response to the operation to start the camera application, starting the first camera and the second camera; controlling the first camera to output an image at a first frame rate; controlling the second camera to output an image at a second frame rate, wherein the second frame rate is less than the first frame rate; and displaying a preview interface of the camera application, wherein the preview interface includes an image output by the first camera.
[0019] In this method, when multiple cameras (camera 1 and camera 2) are started for combined imaging, the frame rates of camera 1 and camera 2 are controlled separately. In the photo preview stage, only the image captured by the main camera is used for display on the preview interface, and the image output by the secondary camera is not used for display. The secondary camera outputs images at a lower frame rate than the main camera, which can reduce power consumption during photo preview.
[0020] According to the second aspect, in some embodiments, before controlling the second camera to output images at the second frame rate, the method further includes: controlling the second camera to output images at an initial frame rate; the initial frame rate is the first frame rate.
[0021] According to the second aspect, in some embodiments, the method further includes: receiving an operation of a user to start photo imaging in the preview interface; in response to the operation of starting photo imaging, controlling the second camera to output images at a first frame rate; synthesizing the output image of the first camera and the output image of the second camera into a photo; wherein the first camera outputs images at the first frame rate.
[0022] In this method, when taking photos, the secondary camera increases the frame rate to the same as that of the main camera to output images, which can be used to synthesize the output image of the first camera and the output image of the second camera into a photo to ensure the imaging quality.
[0023] According to the second aspect, in some embodiments, after the output image of the first camera and the output image of the second camera are synthesized into a photo, the second camera is controlled to output the image at a second frame rate; wherein the first camera outputs the image at the first frame rate; and a preview interface of the camera application is displayed, the preview interface including the image output by the first camera.
[0024] In this method, after the photo imaging is completed, the preview interface continues to be displayed, and the preview interface only displays the image captured by the first camera; the output frame rate of the second camera is reduced to the second frame rate again, which can reduce the power consumption in the photo preview stage.
[0025] The step of synthesizing the output image of the first camera and the output image of the second camera into a photo includes: synthesizing M frames of images output by the first camera and N frames of images output by the second camera into one photo; wherein M>=1, N>=1.
[0026] According to the second aspect, in some embodiments, the second frame rate is greater than 0. For example, the second frame rate is half of the first frame rate. The second frame rate is greater than 0, that is, the secondary camera keeps outputting images during the photo preview stage instead of stopping outputting images; compared with the method in which the secondary camera does not output images during the preview stage, the method in which the secondary camera keeps outputting images at a lower frame rate, because the secondary camera is always outputting images, but the image output frame rate is lower than that of the main camera, the AF, AE and AWB functions of the secondary camera are always in a low power working state; when the image output frame rate of the secondary camera is adjusted upward (for example, adjusted to the first frame rate) during the photo imaging stage, a quick response can be achieved to avoid affecting the imaging speed or quality.
[0027] In a third aspect, a method for controlling a camera frame rate is provided, which can be applied to a chip system, the method comprising: receiving a first message, the first message being used to indicate that an operation of starting a camera application by a user has been received; in response to receiving the first message, notifying the first camera and the second camera to start; notifying the first camera to capture images at a first frame rate; notifying the second camera to capture images at a second frame rate, the second frame rate being less than the first frame rate; receiving an image output by the first camera at the first frame rate; receiving an image output by the second camera at the second frame rate; transmitting the image output by the first camera to the camera application, so that the camera application displays a preview interface based on the image output by the first camera.
[0028] In this method, when multiple cameras (camera 1 and camera 2) are started for combined imaging, the frame rates of camera 1 and camera 2 are controlled separately. In the photo preview stage, only the image captured by the main camera is used for display on the preview interface, and the image output by the secondary camera is not used for display. The secondary camera outputs images at a lower frame rate than the main camera, which can reduce power consumption during photo preview.
[0029] According to the third aspect, in some embodiments, after notifying the first camera to capture images at a first frame rate and notifying the second camera to capture images at a second frame rate, the method further includes: sending an image output request message to the first camera at a first frequency, and sending an image output request message to the second camera at a second frequency; wherein the image output request message is used to request the camera to output a frame of image, the first frequency is equal to the first frame rate, and the second frequency is equal to the second frame rate.
[0030] In this method, each time the processor sends a request message for image output to the camera, the camera can be triggered to transmit a frame of image to the camera. The processor sends a request message for image output to the first camera at a first frequency equal to the first frame rate, which can trigger the first camera to output the captured image to the processor at the first frame rate. The processor sends a request message for image output to the second camera at a second frequency equal to the second frame rate, which can trigger the second camera to output the captured image to the processor at the second frame rate. In this way, the first camera can output images to the processor at the first frame rate; and the second camera can output images to the processor at the second frame rate.
[0031] According to the third aspect, in some implementations, before notifying the second camera to capture images at the second frame rate, the second camera is also notified to capture images at an initial frame rate; the initial frame rate is the first frame rate.
[0032] According to the third aspect, in some implementations, after receiving the first message, the camera configuration is obtained; and the first camera and the second camera are started according to the camera configuration and a preset strategy. In this way, the latest camera configuration can be obtained each time, and a suitable camera can be selected to start.
[0033] According to the third aspect, in some embodiments, the method further includes: receiving a second message, the second message being used to indicate that an operation of starting a photo-taking operation in the preview interface by the user has been received; in response to receiving the second message, notifying the second camera to capture images at a first frame rate; receiving images output by the second camera at the first frame rate; synthesizing the output images of the first camera and the output images of the second camera into a photo; wherein the first camera outputs images at the first frame rate.
[0034] In this method, when taking photos, the secondary camera increases the frame rate to the same as that of the main camera to output images, which can be used to synthesize the output image of the first camera and the output image of the second camera into a photo to ensure the imaging quality.
[0035] According to the third aspect, in some embodiments, synthesizing the output image of the first camera and the output image of the second camera into a photo includes: synthesizing M frames of images output by the first camera and N frames of images output by the second camera into one photo; wherein M>=1, N>=1.
[0036] According to the third aspect, in some embodiments, notifying the first camera to capture images at a first frame rate and notifying the second camera to capture images at a second frame rate includes: setting an exposure parameter of the first camera to a first value, setting an exposure parameter of the second camera to a second value, and the second value is greater than the first value.
[0037] In one implementation, the second frame rate is half of the first frame rate, and the second value is twice the first value.
[0038] In a fourth aspect, an electronic device is provided, which has the function of implementing the method described in the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0039] In a fifth aspect, an electronic device is provided, comprising: a processor; the processor is used to couple with a memory, and after reading instructions in the memory, execute a method as described in any one of the above third aspects according to the instructions.
[0040] In a sixth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer can execute any of the methods described in the second aspect.
[0041] In a seventh aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the methods described in the second aspect.
[0042] In an eighth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the third aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.
[0043] Among them, the technical effects brought about by any design method in the fourth to eighth aspects can refer to the technical effects brought about by different design methods in the corresponding second or third aspects, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0045] Figure 2 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of the interaction between modules in the method for controlling the camera frame rate provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the interaction between modules in the method for controlling the camera frame rate provided in an embodiment of the present application;
[0048] Figure 5 A flowchart of a method for controlling a camera frame rate provided in an embodiment of the present application;
[0049] Figure 6 A flowchart of a method for controlling a camera frame rate provided in an embodiment of the present application;
[0050] Figure 7 A flowchart of a method for controlling a camera frame rate provided in an embodiment of the present application;
[0051] Figure 8 A schematic diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include such expressions as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are a kind of "or" relationship.
[0053] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0054] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" 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 "exemplary" or "for example" is intended to present related concepts in a specific way.
[0055] For electronic devices with multiple cameras (e.g., mobile phones), when users start the camera application to take photos, they can start multiple cameras for combined imaging according to preset strategies to improve the shooting quality in different scenes. For example, the RGB camera and the computer vision (CV) camera can be used to achieve dual-channel fusion photography to improve the shooting effect in scenes such as the sky, mountains, green plants, and portraits.
[0056] Generally speaking, considering the processing power and power consumption of electronic device processors, when previewing photos, only the image output by the main camera is transmitted to the camera application for display, and the image output by the secondary camera is not transmitted to the camera application. When taking photos, the images output by the main camera and the secondary camera are combined to improve the photo effect.
[0057] In the current implementation, when previewing photos, the image output by the secondary camera is not used for display, but it is still output at the same frame rate as the main camera. The frame rate is the number of images output by the camera per unit time, generally expressed in frames per second (fps), such as 30fps. In this implementation, the frame rates of the main and secondary cameras are the same, and the frame rates of the main and secondary cameras are bound and simple to control; however, the secondary camera outputs images at a higher frame rate without transmitting them to the camera application, resulting in unnecessary power loss.
[0058] The embodiment of the present application provides a method for controlling the frame rate of a camera. When previewing a photo, the frame rates of the main camera and the secondary camera are controlled respectively, and the secondary camera is controlled to output images at a lower frame rate to reduce power consumption. When taking photos, the frame rate of the secondary camera is increased to the same as the frame rate of the main camera, so as to improve the photo effect in special scenes.
[0059] The method provided in the embodiment of the present application can be applied to electronic devices including display screens. The above-mentioned electronic devices may include mobile phones, tablet computers, laptop computers, personal computers (PCs), ultra-mobile personal computers (UMPCs), handheld computers, netbooks, smart home devices (e.g., smart TVs, smart screens, large screens, smart speakers, smart air conditioners, etc.), personal digital assistants (PDAs), wearable devices (e.g., smart watches, smart bracelets, etc.), vehicle-mounted devices, virtual reality devices, etc., and the embodiments of the present application do not impose any restrictions on this.
[0060] Figure 1 FIG. 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. Figure 1 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 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 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0061] Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
[0062] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 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.
[0063] 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 memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0064] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0065] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0066] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0067] 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 electronic device 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 are stored in an external memory card. The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 can execute various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0068] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0069] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also power the electronic device through the power management module 141 .
[0070] 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, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
[0071] The wireless communication function of the electronic device 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.
[0072] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 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.
[0073] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
[0074] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194.
[0075] The wireless communication module 160 can provide wireless communication solutions including WLAN (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0076] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0077] The electronic device 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 headphone jack 170D, and the application processor.
[0078] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0079] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device 100 can receive the button input and generate a key signal input related to the user settings and function control of the electronic device 100. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0080] The electronic device 100 implements 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 that execute program instructions to generate or change display information.
[0081] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In the embodiment of the present application, the display screen 194 can be used to display a human-computer interaction interface, a photo preview interface, etc.
[0082] The electronic device 100 can realize the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0083] Camera 193 may include 1 to N cameras. For example, the electronic device may include a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, a black and white camera, a macro camera, a CV camera, a depth of field camera, etc., which is not limited in this application. When taking pictures, multiple cameras can be combined to form images according to preset rules according to different scenes to improve the shooting quality in different scenes. The multiple cameras include a main camera and one or more secondary cameras. In the following embodiments, one main camera and one secondary camera are used as examples for introduction. It can be understood that when more secondary cameras are included, the execution logic of the remaining secondary cameras can refer to the execution logic of the secondary cameras in the following embodiments.
[0084] The methods in the following embodiments can all be implemented in the electronic device 100 having the above hardware structure.
[0085] In the embodiment of the present application, the electronic device is an electronic device that can run an operating system and install application programs. Optionally, the operating system running on the electronic device can be system, system, For example, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0086] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through interfaces. In some embodiments, the Android system may include an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, a hardware abstraction layer (HAL) and a kernel layer. It should be noted that the embodiments of the present application are illustrated by taking the Android system as an example. In other operating systems (such as Hongmeng system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those of the embodiments of the present application, the solutions of the present application can also be implemented.
[0087] Among them, the application layer can include a series of application packages.
[0088] like Figure 2 As shown, the application package may include camera applications, gallery, calendar, call, map, navigation, wireless local area network (WLAN), Bluetooth, music, video, short message, setting and other applications. Of course, the application layer may also include other application packages, such as payment applications, shopping applications, banking applications or chat applications, etc., which are not limited in this application.
[0089] In the embodiment of the present application, an application with a shooting function, such as a camera application, can be installed in the application layer. The camera application has the functions of taking photos and videos. Of course, when other applications need to use the shooting function, they can also call the camera application to implement the shooting function.
[0090] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. For example, it may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, and a camera service, etc., and the embodiments of the present application do not impose any restrictions on this.
[0091] The Camera Service can be started when the electronic device is powered on. The Camera Service can interact with the Camera HAL in the Hardware Abstraction Layer (HAL) during operation.
[0092] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0093] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0094] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0095] OpenGL ES is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0096] SGL is a graphics engine for 2D graphics.
[0097] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0098] The HAL layer is an encapsulation of the Linux kernel driver, providing an interface to the upper layer and shielding the implementation details of the underlying hardware.
[0099] The HAL layer may include Wi-Fi HAL, audio HAL, camera HAL, decision-making module, etc.
[0100] The camera HAL is the core software framework of the camera, which is responsible for interacting with the hardware devices (such as cameras) that implement the shooting function in electronic devices. On the one hand, the camera HAL hides the implementation details of the relevant hardware devices (such as specific image processing algorithms), and on the other hand, it provides the Android system with an interface for calling the relevant hardware devices.
[0101] The decision module is used to adapt the initialization phase logic of opening the camera application (for example, determining the camera to be started when opening the camera application, and determining the frame rate of the camera), the photo preview phase logic (for example, determining the frame rate of the main camera and the secondary camera during photo preview), and the photo imaging phase logic (for example, determining the frame rate of the main camera and the secondary camera during photo imaging). In one example, the decision module includes a frame rate decision submodule for determining the frame rate of the camera (such as the secondary camera). In other embodiments, the decision module can also be set in the camera HAL.
[0102] The kernel layer is the layer between hardware and software. The kernel layer can include display driver, camera driver, audio driver, sensor driver, etc. Among them, the camera driver is the driver layer of the Camera device, which is mainly responsible for the interaction with the hardware.
[0103] The hardware layer includes displays, cameras, etc. Cameras may include, for example, wide-angle cameras (also called wide-angle camera modules or wide-angle lenses), telephoto cameras (also called telephoto camera modules or telephoto lenses), ultra-wide-angle cameras (also called ultra-wide-angle camera modules or ultra-wide-angle lenses), black-and-white cameras (also called black-and-white camera modules or black-and-white lenses), macro cameras (also called macro camera modules or macro lenses), computer vision (CV) cameras (also called CV camera modules or CV lenses), etc.
[0104] The following takes a mobile phone as an example of an electronic device to describe in detail the method for controlling the camera frame rate provided in an embodiment of the present application.
[0105] Users can use the camera of their mobile phone to take photos or videos. Figure 3 (a), the desktop of the mobile phone 100 includes shortcut icons of multiple applications. The user can click the icon 101 of the "Camera" application to start the camera application. The mobile phone 100 receives the user's click operation on the icon 101 and starts the camera application. The camera application starts the camera of the mobile phone to capture images and displays the images captured by the camera as a preview interface. Figure 3 As shown in (b), the mobile phone 100 displays a preview interface 102.
[0106] Between the mobile phone 100 receiving the user's operation of starting the camera application (for example, clicking the icon 101 ) and the mobile phone 100 displaying the preview interface 102 , the mobile phone 100 performs a series of internal processing.
[0107] like Figure 3 As shown in (a), the mobile phone 100 receives the user's click operation on the icon 101 and starts the camera application. Figure 3As shown in (c), the camera application sends a preview request to the camera HAL. The camera HAL sends a preview request to the decision module. The decision module determines the camera to be turned on according to the camera configuration information and the preset strategy. Among them, the decision module can use the strategy that can be obtained in the conventional technology to determine the camera to be turned on. For example, the camera to be turned on can be determined according to the light brightness around the mobile phone, the shooting mode, the type of camera included in the mobile phone, etc. For example, in some scenarios, the decision module determines to turn on a camera. In some scenarios (such as portrait mode), the decision module determines to turn on multiple cameras, and the images collected by multiple cameras are transmitted to the camera application. In some scenarios, the decision module determines to turn on multiple cameras, including the main camera and the secondary camera. In the photo preview stage, the image collected by the main camera is transmitted to the camera application for display; in the photo imaging stage, the images collected by the main camera and the secondary camera are merged to generate photos. That is to say, the image collected by the main camera will be used in the photo preview stage and the photo imaging; the image collected by the secondary camera is not used in the photo preview stage, but is used in the photo imaging stage. Exemplarily, if the decision module determines to enable black and white fusion photography, it is determined that the main camera is a wide-angle camera and the secondary camera is a black and white camera. Exemplarily, if the decision module determines that CV fusion photography is enabled, the main camera is determined to be a wide-angle camera, and the secondary camera is a CV camera. It should be noted that in the embodiment of the present application, the image captured by the camera is transmitted to the camera application, which may include transmitting each frame of the image captured by the camera to the camera application, merging multiple frames of images captured by the camera and transmitting them to the camera application, and synthesizing images captured by multiple cameras and transmitting them to the camera application.
[0108] The decision module also determines the frame rate of the camera according to a preset strategy. The decision module can use a strategy that can be obtained in conventional technology to determine the frame rate of the camera. For example, the decision module can determine the frame rate of the camera according to the type of camera turned on, the frame rate supported by the camera, the size of the system's available resources, etc.
[0109] In one implementation, the decision module determines that the preview stage is in progress according to the preview request, and then determines that the frame rate of the main camera is the first frame rate according to the above preset strategy. The decision module also determines that the frame rate of the secondary camera is the second frame rate, where the second frame rate is less than the first frame rate. For example, the frame rate of the main camera is 30fps, and the frame rate of the secondary camera is 15fps. In one example, the decision module can call the frame rate decision submodule ( Figure 3 (not shown) specifically determines the frame rate of the secondary camera output.
[0110] The decision module notifies the camera HAL that the frame rate of the main camera is the first frame rate and the frame rate of the secondary camera is the second frame rate. The camera HAL controls camera 1 (main camera) to output images at the first frame rate and controls camera 2 (secondary camera) to output images at the second frame rate.
[0111] For example, Figure 3 As shown in (d), camera 1 (main camera) returns images to the camera HAL at a first frame rate, and camera 2 (secondary camera) returns images to the camera HAL at a second frame rate. Currently in the photo preview stage, the camera HAL transmits the image returned by camera 1 (main camera) to the camera application.
[0112] The camera application displays the acquired image, that is, the image captured by camera 1 (main camera) is displayed in the preview interface. Figure 3 As shown in (b), the mobile phone 100 displays a preview interface 102, and the preview interface 102 displays the image captured by camera 1 (main camera).
[0113] The method for controlling the camera frame rate provided in the embodiment of the present application is that in the photo preview stage, the main camera outputs images at a first frame rate, and transmits the images output by the main camera to the camera application for display to generate a preview interface; the secondary camera outputs images at a second frame rate, and the images output by the secondary camera are not transmitted to the camera application. Among them, the first frame rate is greater than the second frame rate. In this way, the main camera outputs images at a normal frame rate to ensure the image quality of the preview interface; the images output by the secondary camera are not transmitted to the camera application, saving mobile phone processing resources; the secondary camera outputs images at a second frame rate that is lower than the first frame rate, which can reduce the power consumption of the mobile phone. Moreover, the second frame rate is greater than 0, that is, the secondary camera keeps outputting images instead of stopping outputting images. Compared with the method in which the secondary camera does not output images in the preview stage, in the method provided in the embodiment of the present application, since the secondary camera has been outputting images, but the output frame rate is lower than that of the main camera, the secondary camera's auto focus (AF), automatic exposure (AE) and automatic white balance (AWB) functions are always in a low-power working state. When the output frame rate of the secondary camera is adjusted upward (for example, to the first frame rate) in the photo imaging stage, a quick response can be achieved to avoid affecting the imaging speed or quality.
[0114] In the photo preview interface, the user can start the photo imaging. Figure 4 As shown in (a), the preview interface 102 includes a control 103, and the user can click the control 103 to start taking pictures. After receiving the user's click operation on the control 103, the mobile phone 100 generates a photo according to the image collected by the camera. Figure 4 As shown in (b) of FIG. 1 , the mobile phone 100 displays a thumbnail 104 of the photo.
[0115] From the time when the mobile phone 100 receives the user's operation to start photographing (eg, clicking the control 103 ) to the time when the mobile phone 100 generates the photo, the mobile phone 100 performs a series of internal processing.
[0116] like Figure 4 As shown in (a), the mobile phone 100 receives a user click operation on the control 103. Further, as Figure 4 As shown in (c), the camera application sends an imaging request to the camera HAL. The camera HAL sends an imaging request to the decision module. The decision module determines the image output frame rate of the secondary camera according to the imaging request and the image output frame rate of the main camera, that is, the image output frame rate of the secondary camera is equal to the image output frame rate of the main camera. For example, if the image output frame rate of the main camera is the first frame rate, then the image output frame rate of the secondary camera is determined to be the first frame rate. In one example, the decision module can call the frame rate decision submodule ( Figure 3 (not shown) specifically determines the frame rate of the secondary camera output.
[0117] Optionally, in some implementations, the frame rate of the main camera during the photo imaging stage may be different from the frame rate of the main camera during the photo preview stage. For example, during the photo preview stage, the decision module determines that the frame rate of the main camera is the first frame rate, and the frame rate of the secondary camera is the second frame rate, wherein the second frame rate is less than the first frame rate; during the photo imaging stage, the decision module determines that the frame rate of the main camera is the third frame rate, and determines that the frame rate of the secondary camera is also the third frame rate.
[0118] The following continues to introduce the main camera's image output frame rate at the first frame rate during the photo imaging stage. The camera HAL controls camera 1 (main camera) to output images at the first frame rate, and controls camera 2 (secondary camera) to output images at the first frame rate. Figure 4 As shown in (d), camera 1 (main camera) returns an image to the camera HAL at a first frame rate, and camera 2 (secondary camera) returns an image to the camera HAL at a first frame rate. Currently in the photo imaging stage, the camera HAL synthesizes the image returned by camera 1 (main camera) and the image returned by camera 2 (secondary camera), and transmits the synthesized image to the camera application. The camera application saves the obtained synthesized image as a photo. In one implementation, as Figure 4 As shown in (b) of FIG. 1 , the mobile phone 100 displays a thumbnail 104 of the photo.
[0119] The method for controlling the camera frame rate provided in the embodiment of the present application is that during the photo imaging stage, the main camera and the auxiliary camera output images at the same frame rate, and generate photos based on the images output by the main camera and the auxiliary camera. In this way, the images output by the main camera and the auxiliary camera are synthesized according to the set rules, so that the shooting effects in different scenes can be achieved.
[0120] After the shooting and imaging are completed, the camera application sends an imaging completion request to the camera HAL. The camera HAL sends an imaging completion request to the decision module. The decision module (specifically, it can be executed by the frame rate decision submodule) determines that the image output frame rate of the secondary camera is restored to the second frame rate. The decision module notifies the camera HAL that the image output frame rate of the main camera is the first frame rate, and the image output frame rate of the secondary camera is the second frame rate. The camera HAL controls camera 1 (main camera) to output images at the first frame rate, and controls camera 2 (secondary camera) to output images at the second frame rate. Camera 1 (main camera) returns images to the camera HAL at the first frame rate, and camera 2 (secondary camera) returns images to the camera HAL at the second frame rate. The camera HAL transmits the image returned by camera 1 (main camera) to the camera application. The camera application transmits the acquired image to the camera application for display, that is, the image captured by camera 1 (main camera) is displayed on the preview interface.
[0121] That is to say, after the photo is taken, the camera returns to the photo preview stage, and the main camera outputs images at the first frame rate, and transmits the images output by the main camera to the camera application to generate a preview interface; the secondary camera outputs images at the second frame rate, and the images output by the secondary camera are not transmitted to the camera application. The main camera outputs images at a normal frame rate to ensure the image quality of the preview interface; the secondary camera outputs images at a second frame rate that is lower than the first frame rate, which can reduce the power consumption of the mobile phone.
[0122] The method for controlling the camera frame rate provided in the embodiment of the present application controls the image output frame rate of the secondary camera separately from the image output frame rate of the main camera; in the photo preview stage, the image output frame rate of the secondary camera is lower than the image output frame rate of the main camera, thereby reducing the power consumption of the mobile phone; when the photo imaging is started, the image output frame rate of the secondary camera is increased to the same as the image output frame rate of the main camera, thereby improving the photo effect in special scenes; and the power consumption of multiple cameras during combined imaging is reduced without affecting the photo effect.
[0123] For example, Figure 5 A message interaction flow chart of a method for controlling a camera frame rate provided in an embodiment of the present application.
[0124] like Figure 5 As shown, the method may include:
[0125] S501: The camera application receives an operation from a user to start the camera application.
[0126] Exemplarily, the user can start the camera application by clicking the icon of the camera application. In other examples, the user can start the camera application in other ways. For example, the user can start the camera application by voice, gesture, etc.
[0127] When the input device (such as a touch screen, microphone, camera, etc.) of the mobile phone detects the operation of the user starting the camera application, a first message may be generated, where the first message is used to indicate that the operation of the user starting the camera application has been received. The processor distributes the first message to the camera application. When the camera application receives the first message, it means that the operation of the user starting the camera application has been received.
[0128] S502: The camera application sends a preview request message to the camera HAL.
[0129] The camera application receives the operation of starting the camera application and sends a preview request message to the camera HAL.
[0130] S503: The camera HAL sends a preview request message to the decision module.
[0131] S504: The decision module receives the preview request message, determines to turn on camera 1 and camera 2, and determines the initial frame rate of the camera.
[0132] A mobile phone can be equipped with multiple cameras. The camera configuration information includes the number of cameras on the mobile phone, the type of each camera (for example, wide-angle camera, telephoto camera, ultra-wide-angle camera, black-and-white camera, macro camera, or CV camera), and the hardware parameters of each camera (for example, the frame rate supported by the camera).
[0133] In one implementation, the decision module determines to turn on all cameras on the mobile phone. For example, the mobile phone includes two cameras, camera 1 and camera 2, and the decision module determines to turn on the camera of the mobile phone, that is, to turn on camera 1 and camera 2. The logic of this implementation is simple.
[0134] In one implementation, the camera configuration information is stored in the mobile phone, and the decision module determines to turn on camera 1 and camera 2 according to the camera configuration information and a preset strategy.
[0135] In one implementation, in S503, the camera HAL receives a preview request message from the camera application, and then obtains the camera configuration information of the mobile phone. When the camera HAL sends the preview request message to the decision module, it also sends the camera configuration information to the decision module. The decision module determines to turn on camera 1 and camera 2 according to the camera configuration information and the preset strategy. This implementation can obtain the configuration of the camera on the mobile phone in real time, can turn on the camera combination more accurately, and improve the quality of taking pictures.
[0136] The decision module may use a strategy that can be obtained in conventional technology to determine the camera to be turned on. In some embodiments, the decision module determines to turn on camera 1 and camera 2, where camera 1 is the main camera and camera 2 is the secondary camera. For example, camera 1 is a wide-angle camera and camera 2 is a CV camera.
[0137] The decision module can use the frame rate strategy that can be obtained in conventional technology to determine the initial frame rate of camera one and camera two. For example, based on the image output frame rates supported by camera one and camera two respectively, determine the image output frame rate supported by camera one and camera two. If there are multiple image output frame rates supported by camera one and camera two, you can select one of the multiple image output frame rates as the initial frame rate. For example, select the largest image output frame rate supported by camera one and camera two; for example, pre-set a default image output frame rate, if camera one and camera two both support the image output frame rate, then determine the initial frame rate to be the default image output frame rate. For example, the initial frame rate is the first frame rate.
[0138] S505: The decision module sends information of the camera combination selected for activation and the initial frame rate of the camera to the camera HAL.
[0139] Optionally, the decision module sends information of the camera combination selected for activation and the initial frame rate of the camera to the camera HAL.
[0140] S506. The camera HAL receives the information of the camera combination selected for activation, notifies camera 1 to activate image acquisition, and outputs an image at an initial frame rate (first frame rate); and notifies camera 2 to activate image acquisition, and outputs an image at an initial frame rate (first frame rate).
[0141] S507 , camera 1 and camera 2 respectively capture images at a first frame rate.
[0142] S508. The decision module determines the image output frame rates of camera 1 and camera 2.
[0143] In step S504, after the decision module determines to turn on camera one and camera two and determines the initial frame rate of the camera, the decision module also determines the frame rate of camera one and camera two. It should be noted that the embodiment of the present application does not limit the order of execution of S505 and S508; after the decision module determines to turn on camera one and camera two and determines the initial frame rate of the camera; S505 can be executed first to send the information of the camera combination selected to be turned on and the initial frame rate of the camera to the camera HAL, and then S508 can be executed to determine the frame rate of camera one and camera two; or, S508 can be executed first to determine the frame rate of camera one and camera two, and then S505 can be executed to send the information of the camera combination selected to be turned on and the initial frame rate of the camera to the camera HAL. In one implementation, the frame rate of camera one and camera two is determined by the frame rate decision submodule in the decision module.
[0144] Exemplarily, the decision module sends information about the camera combination that is turned on to the frame rate decision submodule; the information about the camera combination includes the identifiers of a group of cameras (camera one and camera two). The decision module also sends the initial frame rate of the camera to the frame rate decision submodule. The frame rate decision submodule receives the information about the camera combination selected to be turned on and the initial frame rate of the camera, and determines that the current stage is the photo preview stage, then determines that the image output frame rate of camera one (main camera) is the initial frame rate (first frame rate), and determines that the image output frame rate of camera two (secondary camera) is a value less than the first frame rate. That is, the image output frame rate of camera two (secondary camera) is determined to be a second frame rate, wherein the second frame rate is less than the first frame rate. In one example, the second frame rate is half of the first frame rate. Exemplarily, the first frame rate is 30fps and the second frame rate is 15fps.
[0145] Since the image output by the secondary camera will not be transmitted to the camera application during the photo preview stage, setting the secondary camera's image output frame rate lower than the primary camera's image output frame rate can reduce power consumption without affecting the preview image interface. In addition, the value of the second frame rate is greater than 0 instead of being equal to 0; that is, the secondary camera keeps outputting images instead of stopping outputting images; compared with the method in which the secondary camera does not output images during the preview stage, since the secondary camera is always outputting images, the secondary camera's AF, AE, AWB and other functions are always in a low-power working state; in this way, when the secondary camera's image output frame rate is adjusted upward (for example, adjusted to the first frame rate) during the photo imaging stage, it can respond quickly to avoid affecting the imaging speed or quality.
[0146] Furthermore, the frame rate decision submodule returns the output frame rate of camera 1 (main camera) as the first frame rate to the decision module, and returns the output frame rate of camera 2 (secondary camera) as the second frame rate.
[0147] S509, the decision module sends the image output frame rate of camera 1 to the camera HAL as the first frame rate, and sends the image output frame rate of camera 2 to the camera HAL as the second frame rate.
[0148] Optionally, the decision module determines that the image output frame rate of camera 1 is the first frame rate and has not changed, and the image output frame rate of camera 1 may not be sent to the camera HAL. If the camera HAL does not receive the image output frame rate for camera 1, it is determined that the image output frame rate of camera 1 remains unchanged.
[0149] Optionally, in some other embodiments, after the decision module determines to turn on camera 1 and camera 2 in step S504 and determines the initial frame rate of the camera, the information of the camera combination selected to be turned on and the initial frame rate of the camera is not sent to the camera HAL first, that is, the above steps S505, S506 and S507 are not performed. After the decision module determines the image output frame rates of camera 1 and camera 2 in step S508, the decision module sends the information of the camera combination selected to be turned on and the image output frame rate of camera 1 is the first frame rate, and the image output frame rate of camera 2 is the second frame rate to the camera HAL.
[0150] S510: The camera HAL notifies the first camera to capture images at a first frame rate, and notifies the second camera to capture images at a second frame rate.
[0151] In one implementation, the camera HAL sends a first exposure parameter value to camera 1 and a second exposure parameter value to camera 2; wherein the second value is greater than the first value. The exposure parameter is used to indicate the exposure duration. The longer the exposure duration of the camera, the lower the frequency of image acquisition; the exposure duration is inversely proportional to the frequency of image acquisition. If the second exposure parameter value is twice the first exposure parameter value, the frequency of image acquisition by camera 2 (second frame rate) is half the frequency of image acquisition by camera 1 (first frame rate).
[0152] S511. The camera HAL sends a picture output request message to the camera 1 at a first frequency, and the camera HAL sends a picture output request message to the camera 2 at a second frequency.
[0153] The image output request message is used to request the camera to output an image; each time the camera receives the image output request message, it outputs a frame of image to the camera HAL. The first frequency is equal to the first frame rate, and the second frequency is equal to the second frame rate.
[0154] S512: Camera 1 outputs images to the camera HAL at a first frequency, and camera 2 outputs images to the camera HAL at a second frequency.
[0155] Camera 1 captures images at a first frame rate and outputs images to the camera HAL at a first frequency, that is, the output frame rate of camera 1 is the first frame rate. Camera 2 captures images at a second frame rate and outputs images to the camera HAL at a second frequency, that is, the output frame rate of camera 2 is the second frame rate.
[0156] S513: The camera HAL transmits the image output by the camera 1 to the camera application.
[0157] Currently in the photo preview stage, the camera HAL receives the images output by camera 1 and camera 2 respectively, and transmits the image output by camera 1 to the camera application.
[0158] S514: The camera application displays the acquired image on a preview interface.
[0159] The camera application displays the acquired image, that is, the image captured by camera 1 (main camera) is displayed on the preview interface.
[0160] In the preview interface, the user can start taking photos. Figure 6 As shown, the method for controlling the camera frame rate provided in the embodiment of the present application also includes:
[0161] S515: The camera application receives an operation from the user to start taking a photo.
[0162] In the preview interface, the user may start taking photos. Figure 4 As shown in (a), the preview interface 102 includes a control 103, and the user can click the control 103 to start photographing. When the camera application receives the user's click operation on the control 103, it receives the user's operation of starting photographing.
[0163] In other examples, the user may start the photo imaging in other ways, such as by voice, gesture, etc.
[0164] When the input device of the mobile phone (such as a touch screen, microphone, camera, etc.) detects the operation of starting the photo-taking and imaging by the user, a second message may be generated, and the second message is used to indicate that the operation of starting the photo-taking and imaging by the user has been received. The processor distributes the second message to the camera application. When the camera application receives the second message, it means that the operation of starting the photo-taking and imaging by the user has been received.
[0165] S516: The camera application sends an imaging request message to the camera HAL.
[0166] S517: The camera HAL sends an imaging request message to the decision module.
[0167] S518. The decision module receives the imaging request message, determines that the image output frame rate of camera 1 (main camera) is the first frame rate, and determines that the image output frame rate of camera 2 (secondary camera) is the first frame rate.
[0168] In one implementation, the frame rate decision submodule in the decision module determines the frame rate of the output of camera 1 (main camera) and camera 2 (secondary camera). Exemplarily, the decision module sends an imaging message to the frame rate decision submodule. The frame rate decision submodule receives the imaging message and determines that the current stage is the photo imaging stage, then determines that the frame rate of the output of camera 1 (main camera) and camera 2 (secondary camera) is the initial frame rate, that is, the first frame rate. The frame rate decision submodule returns the frame rate of the output of camera 1 (main camera) and camera 2 (secondary camera) to the decision module as the first frame rate.
[0169] During the photo imaging stage, restoring the frame rate of the secondary camera to the same value as that of the main camera can enable the secondary camera to output images at a higher frequency, which can be used for combined imaging to improve photo quality.
[0170] S519, the decision module sends the output frame rate of camera 1 as the first frame rate to the camera HAL, and sends the output frame rate of camera 2 as the first frame rate to the camera HAL.
[0171] Optionally, the decision module determines that the image output frame rate of camera 1 is the first frame rate and has not changed, and the image output frame rate of camera 1 may not be sent to the camera HAL. If the camera HAL does not receive the image output frame rate for camera 1, it is determined that the image output frame rate of camera 1 remains unchanged.
[0172] S520: The camera HAL notifies the camera 1 that the image output frame rate is the first frame rate, and notifies the camera 2 that the image output frame rate is the first frame rate.
[0173] In one implementation, the camera HAL sends the same exposure parameters to camera 1 and camera 2, so that the frame rates of camera 1 and camera 2 can be equal.
[0174] S521. The camera HAL sends image output request messages to the camera 1 and the camera 2 at a first frequency respectively.
[0175] The first frequency is equal to the first frame rate.
[0176] S522: Camera 1 outputs images to the camera HAL at the first frequency, and camera 2 outputs images to the camera HAL at the first frequency.
[0177] Camera 1 captures images at a first frame rate and outputs images to the camera HAL at a first frequency, that is, the frame rate of camera 1 is the first frame rate. Camera 2 captures images at a first frame rate and outputs images to the camera HAL at a first frequency, that is, the frame rate of camera 2 is the first frame rate.
[0178] S523: The camera HAL synthesizes the image output by the camera 1 and the image output by the camera 2 to generate a synthesized image.
[0179] The camera HAL can use methods available in conventional technologies to synthesize the image output by camera one and the image output by camera two.
[0180] In one implementation, the camera HAL may generate a composite image using a frame of image output by camera 1 and a frame of image output by camera 2.
[0181] In one implementation, the camera HAL may generate a composite image using M frames of images output by camera one and N frames of images output by camera two; wherein M>1, N>1; optionally, M and N may be equal or unequal.
[0182] S524: The camera HAL transmits the synthesized image to the camera application.
[0183] S525: The camera application receives the composite image and saves the composite image as a photo.
[0184] The camera application receives the composite image and determines that the photo imaging is completed. In one implementation, the camera application can display a thumbnail of the photo in the preview interface. In one example, the user can also click on the thumbnail of the photo to view the generated photo.
[0185] After the photo is taken, the preview phase is restored, and the frame rate of the second camera output can be restored to the second frame rate to save power. Figure 7 As shown, the method for controlling the camera frame rate provided in the embodiment of the present application also includes:
[0186] S526: The camera application sends an imaging completion message to the camera HAL.
[0187] The camera application receives the composite image and sends an imaging completion message to the camera HAL.
[0188] S527: The camera HAL sends an imaging completion message to the decision module.
[0189] S528. The decision module receives an imaging completion message, determines that the image output frame rate of camera 1 (main camera) is the first frame rate, and determines that the image output frame rate of camera 2 (secondary camera) is the second frame rate.
[0190] In one implementation, the frame rate decision submodule in the decision module determines the image output frame rates of camera one and camera two.
[0191] Exemplarily, the decision module sends an imaging end message to the frame rate decision submodule. The frame rate decision submodule receives the imaging end message, determines that the current stage is the photo preview stage, determines that the image output frame rate of camera 1 (main camera) is the first frame rate, and restores the image output frame rate of camera 2 (secondary camera) to the second frame rate. The frame rate decision submodule returns the image output frame rate of camera 1 (main camera) to the decision module as the first frame rate, and returns the image output frame rate of camera 2 (secondary camera) as the second frame rate.
[0192] After the imaging is completed, the process returns to the photo preview stage. The image output by the secondary camera will not be transmitted to the camera application for display. The frame rate of the secondary camera will be restored to the second frame rate, which can reduce the power consumption in the photo preview stage.
[0193] S529, the decision module sends the image output frame rate of camera 1 to the camera HAL as the first frame rate, and sends the image output frame rate of camera 2 to the camera HAL as the second frame rate.
[0194] Optionally, the decision module determines that the image output frame rate of camera 1 is the first frame rate and has not changed, and the image output frame rate of camera 1 may not be sent to the camera HAL. If the camera HAL does not receive the image output frame rate for camera 1, it is determined that the image output frame rate of camera 1 remains unchanged.
[0195] S530: The camera HAL notifies the first camera to capture images at the first frame rate, and notifies the second camera to capture images at the second frame rate.
[0196] S531. The camera HAL sends a picture output request message to the camera 1 at a first frequency, and the camera HAL sends a picture output request message to the camera 2 at a second frequency.
[0197] S532: Camera 1 outputs images to the camera HAL at a first frequency, and camera 2 outputs images to the camera HAL at a second frequency.
[0198] S533: The camera HAL transmits the image output by the camera 1 to the camera application.
[0199] Currently in the photo preview stage, the camera HAL receives the images output by camera 1 and camera 2 respectively, and transmits the image output by camera 1 to the camera application.
[0200] S534: The camera application displays the acquired image on a preview interface.
[0201] It should be noted that the embodiment of the present application takes taking a photo as an example to introduce the method for controlling the camera frame rate provided by the present application. It can be understood that the method for controlling the camera frame rate provided by the embodiment of the present application is also applicable to the video recording function. The specific implementation method can refer to the photo taking function, and the embodiment of the present application will not be described in detail.
[0202] Some embodiments of the present application provide an electronic device, which may include: a memory, multiple cameras, and one or more processors. The camera, memory, and processor are coupled. 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 can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Figure 1 The structure of the electronic device 100 is shown.
[0203] The present application also provides a chip system (eg, a system on a chip (SoC)), such as Figure 8 As shown, the chip system includes at least one processor 801 and at least one interface circuit 802. The processor 801 and the interface circuit 802 can be interconnected via lines. For example, the interface circuit 802 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 802 can be used to send signals to other devices (such as a processor 801 or a touch screen of an electronic device or a camera of an electronic device). Exemplarily, the interface circuit 802 can read the instructions stored in the memory and send the instructions to the processor 801. When the instructions are executed by the processor 801, the chip system can execute the steps of each module of the HAL layer in the above embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0204] 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 function or step executed by the electronic device in the above-mentioned method embodiment.
[0205] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.
[0206] 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.
[0207] 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.
[0208] 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.
[0209] 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.
[0210] 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.
[0211] 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. An electronic device, It is characterized in that include: A processor, a display screen, a first camera and a second camera; the processor runs an operating system of the electronic device, and the operating system has a camera application installed therein; The processor is configured to receive a first message, where the first message is used to indicate that an operation of starting the camera application by a user is received; The processor is further configured to, in response to receiving the first message, start the first camera and the second camera, notify the first camera to capture images at a first frame rate, and notify the second camera to capture images at the first frame rate; The processor is further configured to, after determining according to a preset strategy that the second camera captures images at a second frame rate, notify the second camera to capture images at the second frame rate, where the second frame rate is less than the first frame rate; The first camera is configured to output images to the processor at a first frame rate; The second camera is used to output images to the processor at a second frame rate; The processor is further configured to transmit the image output by the first camera to the camera application; The display screen is used to display a preview interface of the camera application, wherein the preview interface includes an image captured by the first camera; The processor is further configured to receive a second message, where the second message is used to indicate that an operation of starting a photo-taking operation on the preview interface by a user is received; The processor is further configured to, in response to receiving the second message, notify the second camera to output images at the first frame rate; The second camera is further configured to output images to the processor at the first frame rate; The processor is further used to combine the output image of the first camera and the output image of the second camera into a photo; wherein the first camera outputs images at the first frame rate.
2. The electronic device according to claim 1, It is characterized in that The processor is further configured to send an image output request message to the first camera at a first frequency; The processor is further configured to send an image output request message to the second camera at a second frequency; The image output request message is used to request the camera to output a frame of image, the first frequency is equal to the first frame rate, and the second frequency is equal to the second frame rate.
3. The electronic device according to claim 1 or 2, It is characterized in that The processor is further configured to determine whether to start the first camera and the second camera according to the camera configuration of the electronic device and a preset strategy after receiving the first message.
4. The electronic device according to claim 3, It is characterized in that The processor is further configured to obtain the camera configuration of the electronic device after receiving the first message.
5. The electronic device according to claim 1, It is characterized in that The processor is specifically used for: The M frames of images output by the first camera and the N frames of images output by the second camera are combined into a photo; wherein M>=1, N>=1.
6. The electronic device according to any one of claims 1 to 5, It is characterized in that The second frame rate is greater than 0.
7. A method for controlling a camera frame rate, applied to an electronic device, the electronic device comprising a first camera and a second camera, It is characterized in that The method comprises: Receive the user's operation of launching the camera application; In response to the operation of starting the camera application, starting the first camera and the second camera, controlling the first camera to output images at a first frame rate, and controlling the second camera to output images at the first frame rate; Determining, according to a preset strategy, that the second camera captures images at a second frame rate, where the second frame rate is less than the first frame rate; Controlling the second camera to output images at the second frame rate; Displaying a preview interface of the camera application, wherein the preview interface includes an image output by the first camera; Receive an operation from a user to start taking a photo on the preview interface; In response to the operation of starting the photo-taking and imaging, controlling the second camera to output images at the first frame rate; The output image of the first camera and the output image of the second camera are combined into a photo; wherein the first camera outputs images at the first frame rate.
8. The method according to claim 7, It is characterized in that After synthesizing the output image of the first camera and the output image of the second camera into a photo, the method further includes: Controlling the second camera to output images at the second frame rate; wherein the first camera outputs images at the first frame rate; A preview interface of the camera application is displayed, wherein the preview interface includes an image output by the first camera.
9. The method according to claim 7, It is characterized in that The step of synthesizing the output image of the first camera and the output image of the second camera into a photo includes: The M frames of images output by the first camera and the N frames of images output by the second camera are combined into a photo; wherein M>=1, N>=1.
10. The method according to any one of claims 7 to 9, It is characterized in that The second frame rate is greater than 0.
11. A method for controlling the frame rate of a camera, It is characterized in that include: receiving a first message, where the first message is used to indicate that an operation of starting a camera application by a user is received; In response to receiving the first message, instructing the first camera and the second camera to start, instructing the first camera to capture images at a first frame rate, and instructing the second camera to capture images at the first frame rate; After determining according to a preset strategy that the second camera captures images at a second frame rate, informing the second camera to capture images at the second frame rate, where the second frame rate is less than the first frame rate; receiving an image output by the first camera at the first frame rate; receiving an image output by the second camera at the second frame rate; transmitting the image output by the first camera to the camera application, so that the camera application displays a preview interface according to the image output by the first camera; receiving a second message, where the second message is used to indicate that an operation of starting a photo-taking operation on the preview interface by the user has been received; In response to receiving the second message, notifying the second camera to capture images at the first frame rate; receiving an image output by the second camera at the first frame rate; The output image of the first camera and the output image of the second camera are combined into a photo; wherein the first camera outputs images at the first frame rate.
12. The method according to claim 11, It is characterized in that After notifying the first camera to capture images at the first frame rate and notifying the second camera to capture images at the second frame rate, the method further includes: Sending a picture output request message to the first camera at a first frequency, and sending a picture output request message to the second camera at a second frequency; The image output request message is used to request the camera to output a frame of image, the first frequency is equal to the first frame rate, and the second frequency is equal to the second frame rate.
13. The method according to claim 11 or 12, It is characterized in that After receiving the first message, the method further includes: Get camera configuration; Determine and start the first camera and the second camera according to the camera configuration.
14. The method according to claim 11, It is characterized in that The step of synthesizing the output image of the first camera and the output image of the second camera into a photo includes: The M frames of images output by the first camera and the N frames of images output by the second camera are combined into a photo; wherein M>=1, N>=1.
15. The method according to any one of claims 11 to 14, It is characterized in that The notifying the first camera to capture images at a first frame rate and notifying the second camera to capture images at a second frame rate includes: An exposure parameter of the first camera is set to a first value, and an exposure parameter of the second camera is set to a second value, wherein the second value is greater than the first value.
16. The method according to claim 15, It is characterized in that The second frame rate is half of the first frame rate, and the second value is twice of the first value.
17. A computer-readable storage medium, It is characterized in that The method comprises computer instructions; when the computer instructions are executed on an electronic device, the electronic device executes the method as described in any one of claims 7 to 10.
18. A chip system, It is characterized in that The chip system includes one or more interface circuits and one or more processors, the interface circuits and the processors are interconnected via lines, the interface circuits are used to receive computer instructions from a memory of an electronic device, and when the computer instructions are executed by the processor, the chip system executes a method as described in any one of claims 11-16.
Citation Information
Patent Citations
Photographing preview method and device
CN105975046A
Terminal and photographing method
CN106791017A
Method for controlling any frame rate during photographing preview, mobile terminal and storage medium
CN107682625A
Photographing preview method and device, storage medium and electronic equipment
CN112565589A
Image display method and electronic device
WO2022127787A1
