Exposure adjustment method and apparatus
By utilizing the exposure adjustment method of a second camera in the terminal device, the problem of slow image convergence speed caused by changes in scene lighting was solved, thus improving image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2021-09-07
- Publication Date
- 2026-04-21
AI Technical Summary
In terminal devices, when scene lighting changes significantly, the average brightness of the image converges to the target brightness slowly, resulting in a decrease in the quality of the captured image.
When the terminal device captures an image through the first camera, it turns on the second camera and determines whether its exposure can improve the exposure convergence speed of the first camera. If it can, it configures the exposure of the second camera to improve the convergence speed and adjusts the exposure by using a difference greater than a preset step size.
Even when the scene lighting changes greatly, the exposure of the second camera improves the exposure convergence speed of the first camera, reduces the number of overexposed or underexposed image frames, and improves the image quality.
Smart Images

Figure CN115776615B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to an exposure adjustment method and apparatus. Background Technology
[0002] With the development of terminal technology, terminal devices have been developed and applied, enabling them to provide users with different functions. For example, terminal devices can provide users with video recording or photo preview functions. Typically, when terminal devices provide users with video recording and photo preview functions, they can adjust the exposure to ensure that the image captured by the terminal device based on that exposure is of good quality.
[0003] In one possible approach, the terminal device can adjust the exposure using a step-by-step method. For example, the terminal device can calculate the exposure of the next frame image based on the target brightness and average brightness of the current frame image, and according to a certain step size, until the average brightness of the image converges to the target brightness, thereby ensuring that the quality of the image captured by the terminal device in the current scene is good.
[0004] However, when the scene lighting changes significantly when captured by the terminal device, the exposure convergence speed of the average brightness of the image to the target brightness may be slow, which reduces the quality of the image captured by the terminal device. Summary of the Invention
[0005] This application provides an exposure adjustment method and apparatus for a terminal device. The terminal device includes a first camera and a second camera. When the terminal device captures an image using the first exposure of the first camera, it can activate the second camera and determine whether the second exposure of the second camera can improve the exposure convergence speed of the first camera. When the terminal device determines that the second exposure of the second camera can improve the exposure convergence speed of the first camera, it configures the first camera with a second exposure, enabling the terminal device to capture the next frame image using the second exposure. Even when the scene lighting changes significantly, because the difference between the second exposure and the first exposure is greater than a preset step size, the first camera can improve the exposure convergence speed based on the second exposure of the second camera, thereby improving the quality of the image captured by the terminal device through the first camera.
[0006] In a first aspect, embodiments of this application provide an exposure adjustment method applied to a terminal device, the terminal device including a first camera and a second camera. The method includes: controlling the first camera to acquire Nth frame image data at a first exposure level; where N is an integer greater than or equal to 1; controlling the second camera to acquire the first image data at a second exposure level when the ambient brightness of the terminal device changes to a preset condition; wherein the difference between the second exposure level and the first exposure level is greater than a preset step size, the preset step size being a preset step size when the terminal device adjusts the exposure of the first camera; and controlling the first camera to acquire N+1th frame image data at a second exposure level when the quality of the first image data meets quality requirements. Thus, even when scene lighting changes significantly, because the difference between the second exposure level and the first exposure level is greater than the preset step size, the first camera can increase the exposure convergence speed based on the second exposure level of the second camera, thereby improving the quality of the image acquired by the terminal device through the first camera.
[0007] In one possible implementation, the ambient brightness of the terminal device is related to the first ambient brightness when the terminal device controls the first camera to collect the Nth frame of image data. The change in the ambient brightness of the terminal device reaches the preset condition including: the difference between the first ambient brightness and the second ambient brightness is greater than the first threshold; wherein, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the N-1th frame of image data.
[0008] In one possible implementation, the ambient brightness of the terminal device is related to the target brightness of the Nth frame image data. The change in ambient brightness of the terminal device reaches a preset condition including: the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a second threshold.
[0009] In one possible implementation, the quality requirement for the first image data to meet the quality requirements includes: the average brightness of the first image data is greater than the target brightness of the first image data, and the average brightness of the first image data is less than the average brightness of the Nth frame image data; or, the average brightness of the first image data is less than the target brightness of the first image data, and the average brightness of the first image data is greater than the average brightness of the Nth frame image data.
[0010] In one possible implementation, the second exposure is related to a first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, or the ratio of the number of pixels in M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0011] In one possible implementation, when the first feature value is one, the second exposure is obtained by the terminal device by matching a first feature value in a first correspondence; wherein, the first correspondence includes the relationship between the feature value and the exposure.
[0012] In one possible implementation, when there are multiple first feature values, the second exposure is obtained by the terminal device through a weighted summation of the multiple exposure values and their corresponding weight coefficients; wherein, the multiple exposure values and their corresponding weight coefficients are obtained by the terminal device through matching the multiple first feature values in a second correspondence relationship, and the second correspondence relationship includes the relationship between the feature values, the exposure values, and the corresponding weight coefficients.
[0013] In one possible implementation, the second exposure amount satisfies the following formula: Second exposure amount = (First exposure amount × a) / Average brightness of the Nth frame image data; where a satisfies the following formula, a = (Target brightness of the Nth frame image data - Average brightness of the Nth frame image data) × First parameter + Average brightness of the Nth frame image data, and the target brightness of the Nth frame image data satisfies the following formula: Target brightness of the Nth frame image data = Base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to acquire the Nth frame image data; where the first parameter is related to the first feature value, and the first feature value includes the following... One or more: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins of the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0014] In one possible implementation, when the first feature value is one, the first parameter is obtained by the terminal device by matching a first feature value in a third correspondence; wherein the third correspondence includes the relationship between the feature value and the parameter.
[0015] In one possible implementation, when there are multiple first feature values, the first parameter is obtained by the terminal device through a weighted summation of multiple parameters and their corresponding weight coefficients; wherein, the multiple parameters and their corresponding weight coefficients are obtained by the terminal device through matching multiple first feature values in a fourth correspondence relationship, and the fourth correspondence relationship includes the relationship between feature values, parameters and their corresponding weight coefficients.
[0016] In one possible implementation, the second exposure satisfies the following formula: Second exposure = First exposure × First exposure factor; wherein, the first exposure factor is related to a first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bars of the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0017] In one possible implementation, when the first feature value is one, the first exposure factor is obtained by the terminal device matching a first feature value in a fifth correspondence; wherein the fifth correspondence includes the relationship between the feature value and the exposure factor.
[0018] In one possible implementation, when there are multiple first feature values, the first exposure factor is obtained by the terminal device through a weighted summation of the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients; wherein, the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients are obtained by the terminal device through matching the multiple first feature values in a sixth correspondence relationship, and the sixth correspondence relationship includes the relationship between feature values, exposure factors and the weight coefficients corresponding to the exposure factors.
[0019] In one possible implementation, the first exposure satisfies the following formula: First exposure = (c × d) / e; where c satisfies the following formula: c = (Target brightness of the (N-1)th frame image data - Average brightness of the (N-1)th frame image data) × Second parameter + Average brightness of the (N-1)th frame image data, and the target brightness of the (N-1)th frame image data satisfies the following formula: Target brightness of the (N-1)th frame image data = Base brightness + f, where f is related to the brightness of the environment in which the terminal device controls the first camera to acquire the (N-1)th frame image data; where d is the exposure when the terminal device controls the first camera to acquire the (N-1)th frame image data, and e is the average brightness of the (N-1)th frame image data, and e satisfies the following formula: j is the number of bar bins in the histogram corresponding to the (N-1)th frame of image data, m i Let n be the image brightness corresponding to the i-th bin of the (N-1)-th frame of image data. i Let be the number of pixels corresponding to the i-th bin.
[0020] In one possible implementation, the method further includes: adjusting the first exposure to a third exposure when the ambient brightness change of the terminal device does not meet a preset condition; wherein the third exposure satisfies the following formula: third exposure = (first exposure × g) / average brightness of the Nth frame image data, and g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to acquire the Nth frame image data; and controlling the first camera to acquire the N+1th frame image data at the third exposure. Thus, when the ambient brightness change of the terminal device does not meet the preset condition, the terminal device can use a step-by-step method to adjust the exposure of the first camera, so that the terminal device controls the first camera to acquire the N+1th frame image data at the adjusted exposure.
[0021] In one possible implementation, the method further includes: when the quality of the first image data does not meet the quality requirements, adjusting the first exposure to a fourth exposure; wherein the fourth exposure satisfies the following formula: fourth exposure = (first exposure × g) / average brightness of the Nth frame image data, g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, b is related to the brightness of the environment in which the Nth frame image data is acquired by the terminal device controlled by the first camera; controlling the first camera to acquire the N+1th frame image data at the fourth exposure. Thus, when the quality of the first image data does not meet the quality requirements, the terminal device may not configure the second camera's exposure for the first camera, and the terminal device may use a step-by-step method to adjust the first camera's exposure, so that the terminal device controls the first camera to acquire the N+1th frame image data at the adjusted exposure.
[0022] Secondly, embodiments of this application provide an exposure adjustment device, which can be a terminal device, or a component, chip, or chip system within the terminal device. The exposure adjustment device may include a processing unit. When the exposure adjustment device is a terminal device, the processing unit may be a processor. The exposure adjustment device may also include a storage unit, which may be a memory. The storage unit stores instructions, and the processing unit executes the instructions stored in the storage unit to cause the terminal device to implement the method described in the first aspect or any possible implementation of the first aspect. When the exposure adjustment device is a component, chip, or chip system within the terminal device, the processing unit may be a processor, and the processing unit executes the instructions stored in the storage unit to cause the terminal device to implement the method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.), or a storage unit located outside the chip within the terminal device (e.g., a read-only memory, random access memory, etc.).
[0023] For example, the processing unit is configured to control the first camera to acquire the Nth frame of image data at the first exposure level; wherein N is an integer greater than or equal to 1; the processing unit is further configured to control the second camera to acquire the first image data at the second exposure level when the ambient brightness change of the terminal device reaches a preset condition; wherein the difference between the second exposure level and the first exposure level is greater than a preset step size, the preset step size being a preset step size when the terminal device adjusts the exposure level of the first camera; the processing unit is further configured to control the first camera to acquire the (N+1)th frame of image data at the second exposure level when the quality of the first image data meets the quality requirements.
[0024] In one possible implementation, the ambient brightness of the terminal device is related to the first ambient brightness when the terminal device controls the first camera to collect the Nth frame of image data. The change in the ambient brightness of the terminal device reaches the preset condition including: the difference between the first ambient brightness and the second ambient brightness is greater than the first threshold; wherein, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the N-1th frame of image data.
[0025] In one possible implementation, the ambient brightness of the terminal device is related to the target brightness of the Nth frame image data. The change in ambient brightness of the terminal device reaches a preset condition including: the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a second threshold.
[0026] In one possible implementation, the quality requirement for the first image data to meet the quality requirements includes: the average brightness of the first image data is greater than the target brightness of the first image data, and the average brightness of the first image data is less than the average brightness of the Nth frame image data; or, the average brightness of the first image data is less than the target brightness of the first image data, and the average brightness of the first image data is greater than the average brightness of the Nth frame image data.
[0027] In one possible implementation, the second exposure is related to a first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, or the ratio of the number of pixels in M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0028] In one possible implementation, when the first feature value is one, the second exposure is obtained by the terminal device by matching a first feature value in a first correspondence; wherein, the first correspondence includes the relationship between the feature value and the exposure.
[0029] In one possible implementation, when there are multiple first feature values, the second exposure is obtained by the terminal device through a weighted summation of the multiple exposure values and their corresponding weight coefficients; wherein, the multiple exposure values and their corresponding weight coefficients are obtained by the terminal device through matching the multiple first feature values in a second correspondence relationship, and the second correspondence relationship includes the relationship between the feature values, the exposure values, and the corresponding weight coefficients.
[0030] In one possible implementation, the second exposure amount satisfies the following formula: Second exposure amount = (First exposure amount × a) / Average brightness of the Nth frame image data; where a satisfies the following formula, a = (Target brightness of the Nth frame image data - Average brightness of the Nth frame image data) × First parameter + Average brightness of the Nth frame image data, and the target brightness of the Nth frame image data satisfies the following formula: Target brightness of the Nth frame image data = Base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to acquire the Nth frame image data; where the first parameter is related to the first feature value, and the first feature value includes the following... One or more: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins of the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0031] In one possible implementation, when the first feature value is one, the first parameter is obtained by the terminal device by matching a first feature value in a third correspondence; wherein the third correspondence includes the relationship between the feature value and the parameter.
[0032] In one possible implementation, when there are multiple first feature values, the first parameter is obtained by the terminal device through a weighted summation of multiple parameters and their corresponding weight coefficients; wherein, the multiple parameters and their corresponding weight coefficients are obtained by the terminal device through matching multiple first feature values in a fourth correspondence relationship, and the fourth correspondence relationship includes the relationship between feature values, parameters and their corresponding weight coefficients.
[0033] In one possible implementation, the second exposure satisfies the following formula: Second exposure = First exposure × First exposure factor; wherein, the first exposure factor is related to a first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bars of the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0034] In one possible implementation, when the first feature value is one, the first exposure factor is obtained by the terminal device matching a first feature value in a fifth correspondence; wherein the fifth correspondence includes the relationship between the feature value and the exposure factor.
[0035] In one possible implementation, when there are multiple first feature values, the first exposure factor is obtained by the terminal device through a weighted summation of the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients; wherein, the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients are obtained by the terminal device through matching the multiple first feature values in a sixth correspondence relationship, and the sixth correspondence relationship includes the relationship between feature values, exposure factors and the weight coefficients corresponding to the exposure factors.
[0036] In one possible implementation, the first exposure satisfies the following formula: First exposure = (c × d) / e; where c satisfies the following formula: c = (Target brightness of the (N-1)th frame image data - Average brightness of the (N-1)th frame image data) × Second parameter + Average brightness of the (N-1)th frame image data, and the target brightness of the (N-1)th frame image data satisfies the following formula: Target brightness of the (N-1)th frame image data = Base brightness + f, where f is related to the brightness of the environment in which the terminal device controls the first camera to acquire the (N-1)th frame image data; where d is the exposure when the terminal device controls the first camera to acquire the (N-1)th frame image data, and e is the average brightness of the (N-1)th frame image data, and e satisfies the following formula: j is the number of bar bins in the histogram corresponding to the (N-1)th frame of image data, m i Let n be the image brightness corresponding to the i-th bin of the (N-1)-th frame of image data. i Let be the number of pixels corresponding to the i-th bin.
[0037] In one possible implementation, the processing unit is further configured to: adjust the first exposure to a third exposure when the ambient brightness change of the terminal device does not meet a preset condition; wherein the third exposure satisfies the following formula: third exposure = (first exposure × g) / average brightness of the Nth frame image data, g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, b is related to the brightness of the environment where the Nth frame image data is acquired by the terminal device controlled by the first camera; and control the first camera to acquire the N+1th frame image data at the third exposure.
[0038] In one possible implementation, the processing unit is further configured to: adjust the first exposure to a fourth exposure when the quality of the first image data does not meet the quality requirements; wherein the fourth exposure satisfies the following formula: fourth exposure = (first exposure × g) / average brightness of the Nth frame image data, g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, b is related to the brightness of the environment in which the Nth frame image data is acquired by the terminal device controlled by the first camera; and control the first camera to acquire the N+1th frame image data at the fourth exposure.
[0039] Thirdly, embodiments of this application provide an exposure adjustment device, which includes a processor and a memory. The memory is used to store code instructions, and the processor is used to run the code instructions to perform the method described in the first aspect or any possible implementation of the first aspect.
[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0041] Fifthly, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0042] In a sixth aspect, embodiments of this application provide an exposure adjustment system, which includes the apparatus described in the second aspect and various possible implementations of the second aspect.
[0043] In a seventh aspect, this application provides a chip or chip system, which includes at least one processor and a communication interface, the communication interface and at least one processor being interconnected via a circuit, and the at least one processor being used to run a computer program or instructions to perform the method described in the first aspect or any possible implementation of the first aspect; wherein, the communication interface in the chip can be an input / output interface, a pin, or a circuit, etc.
[0044] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).
[0045] It should be understood that the second to seventh aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0046] Figure 1 This is a schematic diagram illustrating one application scenario of an embodiment of this application;
[0047] Figure 2 A schematic diagram of an image brightness histogram provided in an embodiment of this application;
[0048] Figure 3 A schematic diagram of an image brightness histogram provided in an embodiment of this application;
[0049] Figure 4 This is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of this application;
[0050] Figure 5 This is a schematic diagram of the software structure of a terminal device provided in an embodiment of this application;
[0051] Figure 6 A schematic flowchart illustrating a camera exposure adjustment method provided in an embodiment of this application;
[0052] Figure 7 This is a schematic diagram of the structure of an exposure adjustment device provided in an embodiment of this application;
[0053] Figure 8 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0054] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" do not necessarily imply that they are different.
[0055] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0056] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0057] With the development of terminal technology, terminal devices have been developed and applied, enabling them to provide users with different functions, such as video recording or photo preview.
[0058] For example, Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of this application, such as... Figure 1 As shown, users can use the camera pre-installed on their terminal device to record video by selecting the camera's recording function; or, users can select the camera's photo-taking function to preview photos.
[0059] In camera imaging systems based on complementary metal-oxide-semiconductor (CMOS) image sensors, exposure has a significant impact on image quality. Therefore, when a terminal device provides users with video recording or photo preview functions, the terminal device can adjust the exposure to ensure that the image captured by the terminal device based on that exposure is of good quality.
[0060] In one possible approach, the terminal device can adjust the exposure using a step-by-step method. For example, the terminal device can calculate the average brightness (current_luma) and target brightness of the current frame image, and calculate the exposure for capturing the next frame image based on a certain step size, until the average brightness of the image converges to the target brightness, thereby ensuring that the image quality captured by the terminal device in the current scene is good.
[0061] However, when the lighting conditions in the scene captured by the terminal device change significantly—for example, the terminal device might be capturing the current frame indoors one moment and the next frame outdoors the next—the limited dynamic range of the device's camera can cause several consecutive frames of images to be overexposed or underexposed. Therefore, when the image signal processor (ISP) performs histogram analysis on the image data, the average brightness calculated by the ISP based on the image brightness histogram may be inaccurate. This results in a slow convergence speed of the average brightness to the target brightness, reducing the quality of the images captured by the terminal device. The dynamic range of the device's camera can be understood as the range of brightness in the scene captured by the camera.
[0062] For example, Figure 2 This is a schematic diagram of an image brightness histogram provided in an embodiment of this application. The image brightness histogram in this embodiment is obtained by the ISP performing histogram statistics on the image data acquired by the camera controlled by the ISP. The scene lighting in this application changes from dark to bright. Under this scene lighting, Figure 2 The image brightness histograms captured during scene illumination changes are shown. The solid line represents the curve corresponding to the image brightness histogram compiled by the ISP, and the dashed line represents the curve corresponding to the actual image brightness histogram. Figure 2 The actual image brightness histogram is not shown; in the image brightness histogram compiled by the ISP, the horizontal axis represents the image brightness, and the vertical axis represents the number of pixels corresponding to that image brightness.
[0063] from Figure 2It can be seen that when the scene lighting conditions change from dark to bright, the exposure used by the terminal device to capture images in bright scenes is too large, causing most areas of the captured scene image to exceed the dynamic range of the device's camera. For example, in... Figure 2 In this process, most of the actual image brightness histogram curves appear outside the dynamic range of the device's camera, leading to overexposure in the images captured by the ISP. This causes the image brightness histogram, calculated by the ISP based on the image data, to concentrate in the bright areas, especially in the last bin. Consequently, the average brightness calculated by the ISP based on this histogram is inaccurate. Since average brightness is used to calculate the exposure required for the terminal device to capture the next frame, the linear relationship between average brightness and exposure is disrupted, affecting the quality of the captured image. Furthermore, the more severe the overexposure in the image, the greater the deviation between the average brightness calculated by the ISP and the actual average brightness of the scene. This results in a slower convergence speed of the average brightness to the target brightness, further reducing the quality of the image captured by the terminal device. Here, "device camera" refers to one or more cameras in the terminal device, where the brightness range captured by the device camera in the scene is smaller than the actual image brightness range.
[0064] For example, Figure 3 This is a schematic diagram of an image brightness histogram provided in an embodiment of this application. The image brightness histogram in this embodiment is obtained by the ISP performing histogram statistics on the image data acquired by the camera controlled by the ISP. The scene illumination in this application changes from bright to dark. Under this scene illumination, Figure 3 The image brightness histograms captured during scene illumination changes are shown. The solid line represents the curve corresponding to the image brightness histogram compiled by the ISP, and the dashed line represents the curve corresponding to the actual image brightness histogram. Figure 3 The actual image brightness histogram is not shown; in the image brightness histogram compiled by the ISP, the horizontal axis represents the image brightness, and the vertical axis represents the number of pixels corresponding to that image brightness.
[0065] from Figure 3 It can be seen that when the scene lighting conditions change from bright to dark, the exposure used by the terminal device to capture images in dark scenes is too small, causing most areas of the captured scene image to exceed the dynamic range of the device's camera. For example, in... Figure 3In most cases, the curves corresponding to the actual image brightness histograms are displayed outside the dynamic range of the device's camera, resulting in underexposure in the images captured by the ISP. This causes the image brightness histogram calculated by the ISP to concentrate in low-brightness areas, especially in the first bin of the image brightness histogram. Consequently, the average brightness of the image calculated by the ISP based on this image brightness histogram is inaccurate, and the linear relationship between the average brightness of the image and the exposure is disrupted. Moreover, the more severe the underexposure in the image, the greater the deviation between the average brightness of the image calculated by the ISP and the average brightness of the actual scene, and the slower the convergence speed of the average brightness of the image to the target brightness, thus reducing the quality of the image captured by the terminal device.
[0066] Among them, Figure 2 or Figure 3 In the image brightness histogram, the curve is formed by connecting the number of pixels corresponding to the image brightness.
[0067] Combination Figure 2 or Figure 3 As can be understood from the content shown, since the speed of exposure convergence directly affects the number of overexposed or underexposed image frames, a slow exposure convergence speed results in a large number of overexposed or underexposed video image frames, which reduces the quality of the image captured by the terminal device; a fast exposure convergence speed reduces the number of overexposed or underexposed video image frames, improving the quality of the image captured by the terminal device.
[0068] Based on this, this application provides an exposure adjustment method and apparatus, applied to a terminal device. The terminal device includes a first camera and a second camera. When the terminal device captures an image using the first exposure of the first camera, the terminal device can activate the second camera and determine whether the second exposure of the second camera can improve the exposure convergence speed of the first camera. When the terminal device determines that the second exposure of the second camera can improve the exposure convergence speed of the first camera, the terminal device configures the second exposure of the second camera for the first camera, so that the terminal device can capture the next frame image using the second exposure. Even when the scene lighting changes greatly, because the difference between the second exposure and the first exposure is greater than a preset step size, the first camera can improve the exposure convergence speed based on the second exposure of the second camera, reducing the number of overexposed or underexposed image frames, thereby improving the quality of the image captured by the terminal device through the first camera.
[0069] Among them, the terminal device can detect changes in scene lighting through an ambient light sensor. For example, the ambient light sensor can detect the first ambient brightness when the terminal device controls the first camera to collect the Nth frame of image data, and the second ambient brightness when the terminal device controls the first camera to collect the N-1th frame of image data. When the difference between the first ambient brightness and the second ambient brightness is greater than a first threshold, the terminal device can consider that the change in ambient brightness has reached a preset condition, or it can be understood that the terminal device has detected a large change in scene lighting. This change in scene lighting can be understood as a change from dark to bright or from bright to dark.
[0070] Among them, when the scene lighting changes from dark to bright, the scene from dark to bright can be the scene when the camera is first turned on, or the scene when moving from indoors to outdoors during video recording or photo preview, or the scene when the indoor lights are suddenly turned on during video recording or photo preview; when the scene lighting changes from bright to dark, the scene from bright to dark can be the scene when the indoor lights are suddenly turned off during video recording or photo preview.
[0071] It is understood that the specific content of the scene transitioning from dark to light or from light to dark can be set according to the actual application scenario, and this application embodiment does not limit it.
[0072] It is understandable that when the difference between the first ambient brightness and the second ambient brightness is less than or equal to the first threshold, the terminal device can assume that the scene lighting when the first camera captures the Nth frame of image data is not significantly different from the scene lighting when the first camera captures the N-1th frame of image data.
[0073] The method described in this application embodiment can be applied to a terminal device with dual cameras. For example, the terminal device may include a mobile phone, tablet, laptop, etc. One of the cameras may be called a first camera, which may be a color camera, and the other camera may be called a second camera, which may be a monochrome camera.
[0074] It is understood that the method of this application embodiment can also be applied to a terminal device with multiple cameras. The terminal device can select one of the multiple cameras as the first camera and select another camera as the second camera. This application embodiment does not limit this.
[0075] It is understood that the specific content of the terminal device, as well as the specific content of the first and second cameras, can be set according to the actual application scenario, and this application embodiment does not limit it.
[0076] For example, Figure 4This is a schematic diagram of the hardware structure of a terminal device provided in an embodiment of this application, such as... Figure 4 As shown, the terminal device 100 may include a processor 401, a display screen 402, a camera 403, an ambient light sensor 404, a touch sensor 405, and a battery device 406.
[0077] It should be noted that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the terminal device 100; it is understood that the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements; wherein, the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
[0078] Processor 401 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc.; wherein, different processing units may be independent devices or integrated into one or more processors.
[0079] The processor 401 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 401 may be a cache memory, which can store instructions or data that the processor 401 has just used or is using repeatedly.
[0080] In some embodiments, the processor 401 may include one or more interfaces, which may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, and / or a universal serial bus (USB) interface, etc.
[0081] The terminal device 100 implements display functions through a display screen 402, which is used to display images, videos, etc., and includes a display panel. In some embodiments, the terminal device 100 may include one or N display screens 402, where N is a positive integer greater than 1.
[0082] Terminal device 100 can perform shooting functions through ISP, camera 403, video codec, GPU, display 402 and application processor.
[0083] The ISP (Image Signal Processor) is used to process data fed back from the camera 403. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 403.
[0084] Camera 403 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a CMOS phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard formats such as RGB and YUV. In some embodiments, the terminal device 100 may include one or N cameras 403, where N is a positive integer greater than 2.
[0085] In this embodiment of the application, when N=2, the terminal device may include dual cameras. The specific content of the dual cameras can be adapted to the foregoing description, or it can be set according to the actual application scenario. This embodiment of the application does not limit it.
[0086] The ambient light sensor 404 is used to sense the ambient light intensity. The terminal device 100 can adaptively adjust the brightness of the display screen 402 according to the sensed ambient light intensity; moreover, the ambient light sensor 404 can also be used to automatically adjust the white balance when taking pictures.
[0087] In this embodiment, the ambient light sensor 404 can be used to sense the ambient brightness when the first camera acquires the Nth frame of image data and the ambient light when it acquires the (N-1)th frame of image data. Alternatively, it can be understood that the ambient light sensor 404 is used to detect the first ambient brightness and the second ambient brightness, thereby enabling the ISP to obtain the difference between the first ambient brightness and the second ambient brightness. Based on this difference, the ISP determines whether to enable the second camera for exposure assistance; or, the ISP determines the second exposure amount based on this difference. Wherein, the ISP determining whether to enable the second camera for exposure assistance can be understood as the ISP determining whether to enable the second camera to improve the exposure convergence speed of the first camera.
[0088] Touch sensor 405, also known as a "touch device". Touch sensor 405 can be disposed on display screen 402. Touch sensor 405 and display screen 402 together form a touch screen, also known as a "touchscreen". Touch sensor 405 is used to detect touch operations applied to or near it. For example, terminal device can use touch sensor to detect whether the user clicks the recording function in camera application.
[0089] The terminal device 100 may also include a battery device 406 (such as a battery and a power management chip) that powers various components. The battery can be logically connected to the processor 401 through the power management chip, thereby enabling functions such as charging, discharging, and power consumption management through the power device 406.
[0090] For example, Figure 5 This is a schematic diagram of the software structure of a terminal device 100 provided in an embodiment of this application, as shown below. Figure 5 As shown, the layered architecture divides the software system of terminal device 100 into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces.
[0091] In some embodiments, the Android system can be divided into five layers: applications, application framework, Android runtime, system layer, hardware abstraction layer (HAL), and kernel.
[0092] In one possible approach, the application layer could include a series of application packages, which run the application by calling the application programming interface (API) provided by the application framework layer. For example, ... Figure 5 As shown, the application package may include applications such as camera, calendar, map, phone, music, email, video, or social media.
[0093] In this embodiment, when a user selects video recording or photo preview in the camera, the terminal device can perform video recording or photo preview based on the user's selected video recording or photo preview operation.
[0094] In one possible approach, the application framework layer provides APIs and a programming framework for the applications in the application layer. For example, such as Figure 3 As shown, the application framework layer may include a window manager, content provider, resource manager, view system, input system, and notification manager, and also includes some predefined functions.
[0095] The window manager is used to manage window programs. It can obtain the screen size, determine whether there is a status bar, lock the screen, and capture the screen.
[0096] Content providers are used to store and retrieve data, and make this data accessible to applications. For example, data may include browsing history and bookmarks, phone calls made and received, videos, images, audio, or phone books.
[0097] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, and video files.
[0098] The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can consist of one or more views. For example, it may include a display interface for a text notification icon, a view for displaying text, and a view for displaying images.
[0099] The input system is a program used to manage input devices. For example, the input system can identify input operations such as mouse clicks, keyboard inputs, and touch swipes.
[0100] The notification manager allows applications to display notifications in the status bar. These notifications can be used to convey informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications. Furthermore, it can display notifications as dialog boxes on the screen, such as text messages in the status bar, sound alerts, device vibration, or flashing indicator lights.
[0101] The Activity Manager manages the lifecycle of each application and the navigation back function. It is responsible for creating the Android main thread and maintaining the lifecycle of each application.
[0102] In this possible approach, the Android runtime is responsible for scheduling and managing the Android system, and can include core libraries and a virtual machine. The core libraries consist of two parts: one part contains the functionalities that the Java language needs to call, and the other part is the core Android library itself. The virtual machine is used to perform functions such as object safety and exception management, lifecycle management, stack management, thread management, and garbage collection.
[0103] It should be noted that the application layer and the application framework layer run in a virtual machine, which executes the Java files of the application layer and the application framework layer as binary files.
[0104] In some possible approaches, the system layer could include multiple functional modules. Examples include: a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and a 2D graphics engine.
[0105] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications; the 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing; the 2D graphics engine is the drawing engine for 2D drawing; and the media library supports playback and recording of various commonly used video formats, audio, and still image files. The media library supports various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0106] In some possible approaches, the hardware abstraction layer can contain multiple library modules, such as camera library modules, motor library modules, etc. The Android system can load the corresponding library modules for the device hardware, thereby enabling the application framework layer to access the device hardware. Device hardware can include components such as motors and cameras in electronic devices.
[0107] In some possible approaches, the kernel layer is the layer between hardware and software. The kernel layer includes at least a camera driver, an audio driver, or a display driver, etc., but this application does not limit this.
[0108] In this embodiment, by combining the camera driver and the camera library module, when the user selects video recording or photo preview in the camera, the terminal device can start the camera driver, which can call the camera library module, thereby enabling the user to perform video recording or photo preview.
[0109] Based on the above, for example, Figure 6 This is a flowchart illustrating an exposure adjustment method provided in an embodiment of this application. The method is applied in a terminal device, which includes a first camera and a second camera. Figure 6 The illustrated embodiments are exemplary descriptions using an ISP in a terminal device as an example. Figure 6 As shown, the following steps may be included:
[0110] S601: In response to the first instruction, the ISP configures the first camera with a first exposure for acquiring the Nth frame image data.
[0111] In this embodiment, the first instruction is an instruction to control the first camera to take a picture or an instruction to control the first camera to record. For example, when the user opens the camera and clicks the shutter button, the first instruction is an instruction to control the first camera to take a picture, or when the user opens the camera and clicks the record button, the first instruction is an instruction to control the first camera to record. In this way, the ISP responds to the first instruction and can configure the first camera to a first exposure for acquiring the Nth frame image data, so that the first camera can acquire the Nth frame image data through the first exposure.
[0112] It is understandable that when a user clicks on the camera app, the terminal device can open the camera app, allowing the user to preview the image captured by the first camera. Therefore, the first instruction can also be understood as an instruction to control the opening of the camera app.
[0113] In this embodiment, since the ISP can control the first device to acquire the Nth frame image data at the first exposure level, the ISP can statistically determine the brightness of the Nth frame image based on the first exposure level after performing histogram statistics on the acquired Nth frame image data. Therefore, the first exposure level can be used to reflect the brightness of the Nth frame image, where N is a positive integer greater than or equal to 1. When N = 1, the first camera is in the streaming state, which can be understood as the state when the user first opens the camera application. Therefore, the first exposure level can be a preset initial exposure level. When N is greater than 1, the first camera is not in the streaming state. Therefore, the first exposure level can be obtained based on the average brightness of the (N-1)th frame image data, the target brightness of the (N-1)th frame image data, and the exposure level of the (N-1)th frame image data. For example, the first exposure level satisfies the following formula: First exposure level = (c × d) / e.
[0114] Where c satisfies the following formula: c = (target brightness of the N-1th frame image data - average brightness of the N-1th frame image data) × second parameter + average brightness of the N-1th frame image data, and d is the exposure amount when the ISP controls the first camera to acquire the N-1th frame image data.
[0115] Where e is the average brightness of the (N-1)th frame of image data, and e satisfies the following formula: j is the number of bins in the histogram corresponding to the (N-1)th frame of image data, m i Let n be the image brightness corresponding to the i-th bin of the (N-1)-th frame of image data. i Let be the number of pixels corresponding to the i-th bin.
[0116] The second parameter can be 60% or other values. The target brightness of the (N-1)th frame image data satisfies the following formula: Target brightness of the (N-1)th frame image data = Base brightness + f, Base brightness = h × Fourth parameter, where h can be 255 candela / m² (cd / m²). 2 The fourth parameter can be 18% or other values. f is related to the brightness of the environment in which the (N-1)th frame of image data is acquired by the ISP-controlled first camera. For example, when the brightness of the environment in which the (N-1)th frame of image data is acquired by the ISP-controlled first camera is low, f can be -20 (cd / m²). 2 (or other values) When the ambient brightness is high when the first camera captures the Nth frame of image data, f can be 30 (cd / m²). 2 (or other values), the specific value of f can be set according to the actual application scenario, and is not limited in the embodiments of this application.
[0117] S602: The ISP controls the first camera to acquire the Nth frame image data at the first exposure.
[0118] S603: The ISP performs histogram statistics on the Nth frame image data to obtain the first average brightness of the Nth frame image data.
[0119] In this embodiment of the application, the first average brightness of the Nth frame image data can also be referred to as the average brightness of the Nth frame image data. For ease of description, the first average brightness will be used as an example in the following description.
[0120] In this embodiment of the application, the histogram corresponding to the Nth frame image data can be as follows: Figure 2 or Figure 3 As shown, the horizontal axis of the histogram represents the image brightness corresponding to the Nth frame image, and the vertical axis represents the number of pixels corresponding to that image brightness. Thus, the ISP can obtain the first average brightness corresponding to the Nth frame image data based on the image brightness in the histogram corresponding to the Nth frame image data and the number of pixels corresponding to that image brightness. The calculation formula for the first average brightness can refer to the calculation method for the average brightness corresponding to the N-1th frame image in S601, and will not be repeated here.
[0121] When the scene lighting when the ISP controls the first camera to acquire the Nth frame image data does not change much from the scene lighting when the ISP controls the first camera to acquire the N-1th frame image data, the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is very small. When the scene lighting when the ISP controls the first camera to acquire the Nth frame image data changes significantly from the scene lighting when the ISP controls the first camera to acquire the Nth frame image data, if the ISP calculates the exposure of the Nth frame image data based on the exposure of the N-1th frame image data and obtains the Nth frame image based on the exposure of the Nth frame image data, the Nth frame image may exhibit overexposure or underexposure. For example, after the ISP analyzes the Nth frame image data through a histogram, the brightness of the image may be concentrated in the first two bins or the last two bins of the histogram.
[0122] Therefore, the ISP can determine whether the exposure has converged by comparing the first average brightness of the Nth frame image data with the target brightness of the Nth frame image data. Then, when the ISP determines that the exposure has not converged, the ISP can determine the change in scene lighting when the first camera acquires image data by comparing the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data. Then, the ISP calculates the exposure when the first camera acquires the N+1th frame image data. The method for calculating the target brightness of the Nth frame image data can be described by referring to the method for calculating the target brightness of the N-1th frame image data, and will not be repeated here.
[0123] S604: The ISP determines whether the first average brightness is equal to the target brightness of the Nth frame image data.
[0124] In this embodiment, when the ISP determines that the first average brightness is not equal to the target brightness of the Nth frame image data, the ISP determines that the exposure is not converged. Therefore, the ISP executes S605. When the ISP determines that the first average brightness is equal to the target brightness of the Nth frame image data, the ISP determines that the exposure is converged. Therefore, the ISP does not need to recalculate the exposure. That is, the exposure when the ISP controls the first camera to collect the N+1th frame image data is the same as the exposure when the ISP controls the first camera to collect the Nth frame image data. That is, the exposure is the first exposure. Therefore, the ISP executes S601.
[0125] S605: The ISP determines whether the difference between the first average brightness and the target brightness of the Nth frame image data is greater than the second threshold.
[0126] In this embodiment, when the ISP determines that the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is less than the second threshold, it can be determined that the environmental change of the terminal device has not reached the preset condition. Therefore, the ISP executes S606. When the ISP determines that the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than the second threshold, it can be determined that the environmental change of the terminal device has reached the preset condition. Therefore, the ISP executes S607-S614. The specific content of the target brightness of the Nth frame image data can be referred to the content adaptation description of S601, and will not be repeated here.
[0127] It should be noted that S605 is the ISP determining whether to activate the second camera to assist in improving the exposure convergence speed of the first camera by judging whether the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a second threshold. Alternatively, it can be understood as the ISP determining whether to activate the exposure assistance of the second camera, or the ISP determining whether to allocate the second exposure amount of the second camera to the first camera, so that the ISP controls the first camera to acquire the next frame image data.
[0128] Understandably, the ISP's determination of whether to enable exposure assistance for the second camera can also include the following possible implementation methods:
[0129] In the first possible implementation, the ISP can determine whether to activate the second camera to help improve the exposure convergence speed of the first camera based on histogram features, that is, based on the ratio of the number of pixels in a certain number of bins in the histogram corresponding to the Nth frame image data to the total number of pixels and the size of the third threshold.
[0130] For example, when the ISP determines that the ratio of the number of pixels in a certain number of bins in the histogram corresponding to the Nth frame image data to the total number of pixels is greater than a third threshold, the ISP activates the second camera to help improve the exposure convergence speed of the first camera.
[0131] For example, when the ISP determines that the ratio of the number of pixels in a certain number of bins in the histogram corresponding to the Nth frame image data to the total number of pixels is less than or equal to a third threshold, the ISP will not activate the second camera to help improve the exposure convergence speed of the first camera.
[0132] It should be noted that when the scene lighting changes from dark to bright, a certain number of bins in the histogram can refer to M bins, where M is an integer greater than or equal to 1. For example, when M=1, a certain number of bins in the histogram refers to the last bin of the histogram; when M=2, a certain number of bins in the histogram refers to the last two bins of the histogram. This application does not limit this.
[0133] It should be noted that when the scene lighting changes from bright to dark, a certain number of bins in the histogram can refer to M bins, where M is an integer greater than or equal to 1. For example, when M=1, a certain number of bins in the histogram refers to the first bin of the histogram; when M=2, a certain number of bins in the histogram refers to the first two bins of the histogram. This application does not limit this.
[0134] In the second possible implementation, the ISP can determine whether to activate the second camera to assist in improving the exposure convergence speed of the first camera by using the first ambient brightness and the second ambient brightness. For example, if the difference between the first ambient brightness and the second ambient brightness is greater than a first threshold, the ISP activates the second camera to assist in improving the exposure convergence speed of the first camera; if the difference between the first ambient brightness and the second ambient brightness is less than or equal to the first threshold, the ISP does not activate the second camera to assist in improving the exposure convergence speed of the first camera.
[0135] It is understandable that the ISP may also determine whether to activate the second camera to assist in improving the exposure convergence speed of the first camera by checking whether the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a second threshold, whether the ratio of the number of pixels in a certain number of bins in the histogram corresponding to the Nth frame image data to the total number of pixels is greater than a third threshold, and whether the difference between the first ambient brightness and the second ambient brightness is greater than the first threshold. This application embodiment does not limit this.
[0136] S606: The ISP adjusts the first exposure to the third exposure.
[0137] In this embodiment, since the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is less than the second threshold, the ISP can determine that the scene lighting when the first camera acquires the Nth frame image data is not significantly different from the scene lighting when the first camera acquires the N-1th frame image data. Therefore, the ISP does not need to activate the second camera to assist in improving the exposure convergence speed of the first camera. Thus, the ISP can use a step-by-step method to adjust the first exposure amount, so that the ISP adjusts the first exposure amount to the third exposure amount, thereby enabling the ISP to control the first camera to acquire the N+1th frame image data at the third exposure amount.
[0138] In this embodiment of the application, the ISP adjusts the first exposure to the third exposure. A possible implementation is as follows: the ISP can adjust the first exposure to the third exposure based on the first average brightness and the third parameter; wherein, the third exposure = (first exposure × g) / first average brightness, and g satisfies the following formula: g = (target brightness of the Nth frame image data - first average brightness) × third parameter + first average brightness;
[0139] Wherein, the target brightness of the Nth frame image data = base brightness + b, where b is related to the brightness of the environment in which the ISP controls the first camera to collect the Nth frame image data. For details, please refer to the content adaptation description of the target brightness of the N-1th frame image data described in S601, which will not be repeated here.
[0140] For example, the first exposure is 300 lux per second (lx·s), and the target brightness of the Nth frame image data is 50 cd / m². 2 The first average brightness is 100 (cd / m²). 2 When the third parameter is 60%, the third exposure is 210 (cd / m²). 2 ).
[0141] It is understood that the specific values of the first exposure, the target brightness of the Nth frame image data, the first average brightness, and the third parameter can be set according to the actual application scenario, and are not limited in the embodiments of this application.
[0142] It should be noted that after the ISP executes S606, it can repeat S601-S05 until the average brightness of the image converges to the target brightness, so that the difference between the average brightness and the target brightness is 0, and the ISP will no longer adjust the exposure.
[0143] S607: ISP determines the second exposure.
[0144] In this embodiment, since the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than the second threshold, the ISP can determine that the scene lighting when the first camera collects the Nth frame image data is significantly different from the scene lighting when the first camera collects the (N-1)th frame image data. Therefore, the ISP needs to activate the second camera to help improve the exposure convergence speed of the first camera. Thus, the ISP needs to first determine the second exposure amount required to control the second camera to collect the first image data.
[0145] In this embodiment of the application, the ISP determines the second exposure amount, including the following possible implementation methods:
[0146] The first possible implementation is: the ISP can determine the second exposure based on scene feature values; wherein the second exposure is related to scene feature values, which include one or more of the following: the first exposure, the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the ratio of the number of pixels in a certain number of bins in the histogram corresponding to the Nth frame image data to the total number of pixels, or the difference between the first ambient brightness and the second ambient brightness.
[0147] In the first example, when there is only one scene feature value, if the ISP matches the fifth exposure value in the first correspondence based on the feature value, the ISP determines the fifth exposure value as the second exposure value; wherein, the first correspondence includes the relationship between the feature value and the exposure value.
[0148] For example, when the first exposure is 50 (lx·s), the ISP finds the fifth exposure in the first correspondence to be 100 (lx·s), therefore, the second exposure is 100 (lx·s).
[0149] It is understood that the specific values of scene feature values and the exposure values matched by the ISP in the first correspondence based on the scene feature values can be set according to the actual application scenario, and are not limited in the embodiments of this application.
[0150] In the second example, when there are multiple scene feature values, the ISP can obtain the result by weighted summation of multiple exposures and their corresponding weight coefficients. The multiple exposures and their corresponding weight coefficients are obtained by the terminal device by matching multiple first feature values in a second correspondence relationship. The second correspondence relationship includes the relationship between feature values, exposures, and their corresponding weight coefficients.
[0151] For example, when the first exposure is 50 (lx·s), the ISP finds an exposure of 100 (lx·s) in the second correspondence, with a corresponding weight of 50%. When the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is 60 (cd / m²),... 2 When the ISP finds an exposure of 120 (lx·s) in the second correspondence, the corresponding weight coefficient is 70%. Therefore, the second exposure = 120 × 70% + 100 × 50% = 134 (lx·s).
[0152] It is understood that the specific values of the scene feature value, exposure amount, and the weight coefficient corresponding to the exposure amount in the second correspondence can be set according to the actual application scenario, and this application embodiment does not limit them.
[0153] The second possible implementation is as follows: The ISP can determine the second exposure based on the first exposure and the target brightness of the Nth frame image data; wherein the second exposure satisfies the following formula: second exposure = (first exposure × a) / first average brightness, and a satisfies the following formula: a = (target brightness of the Nth frame image data - first average brightness) × first parameter + first average brightness, and the first parameter is greater than the second parameter.
[0154] The target brightness of the Nth frame image data satisfies the following formula: Target brightness of the Nth frame image data = Base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to collect the Nth frame image data.
[0155] The first parameter can be a fixed value, for example, 120%. Since the first parameter is related to the scene feature value, the ISP can obtain the first parameter based on the scene feature value. The specific content of the scene feature value can be found in the above description and will not be repeated here.
[0156] In the first example, when there is only one scene feature value, the first parameter is obtained by IS matching a first feature value in the third correspondence, where the third correspondence includes the relationship between the feature value and the parameter.
[0157] For example, when the scene feature value is the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data, in the third correspondence, when the difference is 10 (cd / m²), 2 ), 20 (cd / m 2 ), 30 (cd / m 2 ), 40 (cd / m 2 ), 50 (cd / m 2 When the difference is 20 (cd / m), the corresponding parameters are 80%, 90%, 100%, 110%, and 120%; therefore, when the difference is 20 (cd / m), the corresponding parameters are 80%, 90%, 100%, 110%, and 120%. 2 When the difference is 20 (cd / m), the first parameter is 90%; when the difference is 20 (cd / m) 2 ) and 30(cd / m 2 When the value is between 90% and 100%, the first parameter = (90% + 100%) / 2 = 95%.
[0158] It is understood that the specific values of the feature values and parameters in the third correspondence can be set according to the actual application scenario, and this application embodiment does not limit them.
[0159] In the second example, when there are multiple scene feature values, the first parameter is obtained by the ISP through a weighted summation of multiple parameters and their corresponding weight coefficients. The multiple parameters and their corresponding weight coefficients are obtained by the ISP through matching multiple first feature values in the fourth correspondence relationship, which includes the relationship between feature values, parameters and their corresponding weight coefficients.
[0160] For example, when the first exposure is 50 (lx·s), the parameter matched by the ISP in the fourth correspondence is 100%, and the corresponding weighting coefficient is 140%; when the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is 20 (cd / m²), the ISP matches the target brightness of the target brightness of the target brightness of the Nth frame image data. 2 When the ISP matches the fourth correspondence, the parameter is 120% and the corresponding weight coefficient is 50%. Therefore, the first parameter = 120% × 50% + 100% × 140% = 200%.
[0161] It is understood that the specific values of the feature values, parameters and corresponding weight coefficients in the fourth correspondence can be set according to the actual application scenario, and this application embodiment does not limit them.
[0162] The third possible implementation is as follows: The ISP determines the first exposure factor and calculates the exposure amount after multiplying the first exposure factor and the first exposure amount as the second exposure amount. That is, the second exposure amount satisfies the following formula: Second exposure amount = First exposure amount × First exposure factor; where the first exposure factor is related to the scene feature value. The specific content of the scene feature value can be referred to the above description and will not be repeated here.
[0163] The ISP determines the first exposure factor based on scene feature values, and a possible implementation method is as follows:
[0164] In the first example, when the scene feature value is one, the first exposure multiple is obtained by the ISP matching a first feature value in the fifth correspondence; where the fifth correspondence includes the relationship between the feature value and the exposure multiple.
[0165] For example, when the scene feature value is the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data, in the fifth correspondence, when the difference is 10 (cd / m²), 2 ), 20 (cd / m 2 ), 30 (cd / m 2 ), 40 (cd / m 2 ), 50 (cd / m 2When the difference is 20, the corresponding exposure multiples are 1.1x, 1.2x, 1.3x, 1.4x, and 1.5x. Thus, when the difference is 20, the corresponding exposure multiple is 1.2x. Therefore, when the first exposure is 300 (lx·s), the second exposure is 300 × 1.2 = 360 (lx·s).
[0166] In the second example, when there are multiple scene feature values, the first exposure multiple is obtained by the ISP through a weighted summation of multiple exposure multiples and the weight coefficients corresponding to multiple exposure coefficients; wherein, the multiple exposure multiples and the weight coefficients corresponding to multiple exposure coefficients are obtained by the ISP through matching multiple first feature values in the sixth correspondence relationship, which includes the relationship between feature values, exposure multiples and the weight coefficients corresponding to exposure multiples.
[0167] For example, in the sixth correspondence, when the scene feature value is the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data, respectively, it is 10 (cd / m²). 2 ), 20 (cd / m 2 ), 30 (cd / m 2 ), 40 (cd / m 2 ), 50 (cd / m 2 When the exposure ratios of bins in the histogram are 1.1x, 1.2x, 1.3x, 1.4x, and 1.5x, respectively, the corresponding weighting coefficients are 10%, 20%, 30%, 40%, and 50%. When the ratio of the number of pixels in a bin to the total number of pixels in the histogram is 50%, 60%, 70%, 80%, and 90%, respectively, the corresponding exposure ratios are 1.3x, 1.4x, 1.5x, 1.6x, and 1.7x, and the corresponding weighting coefficients are 20%, 30%, 40%, 50%, and 60%. Therefore, when the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is 20 (cd / m²), the exposure ratios are calculated as follows: 2 When the ratio of the number of pixels in the last bin to the total number of pixels is 60%, the corresponding exposure factor is 1.2x, and the weighting factor corresponding to this ratio is 30%. Therefore, the first exposure factor = 1.2 × 20% + 1.4 × 30% = 0.66x. Consequently, when the first exposure is 300 (lx·s), the second exposure is 300 × 0.66 = 198 (lx·s).
[0168] It is understood that the specific values of the feature value, exposure factor, and weight coefficient corresponding to the exposure factor in the sixth correspondence can be set according to the actual application scenario, and this application embodiment does not limit them.
[0169] S608: The ISP configures the second camera with a second exposure for acquiring the first image data.
[0170] S609: The ISP controls the second camera to acquire the first image data at the second exposure.
[0171] In this embodiment of the application, the first image data can be understood as test data. When the ISP determines that the quality of the first image data meets the quality requirements, the ISP can configure the second exposure for the first camera, so that the ISP controls the first camera to acquire the N+1th frame image at the second exposure. The specific content of the ISP's determination that the quality of the first image meets the quality requirements can be referred to the content description of S610-S612, and will not be repeated here.
[0172] S610: The ISP performs histogram statistics on the first image data to obtain the second average brightness of the first image data.
[0173] In this embodiment, the implementation of the ISP obtaining the second average brightness of the first image data can be described with reference to the content of S603, or other implementation methods can be used to calculate the second average brightness. This embodiment does not limit the implementation.
[0174] Based on the descriptions in S606 and S607, it can be understood that since the ISP sets the first parameter to be greater than the second parameter when configuring the second exposure for the second camera to acquire the first image data, the second average brightness obtained based on the second exposure converges to the target brightness faster when the target brightness of the Nth frame image data is the same. Alternatively, it can be understood that the second camera executes an exposure strategy with a faster convergence speed than the first camera. However, overshoot may still occur.
[0175] The overshoot situation can be understood as follows: when the terminal device controls the second camera to collect the first image data, the first parameter set is too large, so that when the scene lighting changes from dark to bright, the second average brightness of the first image data is less than the target brightness of the first image data, or when the scene lighting changes from bright to dark, the second average brightness of the first image data is greater than the target brightness of the first image data. Therefore, in order to determine whether the overshoot situation occurs, the ISP determines whether to call back the exposure amount, which is the content described in S611. Whether the ISP calls back the exposure amount can be understood as whether the ISP recalculates the second exposure amount.
[0176] Furthermore, the exposure convergence direction of the second camera needs to be in the same direction as the exposure convergence direction of the first camera, and the exposure convergence speed of the second camera should be faster than that of the first camera. Therefore, after the ISP executes S611, the ISP needs to determine whether to synchronize the exposure, which is the content described in S612. Whether the ISP synchronizes the exposure can be understood as whether the ISP adjusts the first exposure of the first camera to the second exposure of the second camera.
[0177] S611: ISP determines whether to call back the exposure.
[0178] In this embodiment of the application, the ISP determines whether to call back the exposure amount, which is related to the second average brightness of the first image data and the target brightness of the first image data, as well as the change in scene lighting. The change in scene lighting may be from dark to bright or from bright to dark. The method by which the ISP calculates the target brightness of the first image data can refer to the aforementioned method for calculating the target brightness of the N-1th frame image data, and will not be repeated here.
[0179] For example, when the scene lighting changes from dark to bright, if the second average brightness of the first image data is greater than the target brightness of the first image data, this means that the exposure convergence direction of the second camera is in the same direction as the exposure convergence direction of the first camera. Therefore, the ISP does not need to call back the exposure amount. Furthermore, the ISP executes S612; or it can be understood that when the second average brightness of the first image data is greater than the target brightness of the first image data, when the ISP configures the second exposure amount to the first camera, the ISP controls the exposure convergence direction of the first camera when it acquires the N+1th frame of image data with the first exposure amount, which is consistent with the ISP's control of the first... The camera's exposure convergence direction is the same when it acquires the Nth frame image data with the second exposure. If the second average brightness is less than or equal to the target brightness of the first image data, the possible reason is that the first parameter set by the ISP when calculating the second exposure is too large. If the ISP assigns the second exposure to the first camera, the ISP controls the first camera's exposure convergence direction when it acquires the N+1th frame image data with the first exposure, which is different from the ISP controls the first camera's exposure convergence direction when it acquires the Nth frame image data with the second exposure. Therefore, the ISP needs to call back the exposure. Furthermore, the ISP executes S607-S610.
[0180] For example, when the scene lighting changes from bright to dark, if the second average brightness is less than the target brightness of the first image data, this means that the exposure convergence direction of the second camera is in the same direction as the exposure convergence direction of the first camera. Therefore, the ISP does not need to call back the exposure amount, and the ISP executes S612. Alternatively, it can be understood that when the second average brightness is less than the target brightness of the first image data, when the ISP allocates the second exposure amount to the first camera, the ISP controls the first camera's exposure convergence direction when acquiring the first image data with the first exposure amount to be the same as the ISP controls the first camera's exposure convergence direction when acquiring the Nth frame image data with the second exposure amount. If the second average brightness is greater than or equal to the target brightness of the Nth frame image data, the possible reason is that the first parameter set by the ISP when calculating the second exposure amount is too large. If the ISP allocates the second exposure amount to the first camera, the ISP controls the first camera's exposure convergence direction when acquiring the N+1th frame image data with the first exposure amount to be different from the ISP controls the first camera's exposure convergence direction when acquiring the Nth frame image data with the second exposure amount. Therefore, the ISP needs to call back the exposure amount, and the ISP executes S607-S610.
[0181] S612: ISP determines whether to synchronize exposure.
[0182] In this embodiment, the ISP's determination of whether to synchronize exposure is related to the magnitude of the second average brightness and the first average brightness, as well as changes in scene illumination. Specifically, the ISP's determination of whether to synchronize exposure can be understood as the ISP determining whether to adjust the first exposure to the second exposure. The specific determination process is as follows:
[0183] For example, when the scene lighting changes from dark to bright, if the second average brightness is greater than the first average brightness, it means that the ISP activating the second camera has not improved the exposure convergence speed of the first camera, or it can be understood that the quality of the first image data does not meet the quality requirements. Therefore, the ISP does not synchronize the exposure amount, and further, the ISP executes S614; if the second average brightness is less than or equal to the first average brightness, it means that the second exposure amount corresponding to the second average brightness can improve the exposure convergence speed of the first camera. Therefore, the ISP synchronizes the exposure amount, that is, the ISP executes S613.
[0184] For example, when the scene lighting changes from bright to dark, if the second average brightness is less than the first average brightness, it means that the ISP activating the second camera has not improved the exposure convergence speed of the first camera. Therefore, the ISP does not synchronize the exposure amount, and further, the ISP executes S614; if the second average brightness is greater than the first average brightness, it means that the second exposure amount corresponding to the second average brightness can improve the exposure convergence speed of the first camera. Therefore, the ISP synchronizes the exposure amount, that is, the ISP executes S613.
[0185] Combining the content of S611 and S612, it can be understood that when the scene lighting changes from dark to bright, if the ISP determines that the second average brightness of the first image data is greater than the target brightness of the first image data and the second average brightness of the first image data is less than the first average brightness, the ISP can determine that the quality of the first image data meets the quality requirements; when the scene lighting changes from bright to dark, if the ISP determines that the second average brightness of the first image data is less than the target brightness of the first image data and the second average brightness of the first image data is greater than the first average brightness, the ISP can determine that the quality of the first image data meets the quality requirements. Therefore, the ISP adjusts the first exposure to the second exposure, thereby enabling the ISP to control the first camera to acquire the N+1th frame image data at the second exposure.
[0186] S613: ISP adjusts the first exposure to the second exposure.
[0187] In this embodiment of the application, after the ISP executes S613, the ISP can repeatedly execute S601-612 until the average brightness of the image converges to the target brightness, so that the difference between the average brightness and the target brightness is 0, and the exposure of the first camera converges.
[0188] S614: The ISP adjusts the first exposure to the fourth exposure.
[0189] In this embodiment, the fourth exposure is equal to the third exposure. Therefore, the fourth exposure can satisfy the following formula: Fourth exposure = (first exposure × g) / average brightness of the Nth frame image data, where g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data.
[0190] The method for calculating the target brightness of the Nth frame image data can be adapted to the aforementioned description and will not be repeated here; other methods can also be used to calculate the target brightness of the Nth frame image data, and this application embodiment does not limit it.
[0191] Combination Figure 6As can be understood from the embodiments shown, the difference between the second exposure and the first exposure is greater than a preset step size. The preset step size can be understood as the preset step size when the ISP adjusts the exposure of the first camera, or it can be understood as an increase based on the first exposure. Because the difference between the second exposure and the first exposure is greater than the preset step size, the second exposure can be increased to improve the exposure convergence speed of the first camera. The specific value of the preset step size can be set according to the actual application scenario, and this application embodiment does not limit it.
[0192] It should be noted that when the scene lighting changes from dark to bright, the preset step size is negative. Therefore, the second exposure is less than the first exposure. For example, combining... Figure 2 After the ISP controls the first camera to acquire image data at the second exposure, the image brightness histogram calculated by the ISP is within the dynamic range of the device's camera, thus ensuring that there is no overexposure in the image obtained by the ISP based on the second camera. When the scene lighting changes from bright to dark, the preset step size is positive; therefore, the second exposure is greater than the first exposure. For example, combined with... Figure 3 After the ISP controls the first camera to acquire image data at the second exposure, the image brightness histogram calculated by the ISP is within the dynamic range of the device camera, thus ensuring that there is no underexposure in the image obtained by the ISP based on the second camera.
[0193] In conclusion, Figure 6 In the illustrated embodiment, after the ISP configures the first camera with a first exposure level for acquiring the Nth frame image data, the ISP can control the first camera to acquire the Nth frame image data at the first exposure level. Then, after performing histogram statistics on the Nth frame image data, the ISP can obtain a first average brightness. When the ISP determines that the first average brightness is equal to the target brightness of the Nth frame image data, the ISP does not adjust the first exposure level. When the ISP determines that the first average brightness is not equal to the target brightness of the Nth frame image data, further, when the ISP determines that the difference between the first average brightness and the target brightness of the Nth frame image data is less than a second threshold, the ISP can adjust the first exposure level to a third exposure level. When the ISP determines that the difference between the first average brightness and the target brightness of the Nth frame image data is greater than the second threshold, the ISP can activate the second camera. When the ISP determines that the second exposure level of the second camera can improve the exposure convergence speed of the first camera, the ISP can adjust the first exposure level to the second exposure level. Thus, even when the scene lighting changes significantly, the first camera can improve the exposure convergence speed based on the exposure level of the second camera, thereby improving the user experience of the terminal device.
[0194] The exposure adjustment method of this application has been described above. The apparatus for performing the above exposure adjustment method provided in this application will now be described. Those skilled in the art will understand that the methods and apparatus can be combined with and referenced by each other, and the exposure adjustment apparatus provided in this application can perform the steps of the above exposure adjustment method.
[0195] For example, Figure 7 This is a schematic diagram of an exposure adjustment device provided in an embodiment of this application, as shown below. Figure 7 As shown, the device 70 can be a terminal device or a chip or chip system applied in a terminal device; the device 70 includes: a processing unit 701, which is used for the exposure adjustment device to perform information processing steps.
[0196] For example, processing unit 701 is configured to control the first camera to acquire the Nth frame of image data at the first exposure level; wherein N is an integer greater than or equal to 1; processing unit 701 is further configured to control the second camera to acquire the first image data at the second exposure level when the ambient brightness change of the terminal device reaches a preset condition; wherein the difference between the second exposure level and the first exposure level is greater than a preset step size, the preset step size being a preset step size when the terminal device adjusts the exposure level of the first camera; processing unit 701 is further configured to control the first camera to acquire the (N+1)th frame of image data at the second exposure level when the quality of the first image data meets the quality requirements.
[0197] In one possible implementation, the ambient brightness of the terminal device is related to the first ambient brightness when the terminal device controls the first camera to collect the Nth frame of image data. The change in the ambient brightness of the terminal device reaches the preset condition including: the difference between the first ambient brightness and the second ambient brightness is greater than the first threshold; wherein, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the N-1th frame of image data.
[0198] In one possible implementation, the ambient brightness of the terminal device is related to the target brightness of the Nth frame image data. The change in ambient brightness of the terminal device reaches a preset condition including: the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a second threshold.
[0199] In one possible implementation, the quality requirement for the first image data to meet the quality requirements includes: the average brightness of the first image data is greater than the target brightness of the first image data, and the average brightness of the first image data is less than the average brightness of the Nth frame image data; or, the average brightness of the first image data is less than the target brightness of the first image data, and the average brightness of the first image data is greater than the average brightness of the Nth frame image data.
[0200] In one possible implementation, the second exposure is related to a first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, or the ratio of the number of pixels in M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0201] In one possible implementation, when the first feature value is one, the second exposure is obtained by the terminal device by matching a first feature value in a first correspondence; wherein, the first correspondence includes the relationship between the feature value and the exposure.
[0202] In one possible implementation, when there are multiple first feature values, the second exposure is obtained by the terminal device through a weighted summation of the multiple exposure values and their corresponding weight coefficients; wherein, the multiple exposure values and their corresponding weight coefficients are obtained by the terminal device through matching the multiple first feature values in a second correspondence relationship, and the second correspondence relationship includes the relationship between the feature values, the exposure values, and the corresponding weight coefficients.
[0203] In one possible implementation, the second exposure amount satisfies the following formula: Second exposure amount = (First exposure amount × a) / Average brightness of the Nth frame image data; where a satisfies the following formula, a = (Target brightness of the Nth frame image data - Average brightness of the Nth frame image data) × First parameter + Average brightness of the Nth frame image data, and the target brightness of the Nth frame image data satisfies the following formula: Target brightness of the Nth frame image data = Base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to acquire the Nth frame image data; where the first parameter is related to the first feature value, and the first feature value includes the following... One or more: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins of the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0204] In one possible implementation, when the first feature value is one, the first parameter is obtained by the terminal device by matching a first feature value in a third correspondence; wherein the third correspondence includes the relationship between the feature value and the parameter.
[0205] In one possible implementation, when there are multiple first feature values, the first parameter is obtained by the terminal device through a weighted summation of multiple parameters and their corresponding weight coefficients; wherein, the multiple parameters and their corresponding weight coefficients are obtained by the terminal device through matching multiple first feature values in a fourth correspondence relationship, and the fourth correspondence relationship includes the relationship between feature values, parameters and their corresponding weight coefficients.
[0206] In one possible implementation, the second exposure satisfies the following formula: Second exposure = First exposure × First exposure factor; wherein, the first exposure factor is related to a first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bars of the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
[0207] In one possible implementation, when the first feature value is one, the first exposure factor is obtained by the terminal device matching a first feature value in a fifth correspondence; wherein the fifth correspondence includes the relationship between the feature value and the exposure factor.
[0208] In one possible implementation, when there are multiple first feature values, the first exposure factor is obtained by the terminal device through a weighted summation of the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients; wherein, the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients are obtained by the terminal device through matching the multiple first feature values in a sixth correspondence relationship, and the sixth correspondence relationship includes the relationship between feature values, exposure factors and the weight coefficients corresponding to the exposure factors.
[0209] In one possible implementation, the first exposure satisfies the following formula: First exposure = (c × d) / e; where c satisfies the following formula: c = (Target brightness of the (N-1)th frame image data - Average brightness of the (N-1)th frame image data) × Second parameter + Average brightness of the (N-1)th frame image data, and the target brightness of the (N-1)th frame image data satisfies the following formula: Target brightness of the (N-1)th frame image data = Base brightness + f, where f is related to the brightness of the environment in which the terminal device controls the first camera to acquire the (N-1)th frame image data; where d is the exposure when the terminal device controls the first camera to acquire the (N-1)th frame image data, and e is the average brightness of the (N-1)th frame image data, and e satisfies the following formula: j is the number of bar bins in the histogram corresponding to the (N-1)th frame of image data, m i Let n be the image brightness corresponding to the i-th bin of the (N-1)-th frame of image data. i Let be the number of pixels corresponding to the i-th bin.
[0210] In one possible implementation, the processing unit 701 is further configured to: adjust the first exposure to a third exposure when the ambient brightness change of the terminal device does not meet a preset condition; wherein the third exposure satisfies the following formula: third exposure = (first exposure × g) / average brightness of the Nth frame image data, and g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, where b is related to the brightness of the environment where the Nth frame image data is acquired by the first camera controlled by the terminal device; and control the first camera to acquire the N+1th frame image data at the third exposure.
[0211] In one possible implementation, the processing unit 701 is further configured to: adjust the first exposure to a fourth exposure when the quality of the first image data does not meet the quality requirements; wherein the fourth exposure satisfies the following formula: fourth exposure = (first exposure × g) / average brightness of the Nth frame image data, and g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, where b is related to the brightness of the environment in which the Nth frame image data is acquired by the terminal device controlling the first camera; and control the first camera to acquire the N+1th frame image data at the fourth exposure.
[0212] In one possible embodiment, the exposure adjustment device may further include a storage unit 702. The processing unit 701 and the storage unit 702 may be connected via a communication bus.
[0213] Storage unit 702 may include one or more memories, which may be devices in one or more devices or circuits used to store programs or data.
[0214] The storage unit 702 can exist independently and be connected to the processing unit 701 of the exposure adjustment device via a communication bus; the storage unit 702 can also be integrated with the processing unit 701.
[0215] Exposure adjustment devices can be used in exposure adjustment equipment, circuits, hardware components, or chips.
[0216] For example, Figure 8 This is a schematic diagram of a chip structure provided in an embodiment of this application. The chip 80 includes one or more processors 810 and a communication interface 830.
[0217] In some implementations, memory 840 stores elements such as executable modules or data structures, or subsets thereof, or extended sets thereof.
[0218] In this embodiment, memory 840 may include read-only memory and random access memory, and provides instructions and data to processor 810. A portion of memory 840 may also include non-volatile random access memory (NVRAM).
[0219] In this embodiment, the memory 840, the communication interface 830, and the memory 840 are coupled together via a bus system 820. The bus system 820 includes a data bus, and may also include a power bus, a control bus, and a status signal bus, etc. For ease of description, in... Figure 8 The general labeled all buses as Bus System 820.
[0220] The methods described in the embodiments of this application can be applied to or implemented by the processor 810. The processor 810 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 810 or by instructions in the form of software. The processor 810 may be a general-purpose processor (e.g., a microprocessor or conventional processor), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates, transistor logic devices, or discrete hardware components. The processor 810 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention.
[0221] The steps of the method in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in mature storage media in the art, such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read-only memory (EEPROM). This storage medium is located in memory 840, and the processor 810 reads information from memory 840 and, in conjunction with its hardware, completes the steps of the above method.
[0222] In the above embodiments, the instructions stored in the memory for execution by the processor can be implemented in the form of a computer program product. This computer program product can be pre-written into the memory, or it can be downloaded and installed into the memory as software.
[0223] A 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 flow or function according to the embodiments of this application is 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, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, 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 server or data center that integrates one or more available media. For example, available media may include magnetic media (e.g., floppy disks, hard disks, or magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0224] This application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. The computer-readable medium may include computer storage media and communication media, and may also include any medium capable of transferring a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0225] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disc storage; computer-readable media may also include disk storage or other disk storage devices. Furthermore, any connecting cable may also be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. As used herein, disks and optical discs include optical discs (CD), laser discs, optical discs, digital versatile discs (DVD), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers.
[0226] The above combinations should also be included within the scope of computer-readable media. The above descriptions are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for adjusting exposure, characterized in that, Applied to a terminal device, the terminal device including a first camera and a second camera, the method includes: In response to receiving an instruction to control the first camera to take a picture or record, the first camera is configured to acquire a first exposure value for the Nth frame of image data, the first exposure value corresponding to a first value; the acquisition step of the first camera is executed, the acquisition step of the first camera includes the first camera acquiring the Nth frame of image data at the first exposure value; wherein, N is an integer greater than or equal to 1; Calculate the first average brightness of the Nth frame image data; Determine whether the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a first threshold; if it is greater than the first threshold, determine a second exposure based on the first exposure and the target brightness of the Nth frame image data, the second exposure corresponding to a second value, and execute the acquisition step of the second camera, the acquisition step of the second camera including the second camera acquiring the first image data at the second exposure; if it is less than or equal to the first threshold, adjust the first exposure from the first value to a third value, and execute the acquisition step of the first camera; wherein, the difference between the second exposure and the first exposure is greater than a preset step size, the preset step size being a preset step size when the terminal device adjusts the exposure of the first camera; After completing the acquisition step of the second camera, it is determined whether the exposure convergence direction of the second camera is the same as that of the first camera. If the directions are the same, the step of determining the second exposure value is not repeated. If the directions are different, the step of determining the second exposure value is repeated, the second exposure value is adjusted from the second value to the fourth value, and the acquisition step of the second camera is executed. Herein, the different exposure convergence directions mean that the target brightness of the first image data is between the second average brightness of the first image data and the first average brightness of the Nth frame image data. When the exposure convergence directions are the same, determine whether the first image data meets the quality requirements; if the quality requirements are met, control the first camera to adjust the first exposure from the first value to the second value, and execute the acquisition step of the first camera; meeting the quality requirements indicates that the second exposure corresponding to the second average brightness of the first image data can improve the exposure convergence speed of the first camera; if the quality requirements are not met, control the first camera to adjust the first exposure from the first value to the fifth value, and execute the acquisition step of the first camera; not meeting the quality requirements indicates that the second exposure corresponding to the second average brightness of the first image data cannot improve the exposure convergence speed of the first camera; the quality requirements are: the second average brightness of the first image data is greater than the target brightness of the first image data, and the second average brightness of the first image data is less than the first average brightness of the Nth frame image data; or, the second average brightness of the first image data is less than the target brightness of the first image data, and the second average brightness of the first image data is greater than the first average brightness of the Nth frame image data.
2. The method according to claim 1, characterized in that, The second exposure is related to the first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, or the ratio of the number of pixels in M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
3. The method according to claim 2, characterized in that, When the first feature value is one, the second exposure amount is obtained by the terminal device by matching the first feature value in the first correspondence relationship; wherein, the first correspondence relationship includes the relationship between the feature value and the exposure amount.
4. The method according to claim 2, characterized in that, When there are multiple first feature values, the second exposure is obtained by the terminal device by weighted summation of multiple exposure values and the weight coefficients corresponding to the multiple exposure values; wherein, the multiple exposure values and the weight coefficients corresponding to the multiple exposure values are obtained by the terminal device by matching the multiple first feature values in a second correspondence relationship, and the second correspondence relationship includes the relationship between feature values, exposure values and the weight coefficients corresponding to the exposure values.
5. The method according to claim 1, characterized in that, The second exposure satisfies the following formula: Second exposure = (First exposure × a) / Average brightness of the Nth frame image data; Wherein, 'a' satisfies the following formula: a = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × first parameter + average brightness of the Nth frame image data, and the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to collect the Nth frame image data; Wherein, the first parameter is related to the first feature value, and the first feature value includes one or more of the following: the first exposure amount, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins in the histogram of the Nth frame image data to the total number of pixels. Wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
6. The method according to claim 5, characterized in that, When the first feature value is one, the first parameter is obtained by the terminal device by matching the first feature value in the third correspondence relationship; wherein, the third correspondence relationship includes the relationship between the feature value and the parameter.
7. The method according to claim 5, characterized in that, When there are multiple first feature values, the first parameter is obtained by the terminal device through a weighted summation of multiple parameters and their corresponding weight coefficients; wherein, the multiple parameters and their corresponding weight coefficients are obtained by the terminal device through matching the multiple first feature values in a fourth correspondence relationship, and the fourth correspondence relationship includes the relationship between the feature value, the parameter and the weight coefficient corresponding to the parameter.
8. The method according to claim 1, characterized in that, The second exposure amount satisfies the following formula: Second exposure amount = First exposure amount × First exposure factor; wherein, the first exposure factor is related to a first feature value, and the first feature value includes one or more of the following: the first exposure amount, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
9. The method according to claim 8, characterized in that, When the first feature value is one, the first exposure factor is obtained by the terminal device by matching the first feature value in the fifth correspondence relationship; wherein, the fifth correspondence relationship includes the relationship between feature value and exposure factor.
10. The method according to claim 8, characterized in that, When there are multiple first feature values, the first exposure factor is obtained by the terminal device through a weighted summation of multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients; wherein, the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients are obtained by the terminal device through matching the multiple first feature values in a sixth correspondence relationship, and the sixth correspondence relationship includes the relationship between feature values, exposure factors and the weight coefficients corresponding to the exposure factors.
11. The method according to any one of claims 1-10, characterized in that, The first exposure amount satisfies the following formula: First exposure amount = (c × d) / e; Wherein, c satisfies the following formula: c = (target brightness of the (N-1)th frame image data - average brightness of the (N-1)th frame image data) × second parameter + average brightness of the (N-1)th frame image data, and the target brightness of the (N-1)th frame image data satisfies the following formula: target brightness of the (N-1)th frame image data = base brightness + f, where f is related to the brightness of the environment in which the terminal device controls the first camera to collect the (N-1)th frame image data; Wherein, d is the exposure amount when the terminal device controls the first camera to acquire the (N-1)th frame image data, and e is the average brightness of the (N-1)th frame image data, where e satisfies the following formula: j is the number of bar bins in the histogram corresponding to the (N-1)th frame of image data, and m i The image brightness corresponding to the i-th bin of the (N-1)-th frame of image data, where n i The number of pixels corresponding to the i-th bin.
12. The method according to claim 11, characterized in that, The method further includes: If the exposure is less than or equal to the first threshold, the first exposure is adjusted from the first value to a third value; wherein the third value satisfies the following formula: the third value = (first value × g) / average brightness of the Nth frame image data, and g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, and b is related to the brightness of the environment in which the Nth frame image data is acquired by the terminal device controlled by the first camera; The first camera is controlled to acquire the N+1th frame image data at the third value of the first exposure.
13. The method according to claim 11, characterized in that, The method further includes: If the quality requirements are not met, the first camera is controlled to adjust the first exposure from the first value to the fifth value, and the acquisition step of the first camera is executed; wherein, the fifth value satisfies the following formula: the fifth value = (first value × g) / average brightness of the Nth frame image data, and g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, and b is related to the brightness of the environment in which the Nth frame image data is acquired by the first camera controlled by the terminal device; The first camera is controlled to acquire the N+1th frame image data at the fifth value of the first exposure.
14. An exposure adjustment device, characterized in that, The device is applied to a terminal device, which includes a first camera and a second camera, and the device includes a processing unit. The processing unit is configured, in response to receiving an instruction to control the first camera to take a picture or record, to configure the first camera to acquire a first exposure value for the Nth frame of image data, wherein the first exposure value corresponds to a first value. The processing unit is used to control the first camera to acquire the Nth frame image data at the first exposure level; wherein, N is an integer greater than or equal to 1; The processing unit is further configured to determine whether the difference between the first average brightness of the Nth frame image data and the target brightness of the Nth frame image data is greater than a first threshold; if it is greater than the first threshold, a second exposure value is determined based on the first exposure value and the target brightness of the Nth frame image data, the second exposure value corresponding to a second value, and the acquisition step of the second camera is executed, the acquisition step of the second camera including the second camera acquiring first image data at the second exposure value; if it is less than or equal to the first threshold, the first exposure value is adjusted from the first value to a third value, and the acquisition step of the first camera is executed; wherein, the difference between the second exposure value and the first exposure value is greater than a preset step size, the preset step size being a preset step size when the terminal device adjusts the exposure value of the first camera; The processing unit is further configured to, after completing the acquisition step of the second camera, determine whether the exposure convergence direction of the second camera is the same as that of the first camera. If the directions are the same, the step of determining the second exposure amount is not re-executed; if the directions are different, the step of determining the second exposure amount is re-executed, the second exposure amount is adjusted from the second value to the fourth value, and the acquisition step of the second camera is executed. Wherein, the different exposure convergence directions mean that the target brightness of the first image data is between the second average brightness of the first image data and the first average brightness of the Nth frame image data. The processing unit is further configured to determine whether the first image data meets the quality requirements when the exposure convergence directions are the same. If the quality requirements are met, the unit controls the first camera to adjust the first exposure value from the first value to the second value and executes the acquisition step of the first camera. Meeting the quality requirements indicates that the second exposure value corresponding to the second average brightness of the first image data can improve the exposure convergence speed of the first camera. If the quality requirements are not met, the unit controls the first camera to adjust the first exposure value from the first value to the fifth value and executes the acquisition step of the first camera. Not meeting the quality requirements indicates that the second exposure value corresponding to the second average brightness of the first image data cannot improve the exposure convergence speed of the first camera. The quality requirements are: the second average brightness of the first image data is greater than the target brightness of the first image data, and the second average brightness of the first image data is less than the first average brightness of the Nth frame image data; or, the second average brightness of the first image data is less than the target brightness of the first image data, and the second average brightness of the first image data is greater than the first average brightness of the Nth frame image data.
15. The apparatus according to claim 14, characterized in that, The second exposure is related to the first feature value, which includes one or more of the following: the first exposure, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, or the ratio of the number of pixels in M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
16. The apparatus according to claim 15, characterized in that, When the first feature value is one, the second exposure amount is obtained by the terminal device by matching the first feature value in the first correspondence relationship; wherein, the first correspondence relationship includes the relationship between the feature value and the exposure amount.
17. The apparatus according to claim 15, characterized in that, When there are multiple first feature values, the second exposure is obtained by the terminal device by weighted summation of multiple exposure values and the weight coefficients corresponding to the multiple exposure values; wherein, the multiple exposure values and the weight coefficients corresponding to the multiple exposure values are obtained by the terminal device by matching the multiple first feature values in a second correspondence relationship, and the second correspondence relationship includes the relationship between feature values, exposure values and the weight coefficients corresponding to the exposure values.
18. The apparatus according to claim 14, characterized in that, The second exposure satisfies the following formula: Second exposure = (First exposure × a) / Average brightness of the Nth frame image data; Wherein, 'a' satisfies the following formula: a = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × first parameter + average brightness of the Nth frame image data, and the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, where b is related to the brightness of the environment in which the terminal device controls the first camera to collect the Nth frame image data; Wherein, the first parameter is related to the first feature value, and the first feature value includes one or more of the following: the first exposure amount, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins in the histogram of the Nth frame image data to the total number of pixels. Wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to collect the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
19. The apparatus according to claim 18, characterized in that, When the first feature value is one, the first parameter is obtained by the terminal device by matching the first feature value in the third correspondence relationship; wherein, the third correspondence relationship includes the relationship between the feature value and the parameter.
20. The apparatus according to claim 18, characterized in that, When there are multiple first feature values, the first parameter is obtained by the terminal device through a weighted summation of multiple parameters and their corresponding weight coefficients; wherein, the multiple parameters and their corresponding weight coefficients are obtained by the terminal device through matching the multiple first feature values in a fourth correspondence relationship, and the fourth correspondence relationship includes the relationship between the feature value, the parameter and the weight coefficient corresponding to the parameter.
21. The apparatus according to claim 14, characterized in that, The second exposure amount satisfies the following formula: Second exposure amount = First exposure amount × First exposure factor; wherein, the first exposure factor is related to a first feature value, and the first feature value includes one or more of the following: the first exposure amount, the difference between the average brightness of the Nth frame image data and the target brightness of the Nth frame image data, the difference between the first ambient brightness and the second ambient brightness, and the ratio of the number of pixels in the M bar bins in the histogram of the Nth frame image data to the total number of pixels; wherein, the first ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the Nth frame image data, the second ambient brightness is the ambient brightness when the terminal device controls the first camera to acquire the (N-1)th frame image data, the histogram corresponding to the Nth frame image data is obtained by the terminal device by statistically analyzing the Nth frame image data, and M is an integer greater than or equal to 1.
22. The apparatus according to claim 21, characterized in that, When the first feature value is one, the first exposure factor is obtained by the terminal device by matching the first feature value in the fifth correspondence relationship; wherein, the fifth correspondence relationship includes the relationship between feature value and exposure factor.
23. The apparatus according to claim 21, characterized in that, When there are multiple first feature values, the first exposure factor is obtained by the terminal device through a weighted summation of multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients; wherein, the multiple exposure factors and the weight coefficients corresponding to the multiple exposure coefficients are obtained by the terminal device through matching the multiple first feature values in a sixth correspondence relationship, and the sixth correspondence relationship includes the relationship between feature values, exposure factors and the weight coefficients corresponding to the exposure factors.
24. The apparatus according to any one of claims 14-23, characterized in that, The first exposure amount satisfies the following formula: First exposure amount = (c × d) / e; Wherein, c satisfies the following formula: c = (target brightness of the (N-1)th frame image data - average brightness of the (N-1)th frame image data) × second parameter + average brightness of the (N-1)th frame image data, and the target brightness of the (N-1)th frame image data satisfies the following formula: target brightness of the (N-1)th frame image data = base brightness + f, where f is related to the brightness of the environment in which the terminal device controls the first camera to collect the (N-1)th frame image data; Wherein, d is the exposure amount when the terminal device controls the first camera to acquire the (N-1)th frame image data, and e is the average brightness of the (N-1)th frame image data, where e satisfies the following formula: j is the number of bar bins in the histogram corresponding to the (N-1)th frame of image data, and m i The image brightness corresponding to the i-th bin of the (N-1)-th frame of image data, where n i The number of pixels corresponding to the i-th bin.
25. The apparatus according to claim 24, characterized in that, The processing unit is further configured to: If the exposure is less than or equal to the first threshold, the first exposure value is adjusted from the first value to the third value, and the acquisition step of the first camera is executed; wherein, the third value satisfies the following formula: the third value = (first value × g) / average brightness of the Nth frame image data, and g satisfies the following formula: g = (target brightness of the Nth frame image data - average brightness of the Nth frame image data) × third parameter + average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: target brightness of the Nth frame image data = base brightness + b, and b is related to the brightness of the environment in which the Nth frame image data is acquired by the terminal device controlled by the first camera; The first camera is controlled to acquire the N+1th frame image data at the third value of the first exposure.
26. The apparatus according to claim 24, characterized in that, The processing unit is further configured to: If the quality requirements are not met, the first camera is controlled to adjust the first exposure from the first value to the fifth value, and the acquisition step of the first camera is executed; wherein, the fifth value satisfies the following formula: the fifth value = (the first value × g) / the average brightness of the Nth frame image data, and g satisfies the following formula: g = (the target brightness of the Nth frame image data - the average brightness of the Nth frame image data) × the third parameter + the average brightness of the Nth frame image data; the target brightness of the Nth frame image data satisfies the following formula: the target brightness of the Nth frame image data = the base brightness + b, and b is related to the brightness of the environment in which the Nth frame image data is acquired by the first camera controlled by the terminal device; The first camera is controlled to acquire the N+1th frame image data at the fifth value of the first exposure.
27. An exposure adjustment device, characterized in that, It includes a processor and a memory, the memory being used to store code instructions; the processor being used to execute the code instructions to perform the method as described in any one of claims 1-13.
28. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, cause a computer to perform the method as described in any one of claims 1-13.
29. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to perform the method as described in any one of claims 1-13.
Citation Information
Patent Citations
Photography method, related equipment and computer storage medium
CN108337445A