A method for enhancing uneven brightness of images
By constructing a random center point Gaussian distribution matrix and performing gamma transformation, uneven brightness enhancement of the image is solved, and the problem that image brightness enhancement cannot produce bright spots or highlights in the prior art is solved, and the variety of training data of the face recognition model is improved and model generalization ability.
Patent Information
- Application Number
- CN202011617790.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2040-12-31
AI Technical Summary
The existing image brightness enhancement methods are mainly uniform enhancement, and they cannot produce bright spots or highlight effects in the face images, which limits the training data diversity and model generalization capabilities of the face recognition model.
By constructing a random center point Gaussian distribution matrix and performing gamma transformation, the uneven brightness enhancement of the image is achieved, and the radiation effect of the random point light source on the image is simulated, thereby increasing the diversity of the image.
It improves the sample diversification and generalization capabilities of the face recognition model training set, and enhances the robustness of the model.
Smart Images

Figure CN114693534B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for enhancing uneven brightness of an image. Background Art
[0002] The existing face recognition technology is essentially to build a face recognition model, extract the feature vector of the face based on the model, and determine the identity information of the "new person" by matching the new picture ("new person") with the feature vector in the corpus. Face recognition models based on deep learning require a large number of face data sets to continuously train the model so that the feature vectors extracted by the model can better represent the facial features. Moreover, the data set for training face recognition models must not only be large in size, but also provide accurate labels and be compatible with various application scenarios.
[0003] Conventional training set enhancement methods generally include: image brightness, chroma, saturation enhancement, image flipping, rotation, scaling, cropping, translation, adding Gaussian noise, etc.; these data enhancement methods increase the amount of training data and improve the generalization ability of the model on the one hand; on the other hand, they increase noise data and improve the robustness of the model.
[0004] However, the current method of image brightness enhancement is mainly uniform enhancement, that is, all pixels of the image are increased or decreased by the same factor. If the original image is an image with uniform brightness, this conventional brightness enhancement cannot produce the effect of bright spots or bright spots in a certain area of the face. Summary of the invention
[0005] In order to solve the above problem, the purpose of this method is to achieve uneven enhancement of image brightness by constructing a Gaussian distribution matrix of a random center point for a face image with uniform brightness, enhancing it through gamma transformation, and then multiplying the enhanced distribution matrix by the original image.
[0006] Specifically, the present invention provides a method for enhancing uneven brightness of an image, the method comprising the following steps:
[0007] S1, construct a random center point Gaussian distribution matrix:
[0008] Standard Gaussian distribution matrix, the brightness value of any point on the image can be calculated by formula 1;
[0009]
[0010] Where i, j represent the coordinates of any point on the image, with the upper left corner as the origin of the coordinates, d represents the distance from any point on the image to the center of the image, and R represents the radius of the image;
[0011] Assume that the image has a height of H and a width of W. The random center point Gaussian distribution matrix is actually the randomization of the center point position in the standard Gaussian distribution matrix. The calculation methods of R and d are shown in formulas 4 and 5.
[0012]
[0013]
[0014] Among them, σ is the amplification factor of the radiation radius, (c x ,c y ) is a random center point and satisfies 0≤c x ≤H,0≤c y ≤W;
[0015] Among them, the value of σ must satisfy the requirement that most of the image area is radiated, that is, some values of the distribution matrix are not 0, so the value can be determined according to Formula 6;
[0016]
[0017] in, Where i, j represents the coordinates of any point on the image;
[0018] R m In fact, it is the maximum distance from a point on the image to the random center point of the distribution matrix;
[0019] S2, distribution matrix is enhanced by gamma transformation:
[0020] The random center point Gaussian distribution matrix is transformed by gamma to obtain brightness enhancement of different radiation intensities. The distribution matrix enhanced by gamma transformation can highlight or weaken the contrast.
[0021] S3, image unevenness enhancement:
[0022] Multiply the original image by the constructed random center point Gaussian distribution matrix to increase the offset, and take the value according to formula 7 to obtain the effect of image uneven enhancement.
[0023] I aug =(G+bias)*I src Formula 7
[0024] Among them, G is the constructed random center point Gaussian distribution matrix, and bias is the offset.
[0025] In step S1, the standard Gaussian distribution matrix is mapped to a grayscale range of 0 to 255, which is actually a brightness distribution diagram radiating from the center of the image. The brightness range is from 255 to 0, and the brightness gradually decreases from the center to the edge of the image. The highest brightness value in the center is 255, and the lowest brightness value at the edge is 0.
[0026] In step S1, assuming that the image has a height of H and a width of W, the image center of the standard Gaussian distribution matrix is The calculation method of the corresponding R,d is shown in formula 2,3;
[0027]
[0028]
[0029] In step S2, when the gamma value in the gamma transform is less than 1, the area with lower grayscale in the image will be stretched, and the area with higher grayscale will be compressed; when the gamma value is greater than 1, the area with higher grayscale in the image will be stretched, and the area with lower grayscale will be compressed.
[0030] In step S3, bias is an offset, which generally takes a value of 0.6 to 1.0.
[0031] Therefore, the advantages of this application are:
[0032] 1. It can realize uneven brightness enhancement of uniform brightness images, improve the diversity of face recognition model training set samples, and improve the generalization ability and robustness of the model.
[0033] 2. A brightness unevenness enhancement method based on Gaussian distribution matrix is proposed, and the effect of random point light source radiation in the image is achieved by randomizing the center point of the distribution matrix.
[0034] 3. By further enhancing the distribution matrix through gamma transformation, the distribution matrix can be made more variable, which can further increase the diversity of image enhancement. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0036] Figure 1 It is a schematic diagram of the process of the present invention.
[0037] Figure 2 It is a schematic diagram of the standard Gaussian distribution matrix.
[0038] Figure 3 It is a schematic diagram of the Gaussian distribution matrix of a random center point.
[0039] FIG4( a ) is a schematic diagram of a gamma coefficient of 0.5 of a standard Gaussian distribution matrix after gamma transformation.
[0040] FIG4( b ) is a schematic diagram of a gamma coefficient of 1.5 of a standard Gaussian distribution matrix after gamma transformation.
[0041] Figure 5(a) is the original image of lena.
[0042] FIG5( b ) is a schematic diagram of the distribution matrix.
[0043] Fig. 5(c) is a schematic diagram of the corresponding enhancement map. DETAILED DESCRIPTION
[0044] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.
[0045] like Figure 1 The present invention relates to a method for enhancing uneven brightness of an image, the method comprising the following steps:
[0046] S1, construct a random center point Gaussian distribution matrix:
[0047] Standard Gaussian distribution matrix, the brightness value of any point on the image can be calculated by formula 1;
[0048]
[0049] Where i, j represent the coordinates of any point on the image, with the upper left corner as the origin of the coordinates, d represents the distance from any point on the image to the center of the image, and R represents the radius of the image;
[0050] Assume that the image has a height of H and a width of W. The random center point Gaussian distribution matrix is actually the randomization of the center point position in the standard Gaussian distribution matrix. The calculation methods of R and d are shown in formulas 4 and 5.
[0051]
[0052]
[0053] Among them, σ is the amplification factor of the radiation radius, (c x ,c y ) is a random center point and satisfies 0≤c x ≤H,0≤c y ≤W;
[0054] Among them, the value of σ must satisfy the requirement that most of the image area is radiated, that is, some values of the distribution matrix are not 0, so the value can be determined according to Formula 6;
[0055]
[0056] in, Where i, j represents the coordinates of any point on the image; R m In fact, it is the maximum distance from a point on the image to the random center point of the distribution matrix;
[0057] S2, distribution matrix is enhanced by gamma transformation:
[0058] The random center point Gaussian distribution matrix is transformed by gamma to obtain brightness enhancement of different radiation intensities. The distribution matrix enhanced by gamma transformation can highlight or weaken the contrast.
[0059] S3, image unevenness enhancement:
[0060] Multiply the original image by the constructed random center point Gaussian distribution matrix to increase the offset, and take the value according to formula 7 to obtain the effect of image uneven enhancement.
[0061] I aug =(G+bias)*I src Formula 7
[0062] Among them, G is the constructed random center point Gaussian distribution matrix, and bias is the offset.
[0063] Specifically, the embodiments of the present invention are described as follows:
[0064] Step S1. Construct a random center point Gaussian distribution matrix
[0065] The standard Gaussian distribution matrix, mapped to the grayscale range of 0 to 255, is actually a brightness distribution map radiating from the center of the image, as shown in the attached figure. Figure 2 As shown, the brightness ranges from 255 to 0, and the brightness gradually decreases from the center to the edge of the image. The highest brightness value in the center is 255, and the lowest brightness value at the edge is 0. The brightness value of any point on the image can be calculated by formula 1;
[0066]
[0067] Where i, j represent the coordinates of any point on the image, with the upper left corner as the origin, d represents the distance from any point on the image to the center of the image, and R represents the radius of the image. Assuming the image is high H and wide W, the image center of the standard Gaussian distribution matrix is The calculation method of the corresponding R,d is shown in formula 2,3;
[0068]
[0069]
[0070] The random center point Gaussian distribution matrix is actually the randomization of the center point position in the standard Gaussian distribution matrix, where the calculation method of R and d is shown in formulas 4 and 5;
[0071]
[0072]
[0073] Among them, σ is the amplification factor of the radiation radius, (c x ,c y ) is a random center point and satisfies 0≤c x ≤H,0≤c y ≤W;
[0074] Among them, the value of σ must satisfy the requirement that most of the image area is radiated (that is, the value of some distribution matrix is not 0), so the value can be determined according to the formula σ;
[0075]
[0076] in, Where i, j represents the coordinates of any point on the image; R m In fact, it is the maximum distance from a point on the image to the random center point of the distribution matrix; Figure 3 As shown in FIG. 1 , a random center point Gaussian distribution matrix is mapped to the brightness image of the grayscale space. Step S2: Gamma transformation enhancement of the distribution matrix
[0077] The random center point Gaussian distribution matrix can be transformed into brightness enhancement with different radiation intensities after gamma transformation, as shown in the following figure. Figure 4(a)-4(b) As shown in the figure, the standard Gaussian distribution matrix after gamma transformation, where (a) gamma coefficient is 0.5, (b) gamma coefficient is 1.5. The distribution matrix after gamma transformation enhancement can highlight or weaken the contrast; when the gamma value in the gamma transformation is less than 1, the area with lower grayscale in the image will be stretched, and the area with higher grayscale will be compressed; when the gamma value is greater than 1, the area with higher grayscale in the image will be stretched, and the area with lower grayscale will be compressed.
[0078] Step S3: Image non-uniformity enhancement
[0079] The effect of image uneven enhancement can be obtained by multiplying the original image by the constructed random center point Gaussian distribution matrix (adding offset) (as shown in Formula 7), as shown in Figure 5(a)-5(c) As shown, (a) lena original image, (b) distribution matrix and (c) corresponding enhanced image.
[0080] I aug =(G+bias)*I src Formula 7
[0081] Among them, G is the constructed random center point Gaussian distribution matrix, bias is the offset, which generally takes a value of 0.6 to 1.0, which can ensure better image visual effects.
[0082] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for enhancing uneven brightness of an image, characterized in that: The method comprises the following steps: S1, construct a random center point Gaussian distribution matrix: Standard Gaussian distribution matrix, the brightness value of any point on the image can be calculated by formula 1; Where i, j represent the coordinates of any point on the image, with the upper left corner as the origin of the coordinates, d represents the distance from any point on the image to the center of the image, and R represents the radius of the image; Assume that the image has a height of H and a width of W. The random center point Gaussian distribution matrix is actually the randomization of the center point position in the standard Gaussian distribution matrix. The calculation methods of R and d are shown in formulas 4 and 5. Among them, σ is the amplification factor of the radiation radius, (c x ,c y ) is a random center point and satisfies 0≤c x ≤H,0≤c y ≤W; Among them, the value of σ must satisfy the requirement that most of the image area is radiated, that is, some values of the distribution matrix are not 0, so the value can be determined according to Formula 6; in, Where i, j represents the coordinates of any point on the image; R m In fact, it is the maximum distance from a point on the image to the random center point of the distribution matrix; S2, distribution matrix is enhanced by gamma transformation: The random center point Gaussian distribution matrix is transformed by gamma to obtain brightness enhancement of different radiation intensities. The distribution matrix enhanced by gamma transformation can highlight or weaken the contrast. S3, image unevenness enhancement: Multiply the original image by the constructed random center point Gaussian distribution matrix to increase the offset, and take the value according to formula 7 to obtain the effect of image uneven enhancement. I aug =(G + bias)*I src Equation 7 Among them, G is the constructed random center point Gaussian distribution matrix, and bias is the offset.
2. The method for realizing image uneven brightness enhancement according to claim 1, characterized in that: In step S1, the standard Gaussian distribution matrix is mapped to a grayscale range of 0 to 255, which is actually a brightness distribution diagram radiating from the center of the image. The brightness range is from 255 to 0, and the brightness gradually decreases from the center to the edge of the image. The highest brightness value in the center is 255, and the lowest brightness value at the edge is 0.
3. The method for realizing image uneven brightness enhancement according to claim 1, characterized in that: In step S1, assuming that the image has a height of H and a width of W, the image center of the standard Gaussian distribution matrix is The calculation method of the corresponding R,d is shown in formula 2,3; 4. The method for realizing image uneven brightness enhancement according to claim 1, characterized in that: In step S2, when the gamma value in the gamma transform is less than 1, the area with lower grayscale in the image will be stretched, and the area with higher grayscale will be compressed; when the gamma value is greater than 1, the area with higher grayscale in the image will be stretched, and the area with lower grayscale will be compressed.
5. The method for realizing image uneven brightness enhancement according to claim 1, characterized in that: In step S3, bias is an offset, which generally takes a value of 0.6 to 1.0.
Citation Information
Patent Citations
Half-bright and half-dark face processing method and device
CN107358578A
Gaussian mixture model based illumination normalization for global enhancement
US20110123133A1
Image processing method, apparatus, electronic device and storage medium
WO2019148912A1
