CN110868549B - Exposure control method and device and electronic equipment - Google Patents
Exposure control method and device and electronic equipment Download PDFInfo
- Publication number
- CN110868549B CN110868549B CN201810989820.6A CN201810989820A CN110868549B CN 110868549 B CN110868549 B CN 110868549B CN 201810989820 A CN201810989820 A CN 201810989820A CN 110868549 B CN110868549 B CN 110868549B
- Authority
- CN
- China
- Prior art keywords
- brightness
- target
- scene image
- image
- interval
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004891 communication Methods 0.000 claims description 19
- 230000008569 process Effects 0.000 claims description 16
- 238000003384 imaging method Methods 0.000 claims description 13
- 238000012163 sequencing technique Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 230000001105 regulatory effect Effects 0.000 claims description 4
- 235000019557 luminance Nutrition 0.000 description 70
- 230000000694 effects Effects 0.000 description 9
- 238000012806 monitoring device Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/73—Circuitry for compensating brightness variation in the scene by influencing the exposure time
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/76—Circuitry for compensating brightness variation in the scene by influencing the image signals
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
The embodiment of the invention provides an exposure control method, an exposure control device and electronic equipment, wherein the method comprises the following steps: acquiring a target scene image to be exposed; determining target brightness corresponding to an image dark region of a target scene image, wherein the target brightness is brightness corresponding to the number of target pixels, and the number of the target pixels is the maximum number of pixels in the image dark region and the number of pixels corresponding to each brightness; determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval; determining a second average brightness based on the determined brightness interval, wherein the second average brightness is the average brightness of the target scene image after the target scene image is exposed; and adjusting the brightness of the image dark area until the average brightness of the target scene image is the second average brightness, and completing the exposure of the target scene image. By the technical scheme provided by the embodiment of the invention, the scene adaptability of image exposure can be enhanced.
Description
Technical Field
The present invention relates to the field of automatic exposure technology for cameras, and in particular, to an exposure control method and apparatus, and an electronic device.
Background
With the continuous development of science and technology, more and more electronic devices have a photographing function, for example, devices such as smart phones and intelligent monitoring devices can photograph.
At present, in order to ensure the exposure effect of a shot photo, when an electronic device exposes an image, the average brightness of the image is usually controlled to be within a specific brightness interval, and the specific brightness interval is usually fixed.
The image exposure method has poor scene adaptability, and particularly, in some scenes, the effect of pictures taken by electronic equipment is poor.
For example, as shown in FIG. 1, for a high contrast scene, there are both bright and dark areas in the scene. When the camera shoots a window (highlight area in the scene), the average brightness of the scene image is higher than a specific brightness interval because the brightness of the highlight area in the scene is high. When the electronic device is exposed, the average brightness of the scene image needs to be reduced to control the average brightness of the captured scene image in the specific brightness interval, so that the image brightness of the dark area (indoor) of the captured scene image is too low, and the details in the indoor are not clear.
Disclosure of Invention
An embodiment of the invention provides an exposure control method, an exposure control device and an electronic device, so as to enhance scene adaptability of image exposure. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides an exposure control method, where the method includes:
acquiring a target scene image to be exposed;
determining target brightness corresponding to an image dark area of the target scene image, wherein the image dark area is an area in which the brightness of each pixel point is smaller than a first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of target pixel points, and the number of the target pixel points is the largest number of the pixel points in the image dark area and corresponding to each brightness;
determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval;
determining a second average luminance based on the determined luminance section;
adjusting the brightness of the image dark area until the average brightness of the target scene image is the second average brightness, and completing exposure of the target scene image;
and the second average brightness is the average brightness of the target scene image after the target scene image is exposed.
Optionally, before the step of determining the brightness interval corresponding to the target scene image based on the size relationship between the target brightness and the endpoint value of the preset brightness interval, the method further includes:
judging whether the target brightness meets a preset brightness interval determination condition or not;
the step of determining the brightness interval corresponding to the target scene image based on the size relationship between the target brightness and the endpoint value of the preset brightness interval includes:
and when the target brightness is judged to accord with a preset brightness interval determination condition, determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval.
Optionally, the step of judging whether the target brightness meets a preset brightness interval determination condition includes:
determining first brightness corresponding to an image dark area of at least one frame of scene image, wherein the at least one frame of scene image is a previous frame of scene image of the target scene image, or N consecutive frames of scene images in front of the target scene image, the first brightness corresponding to the image dark area of any frame of scene image is brightness corresponding to the number of first pixels, and the number of the first pixels is the maximum number of pixels in the number of pixels corresponding to each brightness in the image dark area of the frame of scene image;
judging the size relation between the target brightness and the endpoint value of a preset brightness interval to obtain a first judgment result; judging the magnitude relation between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result;
judging whether the first judgment result is consistent with each obtained second judgment result;
if so, judging that the target brightness meets a preset brightness interval determination condition.
Optionally, the determining process of the first brightness corresponding to the image dark area of any frame of scene image includes:
counting a first number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of a frame of scene image;
sequencing a plurality of first numbers obtained by statistics according to the sizes of the brightness of the image dark areas of the target scene image;
after sorting, for each first quantity, summing a plurality of continuous first quantities including the first quantity, and determining a summation result as the quantity of pixel points of the brightness corresponding to the first quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the first brightness corresponding to the image dark area of the frame of scene image.
Optionally, the step of determining a size relationship between the target brightness and an endpoint value of a preset brightness interval to obtain a first determination result includes:
when the target brightness is smaller than the left endpoint value of the preset brightness interval, determining that the target brightness is smaller than the left endpoint value as a first judgment result; when the target brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining that the target brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a first judgment result; when the target brightness is larger than a right end point value of a preset brightness interval, determining that the target brightness is larger than the right end point value as a first judgment result;
correspondingly, the step of judging the size relationship between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result includes:
for each brightness in the first brightness, when the first brightness is smaller than a left end point value of a preset brightness interval, determining that the first brightness is smaller than the left end point value as a second judgment result; when the first brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining the first brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a second judgment result; and when the first brightness is larger than the right endpoint value of the preset brightness interval, determining that the first brightness is larger than the right endpoint value as a second judgment result.
Optionally, the step of judging whether the target brightness meets a preset brightness interval determination condition includes:
judging whether the number of pixel points corresponding to the target brightness is larger than a preset number or not;
if so, judging that the target brightness meets a preset brightness interval determination condition.
Optionally, the step of acquiring an image of a target scene to be exposed includes:
in the process of imaging a scene, when at least two continuous frames of scene images obtained by imaging meet image acquisition conditions, determining the last frame of scene image in the at least two continuous frames of scene images as a target scene image to be exposed;
wherein the image acquisition conditions are: and the absolute value of the difference between the average brightness of the adjacent scene images is smaller than the preset brightness threshold value.
Optionally, the step of determining the brightness interval corresponding to the target scene image based on the size relationship between the target brightness and the endpoint value of the preset brightness interval includes:
when the target brightness is smaller than the left end point value of a preset brightness interval, increasing the left end point value and/or the right end point value of the preset brightness interval, and taking the adjusted brightness interval as a brightness interval corresponding to the target scene image;
when the target brightness is larger than the right end point value of a preset brightness interval, reducing the left end point value and/or the right end point value of the preset brightness interval, and taking the regulated brightness interval as a brightness interval corresponding to the target scene image;
and when the target brightness is greater than a left end point value of a preset brightness interval and less than a right end point value of the preset brightness interval, taking the preset brightness interval as a brightness interval corresponding to the target scene image.
Optionally, the step of determining the target brightness of the image dark area of the target scene image includes:
counting a second number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of the target scene image;
sequencing a plurality of second quantities obtained by statistics according to the brightness of each image dark area of the target scene image;
after sorting, for each second quantity, summing a plurality of continuous second quantities including the second quantity, and determining the summation result as the number of pixels with brightness corresponding to the second quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the target brightness of the image dark area of the target scene image.
Optionally, the step of determining a second average luminance based on the determined luminance interval includes:
calculating an average value of the left end point value and the right end point value of the determined brightness interval;
the calculated average value is determined as the second average luminance.
In a second aspect, an embodiment of the present invention provides an exposure control apparatus, including:
the scene image acquisition module is used for acquiring a target scene image to be exposed;
the target brightness determining module is used for determining target brightness corresponding to an image dark area of the target scene image, wherein the image dark area is an area in which the brightness of each pixel point is smaller than a first average brightness of the target scene image, the target brightness is brightness corresponding to the number of target pixel points, and the number of the target pixel points is the largest number of pixel points in the image dark area in the number of pixel points corresponding to each brightness;
the brightness interval determining module is used for determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval;
an average brightness determination module for determining a second average brightness based on the determined brightness interval;
the dark area brightness adjusting module is used for adjusting the brightness of the image dark area until the average brightness of the target scene image is the second average brightness, and completing exposure of the target scene image;
and the second average brightness is the average brightness of the target scene image after the target scene image is exposed.
Optionally, the apparatus further comprises:
the condition judgment module is used for judging whether the target brightness meets a preset brightness interval determination condition or not before the bright area interval determination module determines the brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval;
correspondingly, the luminance interval determining module is specifically configured to:
and when the target brightness is judged to accord with a preset brightness interval determination condition, determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval.
Optionally, the condition determining module is specifically configured to:
determining first brightness corresponding to an image dark area of at least one frame of scene image, wherein the at least one frame of scene image is a previous frame of scene image of the target scene image, or N consecutive frames of scene images in front of the target scene image, the first brightness corresponding to the image dark area of any frame of scene image is brightness corresponding to the number of first pixels, and the number of the first pixels is the maximum number of pixels in the number of pixels corresponding to each brightness in the image dark area of the frame of scene image;
judging the size relation between the target brightness and the endpoint value of a preset brightness interval to obtain a first judgment result; judging the magnitude relation between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result;
judging whether the first judgment result is consistent with each obtained second judgment result;
if so, judging that the target brightness meets a preset brightness interval determination condition.
Optionally, the determining process of the first brightness corresponding to the image dark area of any frame of scene image includes:
counting a first number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of a frame of scene image;
sequencing a plurality of first numbers obtained by statistics according to the sizes of the brightness of the image dark areas of the target scene image;
after sorting, for each first quantity, summing a plurality of continuous first quantities including the first quantity, and determining a summation result as the quantity of pixel points of the brightness corresponding to the first quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the first brightness corresponding to the image dark area of the frame of scene image.
Optionally, the condition determining module is specifically configured to:
when the target brightness is smaller than the left endpoint value of the preset brightness interval, determining that the target brightness is smaller than the left endpoint value as a first judgment result; when the target brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining that the target brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a first judgment result; when the target brightness is larger than a right end point value of a preset brightness interval, determining that the target brightness is larger than the right end point value as a first judgment result;
for each brightness in the first brightness, when the first brightness is smaller than a left end point value of a preset brightness interval, determining that the first brightness is smaller than the left end point value as a second judgment result; when the first brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining the first brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a second judgment result; and when the first brightness is larger than the right endpoint value of the preset brightness interval, determining that the first brightness is larger than the right endpoint value as a second judgment result.
Optionally, the condition determining module is specifically configured to:
judging whether the number of pixel points corresponding to the target brightness is larger than a preset number or not;
if so, judging that the target brightness meets a preset brightness interval determination condition.
Optionally, the scene image obtaining module is specifically configured to:
in the process of imaging a scene, when at least two continuous frames of scene images obtained by imaging meet image acquisition conditions, determining the last frame of scene image in the at least two continuous frames of scene images as a target scene image to be exposed;
wherein the image acquisition conditions are: and the absolute value of the difference between the average brightness of the adjacent scene images is smaller than the preset brightness threshold value.
Optionally, the brightness interval determining module is specifically configured to:
when the target brightness is smaller than the left end point value of a preset brightness interval, increasing the left end point value and/or the right end point value of the preset brightness interval, and taking the adjusted brightness interval as a brightness interval corresponding to the target scene image;
when the target brightness is larger than the right end point value of a preset brightness interval, reducing the left end point value and/or the right end point value of the preset brightness interval, and taking the regulated brightness interval as a brightness interval corresponding to the target scene image;
and when the target brightness is greater than a left end point value of a preset brightness interval and less than a right end point value of the preset brightness interval, taking the preset brightness interval as a brightness interval corresponding to the target scene image.
Optionally, the target brightness determining module is specifically configured to:
counting a second number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of the target scene image;
sequencing a plurality of second quantities obtained by statistics according to the brightness of each image dark area of the target scene image;
after sorting, for each second quantity, summing a plurality of continuous second quantities including the second quantity, and determining the summation result as the number of pixels with brightness corresponding to the second quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the target brightness of the image dark area of the target scene image.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and a processor configured to implement the exposure control method according to the first aspect when executing the program stored in the memory.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the exposure control method according to the first aspect.
According to the technical scheme provided by the embodiment of the invention, after the electronic equipment acquires the target scene image to be exposed, the target brightness corresponding to the image dark area of the target scene image is determined, wherein the image dark area is an area with the brightness of each pixel point smaller than the first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of the target pixel points, and the number of the target pixel points is the largest number of the pixel points corresponding to each brightness in the image dark area; determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval; determining a second average brightness based on the determined brightness interval, wherein the second average brightness is the average brightness of the target scene image after the target scene image is exposed; and finally, adjusting the brightness of the dark area of the image until the average brightness of the target scene image is the second average brightness, and completing the exposure of the target scene image. The brightness interval adopted when the target scene image is exposed by the scheme is related to the target brightness of the image dark area of the target scene image, but is not a fixed brightness interval, so that the scene adaptability of image exposure can be enhanced by the scheme, and the exposure effect of the image is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram illustrating a scene image after exposure according to a prior art;
FIG. 2 is a flowchart illustrating an exposure control method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an exposure control apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the technical problem that an image exposure method in the prior art is poor in scene adaptability, the embodiment of the invention provides an exposure control method, an exposure control device and electronic equipment.
In the first aspect, an exposure control method provided by an embodiment of the present invention is first described below.
It should be noted that the exposure control method is applied to an electronic device with a photographing function, and the electronic device may be an electronic device such as a smart phone and an intelligent monitoring device.
As shown in fig. 2, an exposure control method provided by an embodiment of the present invention may include the following steps:
s210, acquiring a target scene image to be exposed.
When the electronic device exposes a scene image, a target scene image to be exposed needs to be acquired. It can be understood that the image content of the target scene image is related to a scene captured by the electronic device, which is not limited in the embodiment of the present invention. For example: when the electronic equipment is a smart phone, a scene shot by the electronic equipment can be a certain scene in which a user is interested, and the scene can contain one or more of characters, scenes and the like; or, when the electronic device is an intelligent monitoring device, the scene shot by the electronic device may be a scene monitored by the intelligent monitoring device, and the scene may include one or more of a person, a scene, and the like.
It should be noted that the target scene image to be exposed may be acquired by any method in the prior art. In the embodiment of the present invention, in order to avoid interference caused by an interfering object existing in a scene to an image of a target scene to be exposed, in an implementation manner, the step of acquiring the image of the target scene to be exposed may include:
in the process of imaging a scene, when at least two continuous frames of scene images obtained by imaging meet image acquisition conditions, determining the last frame of scene image in the at least two continuous frames of scene images as a target scene image to be exposed;
wherein the image acquisition conditions are: and the absolute value of the difference between the average brightness of the adjacent scene images is smaller than the preset brightness threshold value.
In this embodiment, in the process of imaging the scene, the difference between the average luminances of the adjacent imaged scene images may be calculated, and when the difference between the average luminances of the adjacent scene images in at least two consecutive frame scene images is smaller than the preset luminance threshold, it is described that the scene image is more stable as the interference of the interferent in the scene to the scene image is smaller, and therefore, the last frame scene image in at least two consecutive frame images may be determined as the target scene image to be exposed. It can be understood that the smaller the preset brightness threshold, the more stable the scene image is, and the less interference of the scene image by the interferent in the scene is. Of course, the size of the preset brightness threshold may be set according to the actual scene, and the size of the preset brightness threshold is not specifically limited in the embodiment of the present invention.
For example, the preset brightness threshold is 3, and the electronic device continuously acquires three frames of scene images in the process of imaging the scene, where the three frames of scene images are respectively: the image processing method includes a scene image 1, a scene image 2, and a scene image 3, wherein an average luminance of the scene image 1 is 100, an average luminance of the scene image 2 is 101, an average luminance of the scene image 3 is 102, an absolute value of a difference between the average luminances of the scene image 1 and the scene image 2 is 1, and an absolute value of a difference between the average luminances of the scene image 2 and the scene image 3 is 1. As can be seen, the absolute value of the difference between the average brightnesses of the scene image 1 and the scene image 2, and the absolute value of the difference between the average brightnesses of the scene image 2 and the scene image 3 are both smaller than the preset brightness threshold, so that the scene image 3 can be determined as the target scene image, that is, the electronic device acquires the target scene image to be exposed.
For another example, the preset brightness threshold is 3, and the electronic device continuously acquires three frames of scene images in the process of imaging the scene, where the three frames of scene images are respectively: scene image 1, scene image 2, and scene image 3. The average luminance of the scene image 1 is 50, the average luminance of the scene image 2 is 100, the average luminance of the scene image 3 is 102, the absolute value of the difference between the average luminances of the scene image 1 and the scene image 2 is 50, and the absolute value of the difference between the average luminances of the scene image 2 and the scene image 3 is 2. It can be seen that the absolute value of the difference between the average luminances of the scene images 1 and 2 is much larger than the preset luminance threshold, although the absolute value of the difference between the average luminances of the scene images 2 and 3 is smaller than the preset luminance threshold, the electronic device will not use the scene image 3 as the target scene image to be exposed.
S220, determining the target brightness corresponding to the image dark area of the target scene image.
The image dark area is an area where the brightness of each pixel point is smaller than the first average brightness of the scene image, the target brightness is the brightness corresponding to the number of the target pixel points, and the number of the target pixel points is the largest number of the pixel points corresponding to each brightness in the image dark area.
After the target scene image to be exposed is acquired, the average brightness of the target scene image may be determined, and for convenience of description, the average brightness is referred to as a first average brightness. It can be understood that, according to the magnitude relation between the brightness of each pixel point in the target scene image and the first average brightness, the target scene image can be divided into two regions, namely an image bright region and an image dark region, wherein the brightness of each pixel point in the image bright region is greater than the first average brightness; the brightness of each pixel point in the image dark area is less than the first average brightness.
It can be understood that, in the image dark area of the target scene image, there are a plurality of luminances smaller than the first average luminance, and for each luminance of the plurality of luminances, the luminance corresponds to one pixel number.
In one embodiment, the step of determining the target brightness corresponding to the image dark region of the target scene image may include:
counting a first number of pixel points with the brightness of the scene image in the dark area of the image according to each brightness of the image dark area of the scene image, and determining the first number of the pixel points with the brightness of the scene image as the number of the pixel points corresponding to the brightness;
and determining the maximum number from the number of the pixel points corresponding to each brightness, and determining the brightness corresponding to the maximum number as the target brightness of the image dark area of the scene image.
For example, the first average brightness in the target scene image is 120, and in the target scene image, 5 continuous brightnesses less than the first average brightness are 100, 101, 102, 103, and 104, where the first number corresponding to the brightness 100 is 80, the first number corresponding to the brightness 101 is 90, the first number corresponding to the brightness 102 is 100, the first number corresponding to the brightness 103 is 110, and the first number corresponding to the brightness 104 is 120. At this time, the number of the pixels corresponding to each brightness may be the first number corresponding to the brightness, for example, the number of the pixels corresponding to the brightness 102 is the first number 100 corresponding to the brightness 102.
After the sum of the numbers of the pixel points corresponding to the luminances 100, 101, 102, 103, and 104 is determined, the maximum number is determined from the determined numbers, and it can be seen that the maximum number is the first number corresponding to the luminance 104, that is, the maximum number is 120. Thus, the brightness 104 may be determined as a target brightness of an image dark region of the target scene image.
In another embodiment, the step of determining the target brightness corresponding to the image dark region of the target scene image may include:
counting a first number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of a target scene image;
sequencing a plurality of first numbers obtained by statistics according to the sizes of the brightness of the image dark areas of the target scene image;
after sorting, for each first quantity, summing a plurality of continuous first quantities including the first quantity, and determining a summation result as the quantity of pixel points of the brightness corresponding to the first quantity;
and determining the brightness corresponding to the maximum pixel point number as the target brightness of the image dark area of the target scene image.
In this embodiment, when the number of pixel points corresponding to each brightness in the plurality of brightnesses in the image dark area of the target scene image is calculated, the first number of pixel points having the brightness is not directly used as the number of pixel points corresponding to the brightness; the first number of the plurality of luminances near the luminance is summed, and the summed number is used as the number of the pixel points corresponding to the luminance.
For example, the first average brightness in the target scene image is 120, and in the target scene image, 5 continuous brightnesses less than the first average brightness are 100, 101, 102, 103, and 104, where the first number corresponding to the brightness 100 is 80, the first number corresponding to the brightness 101 is 90, the first number corresponding to the brightness 102 is 100, the first number corresponding to the brightness 103 is 110, and the first number corresponding to the brightness 104 is 120; and the preset first number is 3.
When the number of the pixel points corresponding to the brightness 102 is determined, the sum of consecutive 3 first numbers including the first number corresponding to the brightness 102 may be used as the number of the pixel points corresponding to the brightness 102. That is, the sum of the first number corresponding to the luminance 102, the first number corresponding to the luminance 103, and the first number corresponding to the luminance 104 may be used as the number of the pixel points corresponding to the luminance 102; the sum of the first number corresponding to the luminance 100, the first number corresponding to the luminance 101, and the first number corresponding to the luminance 102 may also be used as the number of the pixel points corresponding to the luminance 102; it is also reasonable to take the sum of the first number corresponding to the luminance 101, the first number corresponding to the luminance 102, and the first number corresponding to the luminance 103 as the number of the pixel points corresponding to the luminance 102.
The larger the number of the pixel points corresponding to one brightness is, the larger the proportion of the area formed by the pixel points corresponding to the brightness in the image dark area is, and the brightness of the image dark area can be reflected more accurately by the brightness. Therefore, after the number of pixel points corresponding to each brightness in the image dark area of the target scene image is obtained, the maximum number of the pixel points corresponding to each brightness can be determined, and the brightness corresponding to the maximum number is determined as the target brightness of the image dark area of the scene image.
And S230, determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval.
After the target brightness corresponding to the image dark area of the target scene image is determined, the brightness interval corresponding to the target scene image may be determined based on the size relationship between the target brightness and the endpoint value of the preset brightness interval.
In one embodiment, the step of determining a brightness interval corresponding to the target scene image based on a size relationship between the target brightness and an endpoint value of a preset brightness interval may include:
when the target brightness is smaller than the left end point value of the preset brightness interval, the left end point value and/or the right end point value of the preset brightness interval are/is increased, and the adjusted brightness interval is used as the brightness interval corresponding to the target scene image;
when the target brightness is larger than the right end point value of the preset brightness interval, the left end point value and/or the right end point value of the preset brightness interval are/is reduced, and the adjusted brightness interval is used as a brightness interval corresponding to the target scene image;
and when the target brightness is greater than the left end point value of the preset brightness interval and less than the right end point value of the preset brightness interval, taking the preset brightness interval as the brightness interval corresponding to the target scene image.
In this embodiment, when the target brightness is less than the left end point value of the preset brightness interval, it is described that the brightness of the image dark area of the target scene image is low, that is, the image dark area is dark, and the brightness of the image dark area of the target scene image can be increased during exposure, so that the details of the image dark area are relatively clear, therefore, the left end point value and/or the right end point value of the preset brightness interval need to be increased, and the adjusted brightness interval is determined as the brightness interval corresponding to the target scene image. Moreover, the left side of the preset brightness interval and/or the amplitude increased by the endpoint value may be determined according to an actual scene, which is not specifically limited in the embodiment of the present invention.
When the target brightness is greater than the right end point value of the preset brightness interval, it is indicated that the brightness of the image dark area of the target scene image is relatively large, that is, the image dark area is relatively bright, and the brightness of the image dark area of the target scene image can be reduced during exposure, so that the left end point value and/or the right end point value of the preset brightness interval need to be reduced, and the adjusted brightness interval is determined as the brightness interval corresponding to the target scene image. It should be noted that only the left endpoint value of the preset luminance interval may be adjusted downward, only the right endpoint value of the preset luminance interval may be adjusted, or both the left endpoint value and the right endpoint value of the preset luminance interval may be adjusted downward. Moreover, the left side of the preset brightness interval and/or the amplitude of the end point value reduction may be determined according to an actual scene, which is not specifically limited in the embodiment of the present invention.
When the target brightness is greater than the left end point value of the preset brightness interval and less than the right end point value of the preset brightness interval, the brightness of the image dark area of the target scene image is moderate, and the brightness of the image dark area can not be adjusted during exposure, so that the left end point value and/or the right end point value of the preset brightness interval can not be adjusted, that is, the preset brightness interval is used as the brightness interval corresponding to the target scene image.
S240, determining a second average luminance based on the determined luminance section.
And the second average brightness is the average brightness of the target scene image after the target scene image is exposed.
After determining the brightness interval corresponding to the target scene image, a second average brightness of the target scene image may be determined based on the determined brightness interval, where the second average brightness is an average brightness of the target scene image after the target scene image is exposed.
It should be noted that when the brightness interval corresponding to the target scene image is the brightness interval obtained by adjusting the left end point value and/or the right end point value of the preset brightness interval to be high, it is indicated that the image dark area of the target scene image is dark, and the brightness of the image dark area needs to be increased during exposure, so that the determined second average brightness of the target scene image is higher than the first average brightness, and thus, after the target scene image is processed, the brightness of the image dark area of the target scene image is increased, and the details of the image dark area are relatively clear.
When the brightness interval corresponding to the target scene image is the brightness interval obtained by adjusting the left end point value and/or the right end point value of the preset brightness interval to be lower, the image dark area of the target scene image is brighter, and the details of the image dark area can be clearer even if the brightness of the image dark area is properly adjusted to be lower during exposure, so that the determined second average brightness of the target scene image can be smaller than the first average brightness; of course, the second average brightness of the determined target image brightness may also be equal to the first average brightness. In order to avoid excessive noise caused by too large brightness of the dark image area of the target scene image, the second average brightness of the determined target image brightness is usually not greater than the first average brightness.
Similarly, when the brightness interval corresponding to the target scene image is the preset brightness interval, it is indicated that the brightness of the image dark area of the target scene image is moderate, and therefore, the determined second average brightness of the target image brightness may be equal to the first average brightness.
In one embodiment, the step of determining the second average luminance based on the determined luminance section may include: the middle value of the determined luminance section is determined as a second average luminance. Of course, there may be other types of ways to determine the second average luminance based on the determined luminance interval, and this is not specifically limited in this embodiment of the present invention.
And S250, adjusting the brightness of the image dark area until the average brightness of the target scene image is the second average brightness, and completing the exposure of the scene image.
After the second average brightness of the target scene image is determined, brightness adjustment can be performed on the image dark area until the average brightness of the target scene image reaches the second average brightness, and exposure of the target scene image can be completed. It can be understood that, in practical applications, the brightness of the image dark area of the target scene image may be adjusted once, so that the average brightness of the target scene image reaches the second average brightness; it is reasonable to perform brightness adjustment on the image dark area of the target scene image multiple times to make the average brightness of the target scene image reach the second average brightness.
It can be understood that the image dark area is usually a region of interest of the target scene image, and therefore, when the brightness of the image dark area of the target scene image is adjusted, the region of interest of the target scene image, that is, the image dark area, can be found and the brightness of the image dark area is adjusted.
According to the technical scheme provided by the embodiment of the invention, after the electronic equipment acquires the target scene image to be exposed, the target brightness corresponding to the image dark area of the target scene image is determined, wherein the image dark area is an area with the brightness of each pixel point smaller than the first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of the target pixel points, and the number of the target pixel points is the largest number of the pixel points corresponding to each brightness in the image dark area; determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval; determining a second average brightness based on the determined brightness interval, wherein the second average brightness is the average brightness of the target scene image after the target scene image is exposed; and finally, adjusting the brightness of the dark area of the image until the average brightness of the target scene image is the second average brightness, and completing the exposure of the target scene image. The brightness interval adopted when the target scene image is exposed by the scheme is related to the target brightness of the image dark area of the target scene image, but is not a fixed brightness interval, so that the scene adaptability of image exposure can be enhanced by the scheme, and the exposure effect of the image is ensured.
In order to more accurately determine the brightness interval corresponding to the target scene image, the exposure effect of the target scene image is improved. In an implementation manner, on the basis of the embodiment shown in fig. 2, before the step of determining the brightness interval corresponding to the target scene image based on the size relationship between the target brightness and the endpoint value of the preset brightness interval, the exposure control method provided in the embodiment of the present invention may further include the following steps:
judging whether the target brightness meets a preset brightness interval determination condition;
the method comprises the following steps of determining a brightness interval corresponding to a target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval, wherein the steps comprise:
and when the target brightness is judged to accord with the preset brightness interval determination condition, determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval.
In this embodiment, before determining the luminance section corresponding to the target scene image based on the magnitude relationship between the target luminance and the endpoint value of the preset luminance section, it may be determined whether the target luminance meets the preset luminance section determination condition, and when it is determined that the target luminance meets the preset luminance section determination condition, the luminance section corresponding to the target scene image is determined based on the magnitude relationship between the target luminance and the endpoint value of the preset luminance section.
In one embodiment, the step of determining whether the target brightness meets a preset brightness interval determination condition may include:
determining first brightness corresponding to an image dark region of at least one frame of scene image, wherein the at least one frame of scene image is a previous frame of scene image of a target scene image, or N continuous frames of scene images in front of the target scene image, the first brightness corresponding to the image dark region of any frame of scene image is brightness corresponding to the number of first pixels, and the number of the first pixels is the maximum number of pixels in the image dark region of the frame of scene image corresponding to each brightness;
judging the size relation between the target brightness and the endpoint value of the preset brightness interval to obtain a first judgment result; judging the magnitude relation between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result;
judging whether the first judgment result is consistent with each obtained second judgment result or not;
and if the first judgment result is consistent with each obtained second judgment result, judging that the target brightness meets the preset brightness interval determination condition.
In this embodiment, when determining whether the target brightness meets the preset brightness interval determination condition, a previous frame of scene image of the target scene image or a previous consecutive N frames of scene images of the target scene image may be acquired, and the corresponding first brightness of the image dark area of the previous frame of scene image acquired or the first brightness of the previous consecutive N frames of scene images of the target scene image may be calculated. In essence, the first brightness corresponding to the image dark area of any frame of scene image is the target brightness of the image dark area of the frame of scene image.
In one embodiment, the determining of the first brightness corresponding to the image dark area of any one frame of scene image includes:
counting a first number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of a frame of scene image;
sequencing a plurality of first numbers obtained by statistics according to the sizes of the brightness of the image dark areas of the target scene image;
after sorting, for each first quantity, summing a plurality of continuous first quantities including the first quantity, and determining a summation result as the quantity of pixel points of the brightness corresponding to the first quantity;
and determining the brightness corresponding to the maximum pixel point number as the first brightness corresponding to the image dark area of the frame of scene image.
In this embodiment, when calculating the first brightness corresponding to the image dark area of any frame of scene image, the first number of pixels having the brightness may not be used as the number of pixels corresponding to the brightness; the first number of the plurality of luminances near the luminance is summed, and the summed number is used as the number of the pixel points corresponding to the luminance. It is understood that the determination process of the first brightness corresponding to the image dark area of any one frame of scene image is the same as the determination process of the target brightness corresponding to the image dark area of the target scene image.
After the first brightness of the previous frame of scene image of the target scene image is obtained or the first brightness of the previous continuous N frames of scene images corresponding to the target scene image is obtained, the size relationship between the target brightness and the endpoint value of the preset brightness interval can be judged to obtain a first judgment result, and the size relationship between each obtained first brightness and the endpoint value of the preset brightness interval can be judged to be used as a second judgment result; and judging whether the first judgment result is consistent with each obtained second judgment result, if so, indicating that the size relationship between the target brightness of the image dark area of the continuous several frames of scene images including the target scene image and the endpoint value of the preset brightness interval is consistent, namely, the size relationship between the target brightness of the image dark area of the scene image and the endpoint value of the preset brightness interval is stable, and at the moment, determining the brightness interval corresponding to the target scene image, namely, judging that the preset brightness interval adjustment condition is met.
For example, the preset brightness interval is [50, 55], and the electronic device obtains two consecutive frames of scene images including a previous frame of imaged image corresponding to the target scene image, which are a first scene image and a second scene image, respectively, where the target brightness corresponding to the image dark area of the target scene image is 5, the first brightness corresponding to the image dark area of the first scene image is 6, and the first brightness corresponding to the image dark area of the second scene image is 5. As can be seen, the first determination result is: the target brightness of the image dark area of the target scene image is smaller than the left end point value of the preset brightness interval; the second judgment result is respectively: the first brightness of the image dark area of the first scene image is smaller than the left endpoint value of the preset brightness interval; the first brightness of the image dark area of the second scene image is smaller than the left endpoint value of the preset brightness interval; therefore, the first judgment result is consistent with each obtained second judgment result, so that the condition that the preset brightness interval adjustment condition is met can be judged.
In another embodiment, the step of determining whether the preset brightness interval adjustment condition is met may include:
judging whether the number of pixel points corresponding to the target brightness is larger than a preset number or not;
if yes, judging that the preset brightness interval determination condition is met.
The larger the number of the pixel points corresponding to the target brightness is, the larger the proportion of the image dark area of the target scene image in the target scene image is, after the target scene image is exposed, the brightness of the image dark area of the target scene image cannot be too low, so that the situation that the details of the image dark area of the target scene image are not clear due to too dark image dark area of the target scene image is avoided; and after the target scene image is exposed, the brightness of the image dark area of the target scene image cannot be too high, so that the noise of the image dark area of the target scene image is prevented from being too high due to the fact that the image dark area of the target scene image is too bright. Therefore, it is necessary to determine the brightness interval corresponding to the target scene image, that is, to determine the determination condition of the preset brightness interval.
It can be understood that, in this embodiment, except for determining whether the number of the pixel points corresponding to the target brightness is greater than the preset number, whether the preset brightness interval adjustment condition is met is determined; whether the preset brightness interval adjusting condition is judged by judging whether the proportion of the pixel points of the target scene image where the pixel points corresponding to the target brightness are located is larger than the preset proportion or not, and the judgment is reasonable.
It should be noted that the preset number and the preset ratio related in the embodiment may be determined according to an actual application scenario, and the preset number and the preset ratio are not specifically limited in the embodiment of the present invention.
It is emphasized that, in the embodiment of the present invention, when the first determination result is determined to be consistent with each second determination result, it may be determined that the target brightness meets a preset brightness interval determination condition; or when the pixel points corresponding to the target brightness are judged to be more than the preset number, judging that the target brightness meets the preset brightness interval determination condition; of course, it is reasonable to determine that the target brightness meets the preset brightness interval determination condition when the first determination result is determined to be consistent with each second determination result and when the pixel points corresponding to the target brightness are determined to be greater than the preset number.
Therefore, according to the technical scheme provided by the embodiment of the invention, the brightness interval corresponding to the target scene image is related to the target brightness of the image dark area of the target scene image, and the brightness interval corresponding to the target scene image can be more accurately determined, so that the exposure effect of the target scene image is further improved.
In a second aspect, an embodiment of the present invention provides an exposure control apparatus, as shown in fig. 3, the apparatus including:
a scene image obtaining module 310, configured to obtain a target scene image to be exposed;
a target brightness determining module 320, configured to determine a target brightness corresponding to an image dark region of the target scene image, where the image dark region is a region where brightness of each pixel is less than a first average brightness of the target scene image, the target brightness is brightness corresponding to a number of target pixels, and the number of the target pixels is a maximum number of pixels in the image dark region among the number of pixels corresponding to each brightness;
a bright area interval determining module 330, configured to determine a brightness interval corresponding to the target scene image based on a size relationship between the target brightness and an endpoint value of a preset brightness interval;
an average brightness determination module 340 for determining a second average brightness based on the determined brightness interval;
a brightness adjusting module 350, configured to perform brightness adjustment on the image dark area until the average brightness of the target scene image is the second average brightness, and complete exposure of the target scene image; wherein the second average brightness is the average brightness of the target scene image after exposure of the target scene image
According to the technical scheme provided by the embodiment of the invention, after the electronic equipment acquires the target scene image to be exposed, the target brightness corresponding to the image dark area of the target scene image is determined, wherein the image dark area is an area with the brightness of each pixel point smaller than the first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of the target pixel points, and the number of the target pixel points is the largest number of the pixel points corresponding to each brightness in the image dark area; determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval; determining a second average brightness based on the determined brightness interval, wherein the second average brightness is the average brightness of the target scene image after the target scene image is exposed; and finally, adjusting the brightness of the dark area of the image until the average brightness of the target scene image is the second average brightness, and completing the exposure of the target scene image. The brightness interval adopted when the target scene image is exposed by the scheme is related to the target brightness of the image dark area of the target scene image, but is not a fixed brightness interval, so that the scene adaptability of image exposure can be enhanced by the scheme, and the exposure effect of the image is ensured.
Optionally, the apparatus further comprises:
the condition judgment module is used for judging whether the target brightness meets a preset brightness interval determination condition or not before the bright area interval determination module determines the brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval;
correspondingly, the luminance interval determining module is specifically configured to:
and when the target brightness is judged to accord with a preset brightness interval determination condition, determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval.
Optionally, the condition determining module is specifically configured to:
determining first brightness corresponding to an image dark area of at least one frame of scene image, wherein the at least one frame of scene image is a previous frame of scene image of the target scene image, or N consecutive frames of scene images in front of the target scene image, the first brightness corresponding to the image dark area of any frame of scene image is brightness corresponding to the number of first pixels, and the number of the first pixels is the maximum number of pixels in the number of pixels corresponding to each brightness in the image dark area of the frame of scene image;
judging the size relation between the target brightness and the endpoint value of a preset brightness interval to obtain a first judgment result; judging the magnitude relation between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result;
judging whether the first judgment result is consistent with each obtained second judgment result;
if so, judging that the target brightness meets a preset brightness interval determination condition.
Optionally, the determining process of the first brightness corresponding to the image dark area of any frame of scene image includes:
counting a first number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of a frame of scene image;
sequencing a plurality of first numbers obtained by statistics according to the sizes of the brightness of the image dark areas of the target scene image;
after sorting, for each first quantity, summing a plurality of continuous first quantities including the first quantity, and determining a summation result as the quantity of pixel points of the brightness corresponding to the first quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the first brightness corresponding to the image dark area of the frame of scene image.
Optionally, the condition determining module is specifically configured to:
when the target brightness is smaller than the left endpoint value of the preset brightness interval, determining that the target brightness is smaller than the left endpoint value as a first judgment result; when the target brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining that the target brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a first judgment result; when the target brightness is larger than a right end point value of a preset brightness interval, determining that the target brightness is larger than the right end point value as a first judgment result;
for each brightness in the first brightness, when the first brightness is smaller than a left end point value of a preset brightness interval, determining that the first brightness is smaller than the left end point value as a second judgment result; when the first brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining the first brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a second judgment result; and when the first brightness is larger than the right endpoint value of the preset brightness interval, determining that the first brightness is larger than the right endpoint value as a second judgment result.
Optionally, the condition determining module is specifically configured to:
judging whether the number of pixel points corresponding to the target brightness is larger than a preset number or not;
if so, judging that the target brightness meets a preset brightness interval determination condition.
Optionally, the scene image obtaining module is specifically configured to:
in the process of imaging a scene, when at least two continuous frames of scene images obtained by imaging meet image acquisition conditions, determining the last frame of scene image in the at least two continuous frames of scene images as a target scene image to be exposed;
wherein the image acquisition conditions are: and the absolute value of the difference between the average brightness of the adjacent scene images is smaller than the preset brightness threshold value.
Optionally, the brightness interval determining module is specifically configured to:
when the target brightness is smaller than the left end point value of a preset brightness interval, increasing the left end point value and/or the right end point value of the preset brightness interval, and taking the adjusted brightness interval as a brightness interval corresponding to the target scene image;
when the target brightness is larger than the right end point value of a preset brightness interval, reducing the left end point value and/or the right end point value of the preset brightness interval, and taking the regulated brightness interval as a brightness interval corresponding to the target scene image;
and when the target brightness is greater than a left end point value of a preset brightness interval and less than a right end point value of the preset brightness interval, taking the preset brightness interval as a brightness interval corresponding to the target scene image.
Optionally, the target brightness determining module is specifically configured to:
counting a second number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of the target scene image;
sequencing a plurality of second quantities obtained by statistics according to the brightness of each image dark area of the target scene image;
after sorting, for each second quantity, summing a plurality of continuous second quantities including the second quantity, and determining the summation result as the number of pixels with brightness corresponding to the second quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the target brightness of the image dark area of the target scene image.
In a third aspect, an embodiment of the present invention further provides an electronic device, as shown in fig. 4, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404, where the processor 401, the communication interface 402, and the memory 403 complete mutual communication through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement the exposure control method according to the first aspect when executing the program stored in the memory 403.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
According to the technical scheme provided by the embodiment of the invention, after the electronic equipment acquires the target scene image to be exposed, the target brightness corresponding to the image dark area of the target scene image is determined, wherein the image dark area is an area with the brightness of each pixel point smaller than the first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of the target pixel points, and the number of the target pixel points is the largest number of the pixel points corresponding to each brightness in the image dark area; determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval; determining a second average brightness based on the determined brightness interval, wherein the second average brightness is the average brightness of the target scene image after the target scene image is exposed; and finally, adjusting the brightness of the dark area of the image until the average brightness of the target scene image is the second average brightness, and completing the exposure of the target scene image. The brightness interval adopted when the target scene image is exposed by the scheme is related to the target brightness of the image dark area of the target scene image, but is not a fixed brightness interval, so that the scene adaptability of image exposure can be enhanced by the scheme, and the exposure effect of the image is ensured.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the exposure control method according to the first aspect.
According to the technical scheme provided by the embodiment of the invention, after the electronic equipment acquires the target scene image to be exposed, the target brightness corresponding to the image dark area of the target scene image is determined, wherein the image dark area is an area with the brightness of each pixel point smaller than the first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of the target pixel points, and the number of the target pixel points is the largest number of the pixel points corresponding to each brightness in the image dark area; determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval; determining a second average brightness based on the determined brightness interval, wherein the second average brightness is the average brightness of the target scene image after the target scene image is exposed; and finally, adjusting the brightness of the dark area of the image until the average brightness of the target scene image is the second average brightness, and completing the exposure of the target scene image. The brightness interval adopted when the target scene image is exposed by the scheme is related to the target brightness of the image dark area of the target scene image, but is not a fixed brightness interval, so that the scene adaptability of image exposure can be enhanced by the scheme, and the exposure effect of the image is ensured.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device, the electronic apparatus, and the storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (13)
1. An exposure control method, characterized in that the method comprises:
acquiring a target scene image to be exposed;
determining target brightness corresponding to an image dark area of the target scene image, wherein the image dark area is an area in which the brightness of each pixel point is smaller than a first average brightness of the target scene image, the target brightness is the brightness corresponding to the number of target pixel points, and the number of the target pixel points is the largest number of the pixel points in the image dark area and corresponding to each brightness;
determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval;
determining a second average luminance based on the determined luminance section;
adjusting the brightness of the image dark area until the average brightness of the target scene image is the second average brightness, and completing exposure of the target scene image;
and the second average brightness is the average brightness of the target scene image after the target scene image is exposed.
2. The method according to claim 1, wherein before the step of determining the brightness interval corresponding to the target scene image based on the magnitude relationship between the target brightness and the endpoint value of the preset brightness interval, the method further comprises:
judging whether the target brightness meets a preset brightness interval determination condition or not;
the step of determining the brightness interval corresponding to the target scene image based on the size relationship between the target brightness and the endpoint value of the preset brightness interval includes:
and when the target brightness is judged to accord with a preset brightness interval determination condition, determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of the preset brightness interval.
3. The method according to claim 2, wherein the step of determining whether the target brightness meets a preset brightness interval determination condition comprises:
determining first brightness corresponding to an image dark area of at least one frame of scene image, wherein the at least one frame of scene image is a previous frame of scene image of the target scene image, or N consecutive frames of scene images in front of the target scene image, the first brightness corresponding to the image dark area of any frame of scene image is brightness corresponding to the number of first pixels, and the number of the first pixels is the maximum number of pixels in the number of pixels corresponding to each brightness in the image dark area of the frame of scene image;
judging the size relation between the target brightness and the endpoint value of a preset brightness interval to obtain a first judgment result; judging the magnitude relation between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result;
judging whether the first judgment result is consistent with each obtained second judgment result;
if so, judging that the target brightness meets a preset brightness interval determination condition.
4. The method of claim 3, wherein the determining of the first luminance corresponding to the image dark region of any one frame of the scene image comprises:
counting a first number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of a frame of scene image;
sequencing a plurality of first numbers obtained by statistics according to the sizes of the brightness of the image dark areas of the target scene image;
after sorting, for each first quantity, summing a plurality of first quantities corresponding to the continuous brightness including the first quantity, and determining a summation result as the number of pixel points of the brightness corresponding to the first quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the first brightness corresponding to the image dark area of the frame of scene image.
5. The method according to claim 3, wherein the step of determining the magnitude relationship between the target brightness and the endpoint value of the preset brightness interval to obtain the first determination result comprises:
when the target brightness is smaller than the left endpoint value of the preset brightness interval, determining that the target brightness is smaller than the left endpoint value as a first judgment result; when the target brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining that the target brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a first judgment result; when the target brightness is larger than a right end point value of a preset brightness interval, determining that the target brightness is larger than the right end point value as a first judgment result;
correspondingly, the step of judging the size relationship between each first brightness and the endpoint value of the preset brightness interval to obtain a second judgment result includes:
for each brightness in the first brightness, when the first brightness is smaller than a left end point value of a preset brightness interval, determining that the first brightness is smaller than the left end point value as a second judgment result; when the first brightness is greater than or equal to a left endpoint value of a preset brightness interval and is less than or equal to a right endpoint value of the preset brightness interval, determining the first brightness is greater than or equal to the left endpoint value and is less than or equal to the right endpoint value as a second judgment result; and when the first brightness is larger than the right endpoint value of the preset brightness interval, determining that the first brightness is larger than the right endpoint value as a second judgment result.
6. The method according to claim 2, wherein the step of determining whether the target brightness meets a preset brightness interval determination condition comprises:
judging whether the number of pixel points corresponding to the target brightness is larger than a preset number or not;
if so, judging that the target brightness meets a preset brightness interval determination condition.
7. The method of claim 1, wherein the step of acquiring an image of the target scene to be exposed comprises:
in the process of imaging a scene, when at least two continuous frames of scene images obtained by imaging meet image acquisition conditions, determining the last frame of scene image in the at least two continuous frames of scene images as a target scene image to be exposed;
wherein the image acquisition conditions are: and the absolute value of the difference between the average brightness of the adjacent scene images is smaller than the preset brightness threshold value.
8. The method according to any one of claims 1 to 7, wherein the step of determining the brightness interval corresponding to the target scene image based on the magnitude relationship between the target brightness and the endpoint value of the preset brightness interval comprises:
when the target brightness is smaller than the left end point value of a preset brightness interval, increasing the left end point value and/or the right end point value of the preset brightness interval, and taking the adjusted brightness interval as a brightness interval corresponding to the target scene image;
when the target brightness is larger than the right end point value of a preset brightness interval, reducing the left end point value and/or the right end point value of the preset brightness interval, and taking the regulated brightness interval as a brightness interval corresponding to the target scene image;
and when the target brightness is greater than a left end point value of a preset brightness interval and less than a right end point value of the preset brightness interval, taking the preset brightness interval as a brightness interval corresponding to the target scene image.
9. The method of any of claims 1 to 7, wherein the step of determining the target brightness of image dark regions of the target scene image comprises:
counting a second number of pixel points with the brightness aiming at each brightness in a plurality of brightnesses in an image dark region of the target scene image;
sequencing a plurality of second quantities obtained by statistics according to the brightness of each image dark area of the target scene image;
after sorting, for each second quantity, summing a plurality of continuous second quantities including the second quantity, and determining the summation result as the number of pixels with brightness corresponding to the second quantity;
and determining the brightness corresponding to the determined maximum pixel point number as the target brightness of the image dark area of the target scene image.
10. The method according to any of claims 1 to 7, wherein the step of determining a second average luminance based on the determined luminance interval comprises:
calculating an average value of the left end point value and the right end point value of the determined brightness interval;
the calculated average value is determined as the second average luminance.
11. An exposure control apparatus, characterized in that the apparatus comprises:
the scene image acquisition module is used for acquiring a target scene image to be exposed;
the target brightness determining module is used for determining target brightness corresponding to an image dark area of the target scene image, wherein the image dark area is an area in which the brightness of each pixel point is smaller than a first average brightness of the target scene image, the target brightness is brightness corresponding to the number of target pixel points, and the number of the target pixel points is the largest number of pixel points in the image dark area in the number of pixel points corresponding to each brightness;
the brightness interval determining module is used for determining a brightness interval corresponding to the target scene image based on the size relation between the target brightness and the endpoint value of a preset brightness interval;
an average brightness determination module for determining a second average brightness based on the determined brightness interval;
the dark area brightness adjusting module is used for adjusting the brightness of the image dark area until the average brightness of the target scene image is the second average brightness, and completing exposure of the target scene image;
and the second average brightness is the average brightness of the target scene image after the target scene image is exposed.
12. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-10 when executing a program stored in the memory.
13. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810989820.6A CN110868549B (en) | 2018-08-28 | 2018-08-28 | Exposure control method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810989820.6A CN110868549B (en) | 2018-08-28 | 2018-08-28 | Exposure control method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110868549A CN110868549A (en) | 2020-03-06 |
CN110868549B true CN110868549B (en) | 2021-01-08 |
Family
ID=69651480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810989820.6A Active CN110868549B (en) | 2018-08-28 | 2018-08-28 | Exposure control method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110868549B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114449176B (en) * | 2022-01-10 | 2024-06-14 | 瑞芯微电子股份有限公司 | Automatic exposure method, dynamic range identification method, device, medium and equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1719328A (en) * | 2005-07-01 | 2006-01-11 | 北京中星微电子有限公司 | Method of automatic exposure regulation and its control system |
CN101013250A (en) * | 2006-01-30 | 2007-08-08 | 索尼株式会社 | Exposure control apparatus and image pickup apparatus |
CN101529891A (en) * | 2006-08-22 | 2009-09-09 | 高通股份有限公司 | Dynamic automatic exposure compensation for image capture devices |
CN105827995A (en) * | 2016-03-30 | 2016-08-03 | 金三立视频科技(深圳)有限公司 | Automatic exposure method and system based on histogram |
CN108206918A (en) * | 2016-12-19 | 2018-06-26 | 杭州海康威视数字技术股份有限公司 | A kind of smooth compensation method and device |
-
2018
- 2018-08-28 CN CN201810989820.6A patent/CN110868549B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1719328A (en) * | 2005-07-01 | 2006-01-11 | 北京中星微电子有限公司 | Method of automatic exposure regulation and its control system |
CN101013250A (en) * | 2006-01-30 | 2007-08-08 | 索尼株式会社 | Exposure control apparatus and image pickup apparatus |
CN101529891A (en) * | 2006-08-22 | 2009-09-09 | 高通股份有限公司 | Dynamic automatic exposure compensation for image capture devices |
CN105827995A (en) * | 2016-03-30 | 2016-08-03 | 金三立视频科技(深圳)有限公司 | Automatic exposure method and system based on histogram |
CN108206918A (en) * | 2016-12-19 | 2018-06-26 | 杭州海康威视数字技术股份有限公司 | A kind of smooth compensation method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110868549A (en) | 2020-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111028189B (en) | Image processing method, device, storage medium and electronic equipment | |
CN109936698B (en) | Automatic exposure control method and device, electronic equipment and storage medium | |
CN109712102B (en) | Image fusion method and device and image acquisition equipment | |
CN108335279B (en) | Image fusion and HDR imaging | |
CN111491108B (en) | Exposure parameter adjusting method and device | |
JP6160004B2 (en) | Scene recognition method and apparatus | |
TWI682664B (en) | Method for generating an hdr image of a scene based on a tradeoff between brightness distribution and motion | |
KR101662846B1 (en) | Apparatus and method for generating bokeh in out-of-focus shooting | |
CN112738411B (en) | Exposure adjusting method, exposure adjusting device, electronic equipment and storage medium | |
US10972676B2 (en) | Image processing method and electronic device capable of optimizing hdr image by using depth information | |
CN105049743A (en) | Backlight testing method, backlight testing system, picture taking device and terminal | |
CN111368587B (en) | Scene detection method, device, terminal equipment and computer readable storage medium | |
CN105391940B (en) | A kind of image recommendation method and device | |
CN110809146A (en) | Image contrast adjusting method and device, terminal equipment and storage medium | |
CN106791451B (en) | Photographing method of intelligent terminal | |
CN111314622A (en) | Adaptive adjustment method, device and system for image brightness under various scenes | |
CN111405185B (en) | Zoom control method and device for camera, electronic equipment and storage medium | |
CN113163127A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN106773453B (en) | Camera exposure method and device and mobile terminal | |
CN110868549B (en) | Exposure control method and device and electronic equipment | |
van Beek | Improved image selection for stack-based hdr imaging | |
CN111970501A (en) | Pure color scene AE color processing method and device, electronic equipment and storage medium | |
US10609299B1 (en) | Method of measuring light using dual cameras | |
CN108401119B (en) | Image processing method, mobile terminal and related medium product | |
CN111630839B (en) | Image processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |