Camera control method, electronic device and storage medium
By dynamically adjusting the acquisition frequency of the second camera and synchronizing the exposure parameters of the first camera, the abnormal brightness caused by camera switching in multi-camera electronic devices is solved, and the device power consumption is reduced.
Patent Information
- Application Number
- CN202410183431.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-19
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-02-19
AI Technical Summary
In multi-camera electronic devices, it is easy to cause abnormal brightness of the shooting screen when switching cameras, and the equipment consumes a lot of power.
By dynamically adjusting the frequency of the image captured by the second camera, adjusting the acquisition frequency of the second camera according to the image brightness change value acquired by the first camera, and synchronizing the exposure parameters of the first camera to maintain the consistency of the image brightness.
It realizes that when switching cameras in any scenes, maintaining consistency in the brightness of the shooting screen, reducing the power consumption of the device.
Smart Images

Figure CN117750191B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a camera control method, an electronic device, and a storage medium. Background Art
[0002] More and more electronic devices are equipped with cameras, and users can carry electronic devices to take photos or videos anytime and anywhere. At present, for electronic devices including multiple cameras, during the shooting process, when the camera used to collect and send images is collecting and sending images, other cameras of the electronic device are also collecting images, resulting in high power consumption of the electronic device. Summary of the invention
[0003] The embodiments of the present application provide a camera control method, an electronic device, and a storage medium, which achieve the purpose of reducing the power consumption of the device by reducing the frequency of image acquisition by the second camera.
[0004] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0005] In a first aspect, a camera control method is provided, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the lenses of the first camera and the second camera face the same direction, and the method includes:
[0006] In response to the user's operation, a first shooting interface is displayed; wherein, the first image from the first camera is displayed in the first shooting interface; the second camera is controlled to capture the second image at a first frequency; when the brightness change value of the first image is greater than a brightness threshold, the frequency of the second camera capturing the second image is adjusted from the first frequency to a second frequency; the second frequency is less than the first frequency.
[0007] That is to say, after the electronic device determines the frequency of collecting images by the second camera according to the brightness change value of the first image collected by the first camera, the device power consumption is reduced by reducing the frequency of collecting images by the second camera.
[0008] In a possible implementation manner of the first aspect, the second frequency has different values under different brightness thresholds.
[0009] That is, the larger the brightness threshold, the larger the value of the second frequency, and the smaller the brightness threshold, the smaller the value of the second frequency. In other words, the larger the brightness change value of the first image captured by the first camera, the larger the capture frequency of the second camera.
[0010] In another possible implementation manner of the first aspect, when the brightness change value of the first image is greater than the brightness threshold, before adjusting the frequency of capturing the second image by the second camera from the first frequency to the second frequency, the method further includes:
[0011] When the brightness change value of the first image is greater than the brightness threshold, the second frequency is determined according to brightness information of multiple frames of the first image.
[0012] That is to say, the acquisition frequency of the second camera is related to the brightness information of the first image acquired by the first camera.
[0013] In another possible implementation manner of the first aspect, determining the second frequency according to brightness information of multiple frames of first images includes:
[0014] Determine brightness change values of the multiple frames of first images according to brightness information of the multiple frames of first images;
[0015] According to the corresponding relationship between the brightness change value and the frequency, a second frequency corresponding to the brightness change value of the plurality of frames of the first image is determined.
[0016] That is to say, the electronic device pre-stores the correspondence between the brightness change value and the frequency. After determining the brightness change value of the multiple frames of the first image, the second frequency corresponding to the brightness change value of the multiple frames of the first image can be determined by query.
[0017] In another possible implementation manner of the first aspect, determining brightness change values of the multiple frames of first images according to brightness information of the multiple frames of first images includes:
[0018] According to the brightness information of the multiple frames of first images, the brightness difference between each two adjacent frames of first images in the multiple frames of first images is determined; the brightness difference between each two adjacent frames of first images is summed to obtain the brightness change value of the multiple frames of first images.
[0019] In another possible implementation manner of the first aspect, the method further includes:
[0020] When the brightness change value of the first image is greater than the brightness threshold, the second camera is controlled to synchronize the exposure parameters from the first camera at a second frequency.
[0021] That is to say, the electronic device can dynamically adjust the frequency of synchronized shooting parameters between the first camera and the second camera according to the brightness information of the multiple frames of images collected by the first camera, thereby achieving a smooth transition in the brightness of the displayed image when switching the camera in any scene, and avoiding abnormal brightness of the captured image.
[0022] In another possible implementation manner of the first aspect, controlling the second camera to synchronize exposure parameters from the first camera includes:
[0023] The exposure parameters of the first camera are written into the storage area; after the second camera is controlled to read the exposure parameters of the first camera from the storage area, the exposure parameters of the second camera are adjusted to the exposure parameters of the first camera.
[0024] That is to say, each time the first camera captures a frame of image, the exposure parameters used may be the same or different, and the electronic device can write the exposure parameters of the first camera into a certain storage area. Before the second camera captures the second image, the electronic device controls the second camera to synchronize the exposure parameters of the first camera, so that the exposure parameters of the second camera are consistent with the exposure parameters of the first camera, and when the camera is switched in any scene, the brightness of the displayed image is smoothly transitioned, and the abnormal brightness of the captured image is avoided.
[0025] In another possible implementation manner of the first aspect, the method further includes:
[0026] When the brightness change value of the first image is less than the brightness threshold, the frequency of the second camera collecting the second image is adjusted from the first frequency to a third frequency; and the third frequency is less than the second frequency.
[0027] That is, when the brightness change of the shooting scene in which the electronic device is located is small, the brightness change of the first image captured by the first camera is also small. When the brightness change value of the first image is less than the brightness threshold, the electronic device can reduce the frequency of the second camera capturing the second image to the third frequency, thereby further reducing the power consumption of the electronic device.
[0028] In another possible implementation manner of the first aspect, the method further includes:
[0029] When the brightness change value of the first image is less than the brightness threshold, the second camera is controlled to synchronize the exposure parameters from the first camera according to the third frequency.
[0030] For example, assuming that the electronic device is shooting an image in a scene where the ambient brightness remains unchanged, after the first camera captures multiple frames of the first image, it is determined that the brightness change value of the first image is 0. In this case, after the electronic device controls the second camera to synchronize the exposure parameters of the first camera once, it can control the second camera to stop running. As a result, the exposure parameters of the second camera are kept consistent with the exposure parameters of the first camera, so that when switching cameras in any scene, the purpose of smooth transition of the brightness of the displayed image is achieved, and the power consumption of the device is also reduced.
[0031] In a second aspect, the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the camera control method of any one of the above-mentioned first aspects.
[0032] In a third aspect, the present application provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the camera control method of any one of the first aspects is implemented.
[0033] In a fourth aspect, the present application provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the camera control method of any one of the first aspects.
[0034] It can be understood that the electronic device described in the second aspect, the computer storage medium described in the third aspect, and the computer program product described in the fourth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 An example diagram of brightness convergence of a camera provided by the prior art;
[0036] Figure 2 An example diagram of an electronic device capturing an image provided by the prior art;
[0037] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0038] Figure 4 An exemplary structural diagram of an electronic device provided in an embodiment of the present application;
[0039] Figure 5 This is another example diagram of brightness convergence of a camera provided in an embodiment of the present application;
[0040] Figure 6 An example diagram of the change in brightness before and after the camera is switched provided in an embodiment of the present application;
[0041] Figure 7 An example image taken by a camera provided in an embodiment of the present application;
[0042] Figure 8 A flowchart of a camera control method provided in an embodiment of the present application;
[0043] Fig. 9 A schematic diagram of a process of synchronizing exposure parameters provided in an embodiment of the present application;
[0044] Fig.10 A frequency comparison example provided in the embodiment of the present application Figure 1 ;
[0045] Fig.11 A frequency comparison example provided in the embodiment of the present application Figure 2 ;
[0046] Fig.12 An exemplary diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solution in the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application. In the description of the embodiment of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0048] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0049] 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.
[0050] In the related art, an electronic device may include multiple cameras, for example, the electronic device includes a rear main camera, a rear wide-angle camera, and a rear telephoto camera. When a user uses the rear main camera of the electronic device to shoot, the electronic device detects the user's adjustment operation of the focal length. In response to the user's adjustment operation, the focal length of the camera changes, so that the rear camera used for frame output and display in the electronic device is also switched. When the rear camera of the electronic device is switched, due to the different exposure parameters of the front and rear cameras, the brightness of the image displayed on the display screen is abnormal, such as being too bright or too dark.
[0051] For example, the electronic device detects that the user adjusts the focal length from 1x zoom to 5x zoom. In response to the user's adjustment operation, the electronic device switches the camera used for framing and displaying from the rear main camera to the rear telephoto camera. When the electronic device controls the rear telephoto camera to start, the electronic device controls the rear telephoto camera to perform automatic exposure (autoexposure, AE), that is, the rear telephoto camera automatically adjusts the exposure parameters and gain according to the intensity of the external light to prevent overexposure or underexposure. It can be seen that when the electronic device switches the camera used for framing and displaying from the rear main camera to the rear telephoto camera, the brightness of the image displayed on the display converges from a certain brightness value, resulting in abnormal brightness of the captured image.
[0052] For example, Figure 1 An example diagram of brightness convergence of a camera provided by the prior art, such as Figure 1 As shown, when the electronic device controls the rear telephoto camera to start, the rear telephoto camera performs automatic exposure, and the brightness of the image displayed on the display converges from a certain brightness value to a brightness value corresponding to the brightness of the ambient light.
[0053] For example, Figure 2 As shown in (a), the electronic device controls the rear main camera to capture images at 1x zoom. The electronic device detects that the user adjusts the focal length from 1x zoom to 5x zoom, and the camera used for frame output and display in the electronic device is switched from the rear main camera to the rear telephoto camera. Because the exposure parameters of the rear main camera and the rear telephoto camera have not been synchronized, when the electronic device controls the rear telephoto camera to start, the display screen of the electronic device displays Figure 2 The image shown in (b) is an overexposed image captured by the electronic device. The electronic device controls the rear telephoto camera to automatically expose the image so that the brightness of the image captured by the rear telephoto camera converges to an appropriate brightness value. Figure 2 The image shown in (c).
[0054] To this end, an embodiment of the present application provides a camera control method, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the lenses of the first camera and the second camera face the same direction. For example, the first camera and the second camera are both front cameras, or the first camera and the second camera are both rear cameras.
[0055] When the electronic device displays the first shooting interface, the second camera is controlled to capture the second image at the first frequency. When the brightness change value of the first image is greater than the brightness threshold, the frequency of the second camera capturing the second image is adjusted from the first frequency to the second frequency, and the second frequency is less than the first frequency. Thus, by dynamically adjusting the frequency of the second camera capturing images, when switching cameras in any scene, the purpose of smooth transition of the brightness of the displayed image is achieved, and abnormal brightness of the captured image is avoided.
[0056] Exemplarily, the camera control method provided in the embodiments of the present application can be applied to electronic devices with multiple cameras, such as mobile phones, tablet computers, personal computers (PCs), personal digital assistants (PDAs), smart watches, netbooks, wearable electronic devices, augmented reality (AR) devices, and virtual reality (VR) devices, and the embodiments of the present application do not impose any restrictions on this.
[0057] like Figure 3 As shown, Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0058] 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. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0059] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split 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.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0065] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0066] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0067] 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.
[0068] 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, etc. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0069] 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.
[0070] 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), 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 some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0071] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0072] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0073] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0074] In the embodiment of the present application, the camera 193 may be a front camera or a rear camera, which is not limited here. When the camera 193 is a rear camera, the electronic device 100 includes multiple rear cameras. For example, the camera 193 may be a wide-angle camera, an ultra-wide-angle camera, or a telephoto camera. After the rear camera captures an image, it is displayed on the display screen 194.
[0075] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0076] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0077] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. NPU can realize applications such as intelligent cognition of electronic device 100, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0078] 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, such as storing music, video and other files in the external memory card.
[0079] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. 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.
[0080] 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.
[0081] The software system of the electronic device 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.
[0082] Figure 4 An example diagram of the structure of an electronic device provided in an embodiment of the present application.
[0083] It is understandable that the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system may include an application layer (referred to as the application layer), an application framework layer (referred to as the framework layer), a hardware abstract layer (HAL), and a kernel layer.
[0084] The above application layer may include a series of application packages. The application package may include system applications and may also include third-party applications. Among them, system applications refer to applications that are set in the electronic device before leaving the factory. For example, Figure 4 As shown, system applications can include camera applications, of course, also include Figure 4 Applications not shown in the application, such as gallery, calendar, music, short message, memo, and weather programs. Third-party applications refer to applications that users install after downloading the installation package from the application store (or application market). For example, map applications, food delivery applications, reading applications (such as e-books), social applications, and travel applications.
[0085] The application framework layer includes a camera service, which is used to read various information from the camera application.
[0086] The hardware abstraction layer includes a first camera control module, a second camera control module and a resource pool.
[0087] The first camera control module further includes a synchronous exposure parameter node 1 and a sensor node 1. The second camera control module further includes a synchronous exposure parameter node 2 and a sensor node 2.
[0088] The kernel layer is a layer between hardware and software. The kernel layer includes at least a first camera driver and a second camera driver. The first camera driver can be used to drive the first camera, and the second camera driver can be used to drive the second camera. In addition, the first camera driver and the second camera driver can both be front camera drivers, or can both be rear camera drivers, which is not limited in the embodiments of the present application.
[0089] The electronic device also includes a hardware layer, and the hardware layer includes a first camera sensor and a second camera sensor.
[0090] like Figure 4 As shown, after the camera application is started, the camera application detects the shooting operation triggered by the user, and in response to the user's triggering operation, the camera application sends a shooting request to the camera service. After receiving the shooting request, the camera service sends the shooting request to the hardware abstraction layer.
[0091] In some embodiments, after receiving the shooting request, the hardware abstraction layer triggers the first camera sensor to collect image data 1. After the first camera sensor collects the image data 1, the first camera sensor sends the image data 1 to the first camera driver. After receiving the image data 1, the first camera driver sends the image data 1 to the sensor node 1. After receiving the image data 1, the sensor node 1 sends the image data 1 to the synchronous exposure parameter node 1. The synchronous exposure parameter node 1 automatically adjusts the exposure parameters of the first camera according to the brightness information of the image data 1 and / or the brightness information of the shooting environment, and sends the adjusted exposure parameters to the sensor node 1. After the sensor node 1 receives the exposure parameters, the sensor node 1 sends the exposure parameters to the first camera driver, so that the first camera driver controls the first camera sensor to collect image data with the adjusted exposure parameters. It can be seen that the electronic device can automatically adjust the exposure parameters of the first camera according to the brightness information of the image data collected by the first camera and / or the brightness information of the shooting environment, thereby avoiding the problem of overexposure or underexposure of the image collected by the first camera.
[0092] After the synchronous exposure parameter node 1 determines the exposure parameters of the first camera to collect images according to the brightness information of the image data 1, the exposure parameters can be stored in the resource pool. When the second camera control module controls the second camera to start, the second camera control module obtains the exposure parameters of the first camera from the resource pool and sends the exposure parameters of the first camera to the synchronous exposure parameter node 2. The synchronous exposure parameter node 2 sends the exposure parameters of the first camera to the second camera driver of the kernel layer through the sensor node 2. After the second camera driver receives the exposure parameters of the first camera, it controls the second camera sensor to collect images using the exposure parameters of the first camera. After the second camera sensor collects the image data 2, it sends the image data 2 to the second camera driver. After the second camera driver receives the image data 2, it sends the image data 2 to the second camera control module. Here, the second camera control module does not send the image data 2 to the camera application for display, that is, the image collected by the first camera is displayed in the display interface of the camera application, and the second camera only collects the image but does not send the image for display. Therefore, the electronic device controls the second camera to synchronize the exposure parameters of the first camera, so that the exposure parameters of the image captured by the second camera are consistent with the exposure parameters of the image captured by the first camera, and the brightness of the captured image displayed on the display screen is consistent after switching the camera in any scene, thereby improving the user's shooting experience.
[0093] It should be explained that before the second camera captures each frame of image, the second camera control module obtains the exposure parameters of the first camera from the resource pool once, and controls the exposure parameters of the second camera to be adjusted to the exposure parameters of the first camera, so that the exposure parameters of the image captured by the second camera are consistent with the exposure parameters of the image captured by the first camera.
[0094] In one scenario, a first camera and a second camera in an electronic device are in the process of starting up, and exposure parameters of the first camera and the second camera can be synchronized in real time so that the exposure parameters of the first camera and the second camera are always consistent.
[0095] For example, Figure 5 As shown, it is assumed that the electronic device includes camera A and camera B, and the electronic device controls camera A and camera B to run simultaneously. For example, the electronic device controls camera A to capture images and send them for display, and controls camera B to capture images but not send them for display. In the process of the electronic device controlling camera A to capture images and send them for display, the electronic device controls camera A and camera B to synchronize exposure parameters in real time. That is, the electronic device controls camera B to synchronize the exposure parameters of camera A, so that camera B adjusts its own exposure parameters in real time according to the exposure parameters of camera A, so that the brightness of the images captured by camera A and camera B remains basically consistent. Figure 5As shown, the exposure parameters of camera A and camera B are synchronized in real time, and the brightness values of the images captured by camera A and camera B are both within a range of about 40. In this way, when the electronic device switches the camera for display from camera A to camera B, the brightness of the image displayed on the display screen of the electronic device remains basically consistent.
[0096] For example, for an electronic device that includes multiple rear cameras, when the electronic device uses the rear cameras to take pictures, real-time exposure parameter synchronization is performed between the multiple rear cameras of the electronic device, so that the exposure parameters of the multiple rear cameras are the same, thereby avoiding abnormal brightness of the captured picture due to switching between the rear cameras.
[0097] For example, when the rear main camera (such as the rear wide-angle camera) of an electronic device captures images within the 1-5x zoom range and sends them for display, the rear auxiliary camera (such as the rear ultra-wide-angle camera) is also always exposing frames. At the same time, the rear auxiliary camera of the electronic device synchronizes the exposure parameters of the rear main camera once before capturing each frame of image.
[0098] For example, when the rear main camera (such as the rear wide-angle camera) of an electronic device captures images within a 5-10x zoom range and sends them for display, the rear auxiliary camera (such as the rear telephoto camera) is always exposing frames. At the same time, the rear telephoto camera of the electronic device synchronizes the exposure parameters of the rear wide-angle camera once before capturing each frame of image. That is, the rear main camera and the rear auxiliary camera in the electronic device are always synchronized in real time.
[0099] In another scenario, when the electronic device controls the first camera to collect and display images, the first camera automatically adjusts its own exposure parameters according to the brightness of the shooting environment. When the electronic device controls the second camera to start, it controls the second camera to synchronize the exposure parameters of the first camera. When the electronic device determines that the camera used for display is switched from the first camera to the second camera, the electronic device controls the second camera to collect images, and then sends the images collected by the second camera to the display screen for display. It can be seen that after the second camera is started, the exposure parameters of the first camera are synchronized, so that the exposure parameters of the image collected by the second camera are consistent with the exposure parameters of the first camera, avoiding the situation where the brightness of the shooting picture is abnormal due to switching between cameras.
[0100] like Figure 6As shown, in the process of the electronic device controlling camera A to capture images and send them for display, the electronic device controls camera B to start, and before the electronic device controls camera B to capture images, controls camera B to synchronize the exposure parameters of camera A, so that the exposure parameters of camera A and camera B are consistent. When the electronic device controls the camera for sending images to be switched from camera A to camera B, the electronic device controls camera B to capture images and send them to the display screen for display.
[0101] In some embodiments, the synchronous exposure parameter node 1 may include a frequency decision module.
[0102] The frequency decision module is used to determine the synchronization frequency of the second camera synchronizing with the first camera according to the brightness information of the N frames of images collected by the first camera. The frequency decision module sends the synchronization frequency to the resource pool for storage. After the second camera control module controls the second camera to start, after obtaining the synchronization frequency from the resource pool, the second camera control module controls the second camera to collect images with the synchronization frequency as the collection frequency.
[0103] For ease of understanding, the following examples of this application will be Figure 3 and Figure 4 The electronic device shown is a mobile phone as an example, and the camera control method provided in the embodiment of the present application is specifically described in conjunction with the accompanying drawings.
[0104] In the embodiment of the present application, the mobile phone includes multiple cameras, and the lenses of the multiple cameras have the same direction. For example, the mobile phone includes a rear wide-angle camera, a rear ultra-wide-angle camera, and a rear telephoto camera.
[0105] Figure 7 (a) in FIG. 1 shows a graphical user interface (GUI) of a mobile phone, which is a desktop 710 of the mobile phone. When the mobile phone detects that a user clicks an icon 720 of a camera application (APP) on the desktop 710, the camera application can be started and a display such as Figure 7 Another GUI shown in (b) of FIG. 7 is referred to as a shooting interface 730. In the preview state, the shooting interface 730 may display a preview image in real time.
[0106] For example, see Figure 7 In (b), after the mobile phone starts the camera, the image captured and sent by the camera can be displayed in the shooting interface 730. In the shooting mode, when the mobile phone detects that the user clicks the shooting control 740, the mobile phone performs the shooting operation; in the video recording mode, when the mobile phone detects that the user clicks the shooting control 740, the mobile phone performs the video recording operation.
[0107] In an embodiment of the present application, during the process of the camera application using the rear camera to capture an image, the mobile phone executes a process of synchronizing shooting parameters between multiple rear cameras.
[0108] Exemplarily, the mobile phone includes a first camera and a second camera, wherein the first camera is a rear-mounted wide-angle camera and the second camera is a rear-mounted telephoto camera. Figure 7 The image displayed in the shooting interface 730 in (b) is the image captured and displayed by the first camera. While the first camera of the mobile phone is capturing images and displaying them, the second camera is also capturing images, and the mobile phone controls the second camera to synchronize the shooting parameters of the first camera. Among them, the shooting parameters include but are not limited to the flash on state and exposure parameters. The exposure parameters may include exposure duration, exposure amount, etc. The specific shooting parameter synchronization process will be specifically introduced in subsequent embodiments and will not be described in detail here.
[0109] In one scenario, when the first camera of a mobile phone is capturing and displaying an image, the second camera of the mobile phone obtains the exposure parameters of the first camera and adjusts the exposure parameters of the second camera according to the exposure parameters of the first camera, so that the exposure parameters of the second camera are consistent with those of the first camera. After the mobile phone detects that the user has adjusted the focal length of the camera, in response to the user's adjustment operation, the mobile phone switches the camera used for display from the first camera to the second camera, and the image captured and displayed by the second camera is displayed on the display screen of the mobile phone, such as Figure 7 The image displayed in the shooting interface 750 in (c) is the image captured and displayed by the second camera. Since the exposure parameters of the first camera and the second camera are consistent, the brightness of the shooting picture displayed on the display screen is basically the same before and after the camera is switched. Therefore, the mobile phone controls the second camera to synchronize the exposure parameters of the first camera, thereby ensuring that the exposure parameters of the first camera and the second camera are consistent, and avoiding abnormal brightness of the shooting picture when switching cameras in any scene.
[0110] It should be explained that the exposure parameters of the camera affect the brightness of the image captured by the camera, that is, the larger the exposure parameters of the camera, the brighter the image captured by the camera, and the smaller the exposure parameters of the camera, the darker the image captured by the camera. Therefore, when the exposure parameters of the first camera and the second camera are the same, the brightness of the image captured before and after the camera is switched is consistent, and when the camera is switched in any scene, the abnormal brightness of the captured image is avoided.
[0111] In some embodiments, the mobile phone can adjust the synchronization frequency of the second camera synchronizing the exposure parameters of the first camera in real time according to the brightness information of the image collected by the first camera. Since the acquisition frequency of the second camera to collect images matches the synchronization frequency of the second camera to synchronize the exposure parameters of the first camera, after the mobile phone determines that the synchronization frequency of the second camera to synchronize the exposure parameters of the first camera is reduced, the acquisition frequency of the second camera is also reduced, thereby achieving the purpose of reducing the power consumption of the mobile phone by reducing the acquisition frequency of the second camera.
[0112] Combine the following Figure 8 The process of adjusting the synchronization frequency of the exposure parameters of the second camera synchronizing with the first camera is described in detail. Figure 8 As shown, the method may include steps 801 to 805.
[0113] Step 801, when the first camera captures each frame of image, determine the brightness information of the currently stored N frames of image, where N is a positive integer greater than or equal to 2. For example, N can be 8, 10, 15 or 20, etc.
[0114] In the embodiment of the present application, each time the first camera captures a frame of image, the first camera control module stores the brightness information of the image captured by the first camera in the resource pool of the hardware abstraction layer. When the resource pool stores the brightness information of N frames of image, the frequency decision module can obtain the brightness information of N frames of image from the resource pool.
[0115] It can be understood that when the brightness information of N frames of images is stored in the resource pool, each time the first camera captures a frame of image, the frequency decision module executes a process of determining the synchronization frequency of the second camera, and the brightness information of the N frames of images stored in the resource pool will be updated once. In other words, the brightness information of the image most recently captured by the first camera is continuously added to the resource pool, and the brightness information of the image captured earliest is deleted, so that the brightness information of the image captured by the first camera is always stored in the resource pool. After the first camera captures the N+1th frame of image, the first camera control module deletes the brightness information of the 1st frame of image in the resource pool, and stores the brightness information of the N+1th frame of image in the resource pool, so that the resource pool stores the brightness information of the N frames of image captured by the first camera. At this time, the brightness information of the N frames of image acquired by the frequency decision module is the brightness information of the 2nd frame of image to the N+1th frame of image.
[0116] The brightness information of the above image may be an average brightness value of all pixels in the image, or may be other values used to evaluate the brightness of the image, which is not limited here.
[0117] Step 802: Determine the brightness change value of the N frames of images according to the brightness information of the N frames of images currently stored.
[0118] In an embodiment of the present application, after the frequency decision module obtains the brightness information of the N frames of images most recently captured by the first camera, it can determine the brightness change value of the N frames of images according to the brightness information of the N frames of images.
[0119] In some embodiments, the frequency decision module first calculates the brightness difference between two adjacent frames in N frames of image, obtains N-1 brightness difference values, and then sums the N-1 brightness difference values to obtain the brightness change value of the N frames of image.
[0120] For example, the frequency decision module obtains the brightness information of 10 frames of images captured by the first camera, and calculates the brightness difference between two adjacent frames of the 10 frames of images to obtain 9 brightness difference values. The frequency decision module sums the 9 brightness difference values to obtain the brightness change value of the 10 frames of images.
[0121] In other embodiments, the frequency decision module can determine the variance of the brightness information of the N frames of images based on the brightness information of the N frames of images. The variance calculated here is the brightness change value. The variance of the brightness information of the N frames of images is used to characterize the discrete degree of the brightness information of the N frames of images.
[0122] Step 803: Determine a target frequency for synchronizing the exposure parameters of the first camera with the second camera according to the brightness change value.
[0123] The target frequency refers to the synchronization frequency corresponding to the brightness change value of the current N frames of image. The target frequency has different values for different brightness change values. In the embodiment of the present application, the larger the brightness change value, the larger the corresponding target frequency value.
[0124] In an embodiment of the present application, the mobile phone pre-stores the correspondence between the brightness change value and the synchronization frequency. After the frequency decision module determines the brightness change value of N frames of images, the synchronization frequency corresponding to the brightness change value of the N frames of images can be determined based on the pre-stored correspondence between the brightness change value and the synchronization frequency.
[0125] Exemplarily, the corresponding relationship between the brightness change value and the target frequency is shown in Table 1 below. As shown in Table 1, the frequency decision module determines that the brightness change value of the N-frame image is [0,1], and the corresponding target frequency can be 1fps; the frequency decision module determines that the brightness change value of the N-frame image is [2,5], and the corresponding target frequency can be 2fps; the frequency decision module determines that the brightness change value of the N-frame image is [6,10], and the corresponding target frequency can be 3fps; the frequency decision module determines that the brightness change value of the N-frame image is [11,15], and the corresponding target frequency can be 4fps; the frequency decision module determines that the brightness change value of the N-frame image is [16,20], and the corresponding target frequency can be 5fps; the frequency decision module determines that the brightness change value of the N-frame image is [21,25], and the corresponding target frequency can be 6fps, and so on.
[0126] Table 1
[0127]
[0128] It should be explained that the corresponding relationship between the brightness change values of the N frames of images and the target frequency in the above Table 1 is only an example and is not limited to this in the embodiments of the present application.
[0129] As shown in Table 1 above, the larger the brightness change value of the N-frame image, the larger the corresponding target frequency value. It can be understood that when the mobile phone is in a scene with a small brightness change, or a scene with basically unchanged brightness, the target frequency of the second camera synchronizing the exposure parameters from the first camera is smaller. For example, when the mobile phone shoots images in a scene with unchanged brightness, the frequency decision module determines that the brightness change value of the N-frame image collected by the first camera is 0, and the frequency decision module refers to Table 1 above to determine that the target frequency of the second camera synchronizing the exposure parameters of the first camera is 1fps. That is, since the brightness of the scene in which the mobile phone is located remains unchanged, the exposure parameters of the first camera remain unchanged. After the second camera synchronizes the exposure parameters of the first camera once, the exposure parameters of the second camera are consistent with the exposure parameters of the first camera, and the second camera can stop running. Therefore, when the mobile phone is in a scene with small brightness changes, the purpose of reducing the power consumption of the mobile phone is achieved by reducing the acquisition frequency of the second camera.
[0130] In the process of the first camera capturing and sending images for display, in order to reduce the brightness difference between the brightness of the image captured by the second camera and the brightness of the image captured by the first camera, the greater the brightness change of the mobile phone in the scene, the higher the target frequency of the second camera synchronizing the exposure parameters from the first camera. This avoids the second camera not synchronizing the exposure parameters of the first camera for a long time. When the camera sending the image for display switches to the second camera, the second camera needs to reconverge from the larger brightness difference, resulting in abnormal brightness in the captured image.
[0131] For example, the frequency decision module determines that the brightness change value of the N frames of images collected by the first camera is 18. The frequency decision module refers to the above Table 1 and determines that the target frequency of the second camera synchronizing the exposure parameters from the first camera is 5fps. That is, the second camera synchronizes the exposure parameters of the first camera 5 times per second, and the second camera collects 5 frames of images per second.
[0132] Step 804, controlling the second camera to synchronize the exposure parameters of the first camera at a target frequency.
[0133] Step 805: Control the second camera to capture images at a target frequency.
[0134] After the mobile phone detects that the user has adjusted the focal length of the camera, in response to the user's adjustment operation, the mobile phone switches the camera used for collecting and displaying from the first camera to the second camera. Since the second camera synchronizes the exposure parameters of the first camera, after the mobile phone controls the second camera to start, the exposure parameters of the second camera are consistent with the exposure parameters of the first camera, so that the brightness of the image displayed by the second camera on the display screen is basically consistent with the brightness of the image displayed by the first camera before the camera is switched, thereby avoiding abnormal shooting images when the camera is switched.
[0135] In the embodiment of the present application, after the second camera synchronizes the exposure parameters of the first camera, the second camera control module controls the second camera to capture images. Thus, according to the brightness information of the image captured by the first camera, the synchronization frequency of the exposure parameters between the first camera and the second camera is dynamically adjusted, so that when switching cameras in any scene, the brightness of the transmitted and displayed images is smoothly transitioned, and the abnormal brightness of the captured images is avoided. In addition, the acquisition frequency of the second camera decreases as the synchronization frequency decreases, thereby achieving the purpose of reducing the power consumption of the device.
[0136] In the above embodiment, the frequency decision module dynamically adjusts the synchronization frequency of the second camera synchronizing the exposure parameters of the first camera according to the brightness information of the image captured by the first camera during the process of the first camera capturing and displaying the image. Similarly, in the process of the second camera capturing and displaying the image, the frequency decision module can also dynamically adjust the synchronization frequency of the first camera synchronizing the exposure parameters of the second camera according to the brightness information of the image captured by the second camera. The implementation process can also refer to the introduction process of the above embodiment, which will not be repeated here.
[0137] In addition, when the mobile phone includes more than two cameras, for example, the mobile phone includes camera 1, camera 2 and camera 3. In the process of camera 1 collecting and sending images for display, camera 2 and camera 3 both synchronize the exposure parameters of camera 1. The frequency decision module dynamically adjusts the synchronization frequency of camera 2 and camera 3 synchronizing the exposure parameters of camera 1 according to the brightness information of the image collected by camera 1. In this way, when the camera for collecting and sending images for display is switched from camera 1 to camera 2 or camera 3, the brightness of the images collected and sent for display before and after the camera switching remains consistent, avoiding the problem of abnormal shooting images after the camera switching.
[0138] In the embodiment of the present application, during the process of the first camera collecting and sending images for display, if the second camera stops running, the second camera will not synchronize the exposure parameters of the first camera. If the second camera normally performs the process of collecting images, the second camera will synchronize the exposure parameters of the first camera once before collecting each frame of image. For the specific parameter synchronization process, see steps 901 to 914.
[0139] Step 901: The first camera control module controls the first camera to drive and operate.
[0140] Step 902: The first camera driver triggers the first camera sensor to start.
[0141] Step 903: The first camera sensor captures an image.
[0142] In an embodiment of the present application, when the camera application is started, the first camera control module controls the first camera driver to run, so that the first camera driver triggers the first camera sensor to start up to capture images.
[0143] For example, when the camera application is started, the mobile phone detects that the user sets the focal length to 1x zoom. Assuming that the mobile phone determines that the camera used to capture images is the rear wide-angle camera, the first camera driver triggers the rear wide-angle camera sensor to capture images.
[0144] Step 904: The first camera sensor sends an image to a display driver.
[0145] Step 905: the display driver triggers the display screen to display an image.
[0146] After the camera sensor captures the image, the captured image is sent to the display driver, and the display driver triggers the display screen to display the image captured by the first camera.
[0147] Step 906: The first camera sensor sends an image to the first camera control module.
[0148] Step 907: The first camera control module adjusts the exposure parameters of the first camera according to the image captured by the first camera.
[0149] It can be understood that after the first camera captures and displays an image, the first camera control module can control the first camera to perform automatic exposure so that the image captured by the first camera converges to a suitable exposure parameter.
[0150] Step 908: The first camera control module sends exposure parameters to the resource pool.
[0151] Step 909: The resource pool stores the exposure parameters.
[0152] The resource pool may be any storage area in the hardware abstraction layer.
[0153] After the first camera control module adjusts the exposure parameters of the first camera once according to the image collected by the first camera each time, the first camera control module stores the exposure parameters of the first camera in the resource pool.
[0154] Here, after the frequency decision module in the first camera control module determines the synchronization frequency of the second camera synchronizing the exposure parameters of the first camera based on the brightness information of the N frames of images captured by the first camera, the first camera control module stores the synchronization frequency in the resource pool.
[0155] Step 910: The second camera control module obtains exposure parameters according to the target frequency.
[0156] Here, the frequency at which the second camera control module obtains exposure parameters from the resource pool is as follows: Figure 8 The target frequency is determined in .
[0157] Step 911: The second camera control module adjusts the exposure parameters of the second camera to the exposure parameters of the first camera.
[0158] Step 912: the second camera control module controls the second camera to drive and operate.
[0159] When the frequency of synchronizing the exposure parameters of the first camera with the second camera is not 0, in the process of the first camera capturing images and sending them for display, the acquisition frequency of the second camera capturing images matches the frequency of synchronizing the exposure parameters of the first camera. The second camera control module controls the second camera to drive the operation so that the second camera drive triggers the second camera to start.
[0160] Step 913: The second camera driver controls the second camera sensor to start.
[0161] Step 914: The second camera sensor captures an image using the exposure parameters of the first camera.
[0162] Before the second camera captures an image, the second camera control module synchronizes the exposure parameters of the second camera with the exposure parameters of the first camera, so that after the second camera driver triggers the second camera sensor to start, the second camera sensor uses the exposure parameters of the first camera to capture an image. Since the first camera and the second camera have the same exposure parameters for capturing images, the brightness of the image captured by the second camera is synchronized with that of the image captured by the first camera, thus avoiding abnormalities in the captured image when the camera is switched.
[0163] In the above embodiment, the exposure parameters of the first camera synchronized with the second camera are used as an example for illustrative description. The implementation process of synchronizing the remaining shooting parameters of the first camera with the second camera can be the same as the above process, which will not be repeated here.
[0164] In an embodiment of the present application, when the mobile phone starts the first camera and the second camera at the same time, the mobile phone controls the first camera to capture and display images, and controls the second camera to capture images but does not display images. After the mobile phone detects the shooting operation triggered by the user, it displays the first shooting interface in response to the user's operation. Among them, the first shooting interface displays the first image from the first camera. When the first image captured by the first camera is less than N frames, the mobile phone cannot determine the frequency of the second camera synchronizing the exposure parameters of the first camera based on the brightness information of the N frames of images. In this case, the mobile phone controls the second camera to capture the second image at the first frequency. The second camera does not synchronize the exposure parameters from the first camera, and the second camera captures the second image according to the exposure parameters of the automatic exposure.
[0165] When the first image captured by the first camera is larger than N frames, the mobile phone determines the target frequency for synchronizing the second camera with the first camera based on the brightness information of the N frames of images, and then controls the second camera to synchronize the exposure parameters of the first camera according to the target frequency.
[0166] In some embodiments, when the brightness change value of the image captured by the first camera is greater than the brightness threshold, the mobile phone determines that the target frequency of the second camera synchronizing with the first camera is the second frequency based on the brightness information of the N frames of images. In this case, the mobile phone adjusts the frequency of the exposure parameters of the second camera synchronizing with the first camera to the second frequency. The second frequency is less than the first frequency. Correspondingly, the acquisition frequency of the second camera collecting images is also adjusted from the first frequency to the second frequency. Since the acquisition frequency of the second camera collecting images is reduced, the purpose of reducing the power consumption of the device is achieved.
[0167] In other embodiments, when the brightness change value of the image captured by the first camera is less than the brightness threshold, the mobile phone determines that the target frequency for synchronizing the second camera with the first camera is the third frequency based on the brightness information of the N frames of images. In this case, the mobile phone also adjusts the frequency of the exposure parameters of the second camera synchronizing with the first camera to the third frequency. The third frequency is less than the second frequency. Correspondingly, the acquisition frequency of the image captured by the second camera is also adjusted to the third frequency. Since the acquisition frequency of the image captured by the second camera is reduced, the purpose of reducing the power consumption of the device is achieved.
[0168] For example, Fig.10 As shown, when the mobile phone determines that the brightness change value of the N frames of images collected by the first camera is less than the brightness threshold, that is, the brightness change of the N frames of images is not large, the acquisition frequency of the second camera to collect images is small, such as 1fps. When the mobile phone determines that the brightness change of the N frames of images collected by the second camera is large, the acquisition frequency of the second camera to collect images is adjusted to 30fps.
[0169] For example, Fig.11 As shown, assuming that when the camera is started, the first frequency of the second camera synchronizing the exposure parameters of the first camera in real time is 50fps. When the mobile phone determines that the brightness change value of the N frames of images collected by the first camera is greater than a certain brightness threshold, the target frequency of the second camera synchronizing the exposure parameters of the first camera is determined to be 20fps, and accordingly, the second camera collects images at a collection frequency of 20fps. After the brightness information of the shooting scene of the mobile phone changes, the mobile phone determines that the brightness change value of the N frames of images collected by the first camera is less than a certain brightness threshold, and determines that the target frequency of the second camera synchronizing the exposure parameters of the first camera is 5fps, and accordingly, the second camera collects images at a collection frequency of 5fps. It can be seen that the mobile phone can adjust the collection frequency of the second camera through the brightness information of the N frames of images collected by the first camera. Compared with the second camera synchronizing the exposure parameters of the first camera in real time in the related art, it is achieved by reducing the frequency of the second camera synchronizing the exposure parameters of the first camera to further reduce the frequency of collecting images, thereby achieving the purpose of reducing the power consumption of the device.
[0170] like Fig.12As shown, an embodiment of the present application discloses an electronic device, which may be the mobile phone mentioned above. The electronic device may specifically include: a touch screen 1201, wherein the touch screen 1201 includes a touch sensor 1206 and a display screen 1207; one or more processors 1202; a memory 1203; one or more application programs (not shown); and one or more computer programs 1204, and the above-mentioned components may be connected via one or more communication buses 1205. The above-mentioned one or more computer programs 1204 are stored in the above-mentioned memory 1203 and are configured to be executed by the one or more processors 1202, and the one or more computer programs 1204 include instructions, which may be used to execute the relevant steps in the above-mentioned embodiment.
[0171] It is understandable that, in order to realize the above functions, the above-mentioned electronic devices, etc. include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present invention.
[0172] The embodiment of the present application can divide the functional modules of the above-mentioned electronic device etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0173] In the case of dividing each functional module according to each function, a possible composition diagram of the electronic device involved in the above embodiment, the electronic device may include: a display unit, a transmission unit and a processing unit, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0174] The embodiment of the present application also provides an electronic device, including one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the above-mentioned related method steps to implement the camera control method in the above-mentioned embodiment.
[0175] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the camera control method in the above-mentioned embodiment.
[0176] An embodiment of the present application further provides a computer program product, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the camera control method in the above-mentioned embodiment.
[0177] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the device executes the camera control method executed by the electronic device in the above-mentioned method embodiments.
[0178] Among them, the electronic device, computer-readable storage medium, computer program product or device provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0179] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0180] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0181] 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 computer-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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a 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: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.
[0182] The above is only a specific implementation 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 should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A camera control method, characterized in that: Applied to an electronic device, the electronic device includes a first camera and a second camera, the lenses of the first camera and the second camera face the same direction, and the method includes: In response to the user's operation, a first shooting interface is displayed; wherein the first shooting interface displays a first image from the first camera, and the first camera automatically adjusts the exposure parameters of the first camera according to the brightness information of the first image and / or the brightness information of the shooting environment; Controlling the second camera to capture a second image at a first frequency; When the brightness change value of the first image is greater than the brightness threshold, the second camera is controlled to synchronize the exposure parameters from the first camera according to the second frequency, and the frequency at which the second camera collects the second image using the exposure parameters of the first camera is adjusted from the first frequency to the second frequency; the second frequency is less than the first frequency.
2. The method according to claim 1, characterized in that Under different brightness thresholds, the value of the second frequency is different.
3. The method according to claim 1 or 2, characterized in that: When the brightness change value of the first image is greater than the brightness threshold, controlling the second camera to synchronize the exposure parameters from the first camera according to the second frequency, and adjusting the frequency at which the second camera acquires the second image using the exposure parameters of the first camera from the first frequency to the second frequency, the method further includes: When the brightness change value of the first image is greater than a brightness threshold, the second frequency is determined according to brightness information of multiple frames of first images.
4. The method according to claim 3, characterized in that The determining the second frequency according to brightness information of the plurality of frames of the first image comprises: Determining brightness change values of the multiple frames of first images according to brightness information of the multiple frames of first images; According to the corresponding relationship between the brightness change value and the frequency, a second frequency corresponding to the brightness change value of the multiple frames of the first image is determined.
5. The method according to claim 4, characterized in that The step of determining brightness change values of the multiple frames of first images according to brightness information of the multiple frames of first images comprises: Determine, according to the brightness information of the multiple frames of first images, a brightness difference between every two adjacent frames of first images in the multiple frames of first images; The brightness difference between each two adjacent frames of the first image is summed to obtain the brightness change values of the multiple frames of the first image.
6. The method according to claim 1, characterized in that The controlling the second camera to synchronize the exposure parameters from the first camera includes: Writing the exposure parameters of the first camera into a storage area; After controlling the second camera to read the exposure parameters of the first camera from the storage area, the exposure parameters of the second camera are adjusted to the exposure parameters of the first camera.
7. The method according to claim 1, characterized in that The method further comprises: When the brightness change value of the first image is less than a brightness threshold, the frequency at which the second camera collects the second image is adjusted from the first frequency to a third frequency; and the third frequency is less than the second frequency.
8. The method according to claim 7, characterized in that The method further comprises: When the brightness change value of the first image is less than a brightness threshold, the second camera is controlled to synchronize the exposure parameters of the first camera according to the third frequency.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Image processing method and related device
CN116939358A
Frame rate adjusting method, device, equipment and system
CN117425064A