CN113947602B - Image brightness detection method and device - Google Patents

Image brightness detection method and device Download PDF

Info

Publication number
CN113947602B
CN113947602B CN202111565771.1A CN202111565771A CN113947602B CN 113947602 B CN113947602 B CN 113947602B CN 202111565771 A CN202111565771 A CN 202111565771A CN 113947602 B CN113947602 B CN 113947602B
Authority
CN
China
Prior art keywords
brightness
value
detected
image
preset
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
Application number
CN202111565771.1A
Other languages
Chinese (zh)
Other versions
CN113947602A (en
Inventor
蔡富东
孔志强
陈雷
李在学
宫光超
李忠平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Senter Electronic Co Ltd
Original Assignee
Shandong Senter Electronic Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shandong Senter Electronic Co Ltd filed Critical Shandong Senter Electronic Co Ltd
Priority to CN202111565771.1A priority Critical patent/CN113947602B/en
Publication of CN113947602A publication Critical patent/CN113947602A/en
Application granted granted Critical
Publication of CN113947602B publication Critical patent/CN113947602B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration by the use of histogram techniques
    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20076Probabilistic image processing

Abstract

The specification discloses a method and a device for detecting image brightness, belongs to the technical field of image data processing, and is used for solving the problem that the accuracy of image brightness detection and identification is low at present. The method comprises the following steps: determining one or more items of brightness mean value and brightness standard deviation of the brightness value of the image to be detected and the brightness related value; removing an over-bright area with the brightness value higher than a preset brightness value in the image to be detected, and determining an effective area of the image to be detected; determining a cumulative distribution histogram of the effective area; determining the brightness value of the cumulative distribution histogram and the cumulative gray probability threshold value according to a preset cumulative gray probability threshold value; taking the corresponding brightness value as an initial brightness value; according to the initial brightness value, the brightness correlation value of the effective area and the preset first brightness correlation value, the images to be detected which do not meet the requirements are screened out, corresponding processing is carried out on the images to be detected which do not meet the requirements, and the image brightness detection precision is improved.

Description

Image brightness detection method and device
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for detecting image brightness.
Background
With the rapid development of terminal technology, electronic devices such as mobile phones and tablet computers have an image acquisition function, and users have higher and higher requirements for the quality of images acquired by terminals. However, the camera often cannot obtain a good imaging effect due to the influence of environmental factors such as weather and photographing time, and an exposed or excessively dark area appears. In the field of photography, exposure refers to the amount of light allowed to enter a lens to shine on a photosensitive medium during photography, for example: the amount of light entering the film negative of a film camera or the image sensor of a digital camera. Due to the slow shutter speed, the strong background light, etc., local areas in the image may have too high brightness, the picture is whitened and the details are lost, which is the case when the image is over-exposed. The picture is too dark due to the fact that the shooting environment light is too dark, and the like, and the image is too dark at this time. In various application scenes such as image shooting and video clipping, too-dark or over-exposure of an image frame is often required to be detected, so that subsequent enhancement processing on the image is facilitated, and image details are restored to obtain better dynamic range and dark area details. Therefore, it is important to detect and classify the brightness of the image so that the images with different brightness can be matched to an appropriate image processing method.
In a traditional brightness detection algorithm, a brightness mean value and a brightness standard deviation based on an image and the total brightness of target pixel points in the image are compared with a preset threshold value, so that the image is simply classified according to a comparison result, and an overexposed image are identified. However, this recognition method can only recognize an overexposed image or an overexposed image, and in an actual situation, an image in which two states of the overexposed image and the overexposed image exist simultaneously cannot be accurately determined, and the accuracy of detecting and recognizing the image brightness is low.
Therefore, there is a need for a method of detecting image brightness that can improve accuracy.
Disclosure of Invention
One or more embodiments of the present disclosure provide a method and an apparatus for detecting image brightness, which are used to solve the following technical problems: how to provide a detection method of image brightness which can improve the accuracy.
One or more embodiments of the present disclosure adopt the following technical solutions:
one or more embodiments of the present specification provide a method for detecting brightness of an image, the method including:
determining a brightness value and a brightness correlation value of an image to be detected, wherein the brightness correlation value comprises one or more items of a brightness mean value and a brightness standard deviation;
removing an over-bright area with a brightness value higher than a preset brightness value in the image to be detected, and determining an effective area of the image to be detected, wherein the preset brightness value is used for removing an area with an original brightness value higher than the preset brightness value in the image to be detected;
calculating and obtaining a brightness correlation value of the effective area according to the number and the brightness of the pixel points of the effective area;
determining a cumulative distribution histogram of the effective area according to the number of the pixel points of the effective area; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value;
screening out an unqualified image to be detected according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the unqualified image to be detected.
Optionally, in one or more embodiments of the present specification, before removing an over-bright area in the image to be detected, where a luminance value of the over-bright area is higher than a preset luminance value, the method further includes:
adjusting the image to be detected according to a preset instruction;
calculating an adjusted brightness correlation value of the adjusted image to be detected;
if the adjusted brightness correlation value is lower than a preset second brightness correlation value, judging that the adjusted image to be detected does not meet the requirements, and performing corresponding processing on the adjusted image to be detected; the second brightness correlation value is lower than the first brightness correlation value and is used for screening out an image to be detected which does not meet the requirement when the initial brightness value is at any value;
and if the adjusted brightness correlation value is not lower than the second brightness correlation value, removing the over-bright area with the brightness value higher than the preset brightness value in the adjusted image to be detected.
Optionally, in one or more embodiments of the present specification, if the adjusted brightness correlation value is lower than a preset second brightness correlation value, determining that the adjusted image to be detected does not meet the requirement, specifically including:
if the adjusted brightness correlation value is lower than a preset third brightness correlation value, judging that the adjusted image to be detected is a first-level brightness loss, judging that the number of pixels with brightness values exceeding the preset brightness value in the adjusted image to be detected is greater than a preset value, and judging that the adjusted image to be detected is the first-level brightness loss and overexposure;
and if the adjusted brightness correlation value is not lower than the third brightness correlation value and is lower than a preset second brightness correlation value, judging that the adjusted image to be detected is second-level brightness missing, judging that the number of pixels of which the brightness values exceed the preset brightness values in the adjusted image to be detected is greater than a preset value, and judging that the adjusted image to be detected is second-level brightness missing and overexposure.
Optionally, in one or more embodiments of the present specification, the removing the over-bright area in the image to be detected, where the brightness value is higher than the preset brightness value, to determine the effective area of the image to be detected specifically includes:
preprocessing the adjusted image to be detected to obtain a gray level image and a gradient image of the adjusted image to be detected;
according to the adjusted preset gray threshold value and preset gradient threshold value of the image to be detected, carrying out binarization processing on the gray image and the gradient image to obtain a gray binarization result corresponding to the gray image and a gradient binarization result corresponding to the gradient image;
combining the gray level binarization result and the gradient binarization result to obtain a pixel point set in a first brightness range and a pixel point set in a second brightness range of the adjusted image to be detected; the brightness of the pixel points in the first brightness range is greater than that of the pixel points in the second brightness range;
and filtering the pixel point set in the first brightness range to remove the over-bright area with the brightness value higher than the preset brightness value in the adjusted image to be detected.
Optionally, in one or more embodiments of the present specification, the screening out an image to be detected that does not meet a requirement according to the initial brightness value, the brightness correlation value of the effective region, and a preset first brightness correlation value specifically includes:
determining a brightness set value corresponding to a preset cumulative gray probability threshold in a preset effective area of the image to be detected;
if the initial brightness value is higher than the brightness set value, judging that the adjusted image to be detected has third-level brightness loss, judging that the brightness average value of all the areas of the adjusted image to be detected is higher than the first brightness related value, and judging that the adjusted image to be detected has third-level brightness loss and is overexposed;
and if the initial brightness value is lower than the brightness set value, screening out the image to be detected which does not meet the requirement based on the brightness correlation value of the pixel points of the effective region, the brightness mean value of the pixel points of all regions in the adjusted image to be detected and a third brightness threshold value.
Optionally, in one or more embodiments of the present specification, the screening out an unsatisfactory image to be detected based on the brightness correlation value of the pixel point in the effective region, the adjusted brightness mean value of the pixel points in all regions in the image to be detected, and the third brightness threshold specifically includes:
if the brightness correlation value of the pixel point of the effective area is lower than a preset fourth brightness correlation value, and the initial brightness value is moved based on a preset first value, the corresponding cumulative gray probability is greater than a preset first threshold value; or judging that the adjusted image to be detected is the first-level brightness loss if the cumulative gray scale probability corresponding to the initial brightness value after the initial brightness value is moved is larger than a preset second threshold value based on a preset second numerical value, judging that the brightness mean value of all area pixel points in the adjusted image to be detected is larger than the preset first brightness related value, and judging that the adjusted image to be detected is the first-level brightness loss and overexposure;
if the brightness correlation value of the pixel point of the effective area is higher than a preset fourth brightness correlation value, or after the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray scale probability is smaller than a preset first threshold value, and after the initial brightness value is moved based on a preset second numerical value, the corresponding cumulative gray scale probability is smaller than a preset second threshold value; and screening the images to be detected which do not meet the requirements according to the brightness correlation value of the pixel points of the effective area, the initial brightness value and the accumulated gray probability.
Optionally, in one or more embodiments of the present specification, the screening, according to the brightness correlation value of the pixel point in the effective region, the initial brightness value, and the cumulative gray scale probability, an unsatisfactory image to be detected further includes:
moving the initial brightness value based on a preset first value to obtain a first initial brightness value, and determining a first cumulative gray probability corresponding to the first initial brightness value based on the cumulative distribution histogram; moving the initial brightness value based on a preset second numerical value to obtain a second initial brightness value, and determining a second cumulative gray probability corresponding to the second initial brightness value based on the cumulative distribution histogram;
if the brightness correlation value of the pixel points of the effective area is lower than a preset first gray-dark brightness threshold, or the first cumulative gray probability is greater than a preset first threshold, or the second cumulative gray probability is greater than a preset second threshold, judging that the adjusted image to be detected is second-level brightness loss, judging that the brightness mean value of the pixel points of all the areas in the adjusted image to be detected is greater than the preset first brightness correlation value, and judging that the adjusted image to be detected is second-level brightness loss and overexposure;
if the brightness correlation value of the pixel points of the effective area is higher than a preset first gray-dark brightness threshold, after the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray probability is smaller than the first threshold, and after the initial brightness value is moved based on a preset second numerical value, the corresponding cumulative gray probability is smaller than the second threshold, the initial brightness value is processed to obtain a processed initial brightness value, and an image to be detected which does not meet the requirement is screened according to the cumulative gray probability corresponding to the processed initial brightness value.
Optionally, in one or more embodiments of the present specification, the processing the initial brightness value to obtain a processed initial brightness value, and screening an unsatisfactory image to be detected according to an accumulated gray scale probability corresponding to the processed initial brightness value specifically includes:
moving the initial brightness value based on a preset third value to obtain a third initial brightness value; moving the initial brightness value based on a preset fourth value to obtain a fourth initial brightness value;
determining a third cumulative gray probability according to the cumulative distribution histogram of the third initial brightness value in the effective area; determining a fourth cumulative gray probability according to the cumulative distribution histogram of the fourth initial brightness value in the effective area;
if the brightness correlation value of the pixel points of the effective area is lower than a preset second gray-dark brightness threshold, or the third cumulative gray probability is greater than a preset third threshold, or the fourth cumulative gray probability is greater than a preset fourth threshold, judging that the adjusted image to be detected is second-level brightness loss, judging that the brightness mean value of the pixel points of all areas in the adjusted image to be detected is greater than the preset first brightness correlation value, and judging that the adjusted image to be detected is second-level brightness loss and overexposure;
and if the brightness correlation value of the pixel point of the effective area is higher than the second gray-dark brightness threshold, the third cumulative gray probability is smaller than a preset third threshold, and the fourth cumulative gray probability is smaller than a preset fourth threshold, screening out the to-be-detected image which does not meet the requirement based on the brightness correlation value, the initial brightness value and the cumulative gray probability of the pixel point of the effective area.
Optionally, in one or more embodiments of the present specification, if the brightness correlation value of the pixel point in the effective region is higher than the second gray-to-dark brightness threshold, and the third cumulative gray level probability is smaller than a preset third threshold and the fourth cumulative gray level probability is smaller than a preset fourth threshold, screening out an image to be detected that does not meet a requirement based on the brightness correlation value of the pixel point in the effective region, the initial brightness value, and the cumulative gray level probability specifically includes:
determining the brightness mean value of the pixel points of the effective area;
moving the initial brightness value based on a preset fifth value to obtain a fifth initial brightness value; moving the initial brightness value based on a preset sixth value to obtain a sixth initial brightness value;
if the average value of the brightness of the pixel points in the effective area is smaller than the fifth initial brightness value and the cumulative gray level probability corresponding to the sixth initial brightness value is smaller than a preset sixth threshold value, judging that the adjusted image to be detected is third-level brightness loss and overexposure;
if the brightness mean value of the pixel points of the effective area is larger than the fifth initial brightness value, or the cumulative gray level probability corresponding to the sixth initial brightness value is higher than a preset sixth threshold value, the adjusted image to be detected is judged to be third-level brightness loss, and the brightness mean value of all the areas of the adjusted image to be detected is judged to be higher than the first brightness related value, so that the adjusted image to be detected is judged to be third-level brightness loss and overexposure.
One or more embodiments of the present specification provide an apparatus for detecting brightness of an image, the apparatus including:
the device comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining a brightness value and a brightness related value of an image to be detected, and the brightness related value comprises one or more items of a brightness mean value and a brightness standard deviation;
the segmentation module is used for removing an over-bright area with a brightness value higher than a preset brightness value in the image to be detected and determining an effective area of the image to be detected, wherein the preset brightness value is used for removing an area with an original brightness value higher than the preset brightness value in the image to be detected;
the calculation module is used for calculating and acquiring a brightness correlation value of the effective area according to the number and the brightness of the pixel points of the effective area;
a second determining module, configured to determine a cumulative distribution histogram of the effective region according to the number of pixel points of the effective region; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
the third determining module is used for determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value;
and the screening module is used for screening out the image to be detected which does not meet the requirements according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the image to be detected which does not meet the requirements.
An embodiment of the present specification provides an apparatus for detecting image brightness, including:
at least one processor, and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores executable instructions of the at least one processor to enable the at least one processor to:
determining a brightness value and a brightness correlation value of an image to be detected, wherein the brightness correlation value comprises one or more items of a brightness mean value and a brightness standard deviation;
removing an over-bright area with a brightness value higher than a preset brightness value in the image to be detected, and determining an effective area of the image to be detected, wherein the preset brightness value is used for removing an area with an original brightness value higher than the preset brightness value in the image to be detected;
calculating and obtaining a brightness correlation value of the effective area according to the number and the brightness of the pixel points of the effective area;
determining a cumulative distribution histogram of the effective area according to the number of the pixel points of the effective area; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value;
screening out an unqualified image to be detected according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the unqualified image to be detected.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
by dividing the image and removing the over-bright area, the reliability of image brightness detection is enhanced, and the problem that the image brightness is possibly overestimated when the brightness mean value and the correlation value are compared at present is solved. By controlling the range, the adverse effect of the over-bright part and the over-dark part on the image brightness detection is eliminated as much as possible, and the state of the image can be judged more accurately.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort. In the drawings:
fig. 1 is a schematic flowchart of a method for detecting image brightness according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a first screening part of image brightness detection in an application scenario according to an embodiment of the present disclosure;
fig. 3 is a flowchart of segmentation of a second part in an application scenario provided by an embodiment of the present disclosure;
FIG. 4 is a cumulative distribution histogram provided by embodiments of the present description;
fig. 5 is a flowchart of a third part of image brightness detection in an application scenario according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart of a fourth part of image brightness detection in an application scenario according to an embodiment of the present disclosure;
fig. 7 is a schematic internal structural diagram of an apparatus for detecting image brightness according to an embodiment of the present disclosure;
fig. 8 is a schematic internal structural diagram of an image brightness detection apparatus provided in an embodiment of this specification.
Detailed Description
The embodiment of the specification provides a method and a device for detecting image brightness.
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present specification without any creative effort shall fall within the protection scope of the present specification.
The embodiment of the present specification provides a method flow diagram of a method for detecting image brightness as shown in fig. 1.
As can be seen from fig. 1, the method comprises the following steps:
s101: and determining a brightness value and a brightness correlation value of the image to be detected, wherein the brightness correlation value comprises one or more items of a brightness mean value and a brightness standard deviation.
S102: and removing the over-bright area with the brightness value higher than the preset brightness value in the image to be detected, and determining the effective area of the image to be detected, wherein the preset brightness value is used for removing the area with the original brightness value higher than the preset brightness value in the image to be detected.
In many cases of actual life, bright regions such as sky regions and water surfaces of pictures have influence on the process of image brightness detection, so that the situation of overestimating the brightness of the pictures is caused. In order to avoid the influence of overestimated image brightness on image detection, an over-bright area in an image to be detected needs to be removed. As shown in the flowchart of fig. 2, before removing the over-bright area with the brightness value higher than the preset brightness value in the image to be detected, the first part of screening is performed first. According to a preset instruction, the image is converted from three channels into a single channel, so that a gray image of the image to be detected is obtained. And after the gray level image is converted into the gray level image, the image to be detected is subjected to down sampling processing so as to adjust the length and width of the image, and the adjusted image to be detected is obtained. Here, it can be understood that the resolution of the image to be detected is reduced and the number of pixels is reduced by down-sampling. Therefore, the efficiency of the arithmetic processing is improved by the down-sampling of the image. In addition, it should be noted that the three-channel image represents that each pixel point in the image has three values, for example, the RGB image, the HSV image, and the HSI image all belong to the three-channel image. And a single-channel image is commonly called as a gray value, each pixel point can only have one value to represent color, the pixel value of the single-channel image is between 0 and 255, 0 is black, 255 is white, and the middle value is gray of different levels. And the pixel value in the gray image, i.e. the gray value, can be used to represent the brightness value in the image to be detected. In the following embodiments of the present specification, the gray value in the gray image is used as the brightness value of the image to be processed to perform the step description.
After the image to be detected is adjusted according to a preset instruction, the brightness mean value, the brightness standard deviation and the like of the adjusted image to be detected are calculated, and one or more items of data including the brightness mean value and the brightness standard deviation are used as the related values of the adjusted brightness. If the adjusted brightness correlation value of the image to be detected is lower than the preset second brightness correlation value, judging that the adjusted image to be detected does not meet the requirements if the adjusted image to be detected has an excessively dark area, wherein the specific judgment process comprises the following steps:
and if the adjusted brightness correlation value is smaller than a preset third brightness correlation value, judging that the image to be detected is adjusted to be the first-level brightness missing. And continuously judging after judging that the adjusted image to be detected is the first-level brightness loss, if the number of pixels of which the brightness values exceed the preset brightness value in the adjusted image to be detected is larger than the preset value, namely the number of brighter pixels in the adjusted image to be detected is larger than the preset value. The situation that the adjusted image to be detected has unreasonable more over-bright pixels under the condition of over-darkness is shown, and then the adjusted image to be detected also has the over-exposure condition, and the image is the first-level brightness loss and over-exposure condition at the moment. Among them, what needs to be explained is: the preset third brightness correlation value is lower than the preset second brightness correlation value, so that the condition that the image is darkest is the third brightness correlation value lower than the preset third brightness correlation value.
If the adjusted brightness correlation value is not lower than the preset third brightness correlation value and is lower than the preset second brightness correlation value, the adjusted image to be detected can be judged to be the second-level brightness missing, and here, it can be understood that the brightness of the image with the second-level brightness missing is higher than that of the image with the first-level brightness missing. After the image is judged to be the second-level missing luminance, if the number of pixels of which the luminance values in the adjusted image to be detected exceed the preset luminance values is larger than the preset value, namely the number of brighter pixels in the adjusted image to be detected which is the second-level missing luminance is larger than the preset number. It can be said that there is an overexposure condition in the adjusted image to be detected that is missing at the second level, and at this time, the adjusted image to be detected is missing in brightness at the second level and is overexposed. Whether the image is too dark or not is judged to determine the brightness missing grade of the image, and then whether the image with brightness missing is overexposed or not is continuously detected based on the number of brighter pixels, so that the image brightness detection is more scientific due to the fact that the image with the brightness missing simultaneously has the image with the brightness missing and the image with the brightness missing in the actual situation.
If the adjusted brightness correlation value is determined to be not lower than the second brightness correlation value in the first part, the adjusted image to be detected has a higher brightness mean value, and the adjusted image to be detected has two conditions at the moment, namely, the brightness of the dark image is not uniformly distributed, so the brightness correlation value is higher, and the image at the moment is not dark and does not have an over-bright area; and secondly, the existence of an over-bright area in the over-dark image causes the displayed numerical value of the over-dark image after the brightness mean value to be higher. Therefore, in order to accurately determine the actual brightness of the image, the over-bright area in the adjusted image to be detected, in which the brightness value is higher than the preset brightness, needs to be removed, so as to determine the effective area capable of effectively detecting the brightness of the image. The specific process for determining the effective area of the image to be detected comprises the following steps:
and preprocessing the adjusted image to be detected, as shown in a flow chart of segmentation of a second part in a certain application scene in fig. 3. As can be seen from fig. 3, in an application scene, noise interference in an image is removed by processing with a high-pass filter and an average filter, and a gray image and a gradient image of an adjusted image to be detected are determined.
After preprocessing, carrying out binarization processing on the gray level image and the gradient image according to a preset gray level threshold value and a preset gradient threshold value to obtain a gray level binarization result and a gradient binarization result, and determining a brightness set of pixels in a first brightness range and a set of pixels in a second brightness range of the adjusted image to be detected by combining the gray level binarization result and the gradient binarization result. The brightness of the pixel points in the first brightness range is greater than that of the pixel points in the second brightness range, namely the pixel points in the first brightness range are pixel points in an over-bright area. Because the binarization can set the value exceeding the preset threshold value as 0, the region corresponding to the pixel point set in the first brightness range can be filtered, and the over-bright region with the brightness value higher than the preset brightness value in the adjusted image to be detected can be removed. By segmenting the image, the part which is originally over-bright in the image is removed, so that the adverse effect of the over-bright area in the image on the image brightness detection process is avoided, and the accuracy of the image brightness detection is improved.
S103: and calculating to obtain a brightness correlation value of the effective region according to the number and the brightness of the pixel points of the effective region.
Based on the effective region of the image to be detected determined in the step S102, the number and brightness of the pixels in the effective region are obtained. Calculating to obtain a brightness correlation value of the effective area according to the obtained pixel number and brightness; the brightness correlation value of the effective area at least comprises one or more items of a brightness mean value and a brightness standard deviation.
S104: determining a cumulative distribution histogram of the effective area according to the number of the pixel points of the effective area; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region.
After removing the over-bright area based on the step S102, an effective area capable of effectively detecting the brightness of the image to be detected is obtained. According to the gray value of each pixel point in the effective area, the result obtained by counting the occurrence times of different gray values is a rectangular coordinate image which takes the gray value 0-255 as a horizontal axis and the counted occurrence times as a vertical axis. Since the present specification described in step S101 above represents the luminance value as the gradation value, the calculation is performed based on the gradation histogram, and the histogram is changed such that the vertical axis is the sum of the number of occurrences of the gradation and all the luminance values smaller than the number of occurrences of the gradation value, and the horizontal axis is the luminance value represented as the gradation value, thereby obtaining the cumulative distribution histogram. The cumulative distribution histogram represents the cumulative probability distribution of the image components at the gray level, and each probability value represents the probability less than or equal to the gray level. As shown in fig. 4, in a cumulative distribution histogram in an application scenario, the cumulative distribution histogram can be used to obtain the cumulative gray level probability of the effective region and the corresponding luminance value.
S105: determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value.
As can be seen from the cumulative distribution histogram in fig. 4 below, a region before the white region appears on the horizontal axis has a cumulative gray level probability of 0 in this region, so that the intersection with the horizontal axis when the cumulative gray level probability is greater than 0 is defined as the initial brightness value in fig. 4. Whether the pixels in the image are accumulated in the lighter area or the darker area can be obtained for subsequent judgment. Meanwhile, the brightness values corresponding to different cumulative gray probability threshold values can be obtained according to the set cumulative gray probability threshold value and serve as the initial brightness values.
S106: screening out an unqualified image to be detected according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the unqualified image to be detected.
In one or more embodiments of the present disclosure, after an image is segmented to remove an over-bright area, an unsatisfactory image to be detected is screened according to an initial brightness value, a brightness correlation value of an effective area, and a preset first brightness correlation value, and with reference to a flowchart of a third part of image brightness detection in an application scenario provided in fig. 5, the screening process specifically includes:
firstly, determining a brightness set value corresponding to a preset accumulated gray threshold in a preset effective area of an image to be detected. Because the initial brightness value corresponds to the cumulative gray scale probability, when the initial brightness value corresponding to the same cumulative gray scale probability threshold is higher than the set value, the pixel point is more accumulated in the pixel range with high brightness, otherwise, if the initial brightness value is lower than the set value, the pixel point is more accumulated in the pixel range with low brightness. If the initial brightness value is higher than the brightness set value, the adjusted image to be detected is judged to have third brightness loss, the brightness mean value of the whole area of the adjusted image to be detected is continuously judged, and if the brightness mean value of the whole area of the adjusted image to be detected is higher than the first brightness related value, the situation that the adjusted image has over-exposure is judged to have third-level brightness loss and over-exposure. And if the initial brightness value is lower than the brightness set value, continuing subsequent brightness detection according to the brightness related value of the pixel points in the effective area, the brightness average value of the pixel points in all the areas in the adjusted image to be detected and a third brightness threshold value.
In one or more embodiments of the present specification, when the initial brightness value is lower than the brightness set value, the fourth part of the filtering is further performed. As shown in fig. 6, a flow chart of a fourth part of image brightness detection in an application scenario includes:
firstly, detecting a first judgment condition, wherein the first judgment condition comprises three sub-conditions, and the first sub-condition comprises the following steps: the brightness correlation value of the pixel point of the effective area is lower than a preset fourth brightness correlation value; the second sub-condition is as follows: after the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray level probability is larger than a preset first threshold value; the third sub-condition: and on the basis of the preset second numerical value, the corresponding cumulative gray level probability after the initial brightness value is moved is larger than a preset second threshold value. After the first sub-condition and the second sub-condition are subjected to OR operation, and then the third sub-condition and the third sub-condition are subjected to OR operation, namely if the brightness correlation value of the pixel point of the effective area is lower than a preset fourth brightness correlation value, and after the initial brightness value is moved according to a preset first value, the corresponding cumulative gray probability is larger than a preset first threshold value; or the cumulative gray probability corresponding to the initial brightness value after the initial brightness value is moved is larger than a preset second threshold value based on a preset second numerical value, and then the adjusted image to be detected is judged to be the first-level brightness loss.
The following is illustrated by specific values: shifting the initial brightness value by 20 to be a preset first value; the initial brightness value is shifted by 40 as a predetermined second value. The first sub-condition is then: the brightness correlation value of the pixel point of the effective area is lower than a preset fourth brightness correlation value; the second sub-condition is: the cumulative gray level probability corresponding to the addition of 20 to the initial brightness value is greater than 0.2; the third sub-condition is: the cumulative gray scale probability corresponding to the initial luminance value plus 40 is greater than 0.35. And after the first sub-condition and the second sub-condition are subjected to AND operation and then subjected to OR operation with the third sub-condition, determining that the first judgment condition is met, and judging that the adjusted image to be detected is the first-level brightness loss. After the first-level brightness is determined to be missing, if the brightness mean value of all the pixel points in the adjusted image to be detected is determined to be larger than a preset first brightness correlation value, unreasonable high-brightness pixels exist in the image to be detected, and the condition that overexposure exists in the adjusted image to be detected is determined, wherein the image is the first-level brightness missing and overexposure.
If the first judgment condition is not met, namely the brightness correlation value of the pixel point in the effective area is higher than a preset fourth brightness correlation value, or after the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray level probability is smaller than a preset first threshold value, and after the initial brightness value is moved based on a preset second numerical value, the corresponding cumulative gray level probability is smaller than a preset second threshold value, then screening of a second judgment condition is carried out according to the brightness correlation value of the pixel point in the effective area, the initial brightness value and the cumulative gray level probability, so that the image to be detected which does not meet the requirement is screened out.
In one or more embodiments of the present specification, a specific method for screening an unsatisfactory image to be detected according to a luminance correlation value of a pixel point of the effective region, the initial luminance value, and the cumulative gray level probability includes:
and moving the initial brightness value according to the set first value to obtain a first initial brightness value, and determining a first cumulative gray probability corresponding to the first initial brightness value according to the cumulative distribution histogram. And simultaneously moving the initial brightness value according to the set second numerical value to obtain a second initial brightness value, and determining a second cumulative gray probability corresponding to the second initial brightness value according to the cumulative distribution histogram. And if the brightness correlation value of the pixel points in the effective area is lower than a preset first gray-dark brightness threshold, or the first cumulative gray probability is greater than a preset first threshold, or the second cumulative gray probability is greater than a preset second threshold, judging that the adjusted image to be detected is the second-level brightness loss.
On the basis, if the brightness mean value of all the area pixel points in the adjusted image to be detected is judged to be larger than the preset first brightness correlation value, the adjusted image to be detected is judged to be second-level brightness loss and overexposure.
Taking specific numerical values as an example for explanation, the second determination condition includes: the brightness correlation value of the pixel points in the effective area is lower than a preset first gray-dark brightness threshold value; the cumulative gray level probability corresponding to the addition of 20 to the initial brightness value is greater than 0.2; and the cumulative gray scale probability corresponding to the initial brightness value plus 40 is greater than 0.35. And selecting the initial brightness value as the brightness value corresponding to the probability that the cumulative gray scale appears in the cumulative distribution histogram. When the adjusted image to be detected meets any one of the three sub-conditions, it can be determined that the adjusted image to be detected is in the second-level brightness deficiency. On the basis, if the brightness mean value of all the area pixel points in the adjusted image to be detected is judged to be larger than the preset first brightness correlation value, the adjusted image to be detected is judged to be second-level brightness loss and overexposure. It should be noted that, since the first grayish luminance threshold is larger than the fourth luminance correlation value, the luminance of the second luminance loss at the post-determination level is higher than the first luminance loss when the luminance is lower than the fourth luminance correlation value. As shown in fig. 4, the data displayed on the cumulative distribution histogram satisfies that the cumulative gray level probability corresponding to the initial luminance value plus 20 is greater than 0.2; the cumulative gray level probability corresponding to the initial brightness value plus 40 is greater than 0.35, if the brightness mean value of the effective area is greater than the fourth brightness correlation value and less than the first gray-dark brightness threshold value, the adjusted image to be detected is the second-level brightness, and overexposure judgment needs to be carried out by combining the brightness mean values of all area pixel points in the adjusted image to be detected and the preset first brightness correlation value.
If the brightness correlation value of the pixel point of the effective area is higher than a preset first gray-dark brightness threshold, and the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray probability is smaller than the first threshold, and the corresponding cumulative gray probability is smaller than a second threshold after the initial brightness value is moved based on a preset second numerical value. That is to say, when the second judgment condition is not met, the initial brightness value needs to be processed to obtain the processed initial brightness value, and according to the cumulative gray level probability corresponding to the processed initial brightness value, the image to be detected which does not meet the requirement is screened, that is, the subsequent judgment is performed according to the third judgment condition.
In one or more embodiments of the present specification, processing the initial brightness value to obtain a processed initial brightness value, and screening an unsatisfactory image to be detected according to an accumulated gray scale probability corresponding to the processed initial brightness value, that is, determining according to a third determination condition specifically includes:
and moving the initial brightness value according to a preset third value to obtain a third initial brightness value, and moving the initial brightness value based on a preset fourth value to obtain a fourth initial brightness value. Determining a third cumulative gray probability according to the cumulative distribution histogram of the third initial brightness value in the effective area; and determining a fourth cumulative gray probability according to the cumulative distribution histogram of the fourth initial brightness value in the effective area.
And if the brightness correlation value of the pixel points in the effective area is lower than a preset second gray-dark brightness threshold, or the third cumulative gray probability is greater than a preset third threshold, or the fourth cumulative gray probability is greater than a preset fourth threshold, judging that the adjusted image to be detected is second-level brightness loss. And continuously judging the brightness mean value of all the area pixel points in the adjusted image to be detected, if the brightness mean value is larger than the preset first brightness correlation value, the adjusted image to be detected still has an exposure condition, and the image is the second-level brightness lack and overexposure.
Taking specific numerical values as an example for explanation, the determination conditions are as follows: the brightness correlation value of the pixel points in the effective area is lower than a preset second gray-dark brightness threshold value; the third cumulative gray probability corresponding to the third initial brightness value obtained by adding 60 to the initial brightness value is greater than 0.49; a fourth cumulative gray scale probability corresponding to the fourth initial luminance value of the initial luminance value plus 80 is greater than 0.62. As can be seen from fig. 4, the third cumulative gray scale probability corresponding to the third initial luminance value that has satisfied the initial luminance value plus 60 is greater than 0.49; a fourth cumulative gray-scale probability corresponding to a fourth initial luminance value of the initial luminance value plus 80 is greater than 0.62, and if it is determined before that the first and second determination conditions are not satisfied, it may be determined that the image is absent of the second-level luminance. If the brightness correlation value of the pixel point of the effective area meets the setting in the first judgment condition or the second judgment condition, screening is performed based on the first judgment condition or the second judgment condition.
And if the brightness correlation value of the pixel point in the effective area is higher than the second gray-dark brightness threshold, the third cumulative gray probability is smaller than a preset third threshold and the fourth cumulative gray probability is smaller than a preset fourth threshold, namely under the condition that a third judgment condition is not met, screening out the image to be detected which does not meet the requirement based on the brightness correlation value, the initial brightness value and the cumulative gray probability of the pixel point in the effective area.
In one or more embodiments of the present specification, in a case that the third determination condition is not satisfied, screening out an image to be detected that does not meet requirements based on the brightness correlation value of the pixel point of the effective region, the initial brightness value, and the cumulative grayscale probability, that is, screening the image to be detected under the fourth determination condition specifically includes:
firstly, the brightness mean value of the pixel points of the effective area needs to be determined, the initial brightness value is moved based on a preset fifth value to obtain a fifth initial brightness value, and the initial brightness value is moved based on a preset sixth value to obtain a sixth initial brightness value, so that the value according to the subsequent judgment is obtained.
And the fourth judgment condition comprises two sub-conditions, wherein the brightness mean value of the pixel points in the effective region is smaller than the fifth initial brightness value, and the cumulative gray scale probability corresponding to the sixth initial brightness value is smaller than a preset sixth threshold value, if the two sub-conditions are met simultaneously, namely the brightness mean value of the pixel points in the effective region is smaller than the fifth initial brightness value, and the cumulative gray scale probability corresponding to the sixth initial brightness value is smaller than the preset sixth threshold value, the adjusted image to be detected is judged to be third-level brightness loss and overexposure.
If the brightness mean value of the pixel points in the effective area is larger than the fifth initial brightness value or the cumulative gray level probability corresponding to the sixth initial brightness value is higher than a preset sixth threshold value, the adjusted image to be detected is judged to be third-level brightness loss, the brightness mean value of all the areas of the adjusted image to be detected is judged to be higher than the first brightness related value, and the adjusted image to be detected is judged to be third-level brightness loss and overexposure. For example: assume that the fourth determination condition is specifically: the average brightness value of the pixel points in the effective area is smaller than the initial brightness value plus a fifth initial brightness value corresponding to 125, and the cumulative gray level probability corresponding to a sixth initial brightness value plus the initial brightness value plus 128 is smaller than 0.6. As can be seen from fig. 4, the cumulative gray scale probability that the image in the scene of fig. 4 does not correspond to the sixth initial luminance value of the initial luminance value plus 128 is less than 0.6. If the image does not satisfy the above-described screening of the first determination condition, the second determination condition, and the third determination condition, it can be determined that the image is deficient in brightness of the third level. If the screening of the first determination condition, the second determination condition, and the third determination condition described above is satisfied, the screening is performed based on the determination condition that is satisfied.
The effective area is analyzed after the over-bright area in the image is removed by segmenting the image to be detected, so that the negative influence of the over-bright area on the image brightness detection is avoided. The image is adaptively detected by calculating the cumulative gray probability in the effective area and a preset corresponding threshold, so that the images with different brightness can be accurately selected. In addition, whether the image is too dark or not is firstly detected, and then whether the image is over-exposed or not is detected, so that the image brightness detection is more suitable for a real scene. The method comprises the steps of screening based on various conditions and parameters, determining image states such as first-level brightness loss, first-level brightness loss and overexposure, second-level brightness loss and overexposure, third-level brightness loss and overexposure, refining the brightness level of an image, being applicable to different types of follow-up algorithms, and providing a basis for follow-up image enhancement processing.
As shown in fig. 7, one or more embodiments of the present disclosure provide an apparatus for detecting brightness of an image, the apparatus including:
a first determining module 701, configured to determine a brightness value and a brightness correlation value of an image to be detected, where the brightness correlation value includes one or more of a brightness mean and a brightness standard deviation;
a segmentation module 702, configured to remove an over-bright region in the image to be detected, where a brightness value of the over-bright region is higher than a preset brightness value, and determine an effective region of the image to be detected, where the preset brightness value is used to remove a region in the image to be detected, where an original brightness value of the region is higher than the preset brightness value;
a calculating module 703, configured to calculate and obtain a brightness correlation value of the effective region according to the number and brightness of the pixel points of the effective region;
a second determining module 704, configured to determine a cumulative distribution histogram of the effective region according to the number of pixel points of the effective region; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
a third determining module 705, configured to determine, according to a preset cumulative gray level probability threshold, a brightness value corresponding to the cumulative gray level probability threshold in the cumulative distribution histogram; and taking the corresponding brightness value as an initial brightness value;
and the screening module 706 is configured to screen out an unsatisfactory image to be detected according to the initial brightness value, the brightness correlation value of the effective region, and a preset first brightness correlation value, and perform corresponding processing on the unsatisfactory image to be detected.
One or more embodiments of the present specification provide an apparatus for detecting brightness of an image, as shown in fig. 8, the apparatus including:
at least one processor 801, and
a memory 802 communicatively coupled to the at least one processor 801; wherein the content of the first and second substances,
the memory 802 stores executable instructions of the at least one processor 801 to enable the at least one processor 801 to:
determining a brightness value and a brightness correlation value of an image to be detected, wherein the brightness correlation value comprises one or more items of a brightness mean value and a brightness standard deviation;
removing an over-bright area with a brightness value higher than a preset brightness value in the image to be detected, and determining an effective area of the image to be detected, wherein the preset brightness value is used for removing an area with an original brightness value higher than the preset brightness value in the image to be detected;
calculating and obtaining a brightness correlation value of the effective area according to the number and the brightness of the pixel points of the effective area;
determining a cumulative distribution histogram of the effective area according to the number of the pixel points of the effective area; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value;
screening out an unqualified image to be detected according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the unqualified image to be detected.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the device, and the nonvolatile computer storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and for the relevant points, reference may be made to the partial description of the embodiments of the method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is merely one or more embodiments of the present disclosure and is not intended to limit the present disclosure. Various modifications and alterations to one or more embodiments of the present description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more embodiments of the present specification should be included in the scope of the claims of the present specification.

Claims (8)

1. A method for detecting image brightness is characterized in that the method comprises the following steps:
determining a brightness value and a brightness correlation value of an image to be detected, wherein the brightness correlation value comprises one or more items of a brightness mean value and a brightness standard deviation;
removing an over-bright area with a brightness value higher than a preset brightness value in the image to be detected, and determining an effective area of the image to be detected, wherein the preset brightness value is used for removing an area with an original brightness value higher than the preset brightness value in the image to be detected; calculating and obtaining a brightness correlation value of the effective area according to the number and the brightness of the pixel points of the effective area;
determining a cumulative distribution histogram of the effective area according to the number of the pixel points of the effective area; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value;
screening out an image to be detected which does not meet the requirements according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the image to be detected which does not meet the requirements; the first brightness correlation value is used for judging the overexposure of the image to be detected;
before removing the over-bright area with the brightness value higher than the preset brightness value in the image to be detected, the method further comprises the following steps:
adjusting the image to be detected according to a preset instruction;
calculating an adjusted brightness correlation value of the adjusted image to be detected;
if the adjusted brightness correlation value is lower than a preset second brightness correlation value, judging that the adjusted image to be detected does not meet the requirements, and performing corresponding processing on the adjusted image to be detected; the second brightness correlation value is lower than the first brightness correlation value and is used for screening out an image to be detected which does not meet the requirement when the initial brightness value is at any value;
if the adjusted brightness correlation value is not lower than the second brightness correlation value, removing an over-bright area with a brightness value higher than a preset brightness value in the adjusted image to be detected;
screening out an image to be detected which does not meet the requirement according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, specifically comprising:
determining a brightness set value corresponding to a preset cumulative gray probability threshold in a preset effective area of the image to be detected;
if the initial brightness value is higher than the brightness set value, judging that the adjusted image to be detected has third-level brightness loss, judging that the brightness average value of all the areas of the adjusted image to be detected is higher than the first brightness related value, and judging that the adjusted image to be detected has third-level brightness loss and is overexposed;
and if the initial brightness value is lower than the brightness set value, screening out the image to be detected which does not meet the requirement based on the brightness correlation value of the pixel points of the effective region, the brightness mean value of the pixel points of all regions in the adjusted image to be detected and a third brightness threshold value.
2. The method according to claim 1, wherein if the adjusted brightness correlation value is lower than a second preset brightness correlation value, it is determined that the adjusted image to be detected does not meet the requirement, and specifically includes:
if the adjusted brightness correlation value is lower than a preset third brightness correlation value, judging that the adjusted image to be detected is a first-level brightness loss, judging that the number of pixels with brightness values exceeding the preset brightness value in the adjusted image to be detected is greater than a preset value, and judging that the adjusted image to be detected is the first-level brightness loss and overexposure;
and if the adjusted brightness correlation value is not lower than the third brightness correlation value and is lower than a preset second brightness correlation value, judging that the adjusted image to be detected is second-level brightness missing, judging that the number of pixels of which the brightness values exceed the preset brightness values in the adjusted image to be detected is greater than a preset value, and judging that the adjusted image to be detected is second-level brightness missing and overexposure.
3. The method according to claim 1, wherein the step of removing the over-bright area in the image to be detected, in which the brightness value is higher than the preset brightness value, to determine the effective area of the image to be detected, specifically comprises:
preprocessing the adjusted image to be detected to obtain a gray level image and a gradient image of the adjusted image to be detected;
according to the adjusted preset gray threshold value and preset gradient threshold value of the image to be detected, carrying out binarization processing on the gray image and the gradient image to obtain a gray binarization result corresponding to the gray image and a gradient binarization result corresponding to the gradient image;
combining the gray level binarization result and the gradient binarization result to obtain a pixel point set in a first brightness range and a pixel point set in a second brightness range of the adjusted image to be detected; the brightness of the pixel points in the first brightness range is greater than that of the pixel points in the second brightness range;
and filtering the pixel point set in the first brightness range to remove the over-bright area with the brightness value higher than the preset brightness value in the adjusted image to be detected.
4. The method according to claim 1, wherein the step of screening out the image to be detected that does not meet the requirement based on the brightness correlation value of the pixel points in the effective region, the adjusted brightness mean value of the pixel points in all regions in the image to be detected, and a third brightness threshold specifically comprises:
if the brightness correlation value of the pixel point of the effective area is lower than a preset fourth brightness correlation value, and the initial brightness value is moved based on a preset first value, the corresponding cumulative gray probability is greater than a preset first threshold value; or judging that the adjusted image to be detected is the first-level brightness loss if the cumulative gray scale probability corresponding to the initial brightness value after the initial brightness value is moved is larger than a preset second threshold value based on a preset second numerical value, judging that the brightness mean value of all area pixel points in the adjusted image to be detected is larger than the preset first brightness related value, and judging that the adjusted image to be detected is the first-level brightness loss and overexposure;
if the brightness correlation value of the pixel point of the effective area is higher than a preset fourth brightness correlation value, or after the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray scale probability is smaller than a preset first threshold value, and after the initial brightness value is moved based on a preset second numerical value, the corresponding cumulative gray scale probability is smaller than a preset second threshold value; and screening the images to be detected which do not meet the requirements according to the brightness correlation value of the pixel points of the effective area, the initial brightness value and the accumulated gray probability.
5. The method according to claim 4, wherein the image to be detected which is not satisfactory is screened according to the brightness correlation value of the pixel point in the effective region, the initial brightness value and the cumulative gray level probability, and the specific method further comprises:
moving the initial brightness value based on a preset first value to obtain a first initial brightness value, and determining a first cumulative gray probability corresponding to the first initial brightness value based on the cumulative distribution histogram; moving the initial brightness value based on a preset second numerical value to obtain a second initial brightness value, and determining a second cumulative gray probability corresponding to the second initial brightness value based on the cumulative distribution histogram;
if the brightness correlation value of the pixel points of the effective area is lower than a preset first gray-dark brightness threshold, or the first cumulative gray probability is greater than a preset first threshold, or the second cumulative gray probability is greater than a preset second threshold, judging that the adjusted image to be detected is second-level brightness loss, judging that the brightness mean value of the pixel points of all the areas in the adjusted image to be detected is greater than the preset first brightness correlation value, and judging that the adjusted image to be detected is second-level brightness loss and overexposure;
if the brightness correlation value of the pixel points of the effective area is higher than a preset first gray-dark brightness threshold, after the initial brightness value is moved based on a preset first numerical value, the corresponding cumulative gray probability is smaller than the first threshold, and after the initial brightness value is moved based on a preset second numerical value, the corresponding cumulative gray probability is smaller than the second threshold, the initial brightness value is processed to obtain a processed initial brightness value, and an image to be detected which does not meet the requirement is screened according to the cumulative gray probability corresponding to the processed initial brightness value.
6. The method according to claim 4, wherein the processing the initial brightness value to obtain a processed initial brightness value, and screening the unsatisfactory image to be detected according to the cumulative gray scale probability corresponding to the processed initial brightness value specifically comprises:
moving the initial brightness value based on a preset third value to obtain a third initial brightness value; moving the initial brightness value based on a preset fourth value to obtain a fourth initial brightness value;
determining a third cumulative gray probability according to the cumulative distribution histogram of the third initial brightness value in the effective area; determining a fourth cumulative gray probability according to the cumulative distribution histogram of the fourth initial brightness value in the effective area;
if the brightness correlation value of the pixel points of the effective area is lower than a preset second gray-dark brightness threshold, or the third cumulative gray probability is greater than a preset third threshold, or the fourth cumulative gray probability is greater than a preset fourth threshold, judging that the adjusted image to be detected is second-level brightness loss, judging that the brightness mean value of the pixel points of all areas in the adjusted image to be detected is greater than the preset first brightness correlation value, and judging that the adjusted image to be detected is second-level brightness loss and overexposure;
and if the brightness correlation value of the pixel point of the effective area is higher than the second gray-dark brightness threshold, the third cumulative gray probability is smaller than a preset third threshold, and the fourth cumulative gray probability is smaller than a preset fourth threshold, screening out the to-be-detected image which does not meet the requirement based on the brightness correlation value, the initial brightness value and the cumulative gray probability of the pixel point of the effective area.
7. The method according to claim 6, wherein if the brightness correlation value of the pixel point in the effective region is higher than the second gray-to-dark brightness threshold, and the third cumulative gray-scale probability is smaller than a preset third threshold and the fourth cumulative gray-scale probability is smaller than a preset fourth threshold, the to-be-detected image that does not meet the requirement is screened out based on the brightness correlation value, the initial brightness value, and the cumulative gray-scale probability of the pixel point in the effective region, specifically comprising:
determining the brightness mean value of the pixel points of the effective area;
moving the initial brightness value based on a preset fifth value to obtain a fifth initial brightness value; moving the initial brightness value based on a preset sixth value to obtain a sixth initial brightness value;
if the average value of the brightness of the pixel points in the effective area is smaller than the fifth initial brightness value and the cumulative gray level probability corresponding to the sixth initial brightness value is smaller than a preset sixth threshold value, judging that the adjusted image to be detected is third-level brightness loss and overexposure;
if the brightness mean value of the pixel points of the effective area is larger than the fifth initial brightness value, or the cumulative gray level probability corresponding to the sixth initial brightness value is higher than a preset sixth threshold value, the adjusted image to be detected is judged to be third-level brightness loss, and the brightness mean value of all the areas of the adjusted image to be detected is judged to be higher than the first brightness related value, so that the adjusted image to be detected is judged to be third-level brightness loss and overexposure.
8. An apparatus for detecting brightness of an image, the apparatus comprising:
the device comprises a first determining module, a second determining module and a judging module, wherein the first determining module is used for determining a brightness value and a brightness related value of an image to be detected, and the brightness related value comprises one or more items of a brightness mean value and a brightness standard deviation;
the segmentation module is used for removing an over-bright area with a brightness value higher than a preset brightness value in the image to be detected and determining an effective area of the image to be detected, wherein the preset brightness value is used for removing an area with an original brightness value higher than the preset brightness value in the image to be detected;
the calculation module is used for calculating and acquiring a brightness correlation value of the effective area according to the number and the brightness of the pixel points of the effective area;
a second determining module, configured to determine a cumulative distribution histogram of the effective region according to the number of pixel points of the effective region; wherein the cumulative distribution histogram includes a cumulative gray probability and a luminance value of the effective region;
the third determining module is used for determining a brightness value corresponding to the cumulative gray probability threshold value in the cumulative distribution histogram according to a preset cumulative gray probability threshold value; and taking the corresponding brightness value as an initial brightness value;
the screening module is used for screening the image to be detected which does not meet the requirement according to the initial brightness value, the brightness correlation value of the effective area and a preset first brightness correlation value, and carrying out corresponding processing on the image to be detected which does not meet the requirement; the first brightness correlation value is used for judging the overexposure of the image to be detected;
wherein the apparatus further comprises: the device comprises an adjusting module, a correlation value calculating module, a first judging module and a removing module;
the adjusting module is used for adjusting the image to be detected according to a preset instruction;
the correlation value calculating module is used for calculating an adjusted brightness correlation value of the adjusted image to be detected;
the judging module is used for judging that the adjusted image to be detected does not meet the requirements if the adjusted brightness correlation value is lower than a preset second brightness correlation value, and carrying out corresponding processing on the adjusted image to be detected; the second brightness correlation value is lower than the first brightness correlation value and is used for screening out an image to be detected which does not meet the requirement when the initial brightness value is at any value;
the removing module is used for removing the over-bright area with the brightness value higher than the preset brightness value in the adjusted image to be detected if the adjusted brightness correlation value is not lower than the second brightness correlation value;
wherein, the screening module specifically includes: a fourth determination module, a second determination module,
The fourth determining module is configured to determine a brightness setting value corresponding to a preset cumulative gray scale probability threshold in a preset effective area of the image to be detected;
if the initial brightness value is higher than the brightness set value, judging that the adjusted image to be detected has third-level brightness loss, judging that the brightness average value of all the areas of the adjusted image to be detected is higher than the first brightness related value, and judging that the adjusted image to be detected has third-level brightness loss and is overexposed;
and if the initial brightness value is lower than the brightness set value, screening out the image to be detected which does not meet the requirement based on the brightness correlation value of the pixel points of the effective region, the brightness mean value of the pixel points of all regions in the adjusted image to be detected and a third brightness threshold value.
CN202111565771.1A 2021-12-21 2021-12-21 Image brightness detection method and device Active CN113947602B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111565771.1A CN113947602B (en) 2021-12-21 2021-12-21 Image brightness detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111565771.1A CN113947602B (en) 2021-12-21 2021-12-21 Image brightness detection method and device

Publications (2)

Publication Number Publication Date
CN113947602A CN113947602A (en) 2022-01-18
CN113947602B true CN113947602B (en) 2022-03-18

Family

ID=79339433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111565771.1A Active CN113947602B (en) 2021-12-21 2021-12-21 Image brightness detection method and device

Country Status (1)

Country Link
CN (1) CN113947602B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110852955A (en) * 2018-08-21 2020-02-28 中南大学 Image enhancement method based on image intensity threshold and adaptive cutting
CN111739110A (en) * 2020-08-07 2020-10-02 北京美摄网络科技有限公司 Method and device for detecting image over-darkness or over-exposure
CN112312001A (en) * 2019-07-30 2021-02-02 北京百度网讯科技有限公司 Image detection method, device, equipment and computer storage medium
CN113344907A (en) * 2021-06-29 2021-09-03 深圳前海微众银行股份有限公司 Image detection method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6089424B2 (en) * 2012-03-21 2017-03-08 セイコーエプソン株式会社 Image processing apparatus, projector, and projector control method
CN111784609B (en) * 2020-07-02 2023-11-07 烟台艾睿光电科技有限公司 Image dynamic range compression method, device and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110852955A (en) * 2018-08-21 2020-02-28 中南大学 Image enhancement method based on image intensity threshold and adaptive cutting
CN112312001A (en) * 2019-07-30 2021-02-02 北京百度网讯科技有限公司 Image detection method, device, equipment and computer storage medium
CN111739110A (en) * 2020-08-07 2020-10-02 北京美摄网络科技有限公司 Method and device for detecting image over-darkness or over-exposure
CN113344907A (en) * 2021-06-29 2021-09-03 深圳前海微众银行股份有限公司 Image detection method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Efficient contrast enhancement with truncated adaptive gamma correction;Lihui Huang;《2016 9th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI)》;20170216;全文 *
手机照片质量评价算法研究与实现;徐敏霞;《中国优秀硕士学位论文全文数据库》;20180615;全文 *

Also Published As

Publication number Publication date
CN113947602A (en) 2022-01-18

Similar Documents

Publication Publication Date Title
CN110276767B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN109936698B (en) Automatic exposure control method and device, electronic equipment and storage medium
US8451371B2 (en) Exposure control for an imaging system
US10382712B1 (en) Automatic removal of lens flares from images
US20200082508A1 (en) Information processing method, information processing apparatus, and recording medium
US9900519B2 (en) Image capture by scene classification
CN110443766B (en) Image processing method and device, electronic equipment and readable storage medium
CN110796041B (en) Principal identification method and apparatus, electronic device, and computer-readable storage medium
US10497107B1 (en) Method, computer program product and computer readable medium for generating a mask for a camera stream
CN113691724A (en) HDR scene detection method and device, terminal and readable storage medium
CN112308843A (en) Camera overexposure abnormity adjusting method and system for photovoltaic cell panel image acquisition
CN111726543B (en) Method and camera for improving dynamic range of image
CN113947602B (en) Image brightness detection method and device
US11631183B2 (en) Method and system for motion segmentation
CN112183454B (en) Image detection method and device, storage medium and terminal
CN112183158B (en) Cereal type identification method of cereal cooking equipment and cereal cooking equipment
JP4869323B2 (en) Image processing apparatus and image processing method
Long et al. An Efficient Method For Dark License Plate Detection
CN113747062B (en) HDR scene detection method and device, terminal and readable storage medium
CN115086566B (en) Picture scene detection method and device
CN112233032B (en) Method for eliminating ghost image of high dynamic range image
Egorova et al. Selection of photos for album building applications
CN113763354A (en) Image processing method and electronic equipment
EP3659333A1 (en) Evaluation of dynamic ranges of imaging devices
CN117808760A (en) Highlight detection method, device, equipment and computer readable storage medium

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