Image processing method, device, electronic device and storage medium

The image processing method captures images with varying flash intensities to determine ambient brightness and reflection index, addressing the inconvenience of flash toggling in continuous light scenarios, enhancing user experience and reducing equipment wear.

CN114418924BActive Publication Date: 2024-12-31BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202011171512.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-28
Publication Date
2024-12-31
Estimated Expiration
2040-10-28

AI Technical Summary

Technical Problem

Existing camera systems require the flash to be turned on and off to determine ambient brightness or reflection index, which is inconvenient and not applicable in scenarios where continuous light adjustment is needed, such as video recording or flashlight mode.

Method used

An image processing method that captures two images with different flash intensities, determining ambient brightness and reflection index based on statistical brightness values, flash intensities, and exposure parameters, allowing continuous flash adjustment without turning the flash on and off.

Benefits of technology

Enables accurate determination of ambient brightness and reflection index in scenarios with continuous flash intensity changes, improving user experience by allowing continuous image capture without flash toggling and reducing equipment wear.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114418924B_ABST
    Figure CN114418924B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose an image processing method, device, and electronic device, the image processing method comprising: obtaining a first image and a second image captured when a flash is on, wherein the first flash intensity when the first image is captured is different from the second flash intensity when the second image is captured; obtaining a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image; determining the ambient brightness when the first image and the second image are captured based on the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity. The image processing method described in the disclosed embodiments can be applied to a wider range of application scenarios and facilitate user operation and improve user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to, but is not limited to, the field of camera automatic exposure technology, and in particular to an image processing method, device, electronic device and storage medium. Background Art

[0002] At present, in photography technology, the ambient brightness or reflection index when an electronic device captures an image is usually obtained based on the parameters of an image with the flash turned on and the parameters of an image with the flash turned off. However, in these scenarios, the camera needs to turn on or off the flash to obtain the ambient brightness or reflection index, which brings great inconvenience to the user; in some scenarios where the light source is not expected to be continuously switched on and off, such as flashlight mode or video recording mode, the existing technology cannot be used to obtain the ambient brightness or reflection index. Summary of the invention

[0003] The present disclosure provides an image processing method, an apparatus, an electronic device and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, including:

[0005] Acquire a first image and a second image captured when a flash is on, wherein a first flash intensity when the first image is captured is different from a second flash intensity when the second image is captured;

[0006] Acquire a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image;

[0007] The ambient brightness when the first image and the second image are captured is determined according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity.

[0008] In the above solution, determining the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity includes:

[0009] Acquire a reflection index when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity;

[0010] The environment brightness when the first image and the second image are captured is acquired according to the first statistical brightness value, the first flash intensity, and the reflection index.

[0011] In the above solution, the step of obtaining a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image includes:

[0012] Divide the first image into k regions; wherein k is a positive integer;

[0013] Acquire k first statistical brightness values ​​of the image brightness of the first image according to the image brightness of the 1st to kth regions of the first image;

[0014] and dividing the second image into k regions;

[0015] According to the image brightness of the 1st to kth regions of the second image, k second statistical brightness values ​​of the image brightness of the second image are obtained.

[0016] In the above solution, acquiring the reflection index when the first image and the second image are collected according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity includes:

[0017] The reflection index of the i-th area of ​​the first image and the second image is determined based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity, and the second flash intensity; wherein i is less than or equal to k.

[0018] In the above solution, the first image is acquired based on the first statistical brightness value, the first flash intensity and the reflection index.

[0019] and the ambient brightness when the second image is obtained, comprising:

[0020] The ambient brightness of the i-th area when the first image and the second image are captured is obtained according to the first statistical brightness value of the i-th area of ​​the first image, the first flash intensity, and the reflection index of the i-th area.

[0021] In the above scheme, the method further comprises:

[0022] Acquire a first exposure parameter for acquiring the first image and a second exposure parameter for acquiring the second image;

[0023] The acquiring, according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity, a reflection index when the first image and the second image are collected includes:

[0024] Determine a first value based on a ratio of the first statistical brightness value to the first exposure parameter and a ratio of the second statistical brightness value to the second exposure parameter;

[0025] Determining a second value based on the first flash light intensity and the second flash light intensity;

[0026] The reflection index when the first image and the second image are captured is determined based on the first value and the second value.

[0027] In the above solution, the step of acquiring the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity, and the reflection index includes:

[0028] The ambient brightness when the first image and the second image are captured is acquired based on the ratio of the first statistical brightness value to the first exposure parameter and the product of the first flash intensity and the reflection index.

[0029] In the above solution, the step of acquiring the first image and the second image captured when the flash is on includes:

[0030] A first image and a second image with different flash light intensities acquired continuously when the flash light is on are acquired.

[0031] In the above solution, the first flash intensity is within a first threshold range, and the second flash intensity is within a second threshold range; wherein the lower limit value of the first threshold range is greater than the upper limit value of the second threshold range.

[0032] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:

[0033] An acquisition module, used to acquire a first image and a second image captured when a flash is on, wherein a first flash intensity when the first image is captured is different from a second flash intensity when the second image is captured;

[0034] The acquisition module is used to acquire a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image;

[0035] A processing module is used to determine the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity and the second flash intensity.

[0036] In the above solution, the processing module includes:

[0037] A first processing unit, configured to obtain a reflection index when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity;

[0038] The second processing unit is used to obtain the environment brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity and the reflection index.

[0039] In the above solution, the acquisition module includes:

[0040] A division unit, used for dividing the first image into k regions; wherein k is a positive integer;

[0041] an acquiring unit, acquiring k first statistical brightness values ​​of the image brightness of the first image according to the image brightness of the first to k-th regions of the first image;

[0042] The division unit is used to divide the second image into k regions;

[0043] The acquisition unit is used to acquire k second statistical brightness values ​​of the image brightness of the second image according to the image brightness of the first to kth regions of the second image.

[0044] In the above scheme, the first processing unit is used to determine the reflection index of the i-th area of ​​the first image and the second image based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity and the second flash intensity; wherein i is less than or equal to k.

[0045] In the above solution, the processing module is used to obtain the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity and the ambient brightness.

[0046] In the above solution, the acquisition module is used to acquire a first exposure parameter for acquiring the first image and a second exposure parameter for acquiring the second image;

[0047] The first processing unit is configured to determine a first value based on a ratio of the first statistical brightness value to the first exposure parameter and a ratio of the second statistical brightness value to the second exposure parameter; and determine a second value based on the first flash intensity and the second flash intensity;

[0048] The second processing unit is used to determine the reflection index when the first image and the second image are captured based on the first value and the second value.

[0049] In the above scheme, the second processing module is used to obtain the ambient brightness when the first image and the second image are captured based on the ratio of the first statistical brightness value to the first exposure parameter and the product of the first flash intensity and the reflection index.

[0050] In the above solution, the acquisition module is used to acquire the first image and the second image with different flash intensities which are continuously collected when the flash is on.

[0051] In the above solution, the first flash intensity is within a first threshold range, and the second flash intensity is within a second threshold range; wherein the lower limit value of the first threshold range is greater than the upper limit value of the second threshold range.

[0052] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0053] processor;

[0054] a memory for storing processor-executable instructions;

[0055] The processor is configured to implement the image processing method described in any embodiment of the present disclosure when running the executable instructions.

[0056] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the image processing method described in any embodiment of the present disclosure.

[0057] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0058] The disclosed embodiments can be performed by acquiring a first image and a second image captured when a flash is on, wherein a first flash intensity when the first image is captured is different from a second flash intensity when the second image is captured; acquiring a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image; and determining the ambient brightness when the first image and the second image are captured based on the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity.

[0059] In this way, in the embodiment of the present disclosure, the brightness of the environment in which the electronic device was located when the two images were captured can be determined by using two images captured under different flash intensities; relative to the two images captured respectively with the flash turned on and off, it can be applicable to scenarios where the flash intensity changes continuously, for example, it can be applicable to the brightness of the environment in which images are captured in video mode or flashlight mode.

[0060] Furthermore, in the disclosed embodiment, images can be captured in the flash-on mode all the time, and there is no need to turn on and off the flash to capture images. This makes it easier for users to operate, improves user experience, and reduces the loss of electronic equipment caused by the flash switch.

[0061] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0063] Figure 1 is a schematic diagram of an image processing method according to an exemplary embodiment.

[0064] Figure 2 The figure is a flowchart of an image processing method according to an exemplary embodiment.

[0065] Figure 3 The figure is a flowchart of an image processing method according to an exemplary embodiment.

[0066] Figure 4 The diagram is a schematic diagram showing how a first image is divided into regions according to an exemplary embodiment.

[0067] Figure 5 is a schematic diagram showing a second image divided into regions according to an exemplary embodiment

[0068] Figure 6 The figure is a schematic diagram showing the reflection index of each area and the ambient brightness according to an exemplary embodiment.

[0069] Figure 7 is a schematic diagram of an image processing method according to an exemplary embodiment.

[0070] Figure 8 is a block diagram of an image processing apparatus according to an exemplary embodiment.

[0071] Fig. 9It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0072] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0073] like Figure 1 As shown, the present disclosure provides a flowchart of an image processing method, as shown in Figure 1 As shown, the method comprises the following steps:

[0074] S11: Acquire a first image and a second image captured when a flash is on, wherein a first flash intensity when the first image is captured is different from a second flash intensity when the second image is captured;

[0075] S12: Acquire a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image;

[0076] S13: Determine the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity.

[0077] The image processing method described in the embodiments of the present disclosure is applied to electronic devices; the electronic devices may be various types of mobile devices or fixed devices. For example, the electronic devices may be electronic devices such as mobile phones, computers, servers, tablet computers, televisions, multimedia devices, wearable bracelets or watches, etc. The electronic devices herein may also include devices such as camera modules or components; the electronic devices may be used for taking photos or recording videos, etc.

[0078] The flash light intensity here may be the current intensity or power intensity of the flash light, for example, the flash light intensity may be 100 mA or 600 W, etc. For example, the first flash light intensity is 100 mA, and the second flash light intensity is 110 mA.

[0079] Here, the first flash light intensity and the second flash light intensity are both not zero.

[0080] In some embodiments, the first flash intensity is within a first threshold range, and the second flash intensity is within a second threshold range; wherein a lower limit value of the first threshold range is greater than an upper limit value of the second threshold range.

[0081] For example, the first flash light intensity may be 100 mA to 200 mA, and the second flash light intensity may be 220 mA to 320 mA. For another example, the first flash light intensity may be 500 W to 600 W, and the second flash light intensity may be 650 W to 750 W, and so on.

[0082] The flash on here means that the flash is turned on and is always working.

[0083] In some embodiments, acquiring the first image and the second image captured when the flash is on includes:

[0084] A first image and a second image with different flash light intensities acquired continuously when the flash light is on are acquired.

[0085] Thus, in the embodiment of the present disclosure, the first image and the second image can be captured when the flash light changes continuously. Thus, the accuracy of the ambient brightness determined based on the first flash light intensity and the second flash light intensity can be improved.

[0086] Of course, in other embodiments, the first image and the second image acquired when the flash is on may also be acquired within a preset time interval when the flash is on. In this way, the accuracy of the ambient brightness determined based on the first flash intensity and the second flash intensity may also be improved.

[0087] The image brightness here is used to represent the brightness of the image; for example, the image brightness is represented by the color space RGB, and the image brightness can be RGB=(255, 254, 200) and the like.

[0088] The first statistical brightness value or the second statistical brightness value here may be a statistical value of the image brightness of each pixel in the image. For example, if the first image includes N pixels, then the first statistical brightness value is a statistical value of the image brightness of the N pixels.

[0089] The ambient brightness here is used to represent the brightness of the environment in which the electronic device is located. For example, the ambient brightness may refer to the luminous flux incident on a unit area in the environment in which the electronic device is located when capturing the image, such as 1 lux or a value between 0 and 255 in RGB.

[0090] An implementation of S11 is: the electronic device acquires the first image and the second image continuously captured in a flash-on mode; wherein the intensity of the flash for capturing the first image is different from the intensity of the flash for capturing the second image.

[0091] Of course, in other examples, an implementation of S11 may also be: the electronic device obtains multiple images continuously captured in the flash-on mode, and selects any two images with different flash intensities as the first image or the second image.

[0092] Thus, in the embodiment of the present disclosure, the ambient brightness can be calculated in the scene of continuous flash light changes. For example, the scene of continuous flash light changes can be a flashlight mode or a video recording mode.

[0093] Of course, in other examples, the first image and the second image acquired in the S11 may not be acquired continuously, as long as the flash light intensity used to acquire the first image and the second image is different.

[0094] In the embodiments of the present disclosure, the brightness of the environment in which the electronic device is located when the two images are captured can be determined by using two images captured under different flash intensities; compared with two images captured respectively with the flash turned on and off, it can be applicable to scenarios where the flash intensity changes continuously, for example, it can be applicable to the brightness of the environment in which images are captured in video mode or flashlight mode.

[0095] Furthermore, in the disclosed embodiment, images can be captured in the flash-on mode all the time, and there is no need to turn on and off the flash to capture images. This makes it easier for users to operate, improves user experience, and reduces the loss of electronic equipment caused by the flash switch.

[0096] Of course, in the embodiments of the present disclosure, the image acquisition method may also be applicable to scenarios of acquiring images with the flash on and with the flash off; for example, to acquire the first image in the flash-on mode and the second image in the flash-off mode, the second flash intensity in the above step S13 may be replaced by 0.

[0097] like Figure 2 As shown, in some embodiments, step S13 includes:

[0098] Step S131: acquiring a reflection index when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity;

[0099] Step S132: acquiring the environment brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity, and the reflection index.

[0100] The reflectance index herein is used to indicate the ratio of incident light or reflected light of an object in the image when the image is acquired.

[0101] In the embodiments of the present disclosure, the two images captured under different flash intensities can be used to determine the position of the electronic device when the two images are captured; compared with the two images captured by turning on the flash and turning off the flash respectively, it can be applicable to the scenario where the flash intensity changes continuously, for example, it can be applicable to the reflection index of the image captured in the video mode or the flashlight mode.

[0102] Furthermore, in the disclosed embodiment, images can be captured in the flash-on mode all the time, and there is no need to turn on and off the flash to capture images. This makes it easier for users to operate, improves user experience, and reduces the loss of electronic equipment caused by the flash switch.

[0103] In some embodiments, the method further comprises:

[0104] Acquire a first exposure parameter for acquiring the first image and a second exposure parameter for acquiring the second image;

[0105] The S131 includes:

[0106] Determine a first value based on a ratio of the first statistical brightness value to the first exposure parameter and a ratio of the second statistical brightness value to the second exposure parameter;

[0107] Determining a second value based on the first flash light intensity and the second flash light intensity;

[0108] The reflection index when the first image and the second image are captured is determined based on the first value and the second value.

[0109] The exposure parameter here can be used to indicate the exposure time; for example, the first exposure parameter is 0.01 seconds, and the second exposure parameter is 0.02 seconds. Of course, in other embodiments, the exposure parameter can also be used to identify parameters such as the sensitivity or aperture value of the exposure.

[0110] In some embodiments, the first exposure parameter is different from the second exposure parameter. In other embodiments, the first exposure parameter is different from the second exposure parameter.

[0111] In one embodiment, the first numerical value is determined based on the ratio of the first statistical brightness value to the first exposure parameter and the ratio of the second statistical brightness value to the second exposure parameter as follows: the first numerical value is determined based on the difference between the ratio of the first statistical brightness value to the first exposure parameter and the ratio of the second statistical brightness value to the second exposure parameter.

[0112] In one embodiment, determining the second value based on the first flash light intensity and the second flash light intensity includes: determining the second value based on a difference between the first flash light intensity and the second flash light intensity.

[0113] In one embodiment, determining the reflection index when the first image and the second image are captured based on the first value and the second value is: determining the reflection index when the first image and the second image are captured based on the ratio of the first value and the second value.

[0114] In some embodiments, the calculation formula for implementing step S131 is:

[0115] Wherein, L1 is the first statistical brightness value, L2 is the second statistical brightness value; E1 is the first exposure parameter, E2 is the second exposure parameter; C1 is the first flash intensity, C2 is the second flash intensity; and R is the reflection index.

[0116] In some embodiments, the step S132 includes:

[0117] The ambient brightness when the first image and the second image are captured is acquired based on the ratio of the first statistical brightness value to the first exposure parameter and the product of the first flash intensity and the reflection index.

[0118] In one embodiment, determining the ambient brightness when the first image and the second image are captured by multiplying the ratio of the first statistical brightness value to the first exposure parameter and the first flash intensity by the reflection index comprises:

[0119] Determining a third value based on a ratio of the first statistical brightness value to the first exposure parameter;

[0120] determining a fourth value based on the product of the first flash light intensity and the emission index;

[0121] Based on the difference between the third value and the fourth value, the ambient brightness when the first image and the second image are captured is obtained.

[0122] In some embodiments, the calculation formula for implementing step S132 is:

[0123] Wherein, L1 is the first statistical brightness value; E1 is the first exposure parameter; C1 is the first flash intensity; and I is the ambient brightness.

[0124] In some other embodiments, the step S132 includes:

[0125] The ambient brightness when the first image and the second image are captured is obtained based on the ratio of the second statistical brightness value to the second exposure parameter and the product of the second flash intensity and the ambient brightness.

[0126] For example, the calculation formula for implementing step S132 is:

[0127] Wherein, L2 is the second statistical brightness value; E2 is the second exposure parameter; C2 is the second flash intensity; and R is the ambient brightness.

[0128] In the embodiments of the present disclosure, since the first image and the second image may be captured under a continuously changing flash intensity; or although the first image and the second image are not captured continuously, the time for capturing the first image and the time for capturing the second image are within a preset time range, the environment in which the electronic device that captures the first image and the second image is located does not change much; in this way, the current ambient brightness can also be obtained based on the second statistical brightness value of the second image, the second exposure parameter, the second flash intensity and the reflection index.

[0129] In this way, in the embodiment of the present disclosure, the reflection index and / or ambient brightness when the first image and the second image are captured can be obtained based on the first statistical brightness value, the first flash intensity and the first exposure parameter of the first image, and the second statistical brightness value, the second flash intensity and the second exposure parameter of the second image, and the calculation method is simple and easy to implement.

[0130] In other embodiments, the reflection index and / or the ambient brightness of the environment in which the electronic device is located when the third image and the fourth image are collected can also be determined by collecting the third image when the flash is turned on and collecting the fourth image when the flash is turned off. For example, since the intensity of the fourth flash when collecting the fourth image is 0, the formula for the reflection index of the first image and the second image can be simplified to: To obtain the reflection index of the third image and the fourth image; wherein L3' is the third statistical brightness value when the third image is collected, C3' is the third flash intensity when the third image is collected, E3' is the third exposure parameter when the third image is collected, and R' is the reflection index when the third image and the fourth image are collected. The ambient brightness of the third image and the fourth image can be obtained from the ambient brightness of the first image and the second image as follows: Wherein, I' is the ambient brightness when the third image and the fourth image are captured.

[0131] like Figure 3 As shown, in some embodiments, the step S12 includes:

[0132] Step S1211: Divide the first image into k regions; wherein k is a positive integer;

[0133] Step S1212: acquiring k first statistical brightness values ​​of the image brightness of the first image according to the image brightness of the 1st to kth regions of the first image;

[0134] Step S1213: Divide the second image into k regions;

[0135] Step S1214: acquiring k second statistical brightness values ​​of the image brightness of the second image according to the image brightness of the 1st to kth regions of the second image.

[0136] In some embodiments, the electronic device divides the first image into k regions, for example, into k=M×N regions, and encodes each region as an identification number, and the k regions are the 1st region, the 2nd region, ... the k-1th region, and the kth region; correspondingly, the second image is divided into k regions, for example, into k=M×N regions, and each region is encoded as an identification number, and the k regions are the 1st region, the 2nd region, ... the k-1th region, and the kth region. Here, in the 1st to the kth regions, each region may have the same area or different areas; it only needs to satisfy that the i-th region in the first image and the i-th region in the second image have the same position and the same area. The i-th region here is any region from the 1st to the kth regions.

[0137] In the above embodiment, after the electronic device divides the first image and the second image into k regions, the image brightness of each region in the first image is calculated to obtain k first statistical brightness values; and the image brightness of each region in the second image is calculated to obtain k second statistical brightness values. For example, if the number of pixels in the first region is 10×10, the first statistical brightness value of the 10×10 pixels is obtained, and if the number of pixels in the first region is 15×10, the first statistical brightness value of the 15×10 pixels is obtained.

[0138] For example Figure 4 As shown, the first image is divided into 5×5 regions; wherein the first statistical brightness values ​​of the 5×5 regions are respectively: L1 00 ,……,L1 04 、L1 10 ,……,L1 14 、L1 20 ,……,L1 24 、L1 30 ,……,L1 34 、L1 40 ,……,L1 44 .

[0139] As well as Figure 5 As shown, the second image is divided into 5×5 regions; wherein the second statistical brightness values ​​of the 5×5 regions are respectively: L2 00 , ..., L2 04 、L2 10 , ..., L2 14 、L2 20 , ..., L2 24 、L2 30 , ..., L2 34 、L2 40 , ..., L2 44 .

[0140] Thus, in the embodiment of the present disclosure, the first image and the second image may be divided into k regions, and the first statistical brightness value and the second statistical brightness value may be calculated, thereby reducing the amount of computation required to calculate the ambient brightness and the reflection index.

[0141] Please see again Figure 3 In some embodiments, the step S131 includes:

[0142] Step S1311: Determine the reflection index of the i-th area of ​​the first image and the second image based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity, and the second flash intensity; wherein i is less than or equal to k.

[0143] The i-th region here is any one of the k regions; or, the i-th region here is any multiple of the k regions.

[0144] In some embodiments, the i-th region is a region including the target object in the first image and the second image. For example, if the first image and the second image are regions where fruits on the table are collected, then the i-th region is a region of fruits.

[0145] One way to implement step S1311 is:

[0146] Determine a first value of the i-th region based on a ratio of a first statistical brightness value of the i-th region of the first image to the first exposure parameter and a ratio of a second statistical brightness value of the i-th region of the second image to the second exposure parameter;

[0147] Determine a second value of the i-th area based on the first flash light intensity and the second flash light intensity;

[0148] Based on a first value of an i-th region and a second value of an i-th region, the reflection index of the i-th region where the first image and the second image are captured is determined.

[0149] In some embodiments, the calculation formula for implementing step S1311 is:

[0150] Among them, the L1 i is the first statistical brightness value of the i-th region of the first image, and L2 i is the second statistical brightness value of the i-th area of ​​the second image; E1 is the first exposure parameter, E2 is the second exposure parameter; C1 is the first flash intensity, C2 is the second flash intensity; R i is the reflection index of the ith region.

[0151] In this way, in the embodiment of the present disclosure, the reflection index of each area can be collected separately.

[0152] Please see again Figure 3 In some embodiments, the step S132 includes:

[0153] Step S1321: Obtain the ambient brightness of the i-th area when the first image and the second image are captured according to the first statistical brightness value of the i-th area of ​​the first image, the first flash intensity, and the reflection index of the i-th area.

[0154] One way to implement step S1321 is:

[0155] determining a third value of the i-th region based on a ratio of a first statistical brightness value of the i-th region of the first image to the first exposure parameter;

[0156] determining a fourth value of the i-th area based on a product of the first flash intensity and the reflection index;

[0157] Based on the difference between the third value of the i-th area and the fourth value of the i-th area, the ambient brightness of the i-th area where the first image and the second image are captured is obtained.

[0158] In some embodiments, the calculation formula for implementing step S132 is:

[0159] Among them, the L1 i is the first statistical brightness value of the i-th region of the first image; E1 is the first exposure parameter; C1 is the first flash intensity; I i is the ambient brightness of the ith area.

[0160] Of course, in other embodiments, the step S132 may be:

[0161] According to the first statistical brightness value of the i-th region of the second image, the second flash intensity, and the reflection index of the i-th region, the ambient brightness of the i-th region when the first image and the second image are collected is obtained. For example, the formula for implementing the step S132 is: Among them, the L2 i is the second statistical brightness value of the i-th area of ​​the second image; E2 is the second exposure parameter; C2 is the second flash intensity; I i is the ambient brightness of the ith area.

[0162] For example, Figure 6 As shown, if the first image and the second image are divided into 5×5 areas; through the first statistical brightness value, the second statistical brightness value, the first flash intensity, the second flash intensity, the first exposure parameter and the second exposure parameter of the 5×5 areas, the reflectance index of the 5×5 areas is calculated as follows: R 00 ,……,R 04 , R 10 ,……,R 14 , R 20 ,……,R 24 , R 30 ,……,R 34 , R 40 ,……,R 44The first statistical brightness value of the 5×5 area, the first flash intensity, the first exposure parameter and the reflection index of the 5×5 area are calculated to calculate the reflection index of the 5×5 area: I 00 ,……,I 04 ,I 10 ,……,I 14 ,I 20 ,……,I 24 ,I 30 ,……,I 34 ,I 40 ,……,I 44 .

[0163] Thus, in the disclosed embodiment, the reflection index and / or ambient brightness of the i-th region can be determined based on the first statistical brightness value of the i-th region of the first image or the statistical brightness value of the i-th region of the second image. On the one hand, the amount of calculation can be reduced, and on the other hand, targeted calculations can be performed on each region in the first image or the second image, for example, the region includes a target object, thereby achieving the determination of the ambient brightness and reflection index of multiple target objects, thereby improving the accuracy of image acquisition of multiple target objects.

[0164] A specific example is provided below in combination with any of the above embodiments:

[0165] Figure 7 A method for image processing is provided, the method comprising the following steps:

[0166] Step S21: acquiring a first flash intensity and a first exposure parameter for capturing a first image, and a second flash intensity and a second exposure parameter for capturing a second image;

[0167] In an optional embodiment, the electronic device acquires a first image and a second image when the flash intensity changes; and acquires a first flash intensity and a first exposure parameter when the first image is acquired, and acquires a second flash intensity and a second exposure parameter when the second image is acquired.

[0168] Here, both the first flash light intensity and the second flash light intensity are not 0.

[0169] Step S22: Divide the first image and the second image into k regions respectively; and calculate the first statistical brightness values ​​of the first to k-th regions of the first image and the second statistical brightness values ​​of the first to k-th regions of the second image;

[0170] In an optional embodiment, the electronic device divides the first image into k regions, and obtains k first statistical brightness values ​​of the 1st to kth regions of the first image; and divides the second image into k regions, and obtains k second statistical brightness values ​​of the 1st to kth regions of the second image.

[0171] For example, Figure 4 The first statistical brightness value of the 5×5 area shown: L1 00 ,……,L1 04 、L1 10 ,……,L1 14 、L1 20 ,……,L1 24 、L1 30 ,……,L1 34 、L1 40 ,……,L1 44 Or, if Figure 5 The second statistical brightness value of the 5×5 area shown: L2 00 , ..., L2 04 、L2 10 , ..., L2 14 、L2 20 , ..., L2 24 、L2 30 , ..., L2 34 、L2 40 , ..., L2 44 .

[0172] Step S23: Calculate the reflection index and the ambient brightness of the k regions based on the first statistical brightness values ​​and the second statistical brightness values ​​of the k regions.

[0173] In an optional embodiment, the electronic device determines the reflection index of the i-th area for capturing the first image and the second image based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity, the second flash intensity, the first exposure parameter and the second exposure parameter; the electronic device determines the ambient brightness of the i-th area for capturing the first image and the second image based on the first statistical brightness value of the i-th area of ​​the first image, the first flash intensity, the first exposure parameter and the reflection index of the i-th area.

[0174] In the embodiments of the present disclosure, the brightness of the environment in which the electronic device is located when the two images are captured can be determined by using two images captured under different flash intensities; compared with two images captured respectively with the flash turned on and off, it can be applicable to scenarios where the flash intensity changes continuously, for example, it can be applicable to the brightness of the environment in which images are captured in video mode or flashlight mode.

[0175] Furthermore, since images can be captured in the flash-on mode all the time, there is no need to turn on and off the flash to capture images, which makes it easier for users to operate, improves the user experience, and reduces the loss of electronic equipment caused by the flash switch.

[0176] Furthermore, the disclosed embodiment can statistically calculate the first statistical brightness value and the second statistical brightness value by region, and determine the reflection index and the ambient brightness of each region based on the first statistical brightness value and the second statistical brightness value of each region. This can reduce the amount of calculation on the one hand, and determine the corresponding ambient brightness and reflection index for each region including multiple target objects on the other hand, thereby improving the accuracy of image acquisition of multiple target objects.

[0177] Figure 8 An exemplary embodiment is provided showing an image processing device, such as Figure 8 As shown, the device comprises:

[0178] An acquisition module 41 is used to acquire a first image and a second image captured when a flash is turned on, wherein a first flash intensity when the first image is captured is different from a second flash intensity when the second image is captured;

[0179] The acquisition module 41 is used to acquire a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image;

[0180] The processing module 42 is used to determine the environment brightness when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity.

[0181] In some embodiments, the acquisition module 41 is used to acquire a first image and a second image with different flash intensities that are continuously captured when the flash is on.

[0182] In some embodiments, the first flash intensity is within a first threshold range, and the second flash intensity is within a second threshold range; wherein a lower limit value of the first threshold range is greater than an upper limit value of the second threshold range.

[0183] In some embodiments, the processing module 42 includes:

[0184] A first processing unit 421 is used to obtain a reflection index when the first image and the second image are collected according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity;

[0185] The second processing unit 422 is used to obtain the environment brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity, and the reflection index.

[0186] In some embodiments, the acquisition module 41 includes:

[0187] A division unit 411 is used to divide the first image into k regions; wherein k is a positive integer;

[0188] An acquiring unit 412 acquires k first statistical brightness values ​​of the image brightness of the first image according to the image brightness of the first to k-th regions of the first image;

[0189] The division unit 411 is used to divide the second image into k regions;

[0190] The acquisition unit 412 is used to acquire k second statistical brightness values ​​of the image brightness of the second image according to the image brightness of the first to kth regions of the second image.

[0191] In some embodiments, the first processing unit 421 is used to determine the reflection index of the i-th area of ​​the first image and the second image based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity, and the second flash intensity; wherein i is less than or equal to k.

[0192] In some embodiments, the apparatus further comprises:

[0193] The processing module 42 is used to obtain the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity, and the ambient brightness.

[0194] In some embodiments, the acquisition module 41 is used to acquire a first exposure parameter for acquiring the first image and a second exposure parameter for acquiring the second image;

[0195] The first processing unit 421 is configured to determine a first value based on a ratio of the first statistical brightness value to the first exposure parameter and a ratio of the second statistical brightness value to the second exposure parameter; and determine a second value based on the first flash intensity and the second flash intensity;

[0196] The second processing unit 422 is used to determine the reflection index when the first image and the second image are captured based on the first value and the second value.

[0197] In some embodiments, the second processing module 422 is used to obtain the ambient brightness when the first image and the second image are captured based on the ratio of the first statistical brightness value to the first exposure parameter and the product of the first flash intensity and the reflection index.

[0198] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0199] An embodiment of the present disclosure further provides a server, characterized in that it includes:

[0200] processor;

[0201] a memory for storing processor-executable instructions;

[0202] The processor is configured to implement the image processing method described in any embodiment of the present disclosure when running the executable instructions.

[0203] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to memorize information stored thereon after the communication device loses power.

[0204] The processor may be connected to the memory through a bus or the like, and is used to read the executable program stored in the memory, for example, to implement the following Figures 2 to 3 , Figure 7 At least one of the methods shown.

[0205] The embodiments of the present disclosure further provide a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the image processing method described in any embodiment of the present disclosure. Figures 2 to 3 , Figure 7 At least one of the methods shown.

[0206] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0207] Fig. 9 8 is a block diagram of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0208] Reference Fig. 9, the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0209] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0210] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0211] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0212] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0213] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0214] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0215] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0216] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0217] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0218] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0219] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0220] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: include: Acquire a first image and a second image captured when a flash is on, wherein a first flash intensity when the first image is captured is different from a second flash intensity when the second image is captured; Acquire a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image; Acquire a first exposure parameter for acquiring the first image and a second exposure parameter for acquiring the second image; The environment brightness when the first image and the second image are collected is determined according to the first statistical brightness value, the second statistical brightness value, the first flash light intensity, and the second flash light intensity; wherein, the determination of the environment brightness when the first image and the second image are collected according to the first statistical brightness value, the second statistical brightness value, the first flash light intensity, and the second flash light intensity includes: obtaining the reflection index when the first image and the second image are collected according to the first statistical brightness value, the second statistical brightness value, the first flash light intensity, and the second flash light intensity; obtaining the environment brightness when the first image and the second image are collected according to the first statistical brightness value, the first flash light intensity, and the reflection index; wherein, the determination of the environment brightness when the first image and the second image are collected according to the first statistical brightness value, the second statistical brightness value, the first flash light intensity, and the reflection index The method comprises: determining a first value based on a ratio of the first statistical brightness value to the first exposure parameter and a ratio of the second statistical brightness value to the second exposure parameter; determining a second value based on the first flash intensity and the second flash intensity; determining the reflection index when the first image and the second image are collected based on the first value and the second value; and obtaining the ambient brightness when the first image and the second image are collected according to the first statistical brightness value, the first flash intensity and the reflection index, comprising: obtaining the ambient brightness when the first image and the second image are collected based on the ratio of the first statistical brightness value to the first exposure parameter and the product of the first flash intensity and the reflection index.

2. The method according to claim 1, characterized in that The acquiring a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image includes: Divide the first image into k regions; wherein k is a positive integer; Acquire k first statistical brightness values ​​of the image brightness of the first image according to the image brightness of the 1st to kth regions of the first image; and dividing the second image into k regions; According to the image brightness of the 1st to kth regions of the second image, k second statistical brightness values ​​of the image brightness of the second image are obtained.

3. The method according to claim 2, characterized in that The acquiring, according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity, a reflection index when the first image and the second image are collected includes: The reflection index of the i-th area of ​​the first image and the second image is determined based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity, and the second flash intensity; wherein i is less than or equal to k.

4. The method according to claim 3, characterized in that The acquiring the environment brightness when the first image and the second image are captured according to the first statistical brightness value, the first flash intensity, and the reflection index includes: The ambient brightness of the i-th area when the first image and the second image are captured is obtained according to the first statistical brightness value of the i-th area of ​​the first image, the first flash intensity, and the reflection index of the i-th area.

5. The method according to any one of claims 1 to 4, characterized in that: The step of acquiring the first image and the second image captured when the flash is on includes: A first image and a second image with different flash light intensities acquired continuously when the flash light is on are acquired.

6. The method according to any one of claims 1 to 4, characterized in that: The first flash intensity is within a first threshold range, and the second flash intensity is within a second threshold range; wherein a lower limit value of the first threshold range is greater than an upper limit value of the second threshold range.

7. An image processing device, characterized in that: include: An acquisition module, used for acquiring a first image and a second image when a flash is on, wherein a first flash intensity when acquiring the first image is different from a second flash intensity when acquiring the second image; The acquisition module is used to acquire a first statistical brightness value of the image brightness of the first image and a second statistical brightness value of the image brightness of the second image; The acquisition module is further used to acquire a first exposure parameter for acquiring the first image and a second exposure parameter for acquiring the second image; a processing module, configured to determine the ambient brightness when the first image and the second image are captured according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity; wherein the processing module comprises: a first processing unit, configured to obtain a reflection index when the first image and the second image are collected according to the first statistical brightness value, the second statistical brightness value, the first flash intensity, and the second flash intensity; wherein the first processing unit is specifically configured to determine a first value based on a ratio of the first statistical brightness value to the first exposure parameter and a ratio of the second statistical brightness value to the second exposure parameter; determine a second value based on the first flash intensity and the second flash intensity; and determine the reflection index when the first image and the second image are collected based on the first value and the second value; A second processing unit is used to obtain the ambient brightness when the first image and the second image are captured based on the first statistical brightness value, the first flash intensity and the reflection index; wherein the second processing unit is specifically used to obtain the ambient brightness when the first image and the second image are captured based on the ratio of the first statistical brightness value to the first exposure parameter and the product of the first flash intensity and the reflection index.

8. The device according to claim 7, characterized in that The acquisition module comprises: A division unit, used for dividing the first image into k regions; wherein k is a positive integer; an acquiring unit, acquiring k first statistical brightness values ​​of the image brightness of the first image according to the image brightness of the first to k-th regions of the first image; The division unit is used to divide the second image into k regions; The acquisition unit is used to acquire k second statistical brightness values ​​of the image brightness of the second image according to the image brightness of the first to kth regions of the second image.

9. The device according to claim 8, characterized in that The first processing unit is used to determine the reflection index of the i-th area of ​​the first image and the second image based on the first statistical brightness value of the i-th area of ​​the first image, the second statistical brightness value of the i-th area of ​​the second image, the first flash intensity and the second flash intensity; wherein i is less than or equal to k.

10. The device according to claim 9, characterized in that The second processing unit is used to obtain the ambient brightness of the i-th area when the first image and the second image are captured based on the first statistical brightness value of the i-th area of ​​the first image, the first flash intensity, and the reflection index of the i-th area.

11. The device according to any one of claims 7 to 10, characterized in that The acquisition module is used to acquire the first image and the second image with different flash intensities which are continuously collected when the flash is on.

12. The device according to any one of claims 7 to 10, characterized in that The first flash intensity is within a first threshold range, and the second flash intensity is within a second threshold range; wherein a lower limit value of the first threshold range is greater than an upper limit value of the second threshold range.

13. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: implement the image processing method according to any one of claims 1 to 6 when running the executable instructions.

14. A computer-readable storage medium, characterized in that: The readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the image processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image scene brightness difference judgment device and brightness difference judgment method

    CN102196153A

  • Image capture method and relative image capture system

    CN103297675A

  • Flash lamp brightness adjustment method and terminal

    CN108156391A

  • Ambient brightness value obtaining method and device

    CN109803051A

  • Calculation method for the correction of white balance

    US20090231463A1