CN111738949A - Image brightness adjusting method and device, electronic equipment and storage medium - Google Patents
Image brightness adjusting method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111738949A CN111738949A CN202010568199.3A CN202010568199A CN111738949A CN 111738949 A CN111738949 A CN 111738949A CN 202010568199 A CN202010568199 A CN 202010568199A CN 111738949 A CN111738949 A CN 111738949A
- Authority
- CN
- China
- Prior art keywords
- image
- brightness
- value
- pixel point
- observation image
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 70
- 238000005070 sampling Methods 0.000 claims description 52
- 230000015654 memory Effects 0.000 claims description 19
- 239000011159 matrix material Substances 0.000 claims description 17
- 238000000926 separation method Methods 0.000 claims description 17
- 239000000126 substance Substances 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000012545 processing Methods 0.000 abstract description 5
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 238000013135 deep learning Methods 0.000 abstract description 2
- 238000012216 screening Methods 0.000 abstract description 2
- 230000000875 corresponding effect Effects 0.000 description 135
- 238000010586 diagram Methods 0.000 description 26
- 238000004590 computer program Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000012549 training Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 239000003086 colorant Substances 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000002207 retinal effect Effects 0.000 description 3
- 230000004256 retinal image Effects 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000003902 lesion Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000002792 vascular Effects 0.000 description 2
- 230000003321 amplification Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 210000004204 blood vessel Anatomy 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 210000004220 fundus oculi Anatomy 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 210000001210 retinal vessel Anatomy 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20004—Adaptive image processing
- G06T2207/20008—Globally adaptive
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30004—Biomedical image processing
- G06T2207/30041—Eye; Retina; Ophthalmic
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The application discloses an image brightness adjusting method and device, electronic equipment and a storage medium, relates to the fields of artificial intelligence, deep learning and image processing, and can be particularly applied to the aspect of fundus image screening. The specific scheme is as follows: acquiring an observation image; wherein, the observation image is an image of a red, green and blue color space; separating a background image corresponding to the observation image from the observation image; determining a display parameter value corresponding to the observation image according to the background image; and adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image. According to the embodiment of the application, the appropriate display parameter value can be intelligently selected according to the brightness distribution of the observed image, so that the brightness distribution of the observed image is more reasonable.
Description
Technical Field
The present application relates to the field of computer technologies, and further relates to the fields of artificial intelligence, deep learning, and image processing, and in particular, to an image adjustment method, an image adjustment apparatus, an electronic device, and a storage medium.
Background
The Fundus image adaptive brightness adjustment technology (Fundus image adaptive brightness adjustment) refers to automatic adjustment according to the self brightness distribution of a Fundus image, so that the image quality meets the unified standard. In an actual business scene, due to factors such as model difference of image acquisition equipment, insufficient illumination, too small dynamic range of an imaging sensor, and photographing level of a technician, the brightness of an eyeground image obtained by the image acquisition equipment is not uniformly distributed, the quality is poor, and a difference exists between an eyeground image actually entering an algorithm model and an eyeground image required by the model in an initial training stage, so that the performance of the whole system is influenced. Therefore, the acquired fundus image needs to be preprocessed before being input to the algorithm model to reduce the influence of the image acquisition apparatus on the original fundus image.
In the prior art, much focus has been on enhancing retinal blood vessels to achieve better vessel segmentation by increasing the contrast between the blood vessels and the retinal background in grayscale and color retinal images. The contrast-based enhancement method mainly comprises three modes of histogram-based enhancement, filter-based enhancement and transformation-based enhancement; for example, histogram matching between red and green channels is used as a pre-processing step for vessel segmentation, which may improve the contrast of overall dark features such as vessels, but may reduce the contrast of bright objects with tiny dark objects such as Microangiomas (MAs); enhancement with a matched filter can improve local contrast and aid in vessel segmentation, but does not preserve the fidelity of the image, it can also affect other structures present in the image; the enhancement mode based on the contourlet transformation has poor effect in the area with poor contrast of the fundus image. Further, the luminance-based enhancement method includes: color Retinal Image Enhancement Based on neighborhood (Color reflective Image Enhancement Based on Domain Knowledge) and Color Retinal Image Enhancement Based on brightness and contrast adjustment (Color reflective Image Enhancement Based on illumination and contrast estimation). In the brightness-based enhancement method, brightness adjustment is performed using a fixed display parameter value for different observation images, and it is not possible to intelligently select an appropriate display parameter value according to the brightness distribution of the observation image itself.
Disclosure of Invention
The application provides an image brightness adjusting method, device, equipment and storage medium, which can intelligently select a proper display parameter value according to the brightness distribution of an observed image, so that the brightness distribution of the observed image is more reasonable.
In a first aspect, the present application provides a method for adjusting brightness of an image, where the method includes:
acquiring an observation image; wherein the observation image is an image of a red, green and blue color space;
separating a background image corresponding to the observation image from the observation image;
determining a display parameter value corresponding to the observation image according to the background image;
and adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
In a second aspect, the present application provides an apparatus for adjusting brightness of an image, the apparatus comprising: the device comprises an acquisition module, a separation module, a determination module and an adjustment module; wherein the content of the first and second substances,
the acquisition module is used for acquiring an observation image; wherein the observation image is an image of a red, green and blue color space;
the separation module is used for separating a background image corresponding to the observation image from the observation image;
the determining module is used for determining a display parameter value corresponding to the observation image according to the background image;
and the adjusting module is used for adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
In a third aspect, an embodiment of the present application provides an electronic device, including:
one or more processors;
a memory for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for adjusting brightness of an image according to any embodiment of the present application.
In a fourth aspect, the present application provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for adjusting brightness of an image according to any embodiment of the present application.
According to the technical scheme provided by the application, the technical problem that in the prior art, brightness adjustment cannot be carried out on different observation images by using fixed display parameter values according to the brightness distribution of the observation images is solved, and the proper display parameter values cannot be intelligently selected according to the brightness distribution of the observation images.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 is a schematic flowchart illustrating a method for adjusting image brightness according to an embodiment of the present disclosure;
fig. 2(a) is a schematic position diagram of a sampling point in a fundus image provided in an embodiment of the present application;
fig. 2(b) is a schematic distribution diagram of sampling points in a fundus image provided in the first embodiment of the present application;
fig. 3 is a schematic flowchart of a method for adjusting image brightness according to a second embodiment of the present application;
FIG. 4 is a schematic structural diagram of a background diagram provided in the second embodiment of the present application;
fig. 5 is a schematic flowchart of a method for adjusting image brightness according to a third embodiment of the present application;
fig. 6(a) is a schematic structural diagram of a luminance drift factor provided in the third embodiment of the present application;
FIG. 6(b) is a schematic structural diagram of a contrast shift factor provided in example III of the present application;
FIG. 7 is a schematic structural diagram of a convolution kernel provided in the third embodiment of the present application;
fig. 8 is a schematic comparison diagram before and after adjusting the brightness of an image provided in the third embodiment of the present application;
fig. 9 is a schematic structural diagram of an image brightness adjusting apparatus according to a fourth embodiment of the present application;
FIG. 10 is a schematic structural diagram of a separation module provided in the fourth embodiment of the present application;
fig. 11 is a schematic structural diagram of a determination module provided in the fourth embodiment of the present application;
fig. 12 is a schematic structural diagram of an adjusting module according to a fourth embodiment of the present application;
fig. 13 is a block diagram of an electronic device for implementing the image brightness adjustment method according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Example one
Fig. 1 is a flowchart of an image brightness adjusting method according to an embodiment of the present application, where the method may be executed by an image brightness adjusting apparatus or an electronic device, where the apparatus or the electronic device may be implemented by software and/or hardware, and the apparatus or the electronic device may be integrated in any intelligent device with a network communication function. As shown in fig. 1, the method for adjusting the brightness of an image may include the following steps:
s101, acquiring an observation image; wherein, the observation image is an image of a red, green and blue color space.
In a specific embodiment of the present application, the electronic device may acquire an observation image; the observation image is an image in a red, green, and blue color space (i.e., an RGB space). The RGB space is based on three basic colors of Red (Red), Green (Green), and Blue (Blue), and is superimposed to different degrees to generate abundant and wide colors, so it is commonly called a three-primary-color mode. The RGB space is the most common model in life, and most of the displays of televisions and computers adopt the model. Any color in nature can be formed by mixing red, green and blue lights, and most of colors seen by people in real life are mixed colors.
And S102, separating a background image corresponding to the observation image from the observation image.
In a specific embodiment of the present application, the electronic device may separate a background image corresponding to the observation image from the observation image. Specifically, the electronic device may first separate a green channel (i.e., G channel) image corresponding to the observation image from the observation image; then calculating the mean value and the standard deviation of each pixel point in the G channel image; wherein, the pixel in the G passageway image includes: sampling points and non-sampling points; and separating a background image corresponding to the G channel image from the G channel image according to the mean value and the standard deviation of each pixel point in the G channel image and the pixel value of each pixel point.
Fig. 2(a) is a schematic position diagram of a sampling point in a fundus image provided in the first embodiment of the present application. As shown in fig. 2(a), according to the characteristics that the central area is better illuminated and the peripheral area is relatively poorer illuminated, fewer points can be collected as sampling points in the central area and more points can be collected as sampling points in the peripheral area. The unit of abscissa and ordinate in fig. 2(a) is a basic unit of a pixel point.
Fig. 2(b) is a schematic distribution diagram of sampling points in a fundus image according to a first embodiment of the present application. As shown in fig. 2(b), a polar coordinate system is established with the central point of the fundus image as the origin, and sampling points of the fundus image are distributed on five circles with the origin of the polar coordinate as the center of a circle; because the position of each sampling point is fixed, the angle and the radius of each sampling point relative to the origin can be known in advance, so that the polar coordinate of each sampling point can be obtained, and then the rectangular coordinate of each sampling point can be calculated according to the conversion relation between the polar coordinate and the rectangular coordinate.
And S103, determining a display parameter value corresponding to the observation image according to the background image.
In a specific embodiment of the present application, the electronic device may determine a display parameter value corresponding to the observation image according to the background map; the display parameter value is a gamma value. Specifically, the electronic device may first calculate a brightness drift factor corresponding to each pixel point in the background image according to a predetermined window size and a pixel value of each pixel point in the background image; and then determining a gamma value corresponding to the observed image according to the brightness drift factor corresponding to each pixel point in the background image.
And S104, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
In a specific embodiment of the present application, the electronic device may adjust the brightness of the observation image according to a display parameter value corresponding to the observation image. Specifically, the electronic device may first calculate a brightness gain matrix of the observed image according to a gamma value corresponding to the observed image; the brightness of the observed image is then adjusted according to the brightness gain matrix.
The method for adjusting the image brightness, provided by the embodiment of the application, comprises the steps of firstly obtaining an observation image; then separating a background image corresponding to the observation image from the observation image; determining a display parameter value corresponding to the observation image according to the background image; and finally, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image. That is to say, the present application may determine the display parameter value corresponding to the observation image in the background image corresponding to the observation image, so as to adjust the brightness of the observation image according to the display parameter value corresponding to the observation image. However, in the conventional image brightness adjustment method, brightness adjustment is performed using a fixed display parameter value for different observation images, and it is not possible to intelligently select an appropriate display parameter value according to the brightness distribution of the observation image itself. Because the technical means of separating the background image corresponding to the observation image from the observation image and determining the display parameter value corresponding to the observation image according to the background image are adopted, the technical problem that in the prior art, the brightness of different observation images is adjusted by using fixed display parameter values, and the proper display parameter value cannot be intelligently selected according to the brightness distribution of the observation image is solved; moreover, the technical scheme of the embodiment of the application is simple and convenient to implement, convenient to popularize and wide in application range.
Example two
Fig. 3 is a flowchart illustrating an image brightness adjusting method according to a second embodiment of the present application. As shown in fig. 3, the method for adjusting the brightness of the image may include the following steps:
s301, acquiring an observation image; wherein, the observation image is an image of a red, green and blue color space.
S302, separating a green channel image corresponding to the observation image from the observation image.
In a specific embodiment of the present application, the electronic device may separate a G-channel image corresponding to the observation image from the observation image. Because the G channel image reserves a large amount of contrast information, the background image extraction operation is carried out on the G channel, and the average value and the standard deviation of the sampling points are used for extracting pixel points of the background image from the observation image.
S303, calculating the mean value and the standard deviation of each pixel point in the green channel image; wherein, the pixel in the green channel image includes: sampled points and non-sampled points.
In a specific embodiment of the present application, the electronic device may calculate a mean value and a standard deviation of each pixel point in the G channel image; wherein, the pixel in the G passageway image includes: sampled points and non-sampled points. Specifically, the electronic device may calculate, according to a predetermined window size corresponding to each sampling point, each sampling point in the G channel imageMean and standard deviation of; and then calculating the mean value and the standard deviation of each non-sampling point in the G channel according to the mean value and the standard deviation of each sampling point in the G channel. Suppose that the distances from the center of the circle of the five circles shown in FIG. 2(b) are d1、d2、d3、d4、d5The window sizes corresponding to the sampling points on the five circles are w respectively1、w2、w3、w4、w5. Therefore, the electronic equipment can calculate the mean value and the standard deviation of each sampling point in the G channel image according to the size of the window corresponding to each sampling point; and then performing double-line interpolation calculation among sampling points to obtain the mean value mu (x, y) and the variance sigma (x, y) of all pixel points. Because the distances between different sampling points and the center of a circle are different, the sizes of the windows adopted by different pixel points are also different. In practical applications, the window size may not be limited to these five circles, and thus the window size is not limited to d1-d5These five values take on.
S304, separating a background image corresponding to the green channel image from the green channel image according to the mean value and the standard deviation of each pixel point in the green channel image and the pixel value of each pixel point.
In a specific embodiment of the application, the electronic device may separate a background image corresponding to the G-channel image from the G-channel image according to the mean value and the standard deviation of each pixel point in the G-channel image and the pixel value of each pixel point. Fig. 4 is a schematic structural diagram of a background diagram provided in the second embodiment of the present application. As shown in fig. 4, the electronic device may extract a pixel point from pixel points in the G channel image as a current pixel point, and then calculate a mahalanobis distance corresponding to the current pixel point according to a mean value and a standard deviation of the current pixel point and a pixel value of the current pixel point; if the mahalanobis distance corresponding to the current pixel point is smaller than or equal to the preset threshold, the electronic device can take the current pixel point as a pixel point in a background image corresponding to the G channel image; if the mahalanobis distance corresponding to the current pixel point is greater than the preset threshold, the electronic device can take the current pixel point as a pixel point in a foreground image corresponding to the G channel image; repetition ofAnd executing the operation until all the pixel points in the G channel image are determined as the pixel points in the background image or the pixel points in the foreground image. Specifically, the electronic device may calculate the mahalanobis distance corresponding to the current pixel point according to the following formula:wherein, D (x, y) represents the Mahalanobis distance corresponding to the current pixel point; g (x, y) represents the pixel value of the current pixel point; μ (x, y) represents the mean of the current pixel; σ (x, y) represents the standard deviation of the current pixel point.
And S305, determining a display parameter value corresponding to the observation image according to the background image.
In a specific embodiment of the present application, the electronic device may determine a display parameter value corresponding to the observation image according to the background map. Specifically, the electronic device may first calculate a brightness drift factor corresponding to each pixel point in the background image according to a predetermined window size and a pixel value of each pixel point in the background image; and then determining a gamma value corresponding to the observed image according to the brightness drift factor corresponding to each pixel point in the background image.
And S306, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
The method for adjusting the image brightness, provided by the embodiment of the application, comprises the steps of firstly obtaining an observation image; then separating a background image corresponding to the observation image from the observation image; determining a display parameter value corresponding to the observation image according to the background image; and finally, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image. That is to say, the present application may determine the display parameter value corresponding to the observation image in the background image corresponding to the observation image, so as to adjust the brightness of the observation image according to the display parameter value corresponding to the observation image. However, in the conventional image brightness adjustment method, brightness adjustment is performed using a fixed display parameter value for different observation images, and it is not possible to intelligently select an appropriate display parameter value according to the brightness distribution of the observation image itself. Because the technical means of separating the background image corresponding to the observation image from the observation image and determining the display parameter value corresponding to the observation image according to the background image are adopted, the technical problem that in the prior art, the brightness of different observation images is adjusted by using fixed display parameter values, and the proper display parameter value cannot be intelligently selected according to the brightness distribution of the observation image is solved; moreover, the technical scheme of the embodiment of the application is simple and convenient to implement, convenient to popularize and wide in application range.
EXAMPLE III
Fig. 5 is a flowchart illustrating an image brightness adjusting method according to a third embodiment of the present application. As shown in fig. 5, the method for adjusting the brightness of the image may include the following steps:
s501, acquiring an observation image; wherein, the observation image is an image of a red, green and blue color space.
And S502, separating a green channel image corresponding to the observation image from the observation image.
S503, calculating the mean value and the standard deviation of each pixel point in the green channel image; wherein, the pixel in the green channel image includes: sampled points and non-sampled points.
S504, separating a background image corresponding to the green channel image from the green channel image according to the mean value and the standard deviation of each pixel point in the green channel image and the pixel value of each pixel point.
During image acquisition, the brightness and contrast of the image can generate deformation on the original image, and finally the image observed by human eyes is obtained, and the deformation can be described by an observation model of I (x, y) ═ C (x, y) × I0(x, y) + L (x, y); wherein, I (x, y) represents the pixel value of each pixel point in the observation image; i is0(x, y) represents the pixel value of each pixel point in the original image; c (x, y) represents a contrast drift factor corresponding to each pixel point in the original image; l (x, y) represents the luminance drift factor corresponding to each pixel point in the original image. Further, the original image means that it does not contain non-uniformityThe original image can be regarded as the superposition combination of an ideal background image and a foreground image:wherein the content of the first and second substances,representing the pixel value of each pixel point in the foreground image;the pixel value of each pixel point in the background image is represented. In the foreground image of the original fundus image,is the prospect of the retinal area of the fundus oculi, including vascular structures, optic discs, cups and any visible lesions;is the background of the retinal area of the fundus, and does not contain vascular structures, optic discs, cups and any visible lesions. The formula for obtaining the original image is described according to the observation model:therefore, if the actual brightness drift factor L (x, y) and the contrast drift factor C (x, y) corresponding to each pixel point in the original image can be determined, the pixel value I of each pixel point in the original image can be obtained according to the above formula0(x, y). However, the actual brightness drift factor L (x, y) and contrast drift factor C (x, y) corresponding to each pixel point in the original image are usually unknown, and can only be estimated from the pixel value I (x, y) of each pixel point in the observed image. Therefore, the above formula of the original image can be changed into the following form:wherein, I0’(x, y) is the image of each pixel point in the original imageEstimating the prime value; l' (x, y) is an estimate of the luminance drift factor corresponding to each pixel point in the original image; c' (x, y) is an estimate of the contrast drift factor corresponding to each pixel point in the original image. To obtain I0’(x, y), L '(x, y) and C' (x, y) must be estimated. The foreground graph has large characteristic difference, while the background graph changes smoothly, and can be modeled by normal distribution:wherein, mubIs an ideal uniform brightness value of the background image; sigmabThe natural variation characteristics of the background map in the spatial domain are reflected.
And S505, calculating a brightness drift factor corresponding to each pixel point in the background image according to the predetermined window size and the pixel value of each pixel point in the background image.
In particular embodiments of the present application, the electronic device may be based on a predetermined window size w0Calculating the mean value and standard deviation of each pixel in the background image, wherein the mean value of each pixel is the brightness drift factor L' (x, y) corresponding to each pixel; the standard deviation of each pixel point is the contrast drift factor C' (x, y) corresponding to each pixel point.
Fig. 6(a) is a schematic structural diagram of a luminance drift factor provided in the third embodiment of the present application; fig. 6(b) is a schematic structural diagram of a contrast shift factor provided in example three of the present application. As shown in fig. 6(a) and 6(b), w0∈ (15,25), calculating the window w0×w0The mean value and the standard deviation of each pixel point (x, y) in the image are obtained, and the mean value is the brightness drift factor corresponding to the pixel point; the standard deviation is the contrast shift factor corresponding to that pixel point. The unit of abscissa and ordinate in fig. 6(a) and 6(b) is a basic unit of pixel points.
In the specific embodiment of the application, when the electronic device calculates the mean value and the standard deviation of each sampling point, the traditional double-layer loop traversal mode consumes a lot of time, the extraction of a background image needs 1.1 second, the convolution multiplication mode is adopted to replace the loop of image pixels, and the code efficiency is greatly improved.
Fig. 7 is a schematic structural diagram of a convolution kernel provided in the third embodiment of the present application. As shown in fig. 7, if a convolution kernel k of (w, w) is set, L' (x, y) can be obtained by convolution multiplication of k and the G channel image G (x, y): l' (x, y) ═ k × G (x, y); for C' (x, y):
thenWherein i represents the sequence of each pixel point in the G channel image; n represents the number of pixel points in the G channel image; x is the number ofiExpressing the pixel value of the ith pixel point; mu is the arithmetic mean value from the ith pixel point to the Nth pixel point. The process of extracting the background picture is reduced to 0.06 second from 1.1 second, the speed is improved by 18.3 times, the whole self-adaptive brightness adjustment process only needs 0.2 second, and real-time amplification is supported in the training process.
S506, determining a display parameter value corresponding to the observation image according to the brightness drift factor corresponding to each pixel point in the background image.
In a specific embodiment of the present application, the electronic device may determine a display parameter value corresponding to the observed image according to a brightness drift factor corresponding to each pixel point in the background map. Specifically, the electronic device may extract the brightness drift factor L' (x, y) corresponding to each pixel point, sort the brightness drift factors in the order from small to large, and then obtain the p1 th percentile value and the p2 th percentile value in the sorting result, which are respectively recorded as: img _ percent _ p1 and img _ percent _ p 2; wherein p1 < p 2; and determining a gamma value corresponding to the brightness distribution of the observation image I (x, y) according to the value ranges of img _ percent _ p1 and img _ percent _ p 2. Preferably, the value range of p1 is: 70-100 parts; the value range of p2 is: 10 to 40. Further, if the value corresponding to the second percentile is smaller than the first value, the electronic device may determine the gamma value corresponding to the observed image as one gamma value in the first gamma value set; if the value corresponding to the first percentile is greater than the second value, the electronic device may determine the gamma value corresponding to the observed image as a gamma value in the second gamma value set; if the value corresponding to the first percentile is smaller than the third value and the value corresponding to the second percentile is larger than the fourth value, the electronic device may determine the gamma value corresponding to the observed image as one gamma value in the third gamma value set; wherein the first value is less than the fourth value; the fourth value is less than the third value; the third value is less than the second value. For example, if img _ percent _ p2 is lower than the first threshold th1(th1 is in the range of 15-45), the gamma value is g1(g1 is in the range of 1.9-2.2); if img _ percent _ p1 is higher than a second threshold th2(th2 is in the range of 170-200), the gamma value is g2(g2 is in the range of 0.5-0.8); if img _ percent _ p1 is lower than a third threshold th3(th3 is 140-160) and img _ percent _ p2 is higher than a fourth threshold th4(th4 is 70-90), the gamma value is g3(g3 is 0.9-1.1); in other cases, the gamma value is g4 (the value range of g4 is 1.5-1.8).
And S507, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
In a specific embodiment of the present application, the electronic device may adjust the brightness of the observation image according to a display parameter value corresponding to the observation image. Specifically, the electronic device may first calculate a brightness gain matrix of the observed image according to a gamma value corresponding to the observed image; the brightness of the observed image is then adjusted according to the brightness gain matrix. Since the RGB channels contain both luminance information and color information, they are correlated. In order to obtain a brightness gain matrix irrelevant to color, an observation image can be converted from an RGB space to an HSV space; then, adjusting the brightness of each pixel point in the V-channel image corresponding to the observation image by using the gamma value corresponding to the observation image; then, according to the brightness value V' of each pixel point in the V-channel image after adjustment and the brightness value V before adjustment, determiningThe luminance gain matrix G (x, y) of the observed image is given as V'/V. In order to enhance the brightness and ensure the color information is not changed, the three channels R, G, and B should be adjusted in the same proportion:wherein R' (x, y) is the brightness value of each pixel point in the R channel image after adjustment; r (x, y) is the brightness value of each pixel point in the R channel image before adjustment; g' (x, y) is the brightness value of each pixel point in the G channel image after adjustment; g (x, y) is the brightness value of each pixel point in the G channel image before adjustment; b' (x, y) is the brightness value of each pixel point in the B channel image after adjustment; and B (x, y) is the brightness value of each pixel point in the B channel image before adjustment. Therefore, the brightness of the picture is adjusted by applying G (x, y) to the RGB channels. If gamma value correction is performed directly in the RGB space, the color information is also changed. The brightness gain matrix is corrected based on gamma value, and is a more reasonable method for improving brightness. And the choice of gamma value determines the direction of the image brightness adjustment.
Fig. 8 is a schematic comparison diagram before and after image brightness adjustment according to the third embodiment of the present application. As shown in fig. 8, it can be seen that the originally dark place is adjusted to the normal brightness level, while the originally bright place, such as the video area, is kept unchanged, and the brightness of the adjusted image is distributed uniformly. For a normal fundus image with uniform brightness distribution of the original image, the gamma value is automatically 1, namely the original distribution is not changed. According to the method and the device, the image brightness can be adjusted according to the brightness distribution of the image, so that the image is distributed close to the training set, various actual combat scenes can be effectively coped with, the automatic screening system can accurately screen diseases with high quality, and misdiagnosis caused by low quality is reduced as much as possible; while adaptively adjusting the brightness distribution, the color distribution of the original image is not changed, and the naturalness of the fundus image is kept; in addition, the time efficiency is high, and real-time enhancement in the training process is supported; the existing methods are long in time and cannot support on-line processing during model training; in addition, the method can also perform reverse enhancement, namely, a reverse gamma value is determined according to the brightness distribution of the original image, so that a low-quality image in a real scene is simulated in the training process, and the model is more robust to the eye bottom image with uneven brightness distribution.
The method for adjusting the image brightness, provided by the embodiment of the application, comprises the steps of firstly obtaining an observation image; then separating a background image corresponding to the observation image from the observation image; determining a display parameter value corresponding to the observation image according to the background image; and finally, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image. That is to say, the present application may determine the display parameter value corresponding to the observation image in the background image corresponding to the observation image, so as to adjust the brightness of the observation image according to the display parameter value corresponding to the observation image. However, in the conventional image brightness adjustment method, brightness adjustment is performed using a fixed display parameter value for different observation images, and it is not possible to intelligently select an appropriate display parameter value according to the brightness distribution of the observation image itself. Because the technical means of separating the background image corresponding to the observation image from the observation image and determining the display parameter value corresponding to the observation image according to the background image are adopted, the technical problem that in the prior art, the brightness of different observation images is adjusted by using fixed display parameter values, and the proper display parameter value cannot be intelligently selected according to the brightness distribution of the observation image is solved; moreover, the technical scheme of the embodiment of the application is simple and convenient to implement, convenient to popularize and wide in application range.
Example four
Fig. 9 is a schematic structural diagram of an image brightness adjusting apparatus according to a fourth embodiment of the present application. As shown in fig. 9, the apparatus 900 includes: an acquisition module 901, a separation module 902, a determination module 903 and an adjustment module 904; wherein the content of the first and second substances,
the acquiring module 901 is configured to acquire an observation image; wherein the observation image is an image of a red, green and blue color space;
the separating module 902 is configured to separate a background map corresponding to the observation image from the observation image;
the determining module 903 is configured to determine a display parameter value corresponding to the observation image according to the background map;
the adjusting module 904 is configured to adjust the brightness of the observation image according to the display parameter value corresponding to the observation image.
Fig. 10 is a schematic structural diagram of a separation module provided in the fourth embodiment of the present application. As shown in fig. 10, the separation module 902 includes: a separation sub-module 9021 and a first calculation sub-module 9022; wherein the content of the first and second substances,
the separation sub-module 9021 is configured to separate a green channel image corresponding to the observation image from the observation image;
the first calculating submodule 9022 is configured to calculate a mean value and a standard deviation of each pixel point in the green channel image; wherein, pixel in the green channel image includes: sampling points and non-sampling points;
the separation submodule 9021 is further configured to separate a background image corresponding to the green channel image from the green channel image according to the mean value and the standard deviation of each pixel point in the green channel image and the pixel value of each pixel point.
Further, the first calculating sub-module 9022 is specifically configured to calculate a mean value and a standard deviation of each sampling point in the green channel image according to a predetermined window size corresponding to each sampling point; and calculating the mean value and the standard deviation of each non-sampling point in the green channel according to the mean value and the standard deviation of each sampling point in the green channel.
Further, the determining module 903 is further configured to sample the observation image to obtain each sampling point of the observation image; and determining the window size corresponding to each sampling point according to the distance between each sampling point in the observation image and the central point.
Further, the separation submodule 9021 is specifically configured to extract a pixel point from the pixel points in the green channel image as a current pixel point, and calculate a mahalanobis distance corresponding to the current pixel point according to a mean value and a standard deviation of the current pixel point and a pixel value of the current pixel point; if the Mahalanobis distance corresponding to the current pixel point is smaller than or equal to a preset threshold value, taking the current pixel point as a pixel point in a background image corresponding to the green channel image; if the mahalanobis distance corresponding to the current pixel point is greater than the preset threshold, taking the current pixel point as a pixel point in a foreground image corresponding to the green channel image; and repeatedly executing the operation until all the pixel points in the green channel image are determined as the pixel points in the background image or the pixel points in the foreground image.
Fig. 11 is a schematic structural diagram of a determination module provided in the fourth embodiment of the present application. As shown in fig. 11, the determining module 903 includes: a second calculation sub-module 9031 and a determination sub-module 9032; wherein the content of the first and second substances,
the second calculating submodule 9031 is configured to calculate, according to a predetermined window size and a pixel value of each pixel point in the background map, a brightness drift factor corresponding to each pixel point in the background map;
the determining submodule 9032 is configured to determine a display parameter value corresponding to the observation image according to the brightness drift factor corresponding to each pixel point in the background map.
Further, the determining sub-module 9032 is specifically configured to sort, according to the brightness drift factors corresponding to each pixel point in the background map, the brightness drift factors corresponding to all the pixel points; determining a numerical value corresponding to the first percentile and a numerical value corresponding to the second percentile in the sorted brightness drift factors; wherein the first percentile is less than the second percentile; and determining a display parameter value corresponding to the observation image according to the distribution interval of the numerical value corresponding to the first percentile and/or the numerical value corresponding to the second percentile.
Further, the determining sub-module 9032 is specifically configured to determine, if the value corresponding to the second percentile is smaller than the first value, the display parameter value corresponding to the observed image as a display parameter value in the first display parameter value set; if the numerical value corresponding to the first percentile is larger than the second numerical value, determining the display parameter value corresponding to the observation image as one display parameter value in a second display parameter value set; if the value corresponding to the first percentile is smaller than a third value and the value corresponding to the second percentile is larger than a fourth value, determining the display parameter value corresponding to the observed image as a display parameter value in a third display parameter value set; wherein the first value is less than the fourth value; the fourth value is less than the third value; the third value is less than the second value.
Fig. 12 is a schematic structural diagram of an adjustment module according to a fourth embodiment of the present application. As shown in fig. 12, the adjusting module 904 comprises: a third calculation submodule 9041 and an adjustment submodule 9042; wherein the content of the first and second substances,
the third calculation submodule 9041 is configured to calculate a brightness gain matrix of the observed image according to the display parameter value corresponding to the observed image;
the adjusting submodule 9042 is configured to adjust the brightness of the observation image according to the brightness gain matrix.
Further, the third computing submodule 9041 is specifically configured to convert the observed image from the red, green, and blue color space to a hue saturation brightness space; adjusting the brightness of each pixel point in the lightness channel image corresponding to the observation image by using the display parameter value corresponding to the observation image; and determining a brightness gain matrix of the observed image according to the brightness value of each pixel point in the brightness channel image after adjustment and the brightness value before adjustment.
The image brightness adjusting device can execute the method provided by any embodiment of the application, and has corresponding functional modules and beneficial effects of the execution method. For details of the technology not described in detail in this embodiment, reference may be made to the method for adjusting image brightness provided in any embodiment of the present application.
EXAMPLE five
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 13, the electronic device is a block diagram of an electronic device according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 13, the electronic apparatus includes: one or more processors 1301, memory 1302, and interfaces for connecting the various components, including high speed interfaces and low speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 13 illustrates an example of a processor 1301.
The memory 1302, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the adjusting method of image brightness in the embodiment of the present application (for example, the obtaining module 901, the separating module 902, the determining module 903, and the adjusting module 904 shown in fig. 9). The processor 1301 executes various functional applications of the server and data processing, that is, implements the method of adjusting the brightness of an image in the above-described method embodiment, by running non-transitory software programs, instructions, and modules stored in the memory 1302.
The memory 1302 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device of the adjustment method of the image brightness, and the like. Further, the memory 1302 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 1302 may optionally include a memory remotely disposed from the processor 1301, and these remote memories may be connected to the electronic device of the image brightness adjustment method through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the image brightness adjustment method may further include: an input device 1303 and an output device 1304. The processor 1301, the memory 1302, the input device 1303 and the output device 1304 may be connected by a bus or other means, and fig. 13 illustrates the bus connection.
The input device 1303 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus of the image brightness adjustment method, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 1304 may include a display device, auxiliary lighting devices (e.g., LEDs), tactile feedback devices (e.g., vibrating motors), and the like. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, an observation image is obtained firstly; then separating a background image corresponding to the observation image from the observation image; determining a display parameter value corresponding to the observation image according to the background image; and finally, adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image. That is to say, the present application may determine the display parameter value corresponding to the observation image in the background image corresponding to the observation image, so as to adjust the brightness of the observation image according to the display parameter value corresponding to the observation image. However, in the conventional image brightness adjustment method, brightness adjustment is performed using a fixed display parameter value for different observation images, and it is not possible to intelligently select an appropriate display parameter value according to the brightness distribution of the observation image itself. Because the technical means of separating the background image corresponding to the observation image from the observation image and determining the display parameter value corresponding to the observation image according to the background image are adopted, the technical problem that in the prior art, the brightness of different observation images is adjusted by using fixed display parameter values, and the proper display parameter value cannot be intelligently selected according to the brightness distribution of the observation image is solved; moreover, the technical scheme of the embodiment of the application is simple and convenient to implement, convenient to popularize and wide in application range.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (22)
1. A method for adjusting image brightness is characterized in that the method comprises the following steps:
acquiring an observation image; wherein the observation image is an image of a red, green and blue color space;
separating a background image corresponding to the observation image from the observation image;
determining a display parameter value corresponding to the observation image according to the background image;
and adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
2. The method of claim 1, wherein the separating the background map from the observation image comprises:
separating a green channel image corresponding to the observation image from the observation image;
calculating the mean value and the standard deviation of each pixel point in the green channel image; wherein, pixel in the green channel image includes: sampling points and non-sampling points;
and separating a background image corresponding to the green channel image from the green channel image according to the mean value and the standard deviation of each pixel point in the green channel image and the pixel value of each pixel point.
3. The method of claim 2, wherein the calculating the mean and standard deviation of each pixel point in the green channel image comprises:
calculating the mean value and the standard deviation of each sampling point in the green channel image according to the predetermined window size corresponding to each sampling point;
and calculating the mean value and the standard deviation of each non-sampling point in the green channel according to the mean value and the standard deviation of each sampling point in the green channel.
4. The method of claim 3, wherein prior to said calculating the mean and standard deviation of each sample point in the green channel image, the method further comprises:
sampling the observation image to obtain each sampling point of the observation image;
and determining the window size corresponding to each sampling point according to the distance between each sampling point in the observation image and the central point.
5. The method according to claim 2, wherein the separating the background map corresponding to the green channel image from the green channel image according to the mean and standard deviation of each pixel point in the green channel image and the pixel value of each pixel point comprises:
extracting a pixel point from the pixel points in the green channel image as a current pixel point, and calculating the Mahalanobis distance corresponding to the current pixel point according to the mean value and the standard deviation of the current pixel point and the pixel value of the current pixel point;
if the Mahalanobis distance corresponding to the current pixel point is smaller than or equal to a preset threshold value, taking the current pixel point as a pixel point in a background image corresponding to the green channel image; if the mahalanobis distance corresponding to the current pixel point is greater than the preset threshold, taking the current pixel point as a pixel point in a foreground image corresponding to the green channel image; and repeatedly executing the operation until all the pixel points in the green channel image are determined as the pixel points in the background image or the pixel points in the foreground image.
6. The method of claim 1, wherein the determining the display parameter value corresponding to the observation image according to the background map comprises:
calculating a brightness drift factor corresponding to each pixel point in the background image according to a predetermined window size and the pixel value of each pixel point in the background image;
and determining a display parameter value corresponding to the observation image according to the brightness drift factor corresponding to each pixel point in the background image.
7. The method according to claim 6, wherein the determining a display parameter value corresponding to the observation image according to the brightness drift factor corresponding to each pixel point in the background image comprises:
sorting the brightness drift factors corresponding to all the pixel points according to the brightness drift factors corresponding to all the pixel points in the background image;
determining a numerical value corresponding to the first percentile and a numerical value corresponding to the second percentile in the sorted brightness drift factors; wherein the first percentile is less than the second percentile;
and determining a display parameter value corresponding to the observation image according to the distribution interval of the numerical value corresponding to the first percentile and/or the numerical value corresponding to the second percentile.
8. The method according to claim 7, wherein determining the display parameter value corresponding to the observation image according to the distribution interval of the value corresponding to the first percentile and/or the value corresponding to the second percentile comprises:
if the value corresponding to the second percentile is smaller than the first value, determining the display parameter value corresponding to the observed image as a display parameter value in a first display parameter value set;
if the numerical value corresponding to the first percentile is larger than the second numerical value, determining the display parameter value corresponding to the observation image as one display parameter value in a second display parameter value set;
if the value corresponding to the first percentile is smaller than a third value and the value corresponding to the second percentile is larger than a fourth value, determining the display parameter value corresponding to the observed image as a display parameter value in a third display parameter value set; wherein the first value is less than the fourth value; the fourth value is less than the third value; the third value is less than the second value.
9. The method according to claim 1, wherein the adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image comprises:
calculating a brightness gain matrix of the observation image according to the display parameter value corresponding to the observation image;
and adjusting the brightness of the observation image according to the brightness gain matrix.
10. The method of claim 9, wherein calculating a brightness gain matrix of the observed image according to the display parameter values corresponding to the observed image comprises:
converting the observation image from the red, green, and blue color space to a hue saturation brightness space;
adjusting the brightness of each pixel point in the lightness channel image corresponding to the observation image by using the display parameter value corresponding to the observation image;
and determining a brightness gain matrix of the observed image according to the brightness value of each pixel point in the brightness channel image after adjustment and the brightness value before adjustment.
11. An apparatus for adjusting brightness of an image, the apparatus comprising: the device comprises an acquisition module, a separation module, a determination module and an adjustment module; wherein the content of the first and second substances,
the acquisition module is used for acquiring an observation image; wherein the observation image is an image of a red, green and blue color space;
the separation module is used for separating a background image corresponding to the observation image from the observation image;
the determining module is used for determining a display parameter value corresponding to the observation image according to the background image;
and the adjusting module is used for adjusting the brightness of the observation image according to the display parameter value corresponding to the observation image.
12. The apparatus of claim 11, wherein the separation module comprises: a separation submodule and a first calculation submodule; wherein the content of the first and second substances,
the separation submodule is used for separating a green channel image corresponding to the observation image from the observation image;
the first calculation submodule is used for calculating the mean value and the standard deviation of each pixel point in the green channel image; wherein, pixel in the green channel image includes: sampling points and non-sampling points;
the separation submodule is further configured to separate a background image corresponding to the green channel image from the green channel image according to the mean value and the standard deviation of each pixel point in the green channel image and the pixel value of each pixel point.
13. The apparatus of claim 12, wherein:
the first calculating submodule is specifically configured to calculate a mean value and a standard deviation of each sampling point in the green channel image according to a predetermined window size corresponding to each sampling point; and calculating the mean value and the standard deviation of each non-sampling point in the green channel according to the mean value and the standard deviation of each sampling point in the green channel.
14. The apparatus of claim 13, wherein:
the determining module is further configured to sample the observation image to obtain each sampling point of the observation image; and determining the window size corresponding to each sampling point according to the distance between each sampling point in the observation image and the central point.
15. The apparatus of claim 12, wherein:
the separation submodule is specifically configured to extract a pixel point from pixel points in the green channel image as a current pixel point, and calculate a mahalanobis distance corresponding to the current pixel point according to a mean value and a standard deviation of the current pixel point and a pixel value of the current pixel point; if the Mahalanobis distance corresponding to the current pixel point is smaller than or equal to a preset threshold value, taking the current pixel point as a pixel point in a background image corresponding to the green channel image; if the mahalanobis distance corresponding to the current pixel point is greater than the preset threshold, taking the current pixel point as a pixel point in a foreground image corresponding to the green channel image; and repeatedly executing the operation until all the pixel points in the green channel image are determined as the pixel points in the background image or the pixel points in the foreground image.
16. The apparatus of claim 11, wherein the determining module comprises: a second calculation submodule and a determination submodule; wherein the content of the first and second substances,
the second calculating submodule is used for calculating a brightness drift factor corresponding to each pixel point in the background image according to the predetermined window size and the pixel value of each pixel point in the background image;
and the determining submodule is used for determining a display parameter value corresponding to the observation image according to the brightness drift factor corresponding to each pixel point in the background image.
17. The apparatus of claim 16, wherein:
the determining submodule is specifically configured to sort the brightness drift factors corresponding to all the pixel points according to the brightness drift factors corresponding to each pixel point in the background map; determining a numerical value corresponding to the first percentile and a numerical value corresponding to the second percentile in the sorted brightness drift factors; wherein the first percentile is less than the second percentile; and determining a display parameter value corresponding to the observation image according to the distribution interval of the numerical value corresponding to the first percentile and/or the numerical value corresponding to the second percentile.
18. The apparatus of claim 17, wherein:
the determining submodule is specifically configured to determine, if the value corresponding to the second percentile is smaller than the first value, the display parameter value corresponding to the observed image as a display parameter value in the first display parameter value set; if the numerical value corresponding to the first percentile is larger than the second numerical value, determining the display parameter value corresponding to the observation image as one display parameter value in a second display parameter value set; if the value corresponding to the first percentile is smaller than a third value and the value corresponding to the second percentile is larger than a fourth value, determining the display parameter value corresponding to the observed image as a display parameter value in a third display parameter value set; wherein the first value is less than the fourth value; the fourth value is less than the third value; the third value is less than the second value.
19. The apparatus of claim 11, wherein the adjustment module comprises: a third calculation submodule and an adjustment submodule; wherein the content of the first and second substances,
the third calculation submodule is used for calculating a brightness gain matrix of the observation image according to the display parameter value corresponding to the observation image;
and the adjusting submodule is used for adjusting the brightness of the observed image according to the brightness gain matrix.
20. The apparatus of claim 19, wherein:
the third computing submodule is specifically configured to convert the observed image from the red, green, and blue color space to a hue saturation brightness space; adjusting the brightness of each pixel point in the lightness channel image corresponding to the observation image by using the display parameter value corresponding to the observation image; and determining a brightness gain matrix of the observed image according to the brightness value of each pixel point in the brightness channel image after adjustment and the brightness value before adjustment.
21. An electronic device, comprising:
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 instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-10.
22. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010568199.3A CN111738949B (en) | 2020-06-19 | 2020-06-19 | Image brightness adjusting method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010568199.3A CN111738949B (en) | 2020-06-19 | 2020-06-19 | Image brightness adjusting method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111738949A true CN111738949A (en) | 2020-10-02 |
CN111738949B CN111738949B (en) | 2024-04-05 |
Family
ID=72651857
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010568199.3A Active CN111738949B (en) | 2020-06-19 | 2020-06-19 | Image brightness adjusting method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111738949B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112991206A (en) * | 2021-03-10 | 2021-06-18 | 北京百度网讯科技有限公司 | Image processing method, device, equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090185241A1 (en) * | 2008-01-18 | 2009-07-23 | Grigori Nepomniachtchi | Systems for mobile image capture and processing of documents |
US20130028484A1 (en) * | 2011-07-29 | 2013-01-31 | Canon Kabushiki Kaisha | Image processing apparatus for fundus image, image processing method for fundus image, and program medium |
CN103310422A (en) * | 2013-06-28 | 2013-09-18 | 新晨易捷(北京)科技有限公司 | Image acquiring method and device |
CN106558031A (en) * | 2016-12-02 | 2017-04-05 | 北京理工大学 | A kind of image enchancing method of the colored optical fundus figure based on imaging model |
CN108510473A (en) * | 2018-03-09 | 2018-09-07 | 天津工业大学 | The FCN retinal images blood vessel segmentations of convolution and channel weighting are separated in conjunction with depth |
CN110399929A (en) * | 2017-11-01 | 2019-11-01 | 腾讯科技(深圳)有限公司 | Eye fundus image classification method, device and computer readable storage medium |
CN110473176A (en) * | 2019-07-29 | 2019-11-19 | 腾讯医疗健康(深圳)有限公司 | Image processing method and device, method for processing fundus images, electronic equipment |
-
2020
- 2020-06-19 CN CN202010568199.3A patent/CN111738949B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090185241A1 (en) * | 2008-01-18 | 2009-07-23 | Grigori Nepomniachtchi | Systems for mobile image capture and processing of documents |
US20130028484A1 (en) * | 2011-07-29 | 2013-01-31 | Canon Kabushiki Kaisha | Image processing apparatus for fundus image, image processing method for fundus image, and program medium |
CN103310422A (en) * | 2013-06-28 | 2013-09-18 | 新晨易捷(北京)科技有限公司 | Image acquiring method and device |
CN106558031A (en) * | 2016-12-02 | 2017-04-05 | 北京理工大学 | A kind of image enchancing method of the colored optical fundus figure based on imaging model |
CN110399929A (en) * | 2017-11-01 | 2019-11-01 | 腾讯科技(深圳)有限公司 | Eye fundus image classification method, device and computer readable storage medium |
CN108510473A (en) * | 2018-03-09 | 2018-09-07 | 天津工业大学 | The FCN retinal images blood vessel segmentations of convolution and channel weighting are separated in conjunction with depth |
CN110473176A (en) * | 2019-07-29 | 2019-11-19 | 腾讯医疗健康(深圳)有限公司 | Image processing method and device, method for processing fundus images, electronic equipment |
Non-Patent Citations (2)
Title |
---|
易瑶;张东波;李雄;王耀南;: "基于背景估计和同态滤波的眼底图像归一化", 计算机工程, no. 14 * |
黄丽雯;王勃;宋涛;黄俊木;: "低光照彩色图像增强算法研究", 重庆理工大学学报(自然科学), no. 01 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112991206A (en) * | 2021-03-10 | 2021-06-18 | 北京百度网讯科技有限公司 | Image processing method, device, equipment and storage medium |
CN112991206B (en) * | 2021-03-10 | 2023-11-10 | 北京百度网讯科技有限公司 | Image processing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111738949B (en) | 2024-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhou et al. | Underwater image enhancement method via multi-feature prior fusion | |
CN107680056B (en) | Image processing method and device | |
CN111507914B (en) | Training method, repairing method, device, equipment and medium for face repairing model | |
US10742892B1 (en) | Apparatus and method for capturing and blending multiple images for high-quality flash photography using mobile electronic device | |
CN106683080B (en) | A kind of retinal fundus images preprocess method | |
CN110458826B (en) | Ambient brightness detection method and device | |
CN111064904A (en) | Dark light image enhancement method | |
CN103646392B (en) | Backlighting detecting and equipment | |
CN111127476A (en) | Image processing method, device, equipment and storage medium | |
CN110599418A (en) | Transform domain fused global tone mapping method | |
Wei et al. | An image fusion dehazing algorithm based on dark channel prior and retinex | |
CN111738949B (en) | Image brightness adjusting method and device, electronic equipment and storage medium | |
CN107369157A (en) | A kind of adaptive threshold Otsu image segmentation method and device | |
CN117218039A (en) | Image processing method, device, computer equipment and storage medium | |
CN116489330A (en) | Self-adaptive white balance method and device, electronic equipment and storage medium | |
CN116485679A (en) | Low-illumination enhancement processing method, device, equipment and storage medium | |
WO2023215371A1 (en) | System and method for perceptually optimized image denoising and restoration | |
CN116071623A (en) | Model training method, image-based processing method, device, equipment and medium | |
CN111739008B (en) | Image processing method, device, equipment and readable storage medium | |
CN114266803A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
Mpouziotas et al. | Object Detection for Low Light Images | |
Mosny et al. | Cubical gamut mapping colour constancy | |
CN113379631A (en) | Image defogging method and device | |
Chen | A PCB Image Self-adaption Threshold Segmentation Method Fusing Color Information and OTSU Theory | |
Yang et al. | Unsupervised Low Illumination Enhancement Model Based on YCbCr Color Space |
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 |