Image generation method and electronic device
Patent Information
- Application Number
- CN202611345933.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-10-27
AI Technical Summary
但是,默认的曝光参数或者历史采用的曝光参数可能并不适用于图像采集装置当前所处的环境,导致该图像采集装置基于默认的曝光参数或者历史采用的曝光参数采集到的首帧图像过曝光或者过暗
Smart Images

Figure CN122994627A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of control technology, and more particularly to an image generation method and an electronic device. Background Technology
[0002] When an electronic device's camera or other image acquisition device is activated, it typically captures images based on default or historically used exposure parameters. However, these default or historical exposure parameters may not be suitable for the current environment, resulting in an overexposed or underexposed first frame. For example, if a user previews or captures an image using the camera on a mobile phone or other electronic device, and then closes the camera, the next time the user reopens it, the camera will use the exposure parameters from the previous shutdown. However, if the user changes the environment in which the electronic device is used, causing a significant change in ambient brightness, the exposure parameters used when the camera was previously closed will no longer be suitable for the current environment, leading to an overexposed or underexposed first frame. Summary of the Invention
[0003] On the one hand, this application provides an image generation method, including:
[0004] In response to the electronic device activating the first image acquisition device, the first exposure parameters currently used by the second image acquisition device in the electronic device are obtained, wherein the second image acquisition device is in a normally open state when the electronic device is powered on.
[0005] Determine the first ambient brightness of the environment in which the electronic device is currently located;
[0006] Based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, the first exposure parameter is converted into the second exposure parameter that is currently suitable for the first image acquisition device.
[0007] Set the exposure parameters of the first image acquisition device to the second exposure parameters;
[0008] Based on the first image data acquired by the first image acquisition device using the second exposure parameters, the first frame image corresponding to the first image acquisition device is generated.
[0009] In one possible implementation, based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, the first exposure parameters are converted into second exposure parameters currently suitable for the first image acquisition device, including:
[0010] According to the correspondence between different ambient brightness and exposure parameter ratios, the target exposure parameter ratio corresponding to the first ambient brightness is determined. The exposure parameter ratio corresponding to the ambient brightness is the ratio between the exposure parameters suitable for the first image acquisition device and the exposure parameters suitable for the second image acquisition device under the ambient brightness.
[0011] Based on the target exposure parameter ratio and the first exposure parameter, the second exposure parameter suitable for the first image acquisition device is determined.
[0012] In yet another possible implementation, the image generation method also includes:
[0013] Determine the current lighting scene of the second image acquisition device;
[0014] The second exposure parameter is corrected according to the parameter correction strategy corresponding to the lighting scene to obtain the corrected second exposure parameter;
[0015] Setting the exposure parameters of the first image acquisition device to the second exposure parameters includes:
[0016] Set the exposure parameters of the first image acquisition device to the corrected second exposure parameters.
[0017] In yet another possible implementation, determining the current lighting scene of the second image acquisition device includes:
[0018] Determine the index value of at least one exposure quality evaluation index corresponding to the second image data currently acquired by the second image acquisition device;
[0019] Based on the index value of the at least one exposure quality evaluation index, the current lighting scene of the second image acquisition device is determined.
[0020] In another possible implementation, determining the value of at least one exposure quality evaluation index corresponding to the second image data currently acquired by the second image acquisition device includes:
[0021] Determine at least one of a first proportion of a first type of pixel and a second proportion of a second type of pixel in the second image data currently acquired by the second image acquisition device, wherein the first type of pixel is a pixel with a brightness lower than a first threshold, and the second type of pixel is a pixel with a brightness higher than a second threshold, and the second threshold is greater than the first threshold.
[0022] In yet another possible implementation, the lighting scene is one of an underexposed scene, an overexposed scene, and a normal exposure scene;
[0023] The second exposure parameter is corrected according to the parameter correction strategy corresponding to the lighting scene, including:
[0024] In response to the lighting scene being an underexposed scene, the second exposure parameter is increased;
[0025] In response to the lighting scene being an overexposed scene, the second exposure parameter is reduced;
[0026] In response to the lighting scene being a normal exposure scene, the second exposure parameter is kept unchanged.
[0027] In another possible implementation, the exposure parameter ratio corresponding to the ambient brightness is the ratio between the first target exposure parameter corresponding to the first image acquisition device and the second target exposure parameter corresponding to the second image acquisition device under the ambient brightness.
[0028] Wherein, the first target exposure parameter is the exposure parameter required to make the pixel brightness of the first target area of the first original image acquired by the first image acquisition device reach the target brightness under the ambient brightness.
[0029] The second target exposure parameter is the exposure parameter required to make the pixel brightness of the second target area of the second original image acquired by the second image acquisition device reach the target brightness under the ambient brightness.
[0030] Wherein, the first target region is at least a portion of the first original image; the second target region is at least a portion of the second original image.
[0031] In another possible implementation, the exposure parameter ratio corresponding to the ambient brightness is the product of the baseline exposure parameter ratio corresponding to the ambient brightness and the adjustable coefficient corresponding to the ambient brightness.
[0032] The image generation method further includes:
[0033] After acquiring the first frame image, in response to a change in the exposure parameters used by the first image acquisition device, a third exposure parameter used by the first image acquisition device is determined, and the adjustable coefficient corresponding to the first ambient brightness is adjusted based on the third exposure parameter and the second exposure parameter to change the exposure parameter ratio corresponding to the first ambient brightness.
[0034] In another possible implementation, determining the first ambient brightness of the environment in which the electronic device is currently located includes:
[0035] Obtain the second ambient brightness currently sensed by the light sensor;
[0036] The third ambient brightness currently output by the second image acquisition device is obtained, and the third ambient brightness is determined by the second image acquisition device based on the brightness of each pixel in the acquired second image data;
[0037] Based on the second ambient brightness and the third ambient brightness, the first ambient brightness of the environment in which the electronic device is currently located is determined.
[0038] In another aspect, this application also provides an electronic device, including: a controller, a first image acquisition device, a second image acquisition device, and a graphics signal processor;
[0039] The second image acquisition device is in a normally open state when the electronic device is powered on.
[0040] The controller is configured to, in response to the electronic device activating the first image acquisition device, obtain the first exposure parameters currently used by the second image acquisition device, wherein the second image acquisition device is in a normally-on state when the electronic device is powered on; determine the first ambient brightness of the environment in which the electronic device is currently located; based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, convert the first exposure parameters into a second exposure parameter currently suitable for the first image acquisition device; and set the exposure parameters of the first image acquisition device as the second exposure parameters.
[0041] The first image acquisition device is used to acquire first image data based on the second exposure parameters;
[0042] The graphics signal processor is used to generate the first frame image corresponding to the first image acquisition device based on the first image data acquired by the first image acquisition device. Attached Figure Description
[0043] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0044] Figure 1 A flowchart illustrating the image generation method provided in this application;
[0045] Figure 2 Another flowchart illustrating the image generation method provided in this application;
[0046] Figure 3 This is a schematic diagram illustrating one implementation principle for determining the exposure parameter ratios corresponding to different ambient brightness in this application.
[0047] Figure 4 Another flowchart illustrating the image generation method provided in this application;
[0048] Figure 5 Another flowchart illustrating the image generation method provided in this application;
[0049] Figure 6 A schematic diagram of an implementation framework for the image generation method provided in this application;
[0050] Figure 7 A schematic diagram illustrating the framework of one implementation principle for determining suitable exposure parameters for the first image acquisition device in this application;
[0051] Figure 8 A schematic diagram of the component architecture of the electronic device provided in this application. Detailed Implementation
[0052] The solution proposed in this application is applicable to electronic devices such as mobile phones, tablets, or laptops, and can also be security devices that have or are connected to image acquisition devices, without any specific restrictions.
[0053] The solution proposed in this application enables the reasonable setting of the exposure parameters of the image acquisition device when it is started in an electronic device, thereby reducing the occurrence of underexposure or overexposure in the first frame image acquired by the image acquisition device and improving the quality of the first frame image.
[0054] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0055] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0056] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0057] like Figure 1 This is a schematic flowchart of an image generation method provided in this application. The method of this embodiment is applied to the aforementioned electronic device. The electronic device includes a first image acquisition device and a second image acquisition device, which are two different types of image acquisition devices.
[0058] In this configuration, the second image acquisition device is normally on when the electronic device is powered on. The first image acquisition device, however, is not normally on when the electronic device is powered on; it can be activated by the user or through an application. Typically, the power consumption of the second image acquisition device per unit time is lower than that of the first image acquisition device per unit time.
[0059] The image data acquired by the first image acquisition device can be used to generate preview images, storable pictures, or videos. The second image acquisition device is mainly used for continuous sensing and detection of the environment or user status to achieve purposes such as facial recognition unlocking, gesture control, or preventing screen peeping. For example, the second image acquisition device can be an always-on (AON) camera, while the first image acquisition device is a regular camera used in electronic devices to acquire images.
[0060] The method in this embodiment may include:
[0061] S101, in response to the electronic device activating the first image acquisition device, the first exposure parameters currently used by the second image acquisition device in the electronic device are obtained.
[0062] In this application, exposure parameters are parameters that control the light received and the light-sensing mode of the image acquisition device. For example, exposure parameters may include at least one of parameters such as exposure index, exposure gain, and exposure time. Exposure time is the duration from the start of light sensing to the end of light sensing by the image acquisition device; exposure gain refers to the factor by which the image acquisition device amplifies the acquired electrical signal. The exposure index (EI) is the sensitivity of the image sensor, which is the product of exposure gain and exposure time.
[0063] For ease of distinction, the exposure parameters currently used by the second image acquisition device are referred to as the first exposure parameters, while the exposure parameters currently suitable for the subsequent first image acquisition device are referred to as the second exposure parameters.
[0064] Understandably, since the second image acquisition device is always on, it can adjust its exposure parameters in real time according to the ambient brightness during operation. Therefore, when the first image acquisition device is started, the first exposure parameters used by the second image acquisition device to sense the image are suitable for the second image acquisition device. Based on this, the risk of overexposure or underexposure in the image acquired by the second image acquisition device based on these first exposure parameters is low.
[0065] S102, determine the first ambient brightness of the environment in which the electronic device is currently located.
[0066] The first ambient brightness is the brightness value of the environment in which the electronic device is currently located.
[0067] In this application, there are various possible ways to determine the specific brightness of the first ambient light, and no limitation is imposed on them.
[0068] S103, based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, the first exposure parameters are converted into the second exposure parameters that are currently suitable for the first image acquisition device.
[0069] The exposure performance relationship can characterize the difference in exposure parameter requirements between the first image acquisition device and the second image acquisition device under the same ambient brightness. For example, the exposure performance relationship can include the conversion relationship of exposure parameters between the first image acquisition device and the second image acquisition device under different ambient brightness; or, the difference in exposure parameter requirements between the first image acquisition device and the second image acquisition device under different ambient brightness, etc., without any specific limitations.
[0070] It is understandable that, since the first exposure parameter is the exposure parameter suitable for the second image acquisition device under the first ambient brightness, and given that the exposure performance relationship between the first image acquisition device and the second image acquisition device is determined, the second exposure parameter suitable for the first image acquisition device to acquire images under the first ambient brightness can be derived based on the first exposure parameter.
[0071] S104, set the exposure parameters of the first image acquisition device to the second exposure parameters.
[0072] For example, the second exposure parameter includes the exposure index, which can be configured for the first image acquisition device so that the first image acquisition device can adjust the exposure gain and exposure time required for image acquisition based on the second exposure parameter.
[0073] For example, the second exposure parameters include exposure gain and exposure time, and the exposure time and exposure gain of the first image acquisition device can be set based on the second exposure parameters.
[0074] In this application, there are no restrictions on the specific implementation of setting the exposure parameters of the first image acquisition device to the second exposure parameter.
[0075] S105, based on the first image data acquired by the first image acquisition device using the second exposure parameters, generate the first frame image corresponding to the first image acquisition device.
[0076] The first image data refers to the image data acquired and directly output by the first image acquisition device based on the second exposure parameters, without any processing. For example, the first image data is raw image format (RAW) data, also referred to as raw image or raw image data.
[0077] The first frame image refers to the first image generated based on the image data acquired by the first image acquisition device after its activation. For example, if the electronic device is a mobile terminal such as a mobile phone, in response to a call command to the first image acquisition device or an image acquisition command input by the user, the first frame image generated based on the image data acquired by the first image acquisition device after its activation is the first frame image. Similarly, if the electronic device is a security device, after activating the first image acquisition device, it can generate a first frame image based on the image data acquired by the first image acquisition device to capture the first image after the first image acquisition device is activated.
[0078] In this embodiment, since the second image acquisition device is always on, it can adjust its exposure parameters in a timely manner according to the ambient brightness during operation. Therefore, when the first image acquisition device is started, the first exposure parameters currently used by the second image acquisition device are suitable for the images acquired by the second image acquisition device, thus reducing the risk of overexposure or underexposure in the images acquired by the second image acquisition device. Based on this, and considering the exposure performance relationship between the first and second image acquisition devices, the first exposure parameters can be converted into second exposure parameters suitable for the first image acquisition device to acquire images under the current ambient brightness. This reduces the likelihood of overexposure or underexposure in the image data acquired by the first image acquisition device based on the second exposure parameters, and consequently reduces the likelihood of overexposure or underexposure in the first frame image after the first image acquisition device starts.
[0079] In this application, determining the first ambient brightness of the environment in which the electronic device is located can be achieved in several possible ways, some of which are described below:
[0080] In one possible implementation, an electronic device can utilize a light sensor to sense ambient brightness, and determine the second ambient brightness sensed by the light sensor as the first ambient brightness of the environment in which the electronic device is located. The light sensor, also known as an ambient light sensor (ALS), can detect changes in the brightness of the surrounding environment and convert the light signal into an electronic signal that the electronic device can understand, thus obtaining the detected ambient brightness value.
[0081] In another possible implementation, a third ambient brightness currently output by the second image acquisition device can be obtained, and this third ambient brightness can be determined as the first ambient brightness of the environment in which the electronic device is located. Here, the third ambient brightness is a brightness value determined by the second image acquisition device based on the brightness of each pixel in the acquired second image data; the specific implementation is not limited. The second image data is the unprocessed raw data acquired by the second image acquisition device, such as a RAW image acquired by the second image acquisition device.
[0082] In another possible implementation, in order to more accurately determine the first ambient brightness of the environment in which the electronic device is located, and in order to more accurately determine the appropriate exposure parameters for the first image acquisition device, the second ambient brightness currently sensed by the light sensor and the third ambient brightness currently output by the second image acquisition device can be obtained; then, based on the second and third ambient brightness, the first ambient brightness of the environment in which the electronic device is currently located is determined.
[0083] The determination of the first ambient brightness based on the second and third ambient brightness can be achieved by taking the average of the second and third ambient brightness as the first ambient brightness; or by taking a weighted sum of the second and third ambient brightness and taking the result of the weighted sum as the first ambient brightness.
[0084] To further improve the accuracy of the determined first ambient brightness, this application can also determine the environmental scene in which the electronic device is located, determine the first weight corresponding to the second ambient brightness and the second weight corresponding to the third ambient brightness based on the environmental scene, and perform a weighted summation of the second ambient brightness and the third ambient brightness based on the first weight and the second weight to obtain the first ambient brightness of the environment in which the electronic device is located.
[0085] The environmental scenarios can be divided into indoor, outdoor, sunny outdoor, cloudy outdoor, and backlit scenarios for the second image acquisition device, without any specific restrictions.
[0086] The environmental scenario can be determined by combining one or more of the following: the location of the electronic device, the current weather, and the ambient brightness sensed by the second image acquisition device. For example, the location of the electronic device can indicate whether it is indoors; the weather can further determine whether it is outdoors in sunny or cloudy weather; and the ambient brightness sensed by the second image acquisition device can determine whether the second image acquisition device is currently in a backlit state, which in turn can be used to analyze whether the first image acquisition device is in a backlit state, without any specific limitations.
[0087] In particular, the first weight corresponding to the second ambient brightness and the second weight corresponding to the third ambient brightness will be different in different environmental scenarios.
[0088] For example, in indoor scenes, the ambient brightness sensed by the light sensor is relatively accurate. Therefore, the first weight corresponding to the second ambient brightness sensed by the light sensor is relatively high, for example, it can be 0.8, while the second weight corresponding to the third ambient brightness sensed by the second image acquisition device can be 0.2. Similarly, if in outdoor scenes, the accuracy of the ambient brightness determined by the light sensor and the second image acquisition device is not much different, then both the first and second weights can be 0.5. Furthermore, if the second image acquisition device is in a backlit state, the light sensor will be affected, leading to a decrease in the accuracy of the sensed ambient brightness. In this case, the first weight can be set to 0.3, and the second weight can be set to 0.7.
[0089] In this application, there are various possible relationships between the exposure performance of the first image acquisition device and the second image acquisition device, and correspondingly, there are also various possible implementations for determining the appropriate second exposure parameters for the first image acquisition device.
[0090] In one possible scenario, to more efficiently determine the appropriate second exposure parameters for the first image acquisition device, the exposure performance relationship can be the correspondence between different ambient brightness levels and the ratio of exposure parameters. The following example illustrates this situation. Figure 2 Please provide an explanation. For example... Figure 2 This illustration shows another flowchart of the image generation method provided in this application. The method in this embodiment may include:
[0091] S201, in response to the electronic device activating the first image acquisition device, the first exposure parameters currently used by the second image acquisition device in the electronic device are obtained.
[0092] In this case, the second image acquisition device is in the normally open state when the electronic device is powered on.
[0093] S202, determine the first ambient brightness of the environment in which the electronic device is currently located.
[0094] The above two steps can be referred to in the relevant descriptions of the previous embodiments, and will not be repeated here.
[0095] S203, determine the target exposure parameter ratio corresponding to the first ambient brightness according to the corresponding relationship between the configured different ambient brightness and exposure parameter ratios.
[0096] The exposure parameter ratio corresponding to each ambient brightness level is the ratio between the suitable exposure parameters for the first image acquisition device and the suitable exposure parameters for the second image acquisition device under that ambient brightness level. For example, taking the exposure parameter as the exposure index, the exposure parameter ratio corresponding to the ambient brightness level is the ratio between the suitable exposure index for the first image acquisition device and the suitable exposure index for the second image acquisition device under that ambient brightness level.
[0097] Accordingly, the target exposure parameter ratio is the ratio between the exposure parameters suitable for the first image acquisition device and the exposure parameters suitable for the second image acquisition device under the first ambient brightness.
[0098] In order to accurately determine the ratio between the suitable exposure parameters of the first image acquisition device and the suitable exposure parameters of the second image acquisition device under different ambient brightness conditions, due to the performance differences of different image acquisition devices, this application can pre-calibrate the correspondence between different ambient brightness and exposure parameter ratios. The specific calibration process is not limited.
[0099] In one possible implementation, the exposure parameter ratio corresponding to each ambient brightness is the ratio between the first target exposure parameter corresponding to the first image acquisition device and the second target exposure parameter corresponding to the second image acquisition device under that ambient brightness.
[0100] The first target exposure parameter is the exposure parameter required to make the pixel brightness of the first target area in the first original image acquired by the first image acquisition device reach the target brightness under the ambient brightness. For example, under the ambient brightness, the exposure parameters of the first image acquisition device are continuously adjusted, and the original image is acquired using the first image acquisition device under different exposure parameters. The exposure parameters that enable the pixel brightness of the first target area in the original image to reach the target brightness are determined, and the determined exposure parameters are recorded as the first target exposure parameter corresponding to the ambient brightness.
[0101] The second target exposure parameter is the exposure parameter required to make the pixel brightness of the second target area in the second original image acquired by the second image acquisition device reach the target brightness under the ambient brightness. The process of determining the second target exposure parameter is similar to that of determining the first target exposure parameter, and will not be described again.
[0102] The first raw image is unprocessed image data acquired by the first image acquisition device, such as a RAW image acquired by the first image acquisition device. Similarly, the second raw image is unprocessed image data acquired by the second image acquisition device. For example, the second raw image can be a RAW image acquired by the second image acquisition device.
[0103] The first target region is at least a portion of the first original image, and the second target region is at least a portion of the second original image; the specific regions can be set according to actual needs.
[0104] In one alternative approach, considering that the brightness of non-central areas in the acquired original image may be relatively dark due to lens obstruction or other reasons, and thus cannot accurately reflect the true brightness of the original image, in order to improve the accuracy of the calibration correspondence, in this application, the first target area may be located in the central area of the first original image, the second target area may be located in the central area of the second original image, and the second target area and the first target area have the same area size.
[0105] For example, the first target region is the region in the center of the first original image that has an area ratio that reaches the target ratio (e.g., 1 / 16). The second target region is the region in the center of the second original image that has an area ratio that reaches the target ratio.
[0106] The target brightness can also be set as needed, such as 10 lux or 15 lux.
[0107] To facilitate understanding, this application describes the implementation process of determining the exposure parameter ratios corresponding to different ambient brightness levels, which will be explained below in conjunction with... Figure 3 Let's take one possible implementation as an example:
[0108] exist Figure 3 The example uses a target brightness of 10 Lux, and the first image acquisition device is a regular camera, while the second image acquisition device is an AON camera.
[0109] First, with an ambient brightness of 100 Lux, adjust the exposure parameters of the ordinary camera in the electronic device until the average brightness of each pixel in the first target area (e.g., the area located in the center and accounting for 1 / 16) of the first original image captured by the ordinary camera reaches 10 Lux. Record the exposure parameters used by the ordinary camera at this time (i.e., the first target exposure parameters) as the exposure parameter Nor-100 Lux.
[0110] Similarly, with an ambient brightness of 100 Lux, the exposure parameters of the AON camera in the electronic device are adjusted until the average brightness of each pixel in the second target area (such as the area located in the center and accounting for 1 / 16) of the second original image captured by the AON camera reaches 10 Lux, and the exposure parameters of the AON camera at this time (i.e., the second target exposure parameters) are recorded as the exposure parameters Aon-100 Lux.
[0111] Depend on Figure 3 As can be seen, when the ambient brightness is 100 Lux, the average brightness of each pixel in the second target area of the original image captured by the AON camera may vary depending on the exposure parameters of the AON camera. For example, the average brightness may be 10, 25, or 50 Lux. However, this application only needs to focus on the exposure parameters of the AON camera when the average brightness of the second target area is 10 Lux.
[0112] The exposure parameter here can be the exposure index, exposure time, exposure gain, etc., without any restrictions.
[0113] Next, calculate the ratio of the exposure parameter Nor-100Lux to the exposure parameter Aon-100Lux, and store this ratio as the exposure parameter ratio corresponding to an ambient brightness of 100Lux.
[0114] Wherein, the exposure parameter Nor-100Lux is the first target exposure parameter corresponding to the ordinary camera when the ambient brightness is 100Lux, and the exposure parameter Aon-100Lux is the second target exposure parameter corresponding to the AON camera when the ambient brightness is 100Lux. Therefore, the ratio of these two exposure parameters is the exposure parameter ratio corresponding to the ambient brightness of 100Lux: Nor-100Lux / Aon-100Lux.
[0115] Finally, repeat the above two steps under different ambient brightness levels to obtain the exposure parameter ratios corresponding to different ambient brightness levels.
[0116] like Figure 3 As shown, tests were conducted at different ambient brightness values of 10 Lux, 100 Lux, 300 Lux, 1000 Lux, and 2000 Lux to calibrate the exposure parameter ratios corresponding to different ambient brightness levels. For example, when the ambient brightness is 10 Lux, the exposure parameter ratio is ratio 0; when the ambient brightness is 100 Lux, the exposure parameter ratio is ratio 1; when the ambient brightness is 300 Lux, the exposure parameter ratio is ratio 2, and so on.
[0117] In this application, the correspondence between different ambient brightness and exposure parameter ratios can be stored in the non-volatile memory of the electronic device. Based on this, the corresponding exposure parameter ratio can be retrieved from the non-volatile memory based on the first ambient brightness.
[0118] It is understandable that, since the values of ambient brightness cannot be exhaustively listed, the calibrated correspondence between different ambient brightness levels and exposure parameter ratios may not directly provide an exposure parameter ratio that corresponds to the current first ambient brightness of the electronic device. Therefore, if the calibrated correspondence does not contain an exposure parameter ratio corresponding to the first ambient brightness, this application can also determine the exposure parameter corresponding to the first ambient brightness using linear interpolation based on the exposure parameter ratios corresponding to each ambient brightness level.
[0119] For example, from the calibrated correspondence, determine the first candidate ambient brightness that is greater than the first ambient brightness and closest to the first ambient brightness, and the second candidate ambient brightness that is less than the first ambient brightness and closest to the first ambient brightness. Determine the average value between the first candidate exposure parameter ratio corresponding to the first candidate ambient brightness and the second candidate exposure parameter ratio corresponding to the second candidate ambient brightness, and determine the average value as the target exposure parameter ratio corresponding to the first ambient brightness.
[0120] S204, based on the target exposure parameter ratio and the first exposure parameter, determine the second exposure parameter that is currently suitable for the first image acquisition device.
[0121] For example, by multiplying the first exposure parameter by the ratio of the target exposure parameter, the second exposure parameter suitable for the first image acquisition device can be obtained.
[0122] S205, set the exposure parameters of the first image acquisition device to the second exposure parameters.
[0123] S206, Based on the first image data acquired by the first image acquisition device using the second exposure parameters, generate the first frame image corresponding to the first image acquisition device.
[0124] In this embodiment, the electronic device is configured with an exposure parameter ratio between the suitable exposure parameters for the first image acquisition device and the suitable exposure parameters for the second image acquisition device under different ambient brightness conditions. Based on this, when the first image acquisition device is activated, the suitable second exposure parameters for the first image acquisition device can be directly converted from the suitable first exposure parameters for the second image acquisition device and the current ambient brightness of the electronic device. Thus, the suitable second exposure parameters for the first image acquisition device can be determined efficiently and accurately with just a simple conversion.
[0125] Furthermore, since different users have different preferences for image brightness, their requirements for the exposure parameters of the first image acquisition device will also differ under the same ambient brightness. Therefore, in order to meet the different needs of different users for exposure parameters and to more reasonably determine the suitable second exposure parameters for the first image acquisition device, in this embodiment, the exposure parameter ratio corresponding to the ambient brightness can be the product of the baseline exposure parameter ratio corresponding to the ambient brightness and the adjustable coefficient corresponding to the ambient brightness.
[0126] The reference exposure parameter ratio can be the ratio between the exposure parameters suitable for the first image acquisition device and the exposure parameters suitable for the second image acquisition device under ambient brightness. For the specific determination method, please refer to the relevant introduction on determining the exposure parameter ratio above, which will not be repeated here.
[0127] This adjustable coefficient is an adjustable coefficient. When configuring the exposure parameter ratio corresponding to different ambient brightness, this adjustable coefficient in the exposure parameter ratio can be set to 1 by default. The specific value of this adjustable coefficient can be adjusted according to the user's preference.
[0128] Based on this, after obtaining the first frame image, in response to a change in the exposure parameters used by the first image acquisition device, a third exposure parameter used by the first image acquisition device is determined, and the adjustable coefficient corresponding to the first ambient brightness is adjusted based on the third exposure parameter and the second exposure parameter to change the exposure parameter ratio corresponding to the first ambient brightness.
[0129] There are several ways to adjust the adjustable coefficient corresponding to the first ambient brightness based on the third exposure parameter and the second exposure parameter, and there are no specific restrictions. For example, the ratio between the third exposure parameter and the second exposure parameter can be determined, and the adjustable coefficient can be adjusted to this ratio. Alternatively, the difference between the third exposure parameter and the second exposure parameter can be determined; if the difference is greater than zero, the adjustable coefficient can be increased; if the difference is less than zero, the adjustable coefficient can be decreased.
[0130] It is evident that if the exposure parameters used by the first image acquisition device change after acquiring the first frame, it indicates that the user has manually adjusted the exposure parameters of the image acquired by the first image acquisition device. In this case, the third exposure parameter used by the first image acquisition device is the exposure parameter that the user expects to use under the first ambient brightness. Based on this, by adjusting the adjustable coefficient corresponding to the first ambient brightness in combination with the third and second exposure parameters, the product of the reference exposure ratio and the adjustable coefficient can be changed, thereby achieving the purpose of adjusting the exposure parameter ratio corresponding to the first ambient brightness. This ensures that the exposure parameter ratio corresponding to the first ambient brightness meets the user's preference, and thus, when the first image acquisition device is subsequently started, the appropriate exposure parameters for the first image acquisition device can be more reasonably determined based on the adjusted exposure parameter ratio.
[0131] In order to reduce the change in exposure parameters used by the first image acquisition device due to the first ambient brightness, this application may determine the third exposure parameter used by the first image acquisition device and perform related operations to adjust the adjustable coefficient if the exposure parameters used by the first image acquisition device change within a set time period after the first frame image is acquired, or after the first frame image is acquired and the ambient brightness of the electronic device is still the first ambient brightness.
[0132] In any of the above embodiments of this application, the first exposure parameters set by the second image acquisition device may deviate under certain lighting conditions, resulting in slight overexposure or underexposure of the image data acquired by the second image acquisition device, thereby reducing the accuracy of the second exposure parameters converted from the first exposure parameters. Therefore, after determining the suitable second exposure parameters for the first image acquisition device, this application can further correct the second exposure parameters based on the current lighting conditions of the second image acquisition device. To address this situation, combined with... Figure 4 Please provide an explanation.
[0133] like Figure 4 This is another schematic flowchart of the image generation method provided in this application. The method in this embodiment may include:
[0134] S401, in response to the electronic device activating the first image acquisition device, obtain the first exposure parameters currently used by the second image acquisition device in the electronic device.
[0135] In this case, the second image acquisition device is in the normally open state when the electronic device is powered on.
[0136] S402, determine the first ambient brightness of the environment in which the electronic device is currently located.
[0137] S403, based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, converts the first exposure parameters into the second exposure parameters that are currently suitable for the first image acquisition device.
[0138] The above steps can be found in the description of any of the preceding embodiments, and will not be repeated here.
[0139] S404, determine the current lighting scene of the second image acquisition device.
[0140] The lighting scene is used to characterize the illumination state of the second image acquisition device, such as the amount of light entering the device. This lighting scene reflects the suitability of the second image acquisition device for acquiring image data using the first exposure parameters.
[0141] In one example, the lighting scene can be categorized as: underexposed scene, overexposed scene, and normally exposed scene.
[0142] In this application, there may be multiple ways to determine the specific implementation of the lighting scene, and there are no specific restrictions.
[0143] In one possible scenario, to more accurately determine the lighting scene, the current lighting scene of the second image acquisition device can be determined based on the exposure state of the second image data currently acquired by the second image acquisition device. Specifically, the index value of at least one exposure quality evaluation index corresponding to the second image data currently acquired by the second image acquisition device can be determined; based on the index value of the at least one exposure quality evaluation index, the current lighting scene of the second image acquisition device can be determined.
[0144] Among them, the exposure quality evaluation index is an indicator for evaluating the exposure of the second image data, and there are no specific restrictions.
[0145] For example, the exposure quality evaluation index can be the average brightness of each pixel in the second image data. If the average brightness is higher than a set first brightness threshold, the second image acquisition device is determined to be in an overexposed scene; if the average brightness is lower than a second brightness threshold, the second image acquisition device is determined to be in an underexposed scene. If the average brightness is between the first and second brightness thresholds, the second image acquisition device is determined to be in a normal exposure scene. The first brightness threshold is higher than the second brightness threshold.
[0146] For example, in order to more accurately reflect the exposure status of the image acquired by the second image acquisition device, the exposure quality evaluation index of the second image acquisition device can be at least one of the underexposed pixel ratio and the overexposed pixel ratio in the second image data.
[0147] The underexposed pixel ratio is the first proportion of the first type of pixels in the second image data, where the first type of pixels are those with brightness below a first threshold. The overexposed pixel ratio is the second proportion of the second type of pixels in the second image data, where the second type of pixels are those with brightness above a second threshold, where the second threshold is greater than the first threshold.
[0148] Accordingly, the lighting scene can be determined based on at least one of the underexposed pixel ratio and the overexposed pixel ratio. For example, if the underexposed pixel ratio exceeds a first preset ratio, the lighting scene is determined to be an underexposed scene; if the overexposed pixel ratio exceeds a second preset ratio, the lighting scene is determined to be an overexposed scene. The first and second preset ratios can be the same or different. If the underexposed pixel ratio does not exceed the first preset ratio and the overexposed pixel ratio does not exceed the second preset ratio, the lighting scene is determined to be a normal exposure scene.
[0149] Of course, there may be other possible scenarios for this exposure quality evaluation index, and there are no restrictions on them.
[0150] It is understandable that, since the index value of at least one exposure quality evaluation index corresponding to the second image data can directly reflect the exposure quality of the second image data, combining the index value of at least one exposure quality evaluation index corresponding to the second image acquisition device can more intuitively reflect the suitability of the second image acquisition device in acquiring image data using the first exposure parameters. This can improve the accuracy of lighting scene recognition, thereby providing a reliable basis for subsequent reasonable correction of the second exposure parameters determined based on the first exposure parameters, improving the accuracy of the second exposure parameters, and thus enabling more accurate setting of exposure parameters for the first image acquisition device, thereby improving the image quality of the first frame image data acquired by the first image acquisition device.
[0151] S405, according to the parameter correction strategy corresponding to the lighting scene, the second exposure parameter is corrected to obtain the corrected second exposure parameter.
[0152] Different lighting scenarios can correspond to different parameter correction strategies. Based on this, a parameter correction strategy corresponding to the current lighting scenario of the second image acquisition device can be determined, and the determined parameter correction strategy can be used to correct the second exposure parameter. For example, the parameter correction strategy may include increasing, decreasing, or maintaining the second exposure parameter, and may also include increasing or decreasing the proportion of the second exposure parameter, etc., without any specific limitations.
[0153] In one possible scenario, if the determined lighting scene falls into one of the following categories: underexposed, overexposed, or normally exposed, the second exposure parameter can be corrected as follows:
[0154] In response to an underexposed lighting scene, the second exposure parameter is increased;
[0155] In response to an overexposed lighting scene, the second exposure parameter is reduced.
[0156] In response to a normal exposure scene, the second exposure parameters are kept unchanged.
[0157] In one example, increasing the second exposure parameter can be achieved by multiplying the second exposure parameter by the first correction value. The first correction value is greater than 1 and can be preset according to actual needs; alternatively, it can be determined by combining the proportion of underexposed pixels or the average brightness, etc., without limitation.
[0158] Similarly, reducing the second exposure parameter can be achieved by multiplying the second exposure parameter by the second correction value. The second correction value is less than 1 and can be preset according to actual needs; it can also be determined by combining the proportion of underexposed pixels or the average brightness, etc., without any restrictions.
[0159] Of course, there are other ways to increase or decrease the second exposure parameter, and there are no restrictions on this.
[0160] S406, set the exposure parameters of the first image acquisition device to the corrected second exposure parameters.
[0161] S407, Based on the first image data acquired by the first image acquisition device using the corrected second exposure parameters, generate the first frame image corresponding to the first image acquisition device.
[0162] The above steps S406 and S407 can be found in the relevant descriptions of the previous embodiments, and will not be repeated here.
[0163] In this embodiment, after determining the appropriate second exposure parameters for the currently activated first image acquisition device based on the first exposure parameters used by the second image acquisition device in the normally open state, the current lighting scene of the second image acquisition device is also determined, and the second exposure parameters are corrected based on the parameter correction strategy corresponding to the lighting scene. This allows for more accurate setting of the exposure parameters for the first image acquisition device, thereby further improving the image quality acquired by the first image acquisition device.
[0164] To facilitate understanding of the solution and its advantages in this embodiment, a specific implementation will be described below. For example... Figure 5 This is another schematic flowchart of the image generation method provided in this application. The method in this embodiment may include:
[0165] S501, in response to the electronic device activating the first image acquisition device, obtains the first exposure parameters currently used by the second image acquisition device in the electronic device.
[0166] S502, determine the first ambient brightness of the environment in which the electronic device is currently located.
[0167] S503 determines the target exposure parameter ratio corresponding to the first ambient brightness according to the correspondence between different configured ambient brightness and exposure parameter ratios.
[0168] The exposure parameter ratio corresponding to ambient brightness is the ratio between the suitable exposure parameters for the first image acquisition device and the suitable exposure parameters for the second image acquisition device under that ambient brightness.
[0169] S504, based on the target exposure parameter ratio and the first exposure parameter, determine the second exposure parameter that is currently suitable for the first image acquisition device.
[0170] For example, the product of the first exposure parameter and the ratio of the target exposure parameter can be determined as the second exposure parameter.
[0171] The above steps can be found in the description of any of the preceding embodiments, and will not be repeated here.
[0172] S505, determine at least one of the first proportion of the first type of pixels and the second proportion of the second type of pixels in the second image data currently acquired by the second image acquisition device.
[0173] The first type of pixel is a pixel whose brightness is lower than a first threshold, and the second type of pixel is a pixel whose brightness is higher than a second threshold, where the second threshold is greater than the first threshold.
[0174] S506, if the first proportion of the first type of pixels is greater than the first set proportion, it is determined that the second image data is underexposed, and the second exposure parameter is corrected using the first correction value to increase the second exposure parameter.
[0175] The first correction value is greater than 1, such as 1.2 or 1.3. For example, the first correction value can be multiplied by the second exposure parameter to obtain the corrected second exposure parameter.
[0176] The fact that the second image data is underexposed indicates that the second image acquisition device is in an underexposed scene.
[0177] It is understandable that the underexposure of the second image data indicates that the value of the first exposure parameter currently used by the second image acquisition device is too low. In this case, the second exposure parameter converted based on the ratio of the first exposure parameter and the target exposure parameter will also have a relatively low value, resulting in the underexposure of the image data acquired by the first image acquisition device based on the second exposure parameter.
[0178] Based on this, in this embodiment, if the second image data acquired by the second image acquisition device based on the first exposure parameter is underexposed, this application will use the first correction value to correct the second exposure parameter to increase the second exposure parameter. This can reduce the situation where the second exposure parameter corresponding to the first image acquisition device is too low due to the low value of the exposure parameter used by the second image acquisition device, thereby reducing the situation where the acquired image is too dark due to the relatively low second exposure parameter used by the first image acquisition device.
[0179] S507, if the second proportion of the second type of pixels is greater than the second set proportion, it is determined that the second image data is in an overexposed state, and the second exposure parameter is corrected using the second correction value to reduce the second exposure parameter.
[0180] The second correction value is less than 1; for example, it can be 0.8 or 0.9. For instance, the second correction value can be multiplied by the second exposure parameter to obtain the corrected second exposure parameter.
[0181] It is understandable that if the second image data is overexposed, it means that the value of the first exposure parameter currently used by the second image acquisition device is too high. In this case, the second exposure parameter converted based on the ratio of the first exposure parameter and the target exposure parameter will also have a relatively high value, which will cause the image data acquired by the first image acquisition device based on the second exposure parameter to be overexposed.
[0182] Therefore, in this embodiment, if the second image data acquired by the second image acquisition device based on the first exposure parameter is overexposed, this application will use a second correction value to correct the second exposure parameter to reduce the second exposure parameter. This can reduce the situation where the second exposure parameter corresponding to the first image acquisition device is too high due to the high value of the exposure parameter used by the second image acquisition device, and thus reduce the situation where the acquired image is overexposed due to the relatively high second exposure parameter used by the first image acquisition device.
[0183] It should be noted that this embodiment uses the example of correcting the second exposure parameter by using a correction value when the second image data is underexposed or overexposed. In practical applications, the second exposure parameter can also be increased or decreased in other ways, and there are no restrictions on this.
[0184] S508, if the first proportion of the first type of pixels is not greater than the first set proportion and the second proportion of the second type of pixels is not greater than the second set proportion, determine that the second image data is in a normal exposure state and maintain the second exposure parameters unchanged.
[0185] The fact that the second image data is under normal exposure indicates that the second image acquisition device is in a normal lighting environment. This also suggests that the first exposure parameters used by the second image acquisition device are reasonable, and there is no overexposure or underexposure of the image.
[0186] S509, set the exposure parameters of the first image acquisition device to the second exposure parameters.
[0187] S510: Based on the first image data acquired by the first image acquisition device using the second exposure parameters, generate the first frame image corresponding to the first image acquisition device.
[0188] Understandably, in Figure 5 In this embodiment, the second exposure parameter is determined first, and then corrected. In practical applications, after determining the target exposure parameter ratio corresponding to the first ambient brightness, since this target exposure parameter ratio can affect the second exposure parameter, this application can also correct the target exposure parameter ratio based on the exposure state of the second image data acquired by the second image acquisition device based on the first exposure parameter. The second exposure parameter determined based on the corrected target exposure parameter ratio is essentially also a corrected second exposure parameter.
[0189] For example, if the second image data is overexposed, the target exposure parameter ratio is reduced, for example, by multiplying the target exposure parameter ratio by a second correction value to obtain a corrected target exposure parameter ratio. If the second image data is underexposed, the target exposure parameter ratio is increased, for example, by multiplying the target exposure parameter ratio by a first correction value to obtain a corrected target exposure parameter ratio. If the second image data is underexposed, the target exposure parameter ratio is maintained unchanged. Based on this, and using the first exposure parameter and the corrected target exposure parameter ratio, a suitable second exposure parameter is determined for the first image acquisition device. This obtained second exposure parameter is the corrected second exposure parameter, which can further reduce the possibility of the first image data acquired by the first image acquisition device being too dark or overexposed due to an unsuitable second exposure parameter.
[0190] To facilitate understanding, the following will be combined with... Figure 6 and 7 Please provide an explanation. Figure 6 This is a schematic diagram illustrating one implementation principle framework of the solution proposed in this application. Figure 7 This is a schematic diagram illustrating one implementation principle for determining suitable second exposure parameters for the first image acquisition device in this application.
[0191] For ease of understanding, Figure 6 and Figure 7 The following example illustrates the use of a standard camera as the first image acquisition device and an AON camera as the second image acquisition device.
[0192] Depend on Figure 6 As can be seen, the AON camera can determine the appropriate AON exposure parameters (i.e., the first exposure parameters) based on its internal Auto Exposure (AE) algorithm and output the determined ambient brightness. For ease of distinction, the ambient brightness determined by AON is called AON ambient brightness, the first exposure parameter is called AON exposure parameter, and the second exposure parameter suitable for subsequent ordinary cameras is called Nor exposure parameter.
[0193] It is evident that the AON exposure parameters used by AON serve as input parameters for electronic devices to make parameter decisions.
[0194] At the same time, the ambient light sensor (ALS) will also sense the ambient light level.
[0195] Specifically, by fusing the AON ambient brightness determined by the AON camera with the ambient brightness 2 sensed by the ambient light sensor, such as by weighted summation of the ambient brightness output by AOE and ALS, the first ambient brightness of the current environment can be finally determined.
[0196] Based on this, when the ordinary camera is started, the electronic device can determine the appropriate Nor exposure parameter (i.e., the second exposure parameter) for the ordinary camera based on the determined first ambient brightness and the AON exposure parameters currently used by the AON camera, using the parameter decision algorithm of this application, and configure the determined Nor exposure parameter to the ordinary camera so that the ordinary camera can perform image acquisition based on the Nor exposure parameter.
[0197] Figure 7 for Figure 6 The specific implementation principle of the medium parameter decision algorithm is... Figure 7 It can be seen that:
[0198] Electronic devices can be based on the calibrated correspondence between different ambient brightness and exposure parameter ratios (such as...). Figure 3 As shown in the figure, the target exposure parameter ratio Ratio1 corresponding to the determined first ambient brightness is retrieved.
[0199] Simultaneously, the electronic device acquires RAW data from the AON camera based on its AON exposure parameters. The proportion of underexposed pixels in this RAW data is then determined (i.e.,...). Figure 7 The percentage of underexposed pixels and the percentage of overexposed pixels ( Figure 7The percentage of overexposed pixels (in the image). If the percentage of underexposed pixels is greater than the first set percentage (e.g., ... Figure 7 Taking 0.3 as an example), the correction value CorV used to correct the proportion of the target exposure parameters is determined to be 1.2; if the proportion of overexposed pixels is greater than the second set proportion (e.g., Figure 7 Taking 0.1 as an example, the correction value CorV used to correct the exposure parameter ratio of the target is determined to be 0.8.
[0200] Based on the above, the target exposure parameter ratio is corrected using the determined correction value, resulting in the corrected target exposure parameter ratio Ratio2: .
[0201] By multiplying the corrected target exposure parameter ratio Ratio2 by the AON exposure parameters currently used by the AON camera, the suitable Nor exposure parameters for this ordinary camera can be obtained, i.e. .
[0202] Furthermore, this application also provides an electronic device in its embodiments. For example... Figure 8 As shown, a schematic diagram of the composition structure of the electronic device is presented. The electronic device includes at least a controller 801, a first image acquisition device 802, a second image acquisition device 803, and a graphics signal processor 804.
[0203] Among them, the second image acquisition device is in the normally open state when the electronic device is powered on;
[0204] The controller 801 is configured to respond to the activation of the first image acquisition device by the electronic device, obtain the first exposure parameters currently used by the second image acquisition device, wherein the second image acquisition device is in a normally open state when the electronic device is powered on; determine the first ambient brightness of the environment in which the electronic device is currently located; based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, convert the first exposure parameters into a second exposure parameter currently suitable for the first image acquisition device; and set the exposure parameters of the first image acquisition device as the second exposure parameters.
[0205] The first image acquisition device 802 is used to acquire first image data based on the second exposure parameters;
[0206] The graphics signal processor 804 is used to generate the first frame image corresponding to the first image acquisition device based on the first image data acquired by the first image acquisition device.
[0207] The controller can be a central processing unit (CPU) or other processors.
[0208] For details on the specific operations performed by the controller, please refer to the relevant descriptions in the method embodiments, which will not be repeated here.
[0209] The first image acquisition device can be an image acquisition device such as a camera used in electronic devices to capture images and record videos. The second image acquisition device can be an AON camera or other image acquisition device that is always on; there are no specific limitations.
[0210] Of course, the electronic device can also have more than Figure 8 There are no restrictions on the number of components, whether more or fewer.
[0211] This application also provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the image generation methods provided in this application.
[0212] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the image generation methods provided in this application.
[0213] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0214] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0215] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0216] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. An image generation method, comprising: In response to the electronic device activating the first image acquisition device, the first exposure parameters currently used by the second image acquisition device in the electronic device are obtained, wherein the second image acquisition device is in a normally open state when the electronic device is powered on. Determine the first ambient brightness of the environment in which the electronic device is currently located; Based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, the first exposure parameter is converted into the second exposure parameter that is currently suitable for the first image acquisition device. Set the exposure parameters of the first image acquisition device to the second exposure parameters; Based on the first image data acquired by the first image acquisition device using the second exposure parameters, the first frame image corresponding to the first image acquisition device is generated.
2. The image generation method according to claim 1, wherein based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, the first exposure parameters are converted into second exposure parameters currently suitable for the first image acquisition device, comprising: According to the correspondence between different ambient brightness and exposure parameter ratios, the target exposure parameter ratio corresponding to the first ambient brightness is determined. The exposure parameter ratio corresponding to the ambient brightness is the ratio between the exposure parameters suitable for the first image acquisition device and the exposure parameters suitable for the second image acquisition device under the ambient brightness. Based on the target exposure parameter ratio and the first exposure parameter, a second exposure parameter suitable for the first image acquisition device is determined.
3. The image generation method according to claim 1 or 2 further includes: Determine the current lighting scene of the second image acquisition device; The second exposure parameter is corrected according to the parameter correction strategy corresponding to the lighting scene to obtain the corrected second exposure parameter; Setting the exposure parameters of the first image acquisition device to the second exposure parameters includes: Set the exposure parameters of the first image acquisition device to the corrected second exposure parameters.
4. The image generation method according to claim 3, wherein determining the current lighting scene of the second image acquisition device includes: Determine the index value of at least one exposure quality evaluation index corresponding to the second image data currently acquired by the second image acquisition device; Based on the index value of the at least one exposure quality evaluation index, the current lighting scene of the second image acquisition device is determined.
5. The image generation method according to claim 4, determining the index value of at least one exposure quality evaluation index corresponding to the second image data currently acquired by the second image acquisition device, comprising: Determine at least one of a first proportion of a first type of pixel and a second proportion of a second type of pixel in the second image data currently acquired by the second image acquisition device, wherein the first type of pixel is a pixel with a brightness lower than a first threshold, and the second type of pixel is a pixel with a brightness higher than a second threshold, and the second threshold is greater than the first threshold.
6. The image generation method according to claim 3, wherein the lighting scene is one of an underexposed scene, an overexposed scene, and a normally exposed scene; The second exposure parameter is corrected according to the parameter correction strategy corresponding to the lighting scene, including: In response to the lighting scene being an underexposed scene, the second exposure parameter is increased; In response to the lighting scene being an overexposed scene, the second exposure parameter is reduced; In response to the lighting scene being a normal exposure scene, the second exposure parameter is kept unchanged.
7. The image generation method according to claim 2, wherein the exposure parameter ratio corresponding to the ambient brightness is the ratio between the first target exposure parameter corresponding to the first image acquisition device and the second target exposure parameter corresponding to the second image acquisition device under the ambient brightness. in, The first target exposure parameter is the exposure parameter required to make the pixel brightness of the first target area of the first original image acquired by the first image acquisition device reach the target brightness under the ambient brightness. The second target exposure parameter is the exposure parameter required to make the pixel brightness of the second target area of the second original image acquired by the second image acquisition device reach the target brightness under the ambient brightness. Wherein, the first target region is at least a portion of the first original image; the second target region is at least a portion of the second original image.
8. The image generation method according to claim 2 or 7, wherein the exposure parameter ratio corresponding to the ambient brightness is the product of the reference exposure parameter ratio corresponding to the ambient brightness and the adjustable coefficient corresponding to the ambient brightness; The image generation method further includes: After acquiring the first frame image, in response to a change in the exposure parameters used by the first image acquisition device, a third exposure parameter used by the first image acquisition device is determined, and the adjustable coefficient corresponding to the first ambient brightness is adjusted based on the third exposure parameter and the second exposure parameter to change the exposure parameter ratio corresponding to the first ambient brightness.
9. The image generation method according to claim 1, determining the first ambient brightness of the environment in which the electronic device is currently located, includes: Obtain the second ambient brightness currently sensed by the light sensor; The third ambient brightness currently output by the second image acquisition device is obtained, and the third ambient brightness is determined by the second image acquisition device based on the brightness of each pixel in the acquired second image data; Based on the second ambient brightness and the third ambient brightness, the first ambient brightness of the environment in which the electronic device is currently located is determined.
10. An electronic device, comprising: The controller, the first image acquisition device, the second image acquisition device, and the graphics signal processor; The second image acquisition device is in a normally open state when the electronic device is powered on. The controller is configured to, in response to the electronic device activating the first image acquisition device, obtain the first exposure parameters currently used by the second image acquisition device, wherein the second image acquisition device is in a normally-on state when the electronic device is powered on; determine the first ambient brightness of the environment in which the electronic device is currently located; based on the first ambient brightness and the exposure performance relationship between the first image acquisition device and the second image acquisition device, convert the first exposure parameters into a second exposure parameter currently suitable for the first image acquisition device; and set the exposure parameters of the first image acquisition device as the second exposure parameters. The first image acquisition device is used to acquire first image data based on the second exposure parameters; The graphics signal processor is used to generate the first frame image corresponding to the first image acquisition device based on the first image data acquired by the first image acquisition device.