A method of image brightness adjustment that preserves contrast
Patent Information
- Application Number
- CN202311662445.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-12-06
AI Technical Summary
[0002]现有的图像亮度调节方法是对全图像进行处理,在将图像亮度拉升的同时,也会拉升图像的噪声,导致亮度提升后的图像噪声水平也有明显提高,亮度提升后图像的对比度不足
[0028]本发明的图像亮度调节方法,有别于一般的全图图像亮度调节方法,此方法在调节亮度之前将原图分离为背景图和细节图两部分,对背景图做非线性亮度调节后,将亮度调节后的背景图与细节增强后的细节图进行融合,得到输出图像,输出图像可以很好地增强显示图像的暗部区域、保持图像亮处区域亮度的同时,保持较高的图像对比度、较低的噪声水平,在实际应用场景中很好地消除暗角和暗部区域并提升暗部的图像细节。
Smart Images

Figure CN117635505B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and specifically relates to an image brightness adjustment method that maintains contrast. Background Technology
[0002] Existing image brightness adjustment methods process the entire image. While increasing the image brightness, they also increase the image noise, resulting in a significant increase in the noise level of the image after brightness enhancement and insufficient contrast. Summary of the Invention
[0003] To address the aforementioned technical problems, namely reducing image noise levels and improving image contrast after brightness enhancement, this invention provides the following technical solution:
[0004] A method for adjusting image brightness while maintaining contrast includes the following steps:
[0005] Step S1: Extract the outline of the original image in the RGB color space to obtain the detail image;
[0006] Step S2: Obtain the background image, which is the image obtained by subtracting the original image from the detail image;
[0007] Step S3: Perform non-linear brightness enhancement on the background image and enhance the details of the detail image in the RGB color space;
[0008] Step S4: Output image. The output image is the image after the background image with enhanced brightness and the detail image with enhanced detail are fused together.
[0009] Further, step S1 includes:
[0010] Step S11: Apply Gaussian filtering to the original image;
[0011] Step S12: Obtain the detail image. Each pixel in the detail image is a signed number. The detail image is the image obtained by differential processing of the original image and the filtered image.
[0012] Further, step S11 involves applying a Gaussian filter to the original image using an N*N window template in the RGB three channels, where N*N is the size of the filtering window.
[0013] Furthermore, methods for obtaining detailed images include using USM, two-dimensional FFT, or threshold segmentation.
[0014] Furthermore, step S3, which involves non-linear brightness enhancement of the background image, includes the following steps:
[0015] Step S31: Convert the background image from RGB color space to HSV color space;
[0016] Step S32: Perform non-linear brightness enhancement on all pixels of the background image in the HSV color space;
[0017] Step S33: Convert the background image with increased brightness back to the RGB color space.
[0018] Furthermore, the brightness enhancement curve used for nonlinear brightness enhancement in step S32 is a smooth brightness curve.
[0019] Furthermore, the brightness curve function is:
[0020] Lut[i]=I+sin(PI*i / 255.0)*K*(1-(1 / 255)*i),
[0021] Where i is the original brightness value, and Lut[i] is the result of replacing the original brightness value i with a lookup table, that is, the brightness value after enhancement;
[0022] A brightness enhancement lookup table is created using this brightness curve function to determine the brightness enhancement values for different brightness regions of the image, and then a non-linear brightness enhancement is performed on the background image.
[0023] Furthermore, step S3, which enhances the detail image in the RGB color space, includes the following steps:
[0024] Step S34: Calculate the brightness gain coefficient. The brightness gain coefficient value is the value of the brightness enhancement of the V channel in the HSV color space divided by the original value, to obtain a brightness gain coefficient map composed of the brightness gain coefficients.
[0025] Step S35: Calculate the enhanced detail image in the RGB color space. The value of each pixel in the enhanced detail image is the original detail image multiplied by a gain. The gain value is the brightness gain coefficient of the corresponding pixel in the brightness gain coefficient image obtained in step S34.
[0026] Furthermore, the brightness gain coefficient is a floating-point number.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] The image brightness adjustment method of the present invention differs from the general full-image brightness adjustment method. Before adjusting the brightness, this method separates the original image into two parts: a background image and a detail image. After performing non-linear brightness adjustment on the background image, the brightness-adjusted background image is fused with the detail image after detail enhancement to obtain the output image. The output image can effectively enhance the dark areas of the displayed image, maintain the brightness of the bright areas of the image, and maintain high image contrast and low noise level. In practical application scenarios, it can effectively eliminate vignetting and dark areas and improve image details in dark areas. Attached Figure Description
[0029] Figure 1 This is a flowchart of the image brightness adjustment method of the present invention;
[0030] Figure 2 This is the original image before processing by the image brightness adjustment method of the present invention;
[0031] Figure 3 To process the image brightness adjustment method of the present invention Figure 2 The output image after that. Specific implementation methods
[0032] The technical solution of the present invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are not all embodiments of the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0033] like Figure 1 As shown, the present invention provides an image brightness adjustment method that maintains contrast, comprising the following steps:
[0034] Step S1: Extract the outline of the original image in the RGB color space to obtain the detail image;
[0035] The specific method is as follows:
[0036] Step S11: Apply Gaussian filtering to the original image;
[0037] Specifically, the original image is subjected to Gaussian filtering using an N*N window template in the RGB three channels to obtain the filtered image. N*N is the size of the filtering window, and N takes an odd number. It is recommended to select values such as 3*3, 5*5, 7*7 for the window N*N.
[0038] Step S12: Obtain detailed images;
[0039] The detail map in the RGB color space is calculated using methods such as USM, two-dimensional FFT, or threshold segmentation. Each pixel in the detail map is a signed number. The calculation method is as follows: the detail map is the image obtained by difference processing between the original image and the filtered image.
[0040] Step S2: Obtain the background image;
[0041] The specific method is as follows:
[0042] Step S21: Calculate the background image in the RGB color space. The background image is the image obtained by subtracting the original image from the detail image.
[0043] Step S3: Perform non-linear brightness enhancement on the background image and enhance the details of the detail image in the RGB color space;
[0044] The background image undergoes a non-linear brightness enhancement, specifically achieved through the following method:
[0045] Step S31: Convert the background image from RGB color space to HSV color space;
[0046] Step S32: Perform non-linear brightness enhancement on all pixels of the background image in the HSV color space;
[0047] The brightness enhancement curve used for non-linear brightness enhancement can be adjusted arbitrarily according to requirements. In this example, a smooth brightness enhancement curve is used, with a higher brightness enhancement value at low brightness and a lower brightness enhancement value at high brightness, approaching zero. The specific brightness enhancement value can be determined using the brightness curve function shown below, creating a brightness enhancement lookup table. If K = 80, the brightness enhancement lookup table is shown in Table 1. This lookup table is for 8-bit images with grayscale values ranging from 0 to 255.
[0048] Lut[i]=i+sin(PI*i / 255.0)*K*(1-(1 / 255)*i)
[0049] K is the brightness enhancement coefficient, i is the original brightness value, and Lut[i] is the result of replacing the original brightness value i with a lookup table, i.e., the brightness enhancement value.
[0050] A brightness enhancement lookup table is created using this brightness curve function to determine the brightness enhancement values for different brightness regions of the image, and then a non-linear brightness enhancement is performed on the background image.
[0051] Table 1
[0052]
[0053]
[0054]
[0055]
[0056]
[0057] The brightness enhancement operation, within the HSV color space, keeps the H and S channel values unchanged, while mapping the V channel using a lookup table to increase the brightness of dark areas in the background image. Regarding the brightness enhancement curve, the lookup table formula provided in this embodiment aims to maximize the grayscale value of pixels at low brightness levels while keeping the grayscale value of pixels at high brightness levels approximately unchanged. In the actual image, this translates to increased brightness in dark areas while keeping the brightness in bright areas approximately unchanged, thus ensuring a smooth brightness enhancement curve.
[0058] Depending on the specific needs, other brightness enhancement curves can be modified based on the method described in this article to adapt to different brightness adjustment requirements.
[0059] Step S33: Convert the background image with increased brightness back to the RGB color space;
[0060] The specific method for enhancing the detail image in the RGB color space is as follows:
[0061] Step S34: Calculate the brightness gain coefficient;
[0062] The value of each pixel in the brightness gain coefficient map (i.e., the brightness gain coefficient corresponding to that pixel) is a floating-point number. The brightness gain coefficient value is the value of the pixel after brightness enhancement in the HSV color space V channel divided by the original value.
[0063] Step S35: Calculate the enhanced detail image in the RGB color space;
[0064] The value of each pixel in the enhanced detail image is the original detail image multiplied by a gain, and the gain value is the value of the corresponding pixel in the brightness gain coefficient image calculated in step S34.
[0065] Step S4: Output image. The output image is the image after the background image with enhanced brightness and the detail image with enhanced detail are fused together.
[0066] Based on the aforementioned image brightness adjustment method that preserves contrast, a specific example is provided, wherein the Gaussian filter window number used in step S11 is 5*5, i.e., N=5; in step S32, the brightness enhancement coefficient K=80 is used. Figure 2 The original image before processing. Figure 3 This is the output image after brightness adjustment.
[0067] Therefore, in this embodiment, by separating the image into a background image and a detail image, adjusting the brightness curve of the background image, and enhancing the detail image, the output image can effectively enhance the dark areas of the displayed image while maintaining a high image contrast (not less than 4-2, i.e., 17.95 lp / mm) and a low noise level (signal-to-noise ratio not less than 30dB). In practical applications, this effectively eliminates vignetting and dark areas while improving image details in dark areas.
[0068] Therefore, the image brightness adjustment method that maintains contrast in this invention can achieve the following: while increasing the brightness of dark areas of the image and maintaining the brightness of bright areas, it can also maintain a high image contrast and a low image noise level.
[0069] Since this method uses small-window Gaussian filtering (5*5 in this example), all calculation processes can be implemented through row caching and lookup tables, eliminating the need for full image storage and processing, thus reducing resource consumption. It can be easily implemented on FPGA / SOC, reducing the requirements of image algorithms on computing power and hardware platform.
[0070] Gaussian filtering and contour extraction, brightness enhancement and detail enhancement, and image fusion can all be implemented in the image data stream using row buffering and lookup tables, eliminating the need for image frame buffering. Therefore, this method significantly reduces image processing latency and resource consumption, making it highly compatible with FPGA / SoC platforms. The method in this invention can be easily implemented on FPGAs or embedded SoCs, making it particularly suitable for endoscopic image processing systems.
[0071] The above technical features constitute the preferred embodiment of the present invention, which has strong adaptability and optimal implementation effect. Non-essential technical features can be added or removed according to actual needs to meet the needs of different situations.
[0072] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions made by those skilled in the art to the technical solution of the present invention do not depart from the essence and scope of the technical solution of the present invention.
Claims
1. A method for adjusting image brightness while maintaining contrast, characterized in that, Includes the following steps: Step S1: Extract the outline of the original image in the RGB color space to obtain the detail image; Step S2: Obtain the background image, which is the image obtained by subtracting the original image from the detail image; Step S3: Perform non-linear brightness enhancement on the background image and enhance the details of the detail image in the RGB color space; Step S4: Output image. The output image is the image obtained by fusing the background image after brightness enhancement and the detail image after detail enhancement. Step S3, which involves non-linear brightness enhancement of the background image, includes the following steps: Step S31: Convert the background image from RGB color space to HSV color space; Step S32: Perform non-linear brightness enhancement on all pixels of the background image in the HSV color space; Step S33: Convert the background image with increased brightness back to the RGB color space; In step S32, the brightness enhancement curve used for nonlinear brightness enhancement is a smooth brightness curve. The brightness curve function is Lut[i] = i + sin(PI (in / 255.0) K (1-(1 / 255) in) Where K is the brightness enhancement coefficient, i is the original brightness value, and Lut[i] is the result of replacing the original brightness value i with a lookup table, i.e., the brightness enhancement value. A brightness enhancement lookup table is created using the brightness curve function to determine the brightness enhancement values for different brightness regions of the image, and then non-linear brightness enhancement is performed on the background image. The brightness enhancement operation, within the HSV space, keeps the H and S channel values unchanged, and maps the V channel according to a lookup table to increase the brightness of the dark areas of the background image.
2. The image brightness adjustment method according to claim 1, characterized in that, Step S1 includes: Step S11: Apply Gaussian filtering to the original image; Step S12: Obtain the detail image. Each pixel in the detail image is a signed number. The detail image is the image obtained by differential processing of the original image and the filtered image.
3. The image brightness adjustment method according to claim 2, characterized in that, Step S11 involves using N in the RGB three channels. The template in window N applies a Gaussian filter to the original image. N is the size of the filtering window.
4. The image brightness adjustment method according to claim 2, characterized in that, Detailed images can be obtained using methods such as USM, two-dimensional FFT, or threshold segmentation calculations.
5. The image brightness adjustment method according to claim 1, characterized in that, Step S3, which involves enhancing the detail of the image in the RGB color space, includes the following steps: Step S34: Calculate the brightness gain coefficient. The brightness gain coefficient value is the value of the brightness enhancement of the V channel in the HSV color space divided by the original value, to obtain a brightness gain coefficient map composed of the brightness gain coefficients. Step S35: Calculate the enhanced detail image in the RGB color space. The value of each pixel in the enhanced detail image is the original detail image multiplied by a gain. The gain value is the brightness gain coefficient of the corresponding pixel in the brightness gain coefficient image obtained in step S34.
6. The image brightness adjustment method according to claim 5, characterized in that, The brightness gain coefficient is a floating-point number.
Citation Information
Patent Citations
Automatic adjustment method of color image brightness
CN105096273A
Image processing method and device and computer storage medium
CN110706162A