Brightness adjustment methods, devices, equipment and media
By acquiring abnormal image brightness states, adjusting brightness values, and drawing brightness curves and grid diagrams, the problem of discontinuous screen brightness adjustment is solved, achieving automated and visualized brightness adjustment and improving user experience.
Patent Information
- Application Number
- CN202310700847.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2043-06-13
AI Technical Summary
Existing technologies struggle to automatically adjust screen brightness and make users aware of brightness changes, leading to overexposure or underexposure. Furthermore, existing methods exhibit discontinuity in localized areas, failing to effectively control localized brightness.
By acquiring the original image and determining its brightness anomaly, adjusting the brightness value to obtain the target image, drawing a brightness curve and a grid diagram to show the brightness changes corresponding to the adjustment operation, using the histogram of the grayscale image and the brightness coefficient to determine the brightness anomaly, using brightness gain to adjust the image brightness, and determining the brightness value of the sub-image in the HSL space.
It enables automatic adjustment of screen brightness, allowing users to visually perceive changes in brightness, thus improving the user experience and solving the problem of local brightness control.
Smart Images

Figure CN116739929B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a brightness adjustment method, brightness adjustment device, brightness adjustment equipment, and computer-readable storage medium. Background Technology
[0002] During video playback, overexposure or underexposure can occur, leading to a poor user experience. Current methods for adjusting screen brightness primarily rely on image processing. Among known methods, histogram equalization, if not properly selected, can increase background noise and cause discontinuities in local areas, resulting in significant loss of image detail. Methods using single-channel images with Gaussian filtering to calculate the Gaussian filter grayscale change rate for each pixel to control brightness can only adjust the entire image, failing to control local brightness, and the computational load for each pixel is substantial. Therefore, a method that automatically adjusts screen brightness and plots a brightness curve to alert the user to changes in brightness and enhance their visual experience is urgently needed. Summary of the Invention
[0003] The main objective of this application is to provide a brightness adjustment method, brightness adjustment device, brightness adjustment equipment, and computer-readable storage medium, aiming to solve the technical problem of making it difficult for users to perceive the adjustment of screen brightness.
[0004] To achieve the above objectives, this application provides a brightness adjustment method, the method comprising:
[0005] Acquire the original image and determine whether the original image is in an abnormal brightness state;
[0006] If the original image is in an abnormal brightness state, the brightness value of the original image is adjusted to obtain the target image, wherein the target image is in a normal brightness state;
[0007] Determine the brightness values of each sub-image in the original image and the target image, and draw and display the brightness changes corresponding to the adjustment operation based on the brightness values.
[0008] For example, the step of determining whether the original image is in a state of abnormal brightness includes:
[0009] Determine the grayscale image of the original image and draw its histogram, then determine the average mean and pixel deviation of the pixels in the histogram that deviate from the preset mean.
[0010] A brightness coefficient is determined based on the average value and the pixel deviation, and the original image is then determined to be in an abnormal brightness state based on the brightness coefficient.
[0011] For example, the step of determining whether the original image is in a state of abnormal brightness based on the brightness coefficient includes:
[0012] If the brightness coefficient is greater than 1, then the original image is determined to be in an abnormal brightness state;
[0013] If the brightness coefficient is less than or equal to 1, then the original image is determined to be in a normal brightness state.
[0014] For example, the step of determining that the original image is in a state of abnormal brightness includes:
[0015] If the average value is greater than 0, then the original image is determined to be in an abnormal brightness state of being too bright.
[0016] If the average value is less than or equal to 0, then the original image is determined to be in an abnormally dark brightness state.
[0017] For example, the step of adjusting the brightness value of the original image to obtain the target image includes:
[0018] If the original image is a single-channel image, then the brightness gain of the original image is increased or decreased to obtain the target image;
[0019] If the original image is a three-channel image, then the brightness gain of each channel image is increased or decreased and then merged to obtain the target image;
[0020] If the original image is too bright, the brightness gain is reduced; if the original image is too dark, the brightness gain is increased.
[0021] For example, the step of determining the brightness values of each sub-image in the original image and the target image includes:
[0022] The original image and the target image are segmented based on a preset number of horizontal sub-images and a preset number of vertical sub-images to obtain sub-images;
[0023] The RGB space of the sub-image is converted to the HSL space, and the brightness value of the sub-image is determined in the HSL space.
[0024] For example, the step of drawing and displaying the brightness change corresponding to the adjustment operation based on the brightness value includes:
[0025] A brightness curve and a brightness grid are drawn based on the brightness value, wherein the horizontal axis of the brightness curve is the pixel coordinate and the vertical axis is the brightness value at the pixel coordinate, and the brightness grid is composed of grayscale images of each sub-image of the target image.
[0026] The brightness curve is invoked when the original image is in an abnormal brightness state, the brightness curve is displayed during the adjustment process, and the brightness grid diagram is displayed after the adjustment.
[0027] This application also provides a brightness adjustment device, the device comprising:
[0028] The judgment module is used to acquire the original image and determine whether the original image is in an abnormal brightness state.
[0029] An adjustment module is used to adjust the brightness value of the original image to obtain a target image if the original image is in an abnormal brightness state, wherein the target image is in a normal brightness state.
[0030] The display module is used to determine the brightness values of each sub-image in the original image and the target image, and to draw and display the brightness changes corresponding to the adjustment operation based on the brightness values.
[0031] This application also provides a brightness adjustment device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the brightness adjustment method as described above.
[0032] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the brightness adjustment method described above.
[0033] This application provides a brightness adjustment method, brightness adjustment device, brightness adjustment equipment, and computer-readable storage medium. The method involves acquiring an original image and determining whether the original image is in a brightness abnormal state. If the original image is in a brightness abnormal state, the brightness value of the original image is adjusted to obtain a target image, wherein the target image is in a normal brightness state. The brightness values of each sub-image in the original image and the target image are determined, and the brightness changes corresponding to the adjustment operation are drawn and displayed based on the brightness values.
[0034] In this application, when the acquired original image is in an abnormal brightness state, the original image is adjusted to a target image in a normal brightness state, and the brightness change corresponding to the adjustment operation is drawn and displayed based on the brightness values of each sub-image in the original image and the target image.
[0035] Therefore, by proposing a method for adjusting screen backlight and displaying the adjustment effect, it is possible to automatically capture brightness anomalies and quickly adjust the local brightness of the screen, draw brightness curves and brightness grid diagrams to display the brightness changes corresponding to the adjustment operation, and enable users to perceive the brightness changes and the adjustment of screen brightness, thus making the user's visual experience more visual. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the structure of the operating device of the hardware operating environment involved in the embodiments of this application;
[0037] Figure 2 This is a schematic flowchart of an embodiment of the brightness adjustment method involved in the present application.
[0038] Figure 3 This is a schematic diagram of an original image showing overexposure in one embodiment of the brightness adjustment method involved in the present application.
[0039] Figure 4 This is a schematic diagram of a sub-image corresponding to the original image in one embodiment of the brightness adjustment method involved in the present application;
[0040] Figure 5 This is a schematic diagram of the target image after brightness adjustment in one embodiment of the brightness adjustment method involved in the present application.
[0041] Figure 6 This is a schematic diagram of a sub-image corresponding to the target image in one embodiment of the brightness adjustment method involved in the present application;
[0042] Figure 7 This is a schematic diagram of the brightness line graph and curve results in one embodiment of the brightness adjustment method involved in the present application.
[0043] Figure 8 This is a schematic diagram of an application scenario of the brightness adjustment method involved in the embodiments of this application;
[0044] Figure 9 This is a schematic diagram of the brightness adjustment device involved in the embodiments of this application.
[0045] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0046] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0047] Reference Figure 1 , Figure 1This is a schematic diagram of the operating device structure of the hardware operating environment involved in the embodiments of this application.
[0048] like Figure 1 As shown, the operating device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0049] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the operating equipment and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0050] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and computer programs.
[0051] exist Figure 1 In the illustrated operating device, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and memory 1005 in the operating device of this application can be disposed in the operating device, and the operating device calls the computer program stored in the memory 1005 through the processor 1001 and performs the following operations:
[0052] Acquire the original image and determine whether the original image is in an abnormal brightness state;
[0053] If the original image is in an abnormal brightness state, the brightness value of the original image is adjusted to obtain the target image, wherein the target image is in a normal brightness state;
[0054] Determine the brightness values of each sub-image in the original image and the target image, and draw and display the brightness changes corresponding to the adjustment operation based on the brightness values.
[0055] In one embodiment, the processor 1001 may invoke a computer program stored in the memory 1005 and further perform the following operations:
[0056] The step of determining whether the original image is in a state of abnormal brightness includes:
[0057] Determine the grayscale image of the original image and draw its histogram, then determine the average mean and pixel deviation of the pixels in the histogram that deviate from the preset mean.
[0058] A brightness coefficient is determined based on the average value and the pixel deviation, and the original image is then determined to be in an abnormal brightness state based on the brightness coefficient.
[0059] In one embodiment, the processor 1001 may invoke a computer program stored in the memory 1005 and further perform the following operations:
[0060] The step of determining whether the original image is in a state of abnormal brightness based on the brightness coefficient includes:
[0061] If the brightness coefficient is greater than 1, then the original image is determined to be in an abnormal brightness state;
[0062] If the brightness coefficient is less than or equal to 1, then the original image is determined to be in a normal brightness state.
[0063] In one embodiment, the processor 1001 may invoke a computer program stored in the memory 1005 and further perform the following operations:
[0064] The step of determining that the original image is in a state of abnormal brightness includes:
[0065] If the average value is greater than 0, then the original image is determined to be in an abnormal brightness state of being too bright.
[0066] If the average value is less than or equal to 0, then the original image is determined to be in an abnormally dark brightness state.
[0067] In one embodiment, the processor 1001 may invoke a computer program stored in the memory 1005 and further perform the following operations:
[0068] The step of adjusting the brightness value of the original image to obtain the target image includes:
[0069] If the original image is a single-channel image, then the brightness gain of the original image is increased or decreased to obtain the target image;
[0070] If the original image is a three-channel image, then the brightness gain of each channel image is increased or decreased and then merged to obtain the target image;
[0071] If the original image is too bright, the brightness gain is reduced; if the original image is too dark, the brightness gain is increased.
[0072] In one embodiment, the processor 1001 may invoke a computer program stored in the memory 1005 and further perform the following operations:
[0073] The step of determining the brightness values of each sub-image in the original image and the target image includes:
[0074] The original image and the target image are segmented based on a preset number of horizontal sub-images and a preset number of vertical sub-images to obtain sub-images;
[0075] The RGB space of the sub-image is converted to the HSL space, and the brightness value of the sub-image is determined in the HSL space.
[0076] In one embodiment, the processor 1001 may invoke a computer program stored in the memory 1005 and further perform the following operations:
[0077] The step of drawing and displaying the brightness change corresponding to the adjustment operation based on the brightness value includes:
[0078] A brightness curve and a brightness grid are drawn based on the brightness value, wherein the horizontal axis of the brightness curve is the pixel coordinate and the vertical axis is the brightness value at the pixel coordinate, and the brightness grid is composed of grayscale images of each sub-image of the target image.
[0079] The brightness curve is invoked when the original image is in an abnormal brightness state, the brightness curve is displayed during the adjustment process, and the brightness grid diagram is displayed after the adjustment.
[0080] This application provides a brightness adjustment method, referring to... Figure 2 In one embodiment of the brightness adjustment method, the method includes:
[0081] Step S10: Acquire the original image and determine whether the original image is in an abnormal brightness state;
[0082] The acquired original image can be a television image or a video data stream. In one embodiment, the video stream data of the flat-panel TV is captured, and the video data is read frame by frame and converted into a single image. Then, the bitmap image format of the Android device is converted into a mat object, and the image is read and processed to obtain the original image. Next, it is determined whether the original image is in an abnormal brightness state, and whether the original image is too bright or too dark.
[0083] Step S20: If the original image is in an abnormal brightness state, adjust the brightness value of the original image to obtain the target image, wherein the target image is in a normal brightness state.
[0084] If the original image is in an abnormal brightness state, the brightness value of the original image is adjusted to obtain a target image in a normal brightness state, where the target image is neither too bright nor too dark. In this embodiment, the method for adjusting an original image in an abnormal brightness state to a target image in a normal brightness state is not limited.
[0085] Step S30: Determine the brightness value of each sub-image in the original image and the target image, and draw and display the brightness change corresponding to the adjustment operation based on the brightness value.
[0086] During and after the brightness adjustment process, the brightness changes corresponding to the adjustment operation can be plotted and displayed based on the brightness values of each sub-image in the original image and the target image. In this embodiment, the method for obtaining the sub-images by cutting the original image and the target image is not limited.
[0087] In this embodiment, an original image is acquired and it is determined whether the original image is in a state of abnormal brightness. If the original image is in a state of abnormal brightness, the brightness value of the original image is adjusted to obtain a target image, wherein the target image is in a state of normal brightness. The brightness values of each sub-image in the original image and the target image are determined, and the brightness changes corresponding to the adjustment operation are drawn and displayed based on the brightness values.
[0088] In this embodiment, when the acquired original image is in an abnormal brightness state, the original image is adjusted to a target image in a normal brightness state. The brightness changes corresponding to the adjustment operation are then plotted and displayed based on the brightness values of each sub-image in both the original and target images. Thus, by proposing a method for adjusting screen backlight and displaying its effects, abnormal brightness can be automatically detected, and local screen brightness can be quickly adjusted. Brightness curves and brightness grids are plotted to display the brightness changes corresponding to the adjustment operation, allowing users to perceive the brightness changes and the adjustment of screen brightness, thus visualizing the user's visual experience.
[0089] This application provides a brightness adjustment method. In another embodiment of the brightness adjustment method, the step of determining whether the original image is in a brightness abnormal state includes:
[0090] Determine the grayscale image of the original image and draw its histogram, then determine the average mean and pixel deviation of the pixels in the histogram that deviate from the preset mean.
[0091] A brightness coefficient is determined based on the average value and the pixel deviation, and the original image is then determined to be in an abnormal brightness state based on the brightness coefficient.
[0092] When determining whether the original image is in a state of abnormal brightness, the original image is converted to grayscale and its height and width are obtained. Then, a histogram of the grayscale image is drawn, and the number of pixels deviating from the mean in the grayscale image is calculated. Here, the mean pixel is set to an interval, which in one embodiment is between 100 and 150. The average mean and pixel deviation of the pixels deviating from the mean are calculated. The average mean and pixel deviation are divided to obtain the brightness coefficient. Then, the original image is determined to be in a state of abnormal brightness based on the brightness coefficient.
[0093] For example, the step of determining whether the original image is in a state of abnormal brightness based on the brightness coefficient includes:
[0094] If the brightness coefficient is greater than 1, then the original image is determined to be in an abnormal brightness state;
[0095] If the brightness coefficient is less than or equal to 1, then the original image is determined to be in a normal brightness state.
[0096] When determining whether the original image is in an abnormal brightness state based on the brightness coefficient, if the brightness coefficient is greater than 1, it is considered that the difference between the mean and variance is large, and the original image is considered to be in an abnormal brightness state. If the brightness coefficient is less than or equal to 1, it is considered that the difference between the mean and variance is small, and the original image is considered to be in a normal brightness state.
[0097] For example, the step of determining that the original image is in a state of abnormal brightness includes:
[0098] If the average value is greater than 0, then the original image is determined to be in an abnormal brightness state of being too bright.
[0099] If the average value is less than or equal to 0, then the original image is determined to be in an abnormally dark brightness state.
[0100] In cases of brightness anomalies, if the calculated average value is greater than 0, it indicates that the original image is too bright; if the calculated average value is less than or equal to 0, it indicates that the original image is too dark.
[0101] In this embodiment, a brightness coefficient based on the average value and pixel deviation is proposed to determine whether the original image is in an abnormal brightness state and whether the original image is too bright or too dark, thereby making it simple, convenient and efficient to detect the brightness state of the original image.
[0102] This application provides a brightness adjustment method. In another embodiment of the brightness adjustment method, the step of adjusting the brightness value of the original image to obtain the target image includes:
[0103] If the original image is a single-channel image, then the brightness gain of the original image is increased or decreased to obtain the target image;
[0104] If the original image is a three-channel image, then the brightness gain of each channel image is increased or decreased and then merged to obtain the target image;
[0105] If the original image is too bright, the brightness gain is reduced; if the original image is too dark, the brightness gain is increased.
[0106] If the original image is in an abnormal brightness state, the current brightness value of the original image needs to be adjusted. The formula for adjusting image brightness and contrast is: g(x,y)=αf(x,y)+β, where f(x,y) is the original image, g(x,y) is the transformed image, α is the contrast gain variable, and β is the brightness gain variable.
[0107] The image is converted to grayscale to determine whether it is a single-channel or three-channel image. If it is a single-channel image, the brightness gain is increased or decreased in the original image matrix. If it is a three-channel image, the brightness gain is increased or decreased in each channel before merging them into a three-channel image. Specifically, if the image is too bright, the brightness gain is appropriately decreased; if the image is too dark, the brightness gain is appropriately increased.
[0108] This application provides a brightness adjustment method. In another embodiment of the brightness adjustment method, the step of determining the brightness values of each sub-image in the original image and the target image includes:
[0109] The original image and the target image are segmented based on a preset number of horizontal sub-images and a preset number of vertical sub-images to obtain sub-images;
[0110] The RGB space of the sub-image is converted to the HSL space, and the brightness value of the sub-image is determined in the HSL space.
[0111] Reference Figure 3 and Figure 5 , Figure 3 The original image is overexposed. Figure 5 This is the target image after brightness adjustment. When slicing the original and target images, the preset number of slices can be set by preset values in the horizontal and vertical directions, namely the preset number of horizontal sub-images *m* and the preset number of vertical sub-images *n*, respectively. Here, *m* = 1 represents vertical slicing, and *n* = 1 represents horizontal slicing. After obtaining the height and width of the image, divide the height and width by *m* and *n* respectively to obtain the height and width of the sliced sub-images, denoted by *cw* and *ch*. Iterate through the height and width of the image to obtain the sliced sub-images, with the formula rect(j*cw,i*ch,w,h), where *i* represents the height of the iteration and *j* represents the width.
[0112] Reference Figure 4 and Figure 6 , Figure 4 The sub-image corresponding to the original image. Figure 6 This refers to the sub-images corresponding to the target image. When calculating the brightness value of each sub-image, the sub-image is converted from RGB space to HSL space to easily obtain the brightness (L). In HSL space, H represents the hue angle, S represents saturation, and L represents brightness. In RGB space, there are maximum and minimum pixel values. The brightness of the sub-image is the average of the maximum and minimum values, thus obtaining the brightness value of each sub-image.
[0113] This application provides a brightness adjustment method. In another embodiment of the brightness adjustment method, the step of drawing and displaying the brightness change corresponding to the adjustment operation based on the brightness value includes:
[0114] A brightness curve and a brightness grid are drawn based on the brightness value, wherein the horizontal axis of the brightness curve is the pixel coordinate and the vertical axis is the brightness value at the pixel coordinate, and the brightness grid is composed of grayscale images of each sub-image of the target image.
[0115] The brightness curve is invoked when the original image is in an abnormal brightness state, the brightness curve is displayed during the adjustment process, and the brightness grid diagram is displayed after the adjustment.
[0116] Reference Figure 7 When plotting the brightness curve, two images, one before and one after adjustment, are read and sliced separately. The brightness value of each sub-image is then calculated. A blank image with the same height and width is defined. The brightness values of the two images before and after adjustment are read in a loop. Coordinate points are drawn using circles, and consecutive points are connected to form a polyline segment. Since the origin of the OpenCV image is at the top left corner, the image also needs to be flipped vertically.
[0117] During the drawing process, points may become concentrated in a single area. Therefore, it's necessary to map these dense points onto the entire image. The specific steps are as follows: After obtaining the brightness values of all sub-images before and after brightness adjustment, acquire their maximum and minimum brightness values. Divide the image height by the difference between the maximum and minimum brightness values to obtain the ordinate scale value. Divide the image width by the number of sub-images to obtain the abscissa scale value. Multiply the ordinate and abscissa by their respective scale values to obtain new coordinate values. Finally, plot these coordinate values as a line graph.
[0118] Next, the line chart is converted into a curve. During the sub-chart segmentation process, the more segments there are, the slower the calculation becomes. Therefore, it's necessary to fit a limited number of points to more points. A horizontal and vertical coordinate matrix is constructed, and the coefficient matrix is obtained using the least squares method. By adding more horizontal coordinate points and multiplying by the coefficient matrix, the fitted vertical coordinate is obtained. The line chart is then converted into a curve by adding coordinate points.
[0119] Next, a brightness grid is drawn. The grayscale value of each sub-image after brightness adjustment is extracted, and the grayscale value is assigned to the corresponding position in the original image to draw the brightness grid.
[0120] Finally, the brightness curve and brightness grid are displayed. When the current image is automatically detected to be in an abnormal brightness state, the current brightness curve is displayed, and the curve changes accordingly as the screen brightness is automatically adjusted. When the brightness reaches a normal state after automatic adjustment, the current brightness grid is displayed in the upper right corner of the screen, and the brightness grid disappears after three seconds.
[0121] In this application, 1. a method for drawing a brightness curve is proposed. The image is segmented, and the brightness value of each sub-image is obtained. The horizontal axis represents the number of segmented sub-images, and the vertical axis represents the brightness value of the current sub-image. The least squares method is used to obtain the coefficient matrix, and more horizontal axes are used to fit more vertical axes, thus transforming a finite line graph into a curve graph. 2. A design and visualization method for an automatic backlight adjustment system is proposed. The system determines whether the current image is in an abnormal brightness state by analyzing the captured image. If it is, the screen brightness is automatically adjusted, and the current brightness curve is displayed during adjustment. When the brightness is adjusted to a normal state, the adjusted brightness curve is displayed, followed by a brightness grid before disappearing. This fully automated adjustment and curve drawing enhances the user's sensory experience.
[0122] In one application scenario, refer to Figure 8 The first step is to capture each frame of the video stream; the second step is to read the captured images as individual images.
[0123] The third step is to determine whether the current image is too dark or too bright. If it is not in either of these states, it is considered a normal image. If it is in either of these states, the mean and variance of the grayscale image are calculated, and the number of pixels whose mean and variance deviate from a preset threshold range is counted to obtain the brightness coefficient. The calculated mean and variance are then normalized and fixed within a certain range. If the calculated mean is greater than 0, it is considered too bright; if it is less than 0, it is considered too dark.
[0124] Fourth, if it is in either of these two states, adjust the current image brightness by increasing or decreasing the threshold increment within a certain range so that the image can be in a normal brightness state.
[0125] The fifth step is to slice the image. The preset number of slices can be obtained by cutting the image at preset values in the horizontal and vertical directions to get each sliced sub-image.
[0126] The sixth step is to calculate the current brightness of each sub-image, convert the RGB space of the sub-image to the HSL space, where L represents the brightness of the image, and obtain the image brightness of each sub-image.
[0127] Step 7: Simultaneously read in two images, namely the image before the brightness anomaly and the normal image after adjustment, and obtain the local image brightness of the two sub-images using the same method as in step 6.
[0128] Step 8: Create a blank image, set its size to the same as the original image, and plot the points of both sets of data on the blank image. Since the coordinate points are clustered together, it is necessary to map the points of the horizontal and vertical coordinates to the entire image. Specifically, obtain the scale range of the horizontal and vertical coordinate points, multiply the horizontal and vertical coordinate points by the scale range, so that the coordinate points can be completely covered across the entire image.
[0129] Step 9: Due to the limited number of points, the resulting image is a line graph, which needs to be fitted to a curve. The least squares method is used to fit the image matrix and the ordinate matrix to obtain a coefficient matrix. Multiplying the coefficient matrix by more points yields more pairs of fitted ordinates. The fitted coordinates are then plotted on the image to create a brightness curve comparison chart.
[0130] Step 10: Assign a brightness threshold value to each sub-image, find the corresponding position of each sub-image, and draw a brightness grid diagram on the original image to visualize the result.
[0131] In this way, it can automatically determine whether the current image is in an abnormal brightness state. When it is in an abnormal brightness state, it will automatically adjust the brightness value of the current image until the image brightness is in a normal state. While adjusting the image brightness, you can see the change process of the brightness curve and the visualization result of the brightness grid diagram. You can clearly see the process of brightness value change. Automatically adjusting the screen brightness can greatly improve the user's perception experience.
[0132] Reference Figure 9 Furthermore, embodiments of this application also provide a brightness adjustment device, the brightness adjustment device comprising:
[0133] The judgment module M1 is used to acquire the original image and determine whether the original image is in an abnormal brightness state;
[0134] The adjustment module M2 is used to adjust the brightness value of the original image to obtain a target image if the original image is in an abnormal brightness state, wherein the target image is in a normal brightness state.
[0135] The display module M3 is used to determine the brightness values of each sub-image in the original image and the target image, and to draw and display the brightness changes corresponding to the adjustment operation based on the brightness values.
[0136] For example, the determination module is further configured to:
[0137] Determine the grayscale image of the original image and draw its histogram, then determine the average mean and pixel deviation of the pixels in the histogram that deviate from the preset mean.
[0138] A brightness coefficient is determined based on the average value and the pixel deviation, and the original image is then determined to be in an abnormal brightness state based on the brightness coefficient.
[0139] For example, the determination module is further configured to:
[0140] If the brightness coefficient is greater than 1, then the original image is determined to be in an abnormal brightness state;
[0141] If the brightness coefficient is less than or equal to 1, then the original image is determined to be in a normal brightness state.
[0142] For example, the determination module is further configured to:
[0143] If the average value is greater than 0, then the original image is determined to be in an abnormal brightness state of being too bright.
[0144] If the average value is less than or equal to 0, then the original image is determined to be in an abnormally dark brightness state.
[0145] For example, the adjustment module is further configured to:
[0146] If the original image is a single-channel image, then the brightness gain of the original image is increased or decreased to obtain the target image;
[0147] If the original image is a three-channel image, then the brightness gain of each channel image is increased or decreased and then merged to obtain the target image;
[0148] If the original image is too bright, the brightness gain is reduced; if the original image is too dark, the brightness gain is increased.
[0149] For example, the display module is also used for:
[0150] The original image and the target image are segmented based on a preset number of horizontal sub-images and a preset number of vertical sub-images to obtain sub-images;
[0151] The RGB space of the sub-image is converted to the HSL space, and the brightness value of the sub-image is determined in the HSL space.
[0152] For example, the display module is further configured to: draw a brightness curve and a brightness grid based on the brightness value, wherein the horizontal axis of the brightness curve is the pixel coordinate, the vertical axis is the brightness value at the pixel coordinate, and the brightness grid is composed of grayscale images of each sub-image of the target image;
[0153] The brightness curve is invoked when the original image is in an abnormal brightness state, the brightness curve is displayed during the adjustment process, and the brightness grid diagram is displayed after the adjustment.
[0154] The brightness adjustment device provided in this application employs the brightness adjustment method described in the above embodiments, solving the technical problem of making it difficult for users to perceive screen brightness adjustments. Compared with conventional technologies, the beneficial effects of the brightness adjustment device provided in this application are the same as those of the brightness adjustment method described in the above embodiments, and other technical features in the brightness adjustment device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0155] Furthermore, this application embodiment also provides a brightness adjustment device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the brightness adjustment method described above.
[0156] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the brightness adjustment method described above.
[0157] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to conventional technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0159] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A brightness adjustment method, characterized in that, The method includes: Acquire the original image and determine whether the original image is in an abnormal brightness state; If the original image is in an abnormal brightness state, the brightness value of the original image is adjusted to obtain the target image, wherein the target image is in a normal brightness state; The original image and the target image are segmented based on a preset number of horizontal and vertical sub-images to obtain sub-images for each of the original and target images. The RGB space of the sub-images is converted to HSL space, and the brightness value of each sub-image of the original and target images is determined in the HSL space. Based on the brightness values of each sub-image of the original and target images, brightness curves of the original image and the target image, as well as a brightness grid diagram of the target image, are drawn respectively. The horizontal axis of the brightness curve represents the pixel coordinates, and the vertical axis represents the brightness value at the pixel coordinates. The brightness grid diagram is composed of grayscale images of each sub-image of the target image. The process for plotting the brightness curve involves reading two images before and after adjustment, cropping them, and calculating the brightness value of each sub-image. A blank image with equal height and width is defined, and the brightness values of the two images before and after adjustment are read repeatedly. Coordinate points are drawn using circles, and consecutive points are connected to form a line segment. After obtaining the brightness values of all sub-images before and after adjustment, the maximum and minimum brightness values are obtained. The image height is divided by the difference between the maximum and minimum brightness values to obtain the ordinate scale value, and the image width is divided by the number of sub-images to obtain the abscissa scale value. The abscissa and ordinate are multiplied by the abscissa scale and the ordinate scale to obtain new coordinate values. Finally, the new coordinate values are plotted as a line graph and then converted into a curve graph. In the process of drawing the brightness grid, the grayscale value of each sub-image of the image after brightness adjustment is extracted, and the grayscale value is assigned to the corresponding position in the original image to draw the brightness grid. The brightness curve is invoked when the original image is in an abnormal brightness state, the brightness curve is displayed during the adjustment process, and the brightness grid diagram is displayed after the adjustment. When the system automatically detects that the current image is in an abnormal brightness state, it displays the current brightness curve. As the screen brightness is automatically adjusted, the brightness curve will change accordingly. When the brightness reaches a normal state after automatic adjustment, the current brightness grid is displayed in the upper right corner of the screen, and the brightness grid disappears after three seconds.
2. The brightness adjustment method as described in claim 1, characterized in that, The step of determining whether the original image is in a state of abnormal brightness includes: Determine the grayscale image of the original image and draw its histogram, then determine the average mean and pixel deviation of the pixels in the histogram that deviate from the preset mean. A brightness coefficient is determined based on the average value and the pixel deviation, and the original image is then determined to be in an abnormal brightness state based on the brightness coefficient.
3. The brightness adjustment method as described in claim 2, characterized in that, The step of determining whether the original image is in a state of abnormal brightness based on the brightness coefficient includes: If the brightness coefficient is greater than 1, then the original image is determined to be in an abnormal brightness state; If the brightness coefficient is less than or equal to 1, then the original image is determined to be in a normal brightness state.
4. The brightness adjustment method as described in claim 3, characterized in that, The step of determining that the original image is in a state of abnormal brightness includes: If the average value is greater than 0, then the original image is determined to be in an abnormal brightness state of being too bright. If the average value is less than or equal to 0, then the original image is determined to be in an abnormally dark brightness state.
5. The brightness adjustment method as described in claim 1, characterized in that, The step of adjusting the brightness value of the original image to obtain the target image includes: If the original image is a single-channel image, then the brightness gain of the original image is increased or decreased to obtain the target image; If the original image is a three-channel image, then the brightness gain of each channel image is increased or decreased and then merged to obtain the target image; If the original image is too bright, the brightness gain is reduced; if the original image is too dark, the brightness gain is increased.
6. A brightness adjustment device, characterized in that, The device includes: The judgment module is used to acquire the original image and determine whether the original image is in an abnormal brightness state. An adjustment module is used to adjust the brightness value of the original image to obtain a target image if the original image is in an abnormal brightness state, wherein the target image is in a normal brightness state. The display module is used to segment the original image and the target image based on a preset number of horizontal sub-images and a preset number of vertical sub-images to obtain sub-images for each of the original image and the target image; convert the RGB space of the sub-images to HSL space, and determine the brightness value of each sub-image of the original image and the target image in the HSL space; draw brightness curves of the original image and the target image and a brightness grid diagram of the target image based on the brightness values of each sub-image of the original image and the target image, wherein the horizontal axis of the brightness curve is the pixel coordinate, the vertical axis is the brightness value at the pixel coordinate, and the brightness grid diagram is composed of grayscale images of each sub-image of the target image; The process for plotting the brightness curve involves reading two images before and after adjustment, cropping them, and calculating the brightness value of each sub-image. A blank image with equal height and width is defined, and the brightness values of the two images before and after adjustment are read repeatedly. Coordinate points are drawn using circles, and consecutive points are connected to form a line segment. After obtaining the brightness values of all sub-images before and after adjustment, the maximum and minimum brightness values are obtained. The image height is divided by the difference between the maximum and minimum brightness values to obtain the ordinate scale value, and the image width is divided by the number of sub-images to obtain the abscissa scale value. The abscissa and ordinate are multiplied by the abscissa scale and the ordinate scale to obtain new coordinate values. Finally, the new coordinate values are plotted as a line graph and then converted into a curve graph. In the process of drawing the brightness grid, the grayscale value of each sub-image of the image after brightness adjustment is extracted, and the grayscale value is assigned to the corresponding position in the original image to draw the brightness grid. The brightness curve is invoked when the original image is in an abnormal brightness state, the brightness curve is displayed during the adjustment process, and the brightness grid diagram is displayed after the adjustment. When the system automatically detects that the current image is in an abnormal brightness state, it displays the current brightness curve. As the screen brightness is automatically adjusted, the brightness curve will change accordingly. When the brightness reaches a normal state after automatic adjustment, the current brightness grid is displayed in the upper right corner of the screen, and the brightness grid disappears after three seconds.
7. A brightness adjustment device, characterized in that, The brightness adjustment device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the brightness adjustment method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the brightness adjustment method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Image over-darkness or over-exposure detection method and device
CN111739110A
Screen brightness adjusting method and device and storage medium
CN114581313A
Optical flow estimation method and device
CN115984336A
