Image brightness compensation method and system
By converting the image from RGB space to YCbCr space, performing histogram correction and brightness compensation, and color protection on the Cb and Cr channels, the quality problem of the captured image caused by the large contrast between light and dark is solved, and the image brightness is uniform and the details are restored.
Patent Information
- Application Number
- CN202211037020.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-08-29
AI Technical Summary
When shooting images, the contrast between light and dark is large due to backlighting, strong infrared reflection from objects, and low ambient brightness, which affects the image quality.
Convert the image from RGB space to YCbCr space, count the number of grayscale pixels in the Y channel, perform histogram correction and dynamic contrast segmentation function to calculate brightness compensation, perform color protection processing on the Cb and Cr channels, and finally convert the image back to RGB space.
It adjusts the overly bright and dark areas of the image, improves the overall brightness uniformity of the image, restores more details and colors, and improves image quality.
Smart Images

Figure CN115345798B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image brightness compensation method and system. Background Art
[0002] Generally, when taking images, the image will have a large contrast between light and dark due to backlighting, strong infrared reflection from objects, and a closed environment with low brightness. Such a large contrast between light and dark will result in a loss of picture details.
[0003] For example, when shooting a portrait against the light, the subject will be black and the background will be too bright; when shooting a surgical procedure, the area where the light is directly exposed will be very bright, and the output image will become white due to overexposure, while other areas with relatively weak light will be very dark, and the output image will become black due to underexposure, seriously affecting the image quality. Summary of the Invention
[0004] The purpose of the present invention is to provide an image brightness compensation method and system to improve image quality.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for image brightness compensation, comprising:
[0007] Convert the target image from RGB space to YCbCr space to obtain a YCbCr space image;
[0008] Counting the number of pixels of each gray level in the Y channel of the YCbCr spatial image;
[0009] Performing histogram correction on the YCbCr spatial image, and calculating the number of pixels at each grayscale level of the Y channel of the YCbCr spatial image after the histogram correction;
[0010] calculating the grayscale of each pixel in the Y channel of the YCbCr spatial image according to the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function to obtain a Y channel after brightness compensation; the dynamic contrast piecewise function is used to calculate the contrast of each grayscale level;
[0011] Performing color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image;
[0012] The YCbCr space image composed of the Y channel after brightness compensation and the Cb channel and Cr channel after color protection processing is converted to RGB space to generate an output image.
[0013] Optionally, performing histogram correction on the YCbCr spatial image and calculating the number of pixels of each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction specifically includes:
[0014] When 0≤Y ave When ≤M_Th:
[0015]
[0016] When M_Th<Y ave When ≤255:
[0017]
[0018] Wherein, n" (k) represents the number of pixels of gray level k in the Y channel of the YCbCr spatial image after histogram correction, Y ave is the average grayscale of the Y channel of the YCbCr spatial image, M_Th represents the preset mid-field threshold, begin_n is the preset start node, end_n is the preset stop node, 0<begin_n<stop_n<255, m is the row of the target image, n is the column of the target image, and n'(k) represents the number of pixels in each preset grayscale level;
[0019]
[0020] Optionally, calculating the grayscale of each pixel in the Y channel of the YCbCr spatial image according to the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function to obtain the brightness-compensated Y channel specifically includes:
[0021] According to the formula Y out (i,j)=χ(Y in (i, j)) Calculate the grayscale of each pixel in the Y channel after brightness compensation;
[0022] in,
[0023] Y in (i, j) represents the grayscale of the Y channel of the YCbCr space image in the i-th row and j-th column, Y out (i, j) represents the grayscale of the i-th row and j-th column of the Y channel of the YCbCr spatial image after brightness compensation, χ(k) represents the grayscale after compensation for grayscale level k, Y(·) represents the dynamic contrast piecewise function, α is the exponential coefficient, and β is the gain coefficient.
[0024] Optionally, performing color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image specifically includes:
[0025] Calculate the value of each pixel after color protection processing according to the formula YCbCrOut(i,j,n)=YCbCrIn(i,j,n)+l(index)*λ*YCbCrIn(i,j,n);
[0026] Among them, n takes values of 2 and 3, n=2 represents the Cb channel of the YCbCr spatial image, n=3 represents the Cr channel of the YCbCr spatial image, YCbCrOut(i,j,n) represents the pixel value of the i-th row and j-th column of the n-th channel after color protection processing, YCbCrIn(i,j,n) represents the pixel of the i-th row and j-th column of the n-th channel before color protection processing, l(index) represents the color protection coefficient function, and the index range is 0 to 255; λ represents the correction coefficient.
[0027] The present invention discloses an image brightness compensation system, comprising:
[0028] A space conversion module is used to convert the target image from RGB space to YCbCr space to obtain a YCbCr space image;
[0029] A pixel number counting module, used to count the number of pixels of each gray level in the Y channel of the YCbCr spatial image;
[0030] a histogram correction module, configured to perform histogram correction on the YCbCr spatial image and calculate the number of pixels at each grayscale level of the Y channel of the YCbCr spatial image after the histogram correction;
[0031] a brightness compensation module, configured to calculate the grayscale of each pixel in the Y channel of the YCbCr spatial image based on the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function, to obtain a brightness-compensated Y channel; the dynamic contrast piecewise function is used to calculate the contrast of each grayscale level;
[0032] A color protection module, configured to perform color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image;
[0033] The image output module is used to convert the YCbCr space image composed of the Y channel after brightness compensation and the Cb channel and Cr channel after color protection processing into the RGB space to generate an output image.
[0034] Optionally, the pixel quantity statistics module specifically includes:
[0035] Pixel number counting unit, used for:
[0036] When 0≤Y ave When ≤M_Th:
[0037]
[0038] When M_Th<Y ave When ≤255:
[0039]
[0040] Wherein, n" (k) represents the number of pixels of gray level k in the Y channel of the YCbCr spatial image after histogram correction, Y ave is the average grayscale of the Y channel of the YCbCr spatial image, M_Th represents the preset mid-field threshold, begin_n is the preset start node, end_n is the preset stop node, 0<begin_n<stop_n<255, m is the row of the target image, n is the column of the target image, and n'(k) represents the number of pixels in each preset grayscale level;
[0041]
[0042] Optionally, the brightness compensation module specifically includes:
[0043] Brightness compensation unit, used to calculate the brightness of the image according to the formula Y out (i,j)=χ(Y in (i, j)) Calculate the grayscale of each pixel in the Y channel after brightness compensation;
[0044] in,
[0045] Y in (i, j) represents the grayscale of the Y channel of the YCbCr space image in the i-th row and j-th column, Y out (i, j) represents the grayscale of the i-th row and j-th column of the Y channel of the YCbCr spatial image after brightness compensation, χ(k) represents the grayscale after compensation for grayscale level k, Y(·) represents the dynamic contrast piecewise function, α is the exponential coefficient, and β is the gain coefficient.
[0046] Optionally, the color protection module specifically includes:
[0047] The color protection module unit is used to calculate the value of each pixel after color protection processing according to the formula YCbCrOut(i,j,n)=YCbCrIn(i,j,n)+l(index)*λ*YCbCrIn(i,j,n);
[0048] Among them, n takes values of 2 and 3, n=2 represents the Cb channel of the YCbCr spatial image, n=3 represents the Cr channel of the YCbCr spatial image, YCbCrOut(i,j,n) represents the pixel value of the i-th row and j-th column of the n-th channel after color protection processing, YCbCrIn(i,j,n) represents the pixel of the i-th row and j-th column of the n-th channel before color protection processing, l(index) represents the color protection coefficient function, and the index range is 0 to 255; λ represents the correction coefficient.
[0049] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0050] Based on the statistics of the number of pixels at each grayscale level and histogram correction, the present invention adjusts the overly bright and dark areas of the image, and at the same time performs color correction on the image after brightness compensation to make the overall brightness of the image uniform, restore more details and colors to the captured image, and improve image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 This is a flow chart of an image brightness compensation method according to the present invention;
[0053] Figure 2 is the grayscale image of the overbright image;
[0054] Figure 3 It is the grayscale image of the too dark image;
[0055] Figure 4 is a uniform image grayscale image;
[0056] Figure 5 for Figure 2 Corresponding histogram distribution diagram;
[0057] Figure 6 for Figure 3 Corresponding histogram distribution diagram;
[0058] Figure 7 for Figure 4 Corresponding histogram distribution diagram;
[0059] Figure 8 The figure is a structural diagram of an image brightness compensation system according to the present invention. DETAILED DESCRIPTION
[0060] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0061] The purpose of the present invention is to provide an image brightness compensation method and system to improve image quality.
[0062] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0063] Figure 1 FIG. 1 is a flow chart of an image brightness compensation method according to the present invention. Figure 1 As shown, a method for image brightness compensation includes:
[0064] Step 101: Convert the target image from the RGB space to the YCbCr space to obtain a YCbCr space image.
[0065] The target image includes an image captured during surgery.
[0066] The formula for converting RGB to YCbCr space is:
[0067]
[0068] Step 102: Count the number n(k) of pixels of each gray level in the Y channel of the YCbCr spatial image.
[0069] The value range of k is: 0≤k≤255.
[0070] The average grayscale of the Y channel of the YCbCr space image
[0071] According to the statistical number of pixels at each gray level n(k), the grayscale histogram distribution of the target image as a whole can be found. Figure 2-Figure 7 As shown in the figure, the histogram of the image that is too bright is concentrated on the side with high grayscale, while the histogram of the image that is too dark is concentrated on the side with low grayscale. This step is to correct the histogram of each grayscale and judge the Y ave The histogram is adjusted based on the interval range and the theoretical average number of pixels n'(k).
[0072] Wherein, step 102 specifically includes:
[0073] When 0≤Yave When ≤M_Th:
[0074]
[0075] When M_Th<Y ave When ≤255:
[0076]
[0077] Wherein, n" (k) represents the number of pixels of gray level k in the Y channel of the YCbCr spatial image after histogram correction, Y ave is the average grayscale of the Y channel of the YCbCr spatial image, M_Th represents the preset mid-field threshold, begin_n is the preset start node, end_n is the preset stop node, 0<begin_n<stop_n<255, m is the row of the target image, n is the column of the target image, and n'(k) represents the number of pixels in each preset grayscale level;
[0078]
[0079] Step 103: performing histogram correction on the YCbCr spatial image, and calculating the number of pixels of each gray level in the Y channel of the YCbCr spatial image after the histogram correction.
[0080] Step 104: Calculate the grayscale of each pixel in the Y channel of the YCbCr spatial image based on the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function to obtain a Y channel after brightness compensation; the dynamic contrast piecewise function is used to calculate the contrast of each grayscale level.
[0081] Wherein, step 104 specifically includes:
[0082] The dynamic contrast segmentation function Y(k) is expressed as:
[0083]
[0084] Wherein, L_Th represents the preset dark field threshold, M_Th represents the preset middle field threshold, H_Th represents the preset bright field threshold, L_Th <M_Th<H_Th。
[0085] For the preset thresholds L_Th, M_Th and H_Th corresponding to the dark field, middle field and bright field respectively, calculate the initial dark field function L(k), middle field function M(k) and bright field function H(k), and then determine the preset thresholds and the average grayscale Y aveThe dynamic contrast piecewise function is determined by interpolating three functions.
[0086] L(k) represents the dark field function, M(k) represents the mid field function, and H(k) represents the bright field function.
[0087] L(k)=a1*(k / 255)^b1;
[0088]
[0089] H(k)=a3*(k / 255)^b3;
[0090] Among them, a1, b1, a2, b2, c2, a3 and b3 are all set parameters and can be adjusted.
[0091] According to the formula Y out (i,j)=χ(Y in (i, j)) Calculate the grayscale of each pixel in the Y channel after brightness compensation;
[0092] in,
[0093] Y in (i, j) represents the grayscale of the Y channel of the YCbCr space image in the i-th row and j-th column, Y out (i, j) represents the grayscale of the i-th row and j-th column of the Y channel of the YCbCr spatial image after brightness compensation, that is, the output of the Y channel, χ(k) is the brightness mapping function, χ(k) represents the grayscale after compensation of grayscale level k, Y(·) represents the dynamic contrast piecewise function, α is the exponential coefficient, and β is the gain coefficient.
[0094] Step 105: Perform color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image, so as to highlight the details of the overall image while also restoring the color.
[0095] Wherein, step 105 specifically includes:
[0096] Calculate the value of each pixel after color protection processing according to the formula YCbCrOut(i,j,n)=YCbCrIn(i,j,n)+l(index)*λ*YCbCrIn(i,j,n);
[0097] Among them, n takes values of 2 and 3, n=2 represents the Cb channel of the YCbCr spatial image, n=3 represents the Cr channel of the YCbCr spatial image, YCbCrOut(i,j,n) represents the pixel value of the i-th row and j-th column of the n-th channel after color protection processing, YCbCrIn(i,j,n) represents the pixel of the i-th row and j-th column of the n-th channel before color protection processing, l(index) represents the color protection coefficient function, and the index range is 0 to 255; λ represents the correction coefficient.
[0098] Step 106: Convert the YCbCr space image composed of the Y channel after brightness compensation and the Cb channel and Cr channel after color protection processing to the RGB space to generate an output image.
[0099] The formula for converting YCbCr to RGB space is:
[0100]
[0101] The image brightness compensation method of the present invention is based on the statistics of the number of pixels at each grayscale level and histogram correction, and adjusts the overly bright and dark areas of the image. At the same time, the image after brightness compensation is subjected to color protection processing to make the overall brightness of the image uniform, restore more details and colors to the captured image, and solve the problems of loss of image details due to excessive brightness or darkness and color changes caused by changes in image brightness and darkness.
[0102] Figure 8 This is a schematic diagram of the structure of an image brightness compensation system of the present invention. Figure 8 As shown, an image brightness compensation system includes:
[0103] The space conversion module 201 is used to convert the target image from the RGB space to the YCbCr space to obtain a YCbCr space image.
[0104] The pixel number counting module 202 is used to count the number of pixels of each gray level in the Y channel of the YCbCr spatial image.
[0105] The histogram correction module 203 is configured to perform histogram correction on the YCbCr spatial image and calculate the number of pixels at each grayscale level of the Y channel of the YCbCr spatial image after the histogram correction.
[0106] The brightness compensation module 204 is configured to calculate the grayscale of each pixel in the Y channel of the YCbCr spatial image based on the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function to obtain a brightness-compensated Y channel; the dynamic contrast piecewise function is configured to calculate the contrast of each grayscale level.
[0107] The color protection module 205 is configured to perform color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image.
[0108] The image output module 206 is used to convert the YCbCr space image composed of the Y channel after brightness compensation and the Cb channel and Cr channel after color protection processing into the RGB space to generate an output image.
[0109] The pixel number statistics module 202 specifically includes:
[0110] Pixel number counting unit, used for:
[0111] When 0≤Y ave When ≤M_Th:
[0112]
[0113] When M_Th<Y ave When ≤255:
[0114]
[0115] Wherein, n" (k) represents the number of pixels of gray level k in the Y channel of the YCbCr spatial image after histogram correction, Y ave is the average grayscale of the Y channel of the YCbCr spatial image, M_Th represents the preset mid-field threshold, begin_n is the preset start node, end_n is the preset stop node, 0<begin_n<stop_n<255, m is the row of the target image, n is the column of the target image, and n'(k) represents the number of pixels in each preset grayscale level;
[0116]
[0117] The brightness compensation module 204 specifically includes:
[0118] Brightness compensation unit, used to calculate the brightness of the image according to the formula Y out (i,j)=χ(Y in (i, j)) calculates the grayscale of each pixel in the Y channel after brightness compensation.
[0119] in,
[0120] Y in (i, j) represents the grayscale of the Y channel of the YCbCr space image in the i-th row and j-th column, Y out(i, j) represents the grayscale of the i-th row and j-th column of the Y channel of the YCbCr spatial image after brightness compensation, χ(k) represents the grayscale after compensation for grayscale level k, Y(·) represents the dynamic contrast piecewise function, α is the exponential coefficient, and β is the gain coefficient.
[0121] The color protection module 205 specifically includes:
[0122] The color protection module unit is used to calculate the value of each pixel after color protection processing according to the formula YCbCrOut(i,j,n)=YCbCrIn(i,j,n)+l(index)*λ*YCbCrIn(i,j,n);
[0123] Among them, n takes values of 2 and 3, n=2 represents the Cb channel of the YCbCr spatial image, n=3 represents the Cr channel of the YCbCr spatial image, YCbCrOut(i,j,n) represents the pixel value of the i-th row and j-th column of the n-th channel after color protection processing, YCbCrIn(i,j,n) represents the pixel of the i-th row and j-th column of the n-th channel before color protection processing, l(index) represents the color protection coefficient function, and the index range is 0 to 255; λ represents the correction coefficient.
[0124] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0125] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A method for image brightness compensation, characterized in that: include: Convert the target image from RGB space to YCbCr space to obtain a YCbCr space image; Counting the number of pixels of each gray level in the Y channel of the YCbCr spatial image; Performing histogram correction on the YCbCr spatial image, and calculating the number of pixels at each grayscale level of the Y channel of the YCbCr spatial image after the histogram correction; Calculating the grayscale of each pixel in the Y channel of the YCbCr spatial image according to the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function to obtain a Y channel after brightness compensation; The dynamic contrast segmentation function is used to calculate the contrast of each gray level; Performing color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image; Convert the YCbCr space image composed of the Y channel after brightness compensation and the Cb channel and Cr channel after color protection processing to RGB space to generate an output image; The performing histogram correction on the YCbCr spatial image and calculating the number of pixels of each grayscale level of the Y channel of the YCbCr spatial image after the histogram correction specifically includes: When 0≤Y ave When ≤M_Th: When M_Th<Y ave When ≤255: Wherein, n" (k) represents the number of pixels of gray level k in the Y channel of the YCbCr spatial image after histogram correction, Y ave is the average grayscale of the Y channel of the YCbCr spatial image, M_Th represents the preset mid-field threshold, begin_n is the preset start node, end_n is the preset stop node, 0<begin_n<stop_n<255, m is the row of the target image, n is the column of the target image, and n'(k) represents the number of pixels in each preset grayscale level; The step of calculating the grayscale of each pixel in the Y channel of the YCbCr spatial image according to the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function to obtain the Y channel after brightness compensation specifically includes: According to the formula Y out (i,j)=χ(Y in (i, j)) Calculate the grayscale of each pixel in the Y channel after brightness compensation; in, Y in (i, j) represents the grayscale of the Y channel of the YCbCr space image in the i-th row and j-th column, Y out (i, j) represents the grayscale of the i-th row and j-th column of the Y channel of the YCbCr spatial image after brightness compensation, χ(k) represents the grayscale after compensation for grayscale level k, Y(·) represents the dynamic contrast piecewise function, α is the exponential coefficient, and β is the gain coefficient.
2. The image brightness compensation method according to claim 1, characterized in that: The performing color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image specifically includes: Calculate the value of each pixel after color protection processing according to the formula YCbCrOut(i,j,n)=YCbCrIn(i,j,n)+l(index)*λ*YCbCrIn(i,j,n); Among them, n takes values of 2 and 3, n=2 represents the Cb channel of the YCbCr spatial image, n=3 represents the Cr channel of the YCbCr spatial image, YCbCrOut(i,j,n) represents the pixel value of the i-th row and j-th column of the n-th channel after color protection processing, YCbCrIn(i,j,n) represents the pixel of the i-th row and j-th column of the n-th channel before color protection processing, l(index) represents the color protection coefficient function, and the index range is 0 to 255; λ represents the correction coefficient.
3. An image brightness compensation system, characterized in that: include: A space conversion module is used to convert the target image from RGB space to YCbCr space to obtain a YCbCr space image; A pixel number counting module, used to count the number of pixels of each gray level in the Y channel of the YCbCr spatial image; a histogram correction module, configured to perform histogram correction on the YCbCr spatial image and calculate the number of pixels at each grayscale level of the Y channel of the YCbCr spatial image after the histogram correction; a brightness compensation module, configured to calculate the grayscale of each pixel in the Y channel of the YCbCr spatial image based on the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image, the number of pixels at each grayscale level in the Y channel of the YCbCr spatial image after the histogram correction, and a dynamic contrast piecewise function, to obtain a brightness-compensated Y channel; The dynamic contrast segmentation function is used to calculate the contrast of each gray level; A color protection module, configured to perform color protection processing on the Cb channel and the Cr channel of the YCbCr spatial image; The image output module is used to convert the YCbCr space image composed of the Y channel after brightness compensation and the Cb channel and Cr channel after color protection processing into the RGB space to generate an output image; The pixel number statistics module specifically includes: Pixel number counting unit, used for: When 0≤Y ave When ≤M_Th: When M_Th<Y ave When ≤255: Wherein, n" (k) represents the number of pixels of gray level k in the Y channel of the YCbCr spatial image after histogram correction, Y ave is the average grayscale of the Y channel of the YCbCr spatial image, M_Th represents the preset mid-field threshold, begin_n is the preset start node, end_n is the preset stop node, 0<begin_n<stop_n<255, m is the row of the target image, n is the column of the target image, and n'(k) represents the number of pixels in each preset grayscale level; The brightness compensation module specifically includes: Brightness compensation unit, used to calculate the brightness of the image according to the formula Y out (i,j)=χ(Y in (i, j)) Calculate the grayscale of each pixel in the Y channel after brightness compensation; in, Y in (i, j) represents the grayscale of the Y channel of the YCbCr space image in the i-th row and j-th column, Y out (i, j) represents the grayscale of the i-th row and j-th column of the Y channel of the YCbCr spatial image after brightness compensation, χ(k) represents the grayscale after compensation for grayscale level k, Y(·) represents the dynamic contrast piecewise function, α is the exponential coefficient, and β is the gain coefficient.
4. The image brightness compensation system according to claim 3, characterized in that: The color protection module specifically includes: The color protection module unit is used to calculate the value of each pixel after color protection processing according to the formula YCbCrOut(i,j,n)=YCbCrIn(i,j,n)+l(index)*λ*YCbCrIn(i,j,n); Among them, n takes values of 2 and 3, n=2 represents the Cb channel of the YCbCr spatial image, n=3 represents the Cr channel of the YCbCr spatial image, YCbCrOut(i,j,n) represents the pixel value of the i-th row and j-th column of the n-th channel after color protection processing, YCbCrIn(i,j,n) represents the pixel of the i-th row and j-th column of the n-th channel before color protection processing, l(index) represents the color protection coefficient function, and the index range is 0 to 255; λ represents the correction coefficient.
Citation Information
Patent Citations
Dynamic contrast enhancement device and method
CN102231264A
Image enhancement method and computer readable storage medium
CN107563984A