Image processing method and apparatus, and electronic device and computer-readable storage medium
By establishing the mapping relationship between image brightness parameters and pixel information and adjusting the image color channel value, the overexposure or loss problem when adjusting the brightness and darkness of the picture in the prior art is solved, and a more efficient and accurate image adjustment effect is achieved.
Patent Information
- Application Number
- PCT/CN2024/115525
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-01
- Filing Date
- 2024-08-29
- Publication Date
- 2025-05-08
AI Technical Summary
When adjusting the brightness and darkness of the picture, the prior art cannot take into account both the local bright areas and the local dark details, resulting in overexposure or loss of the picture brightness, affecting the observation effect.
By obtaining the brightness parameters and pixel information of the currently displayed image, establishing a mapping relationship between the brightness parameters and pixel information, filtering out the color channel values that meet the preset conditions, and adjusting the color channel values of the pixel points of the image to achieve more accurate image adjustment.
It improves the accuracy of image adjustment, avoids the problem of overexposure or loss of brightness, improves the detailed performance of image quality, and enhances the three-dimensional sense of image quality.
Smart Images

Figure CN2024115525_08052025_PF_FP_ABST
Abstract
Description
Image processing method, device, electronic device and computer-readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 1, 2023, with application number 202311444903.4 and application name “Image processing method, device, electronic device and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, and computer-readable storage medium. Background Art
[0003] With the rapid development of science and technology, users have increasingly higher requirements for display screen image quality. When choosing a TV or monitor, users often consider the image quality of the display. Excellent image quality technology can enhance the user's viewing experience, so image quality enhancement technology has become very important. Technical issues
[0004] However, in most scenes, the brightness levels of different areas within the image often vary significantly. Existing technologies typically use a global approach to adjust the image, but these traditional global approaches fail to account for details in both locally bright and locally dark areas. This can easily lead to overexposure in bright areas and loss of brightness in dark areas, making observation difficult. Technical Solutions
[0005] The embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium, which can solve the current technical problem of loss of image quality details due to inaccurate image adjustment.
[0006] The present invention provides an image processing method, including:
[0007] Obtaining a current brightness parameter corresponding to a currently displayed image and current pixel information corresponding to each current brightness parameter, wherein the currently displayed image includes a plurality of pixels, each of the pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values;
[0008] Determining a mapping relationship between the brightness parameter and the pixel information according to the current brightness parameter and the current pixel information;
[0009] Filtering the color channel values corresponding to the respective pixel points to obtain the target color channel values corresponding to the respective pixel points according to the preset filtering conditions, and determining the target pixel information corresponding to the target color channel values according to the mapping relationship;
[0010] The pixel points of the current display image are adjusted based on the target pixel information to obtain a target display image.
[0011] Furthermore, the determining of the mapping relationship between the luminance parameter and the pixel information based on the current luminance parameter and the current pixel information includes:
[0012] Determining a brightness point set corresponding to the currently displayed image according to the current brightness parameter and the current pixel information;
[0013] Based on a preset mapping function and the brightness point set, a mapping relationship between brightness parameters and pixel information is determined.
[0014] Furthermore, the above-mentioned luminance point set includes a target luminance point set and a candidate luminance point set, and determining the luminance point set corresponding to the currently displayed image according to the current luminance parameter and the current pixel information includes:
[0015] Dividing the current luminance parameter to obtain a plurality of different candidate luminance intervals, and screening a target luminance interval that meets a preset luminance condition from the plurality of candidate luminance intervals;
[0016] Determining the target brightness point set corresponding to the target brightness interval according to current pixel information corresponding to each current brightness parameter within the target brightness interval;
[0017] Determine the intersection points of each of the candidate luminance intervals, as well as the minimum luminance point and the maximum luminance point of all the current luminance parameters, and determine the candidate luminance point set based on the intersection points, the minimum luminance point and the maximum luminance point.
[0018] Furthermore, the current brightness parameter is divided to obtain a plurality of different candidate brightness intervals, including:
[0019] constructing a luminance histogram of the currently displayed image according to the current luminance parameter and the current pixel information; wherein the horizontal axis of the luminance histogram is the current luminance parameter, and the vertical axis of the luminance histogram is the current pixel information;
[0020] The current luminance parameter is divided in the luminance histogram to obtain a plurality of different candidate luminance intervals.
[0021] Furthermore, the target luminance point set includes a first luminance point set and a second luminance point set, and determining the target luminance point set corresponding to the target luminance interval based on current pixel information corresponding to each current luminance parameter within the target luminance interval includes:
[0022] Selecting first pixel information and second pixel information that meet a preset pixel condition from current pixel information within the target brightness interval, wherein the first pixel information in the target brightness interval is greater than the adjacent second pixel information;
[0023] generating the first brightness point set according to the first pixel information and a first brightness parameter corresponding to the first pixel information;
[0024] The second luminance point set is generated according to the second pixel information and a second luminance parameter corresponding to the second pixel information.
[0025] Furthermore, the preset pixel condition includes a maximum value condition and a minimum value condition, and selecting the first pixel information and the second pixel information that meet the preset pixel condition from the current pixel information within the target brightness range includes:
[0026] Constructing a brightness mapping curve corresponding to all current brightness parameters and current pixel information in the target brightness range;
[0027] Determining pixel information corresponding to all maximum values on the brightness mapping curve as first pixel information within the target brightness range;
[0028] The pixel information corresponding to all minimum values on the brightness mapping curve is determined as the second pixel information within the target brightness range.
[0029] Furthermore, the target brightness point set further includes a third brightness point set, and after generating the second brightness point set according to the second pixel information and the second brightness parameter corresponding to the second pixel information, further includes:
[0030] Dividing the target brightness interval into a plurality of sub-intervals according to the first brightness parameter and the second brightness parameter;
[0031] Selecting a current luminance parameter that meets a preset position condition from each of the subintervals as a third luminance parameter, and obtaining third pixel information corresponding to each of the third luminance parameters;
[0032] The third luminance point set is generated according to each of the third luminance parameters and the third pixel information.
[0033] Furthermore, the above-mentioned selecting the current luminance parameter that meets the preset position condition from each of the subintervals as the third luminance parameter, and obtaining the third pixel information corresponding to each of the third luminance parameters, includes:
[0034] Acquiring an average pixel level of the currently displayed image, interval brightness balance information corresponding to each of the subintervals, and interval exposure information corresponding to each of the subintervals;
[0035] The third luminance parameter of each of the subintervals and the third pixel information corresponding to each of the third luminance parameters are determined according to the average pixel level, the interval luminance balance information and the interval exposure information.
[0036] Furthermore, the interval brightness balance information is obtained through the following steps:
[0037] Obtaining a pixel mean value of all pixel information of the currently displayed image;
[0038] Calculating the difference between the pixel mean and the pixel information in each subinterval;
[0039] A root mean square error or a mean absolute error is calculated according to the difference to obtain brightness equalization information of different intervals corresponding to different sub-intervals.
[0040] Furthermore, the determining of the third luminance parameter of each of the subintervals and the third pixel information corresponding to each of the third luminance parameters according to the average pixel level, the interval luminance balance information, and the interval exposure information includes:
[0041] adjusting a first luminance point in the first luminance point set and a second luminance point in the second luminance point set according to the average pixel level to obtain a first updated luminance point and a second updated luminance point;
[0042] determining a third luminance parameter of each of the subintervals based on the interval luminance balance information, the first updated luminance point, and the second updated luminance point;
[0043] Based on the interval exposure information, the first updated luminance point, and the second updated luminance point, third pixel information corresponding to each third luminance parameter is determined.
[0044] Furthermore, the determining of the third luminance parameter of each sub-interval based on the interval luminance balance information, the first updated luminance point, and the second updated luminance point includes:
[0045] Summing the luminance parameter of the first updated luminance point and the luminance parameter of the second updated luminance point to obtain a sum value;
[0046] Calculate the product of the luminance parameter of the first updated luminance point and the interval luminance balance information to obtain a product value; and determine the third luminance parameter of each sub-interval according to the difference between the sum value and the product value.
[0047] Furthermore, the determining of the third pixel information corresponding to each of the third luminance parameters based on the interval exposure information, the first updated luminance point, and the second updated luminance point includes:
[0048] Calculating a difference between the brightness parameter of the second updated brightness point and the third brightness parameter to obtain a first parameter value;
[0049] Adjusting the interval exposure information according to preset parameters to obtain an adjusted exposure value;
[0050] Adjusting the first parameter value according to the adjusted exposure value and a preset constant to obtain a second parameter value;
[0051] According to the third luminance parameter and the second parameter, third pixel information corresponding to each third luminance parameter is determined.
[0052] Furthermore, after adjusting the pixels of the current display image based on the target pixel information to obtain the target display image, the method further includes:
[0053] Calculating target exposure information and target brightness balance information of the target display image;
[0054] determining, based on the target exposure information and the target brightness balance information, whether the target display image is an image that meets a preset image quality condition;
[0055] If the target display image is an image that meets the preset image quality condition, the target display image is pushed to the target display interface.
[0056] Furthermore, the above-mentioned calculation of the target exposure information of the target display image includes:
[0057] determining an exposure value of the target display image according to each luminance parameter in the target display image, pixel information corresponding to the luminance parameter, and the number of luminance parameters in the target display image;
[0058] Acquire a plurality of preset exposure levels, and determine the exposure level to which the exposure value of the target display image belongs;
[0059] An exposure level to which the exposure value of the target display image belongs is determined as target exposure information of the target display image.
[0060] Furthermore, the above-mentioned calculation of the target brightness balance information of the target display image includes:
[0061] Obtain pixel information corresponding to different brightness parameters of the target display image, and calculate the mean of all pixel information;
[0062] Determine, based on the mean value, difference information between pixel information corresponding to different brightness parameters of the target display image and the mean value;
[0063] Target brightness balance information of the target display image is determined according to the difference information.
[0064] Furthermore, the determining, based on the target exposure information and the target brightness balance information, whether the target display image is an image that meets a preset image quality condition includes:
[0065] Get the preset image exposure level and image brightness balance level;
[0066] If the exposure level of the target exposure information is less than or equal to the image exposure level, and the brightness balance level in the target brightness balance information is greater than or equal to the image brightness balance level, it is determined that the target display image is an image that meets the preset image quality conditions.
[0067] Furthermore, after determining whether the target display image meets the preset image quality conditions based on the target exposure information and the target brightness balance information, the method further includes:
[0068] If the target display image is an image that does not meet the preset image quality condition, re-determining the mapping relationship between the brightness parameter and the pixel information of the target display image according to the brightness parameter and the pixel information of the target display image;
[0069] Calculating the remapped target pixel information corresponding to the target color channel value of each pixel point in the target display image according to the re-determined mapping relationship;
[0070] Iteratively adjust each pixel of the target display image based on the remapped target pixel information until the adjusted image is determined to be an image that meets preset image quality conditions based on exposure information and brightness balance information of the adjusted image.
[0071] Accordingly, an embodiment of the present application provides an image processing device, comprising:
[0072] an acquisition module, configured to acquire a current brightness parameter corresponding to a currently displayed image, and current pixel information corresponding to each current brightness parameter, wherein the currently displayed image includes a plurality of pixels, each of the pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values;
[0073] a confirmation module, configured to determine a mapping relationship between a brightness parameter and pixel information according to the current brightness parameter and the current pixel information;
[0074] A mapping module is configured to filter out, from the color channel values corresponding to the respective pixel points, color channel values that meet a preset filtering condition as target color channel values corresponding to the respective pixel points, and determine target pixel information corresponding to the respective target color channel values according to the mapping relationship;
[0075] An adjustment module is used to adjust each pixel point of the current display image based on each target pixel information to obtain a target display image.
[0076] In addition, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the image processing method provided in the embodiment of the present application.
[0077] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for loading by a processor to execute any image processing method provided in the embodiment of the present application.
[0078] In addition, an embodiment of the present application also provides a computer program product, including a computer program, which implements any image processing method provided in the embodiment of the present application when executed by a processor. Beneficial effects
[0079] In an embodiment of the present application, by obtaining the current brightness parameter corresponding to the currently displayed image and the current pixel information corresponding to each current brightness parameter, the currently displayed image includes multiple pixel points, each pixel point corresponds to multiple color channel values, and the current brightness parameter is a parameter determined based on the multiple color channel values, thereby achieving accurate acquisition of the brightness parameter in the currently displayed image; then, based on the current brightness parameter and the current pixel information, a mapping relationship between the brightness parameter and the pixel information is determined, so that the relationship between the brightness parameter and the pixel information can be accurately expressed through the mapping relationship, thereby improving the accuracy of image adjustment; then, from the color corresponding to each pixel point, The color channel values that meet the preset filtering conditions are filtered out from the channel values as the target color channel values corresponding to each pixel point, and the target pixel information corresponding to each target color channel value is determined according to the mapping relationship, thereby realizing the accurate acquisition of the target pixel information of each pixel point in the currently displayed image; finally, based on the target pixel information, each pixel point of the currently displayed image is adjusted to obtain the target display image, thereby realizing efficient and accurate adjustment of the image quality, and enabling the image to be adaptively enhanced, thereby improving the image quality performance effect, and making the image more three-dimensional. The present application can also be applied to the fields of televisions and display screens to bring users better quality display pictures. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0081] FIG1 is a schematic flow chart of the image processing method provided by the present application;
[0082] FIG2 is a schematic diagram of the target brightness interval of the image processing method provided by the present application;
[0083] FIG3 is a schematic diagram of a brightness mapping curve of the image processing method provided by the present application;
[0084] FIG4 is a schematic structural diagram of an image processing device provided in an embodiment of the present application;
[0085] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Modes for Carrying Out the Invention
[0086] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0087] The present invention provides an image processing method, apparatus, electronic device, and computer-readable storage medium. The image processing apparatus can be integrated into an electronic device, which can be a server, a terminal, or other device.
[0088] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0089] The terminal may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal and the server may be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions thereon.
[0090] In addition, the term "a plurality of" in the embodiments of the present application refers to two or more than two. The terms "first" and "second" in the embodiments of the present application are used to distinguish descriptions and should not be understood to imply relative importance.
[0091] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0092] Please refer to Figure 1, which is a flow chart of an image processing method provided by an embodiment of the present application. The image processing method may include:
[0093] S101. Obtain a current brightness parameter corresponding to a currently displayed image, and current pixel information corresponding to each current brightness parameter. The currently displayed image includes multiple pixel points, each of the pixel points corresponds to multiple color channel values, and the current brightness parameter is a parameter determined based on the multiple color channel values.
[0094] In this embodiment, the currently displayed image includes multiple pixels, each corresponding to multiple color channel values, such as R, G, and B color channel values. These color channel values represent the signal strength values for each pixel in each color channel. The larger the signal strength value, the brighter the color of that color channel value. For example, if the grayscale bit count of the image signal is 8 bits, the signal strength value ranges from 0 to 255, where 0 represents black, 255 represents white, and intermediate numbers represent different levels of grayscale. Based on the multiple color channel values corresponding to each pixel, a brightness value for each pixel can be determined. This brightness value is the current brightness parameter. Specifically, a preset ratio of each color channel is obtained, and a weighted sum calculation is performed based on the preset ratio and the color channel values of the pixel to obtain the current brightness parameter for each pixel. Subsequently, current pixel information corresponding to the current brightness parameter is obtained. This current pixel information is the statistical number of pixels in the currently displayed image corresponding to the current brightness parameter. Based on the current brightness parameter and the current pixel information, a brightness histogram corresponding to the currently displayed image can be constructed. Therefore, when the current display image is obtained, the brightness histogram corresponding to the current display image can also be directly obtained, and then the brightness histogram is subjected to image analysis to obtain the current brightness parameter and current pixel information.
[0095] S102: Determine a mapping relationship between a brightness parameter and pixel information according to the current brightness parameter and the current pixel information.
[0096] In this embodiment, when obtaining the current luminance parameter and current pixel information, one current luminance parameter and its corresponding current pixel information are treated as a pixel point. Multiple current luminance parameters and their corresponding current pixel information are then combined to obtain a set of luminance points corresponding to the currently displayed image. A luminance histogram is constructed based on the current luminance parameter and current pixel information, and this luminance histogram is divided into different intervals to obtain multiple candidate luminance intervals. Luminance points within each candidate luminance interval are selected to obtain a target luminance point. All target luminance points are fitted to obtain a luminance mapping function corresponding to the currently displayed image. This luminance mapping function reflects the mapping relationship between the luminance parameter and pixel information in the currently displayed image.
[0097] S103 , filtering out color channel values that meet preset filtering conditions from the color channel values corresponding to the respective pixel points as target color channel values corresponding to the respective pixel points, and determining target pixel information corresponding to the respective target color channel values according to the mapping relationship.
[0098] In this embodiment, each pixel is composed of multiple color channels, such as RGB (red, green, and blue) three color channels. One color channel corresponds to one color channel value, and the color channel values of each color channel corresponding to the pixel may be different. From the color channel values corresponding to each pixel, a color channel value that meets a preset filtering condition is selected as the target color channel value corresponding to each pixel. The preset filtering condition can be to select the largest color channel value from the multiple color channel values of the pixel. For example, the color channel values of pixel A on the R, G, and B color channels are 30, 40, and 50, and the target color channel value of pixel A is 50; the color channel values of pixel B on the R, G, and B color channels are 20, 90, and 60, and the target color channel value of pixel B is 90.
[0099] Furthermore, in one embodiment, the brightness mapping function representing the mapping relationship between the brightness parameter and the pixel information is 2 n -1 order uniform sampling, and the data range of the luminance mapping function can be adjusted to 8bit, 10bit or 12bit according to actual needs; then, the adjusted luminance mapping function is stored in the form of a LUT (Look-Up-Table). When the image processing method in this application is applied to a television, the display lookup table can be stored in the chip flash. When the target color channel value of each pixel is obtained, the target pixel information corresponding to the target color channel value of each pixel is obtained by performing a pixel-by-pixel lookup and interpolation on the input target color channel value.
[0100] S104 : Adjust each pixel point of the current display image based on each target pixel information to obtain a target display image.
[0101] In this embodiment, when each target pixel information is obtained, each pixel of the currently displayed image is adjusted based on the target pixel information to obtain the target display image. Specifically, the target pixel information is the target pixel information corresponding to the target color channel value of each pixel. Therefore, when each target pixel information is obtained, the ratio of the target pixel information to the current pixel information is calculated, and this ratio is used as the pixel gain value. Each pixel gain value is then input into the different color channels of each pixel, and pixel compensation is performed on each color channel of each pixel in the currently displayed image according to the pixel gain value, thereby obtaining the target display image.
[0102] This embodiment obtains the current brightness parameter corresponding to the current displayed image and the current pixel information corresponding to each current brightness parameter. The current displayed image includes multiple pixel points, each pixel point corresponds to multiple color channel values, and the current brightness parameter is a parameter determined according to the multiple color channel values. This achieves accurate acquisition of the brightness parameter in the current displayed image; then, based on the current brightness parameter and the current pixel information, a mapping relationship between the brightness parameter and the pixel information is determined, so that the relationship between the brightness parameter and the pixel information can be accurately expressed through the mapping relationship, thereby improving the accuracy of image adjustment; then, from the color channel corresponding to each pixel point, the current brightness parameter is obtained. The color channel values that meet the preset filtering conditions are filtered out from the values as the target color channel values corresponding to each pixel point, and the target pixel information corresponding to each target color channel value is determined according to the mapping relationship, thereby realizing the accurate acquisition of the target pixel information of each pixel point in the currently displayed image; finally, based on the information of each target pixel, each pixel point of the currently displayed image is adjusted to obtain the target display image, thereby realizing efficient and accurate adjustment of the image quality, and enabling the image to be adaptively enhanced, thereby improving the image quality performance effect, and making the image more three-dimensional. The present application can also be applied to the fields of televisions and display screens to bring users better quality display pictures.
[0103] In some embodiments of the present application, determining the mapping relationship between the luminance parameter and the pixel information based on the current luminance parameter and the current pixel information includes:
[0104] Determining a brightness point set corresponding to the currently displayed image according to the current brightness parameter and the current pixel information;
[0105] Based on a preset mapping function and the brightness point set, a mapping relationship between brightness parameters and pixel information is determined.
[0106] In this embodiment, when the current luminance parameter and current pixel information are obtained, the luminance point set corresponding to the currently displayed image is determined based on the current luminance parameter and the current pixel information. Specifically, a luminance parameter that meets the target conditions is selected from all current luminance parameters as the target luminance parameter, and a target luminance parameter and its corresponding current pixel information are used as a luminance point; the luminance points corresponding to all target luminance parameters are combined to obtain the luminance point set corresponding to the currently displayed image. Then, a preset mapping function is obtained, wherein the mapping function can be constructed using a shape-preserving piecewise cubic difference of the luminance point set, or it can be constructed using a linear function, wherein different luminance point sets may correspond to different mapping functions. When the preset mapping function is obtained, the relationship between the luminance parameter and the pixel information at each luminance point in the luminance point set is expressed according to the mapping function, and the mapping relationship between the luminance parameter and the pixel information can be determined.
[0107] This embodiment determines the luminance point set corresponding to the currently displayed image based on the current luminance parameter and the current pixel information; determines the mapping relationship between the luminance parameter and the pixel information based on a preset mapping function and the luminance point set, thereby achieving accurate determination of the mapping relationship between the luminance parameter and the pixel information.
[0108] In some embodiments of the present application, the luminance point set includes a target luminance point set and a candidate luminance point set, and determining the luminance point set corresponding to the currently displayed image based on the current luminance parameter and the current pixel information includes:
[0109] Dividing the current luminance parameter to obtain a plurality of different candidate luminance intervals, and screening a target luminance interval that meets a preset luminance condition from the plurality of candidate luminance intervals;
[0110] Determining the target brightness point set corresponding to the target brightness interval according to current pixel information corresponding to each current brightness parameter within the target brightness interval;
[0111] Determine the intersection points of each of the candidate luminance intervals, as well as the minimum luminance point and the maximum luminance point of all the current luminance parameters, and determine the candidate luminance point set based on the intersection points, the minimum luminance point and the maximum luminance point.
[0112] In this embodiment, the luminance point set includes a target luminance point set and a candidate luminance point set. After obtaining all current luminance parameters of the currently displayed image and the current pixel information corresponding to each current luminance parameter, all current luminance parameters are divided to obtain multiple different candidate luminance intervals. Specifically, all current luminance parameters and current pixel information construct a luminance histogram of the currently displayed image. In this luminance histogram, the horizontal axis represents luminance and the vertical axis represents the number of pixel statistics, which is the pixel information. The current luminance parameter is divided within this luminance histogram to obtain multiple different candidate luminance intervals. For example, the interval between the minimum luminance point and a first preset luminance threshold is divided into an absolute gray-dark interval, the interval between the first preset luminance threshold and a second preset luminance threshold is divided into a reasonable brightness interval, and the interval between the second preset luminance threshold and the maximum luminance point is divided into an absolute brightness interval, where the first preset luminance threshold is less than the second preset luminance threshold. The absolute brightness interval, the absolute gray-dark interval, and the reasonable brightness interval are candidate luminance intervals.
[0113] When multiple candidate luminance intervals are obtained, a target luminance interval that meets a preset luminance condition is selected from the multiple candidate luminance intervals. For example, if the preset luminance condition is the luminance range corresponding to a reasonable bright interval, then this reasonable bright interval is selected as the target luminance interval. Then, based on the current pixel information corresponding to each current luminance parameter within the target luminance interval, a target luminance point set corresponding to the target luminance interval is determined. Specifically, the curve trend in the luminance histogram is obtained, and peak points where the number of pixel statistics changes from increasing to decreasing, as well as valley points where the number of pixel statistics changes from decreasing to increasing, are determined as target luminance points. All target luminance points constitute the target luminance point set.
[0114] When determining the candidate luminance point set, the intersection points of each candidate luminance interval, as well as the minimum and maximum luminance points of all current luminance parameters, are determined. The minimum luminance point is (0, 0). When the grayscale bit count of the image signal is 8 bits, the maximum luminance point of the current luminance parameter is (255, 255). When the candidate luminance intervals include an absolute bright interval, an absolute dark interval, and a reasonable bright interval, the intersection points include the intersection point (g_light, g_light) between the absolute bright interval and the reasonable bright interval, and the intersection point (g_dark, g_dark) between the reasonable bright interval and the absolute dark interval. This intersection point, the minimum luminance point, and the maximum luminance point constitute the candidate luminance point set.
[0115] This embodiment divides the current luminance parameter to obtain multiple different candidate luminance intervals, and screens out a target luminance interval that meets the preset luminance conditions from the multiple candidate luminance intervals; then, determines a target luminance point set corresponding to the target luminance interval based on current pixel information corresponding to each current luminance parameter in the target luminance interval; determines the intersection point of each candidate luminance interval, as well as the minimum luminance point and maximum luminance point of all current luminance parameters, and determines the candidate luminance point set based on the intersection point, the minimum luminance point, and the maximum luminance point, thereby achieving the determination of the target luminance point set and the candidate luminance point set, so that the mapping relationship between luminance and pixels can be accurately determined through the target luminance point set and the candidate luminance point set, thereby improving the accuracy of image adjustment.
[0116] In some embodiments of the present application, the target luminance point set includes a first luminance point set and a second luminance point set, and determining the target luminance point set corresponding to the target luminance interval based on current pixel information corresponding to each current luminance parameter within the target luminance interval includes:
[0117] Selecting first pixel information and second pixel information that meet a preset pixel condition from current pixel information within the target brightness interval, wherein the first pixel information in the target brightness interval is greater than the adjacent second pixel information;
[0118] generating the first brightness point set according to the first pixel information and a first brightness parameter corresponding to the first pixel information;
[0119] The second luminance point set is generated according to the second pixel information and a second luminance parameter corresponding to the second pixel information.
[0120] In this embodiment, after obtaining the current pixel information corresponding to each current luminance parameter within the target luminance range, first pixel information and second pixel information that meet preset pixel conditions are selected from the current pixel information within the target luminance range. The preset pixel conditions include a maximum value condition and a minimum value condition. A luminance mapping curve is constructed corresponding to all current luminance parameters and current pixel information within the target luminance range. The pixel information corresponding to all maximum values on the luminance mapping curve is the first pixel information within the target luminance range, and the pixel information corresponding to all minimum values on the luminance mapping curve is the second pixel information within the target luminance range. Within the target luminance range, all current luminance parameters are arranged in ascending order of parameter size, with the first pixel information being larger than the adjacent second pixel information.
[0121] After obtaining the first pixel information and the second pixel information, the current luminance parameter corresponding to the first pixel information is obtained to obtain the first luminance parameter. A first luminance parameter and its corresponding first pixel information are a first luminance point, and multiple first luminance points are combined into a first luminance point set. The current luminance parameter corresponding to the second pixel information is obtained to obtain the second luminance parameter. A second luminance parameter and its corresponding second pixel information are a second luminance point, and multiple second luminance points are combined into a second luminance point set. As shown in Figure 2, Figure 2 is a schematic diagram of the target luminance range, where the maximum point corresponding to g_peak is the first pixel information, g_peak is the first luminance parameter, the minimum point corresponding to g_valley is the second pixel information, g_valley is the second luminance parameter, R is the preset range, and V is the luminance.
[0122] Furthermore, based on a preset mapping function and the first and second luminance point sets, a mapping relationship between the luminance parameter and the pixel information can be determined as F(g)=g, where g is the luminance parameter and F(g) is the pixel information mapped according to the luminance parameter. In the first luminance point set, the horizontal axis coordinate value and the vertical axis coordinate value of the first luminance point in the luminance histogram are the same; in the second luminance point set, the horizontal axis coordinate value and the vertical axis coordinate value of the second luminance point in the luminance histogram are the same.
[0123] This embodiment selects first pixel information and second pixel information that meet preset pixel conditions from current pixel information within a target luminance interval, and the first pixel information in the target luminance interval is greater than the adjacent second pixel information; then, generates a first luminance point set based on the first pixel information and a first luminance parameter corresponding to the first pixel information; and generates a second luminance point set based on the second pixel information and the second luminance parameter corresponding to the second pixel information, thereby achieving accurate acquisition of the first luminance point and the second luminance point, so that the mapping relationship between luminance and pixels can be accurately obtained through the first luminance point set and the second luminance point set, thereby improving the precision and accuracy of image adjustment.
[0124] In some embodiments of the present application, the target luminance point set further includes a third luminance point set. After generating the second luminance point set based on the second pixel information and the second luminance parameter corresponding to the second pixel information, the method further includes:
[0125] Dividing the target brightness interval into a plurality of sub-intervals according to the first brightness parameter and the second brightness parameter;
[0126] Selecting a current luminance parameter that meets a preset position condition from each of the subintervals as a third luminance parameter, and obtaining third pixel information corresponding to each of the third luminance parameters;
[0127] The third luminance point set is generated according to each of the third luminance parameters and the third pixel information.
[0128] In this embodiment, the target luminance point set also includes a third luminance point set. After generating the second luminance point set based on the second pixel point information and the second luminance parameter corresponding to the second pixel point information, the target luminance interval is divided according to the first luminance parameter and the second luminance parameter to obtain a plurality of subintervals. Specifically, the first luminance parameter is the luminance parameter corresponding to the pixel information corresponding to each maximum value in the target luminance interval, and the second luminance parameter is the luminance parameter corresponding to the pixel information corresponding to each minimum value in the target luminance interval. The adjacent first luminance parameter and the second luminance parameter in the target luminance interval are obtained, and each adjacent first luminance parameter and the second luminance parameter are a subinterval, thereby obtaining a plurality of subintervals corresponding to the target luminance interval. Wherein, adjacent means that all luminance parameters in the target luminance interval are arranged in order from small to large to obtain a luminance column, and the adjacent first luminance parameter and the second luminance parameter in the luminance column are the adjacent first luminance parameter and the second luminance parameter in the target luminance interval.
[0129] Taking the luminance histogram as an example, the luminance histogram is divided into multiple candidate luminance intervals, and the target luminance interval is screened from the multiple candidate luminance intervals. The horizontal axis of the luminance histogram is the luminance column composed of luminance parameters, and the vertical axis is the number of pixel statistics. In the target luminance interval of the luminance histogram, the luminance parameter corresponding to each peak is the first luminance parameter, and the luminance parameter corresponding to each valley is the second luminance parameter. The adjacent first luminance parameter and second luminance parameter on the horizontal axis of the luminance histogram constitute a subinterval. When multiple subintervals in the target luminance interval are obtained, the current luminance parameter that meets the preset position conditions is selected from each subinterval as the third luminance parameter; the third pixel information corresponding to each third luminance parameter is obtained, that is, the third luminance point is obtained. Specifically, based on the first luminance parameter, the second luminance parameter, and the interval luminance balance information corresponding to each sub-interval, the third luminance parameter among the first luminance parameter and the second luminance parameter can be determined; based on the first luminance parameter, the second luminance parameter, and the interval exposure information corresponding to each sub-interval, the third pixel information corresponding to each third luminance parameter can be determined.
[0130] According to the third luminance parameter and the third pixel information, a third luminance point set is generated. Among them, a third luminance parameter and the third pixel information corresponding to the third luminance parameter is a third luminance point. As shown in Figure 3, Figure 3 is a schematic diagram of a luminance mapping curve, wherein v is luminance, V' is the statistical number of pixels, g_dark is the intersection point of the absolute gray-dark interval and the reasonable bright interval, g_light is the intersection point of the reasonable bright interval and the absolute bright interval, and there is a third luminance parameter between the first luminance parameter and the second luminance parameter. Furthermore, for the third luminance point set, the mapping relationship between the luminance parameter and the pixel information obtained according to the preset mapping function and the third luminance point set can be directly mapped and determined through the third luminance point.
[0131] This embodiment divides the target luminance interval into multiple sub-intervals based on the first luminance parameter and the second luminance parameter; selects the current luminance parameter that meets the preset position condition from each sub-interval as the third luminance parameter, and obtains the third pixel information corresponding to each third luminance parameter; generates a third luminance point set based on each third luminance parameter and the third pixel information, thereby achieving accurate acquisition of the third luminance point in the target luminance interval and further improving the image adjustment precision and accuracy.
[0132] In some embodiments of the present application, the step of selecting a current luminance parameter that meets a preset position condition from each of the subintervals as a third luminance parameter, and obtaining third pixel information corresponding to each of the third luminance parameters, includes:
[0133] Acquiring an average pixel level of the currently displayed image, interval brightness balance information corresponding to each of the subintervals, and interval exposure information corresponding to each of the subintervals;
[0134] The third luminance parameter of each of the subintervals and the third pixel information corresponding to each of the third luminance parameters are determined according to the average pixel level, the interval luminance balance information and the interval exposure information.
[0135] In this embodiment, the average pixel level (APL) is the average pixel value corresponding to the target display image. The interval brightness balance information is the brightness balance information corresponding to each subinterval, that is, the brightness distribution of each subinterval. Specifically, the pixel mean of all pixel information in the current display image is obtained, and the difference between this pixel mean and the pixel information in each subinterval is calculated. The root mean square error or mean absolute error is then calculated based on this difference to obtain different interval brightness balance information corresponding to different subintervals. Sub-exposure parameters are obtained by multiplying each brightness parameter in the current display image with its corresponding pixel information. The sub-exposure parameters corresponding to all brightness parameters in the current display image are summed to obtain a total exposure parameter. The pixel information corresponding to each brightness parameter in the current display image is summed to obtain a total brightness parameter. The ratio of the total exposure parameter to the total brightness parameter is calculated, and this ratio is divided by the number of brightness parameters in the current display image to obtain the exposure value of the current display image. The number of brightness parameters is determined by the number of grayscale bits of the image. When the number of grayscale bits of the image is n, the number of brightness parameters is 2. n -1. Gets multiple preset exposure levels, such as 1 to E. Different exposure levels represent different degrees of exposure, with larger values indicating higher exposure. Determines the exposure level to which the exposure value belongs. This exposure level serves as the target exposure information for the currently displayed image.
[0136] After obtaining the average pixel level of the currently displayed image, interval luminance balance information corresponding to each subinterval, and interval exposure information corresponding to each subinterval, a third luminance parameter for each subinterval and third pixel information corresponding to each third luminance parameter are determined based on the average pixel level, the interval luminance balance information, and the interval exposure information. Specifically, a first luminance point in the first luminance point set and a second luminance point in the second luminance point set can be adjusted based on the average pixel level to obtain a first updated luminance point and a second updated luminance point; each third luminance parameter is determined based on the interval luminance balance information, the first updated luminance point, and the second updated luminance point; and third pixel information corresponding to each third luminance parameter is determined based on the interval exposure information, the first updated luminance point, and the second updated luminance point.
[0137] Specifically, different areas within the target luminance range correspond to different average pixel levels. Based on these average pixel levels, the target luminance range is divided into dark areas, reasonable areas, and bright areas. Preset dark area thresholds and bright area thresholds are obtained. Areas within the target luminance range where the average pixel level is less than the dark area threshold are defined as dark areas, areas where the average pixel level is between the dark area threshold and the bright area threshold are defined as reasonable areas, and areas where the average pixel level is greater than the bright area threshold are defined as bright areas. When a first luminance point or a second luminance point is located in a dark area, pixel information corresponding to the first luminance point or the second luminance point in the dark area is added or subtracted from a preset constant to calculate an updated first luminance point or an updated second luminance point. Alternatively, a preset luminance mapping table may be obtained and, based on the luminance mapping table, the updated first luminance point corresponding to the first luminance point or the updated second luminance point corresponding to the second luminance point is determined. In dark areas, the adjusted first updated luminance point is positioned below the first luminance point, and the adjusted second updated luminance point is positioned below the second luminance point, compared to the first and second luminance points. Similarly, when the first or second luminance point is in a bright area, a preset constant is added or subtracted from the first or second luminance point in that bright area to calculate the updated first updated luminance point or the updated second updated luminance point. In bright areas, the adjusted first updated luminance point is positioned above the first luminance point, and the adjusted second updated luminance point is positioned above the second luminance point. This allows for clearer dark areas and details in both areas of the image.
[0138] Furthermore, for the first and second updated luminance points obtained after the update, the mapping relationship between the luminance parameters and the pixel information can be determined by the first and second updated luminance points. Since the first and second updated luminance points are points obtained by adjusting the first and second luminance points up and down, respectively, the mapping relationship between the luminance parameters and the pixel information determined based on the first and second updated luminance points is different from the aforementioned F(g)=g, and F(g) and g are not equivalent.
[0139] Then, when determining a third luminance point between the first and second luminance points, the starting luminance point on the subinterval is determined; and based on the starting luminance point on the subinterval, the target area to which the third luminance point belongs is determined. Specifically, if the starting luminance point on the subinterval is the first luminance point and the ending luminance point on the subinterval is the second luminance point, the target area corresponding to the third luminance point is determined to be the triangular area above the first and second luminance points; if the starting luminance point on the subinterval is the second luminance point and the ending luminance point on the subinterval is the first luminance point, the target area corresponding to the third luminance point is determined to be the triangular area below the second and first luminance points.
[0140] The third luminance parameter for each target area is determined based on the interval luminance balance information, the first updated luminance point, and the second updated luminance point. Specifically, the luminance parameter of the first updated luminance point and the luminance parameter of the second updated luminance point are summed, and then the product of the luminance parameter of the first updated luminance point and the interval luminance balance information is calculated. The difference between the sum and the product is used to obtain the third luminance parameter, i.e., the horizontal coordinate value of the third luminance point in the target area within the target luminance interval. Based on the third luminance parameter, the interval exposure information, the first updated luminance point, and the second updated luminance point, the third pixel information corresponding to the third luminance parameter of each target area is calculated. This third pixel is the vertical coordinate value of the third luminance point in the target area within the target luminance interval. Specifically, the difference between the luminance parameter of the second updated luminance point and the third luminance parameter is calculated to obtain a first parameter value; the interval exposure information is adjusted according to the preset parameters to obtain an adjusted exposure value; the first parameter value is adjusted according to the adjusted exposure value and a preset constant (such as a multiplication calculation) to obtain a second parameter value; finally, the third pixel information is calculated according to the third luminance parameter and the second parameter value (such as a summation).
[0141] This embodiment achieves accurate calculation of the third pixel information, so that brightness and pixels can be accurately mapped through the third brightness point and the third pixel information, further improving the accuracy of image adjustment.
[0142] In some embodiments of the present application, after adjusting each pixel of the current display image based on each target pixel information to obtain a target display image, the method further includes:
[0143] Calculating target exposure information and target brightness balance information of the target display image;
[0144] determining, based on the target exposure information and the target brightness balance information, whether the target display image is an image that meets a preset image quality condition;
[0145] If the target display image is an image that meets the preset image quality condition, the target display image is pushed to the target display interface.
[0146] In this embodiment, the target exposure information is the exposure level of the target display image. The exposure value of the target display image is calculated based on each luminance parameter in the target display image, the pixel information corresponding to the luminance parameter, and the number of luminance parameters in the target display image. Multiple preset exposure levels, such as 1 to E exposure levels, are obtained, and the exposure level to which the exposure value of the target display image belongs is determined. This exposure level is the target exposure information of the target display image.
[0147] The target brightness balance information is information representing the brightness distribution of the target display image. The pixel information corresponding to different brightness parameters of the target display image is obtained, and the mean of all pixel information is calculated. Then, the difference information between the pixel information corresponding to different brightness parameters of the target display image and the mean is determined based on the mean, and the target brightness balance information corresponding to the target display image is determined based on the difference information. The difference information can be obtained by calculating the difference between the pixel value corresponding to each brightness parameter and the mean, and then the root mean square error or mean absolute error of the target display image is calculated based on the difference to obtain the target brightness balance value of the target display image. The target brightness balance value is normalized to obtain a normalized value. The balance level to which the normalized value belongs is determined to obtain the target brightness balance level of the target display image. The target brightness balance level is the target brightness balance information of the target display image.
[0148] After obtaining the target exposure information and target brightness information of the target display image, a preset image exposure level and image brightness balance level are obtained; and based on the target exposure information, target brightness balance information, image exposure level, and image brightness balance level, a determination is made as to whether the target display image meets the preset image quality conditions. If the exposure level of the target exposure information is less than or equal to the image exposure level, and the brightness balance level in the target brightness balance information is greater than or equal to the image brightness balance level, the target display image is determined to meet the preset image quality conditions. If the target display image is determined to meet the preset image quality conditions, the target display image is pushed to the target display interface.
[0149] If it is determined that the target display image is not an image that meets the preset image quality conditions, the mapping relationship between the brightness parameters and pixel information of the target display image is re-determined based on the brightness parameters and pixel information of the target display image; based on the re-determined mapping relationship, the remapped target pixel information corresponding to the target color channel value of each pixel point in the target display image is calculated; based on the remapped target pixel information, each pixel point of the target display image is iteratively adjusted to obtain an adjusted image; until, based on the exposure information and brightness balance information of the adjusted image, it is determined that the adjusted image is an image that meets the preset image quality conditions.
[0150] This embodiment calculates the target exposure information and target brightness balance information of the target display image; determines whether the target display image is an image that meets the preset image quality conditions based on the target exposure information and the target brightness balance information; if the target display image is an image that meets the preset image quality conditions, pushes the target display image to the target display interface, thereby achieving accurate evaluation of the adjusted image, so that when the adjusted image does not meet the preset image quality conditions, the adjusted image is further iteratively adjusted, thereby improving the image display quality.
[0151] To facilitate better implementation of the image processing method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above image processing method. The meanings of the terms herein are the same as those in the above image processing method, and the specific implementation details can be referred to the description in the method embodiment.
[0152] For example, as shown in FIG4 , the image processing apparatus may include: an acquisition module 401 , a confirmation module 402 , a mapping module 403 and an adjustment module 404 .
[0153] An acquisition module 401 is configured to acquire a current brightness parameter corresponding to a currently displayed image and current pixel information corresponding to each current brightness parameter, wherein the currently displayed image includes a plurality of pixels, each of which corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values;
[0154] A confirmation module 402 is configured to determine a mapping relationship between a brightness parameter and pixel information based on the current brightness parameter and the current pixel information;
[0155] A mapping module 403 is configured to filter out color channel values that meet a preset filtering condition from the color channel values corresponding to the respective pixel points as target color channel values corresponding to the respective pixel points, and determine target pixel information corresponding to the respective target color channel values according to the mapping relationship;
[0156] The adjustment module 404 is configured to adjust each pixel of the current display image based on the target pixel information to obtain a target display image.
[0157] In one embodiment of the present application, the confirmation module 402 includes:
[0158] a first confirmation unit, configured to determine a brightness point set corresponding to the currently displayed image according to the current brightness parameter and the current pixel information;
[0159] The second confirmation unit is used to determine the mapping relationship between the brightness parameter and the pixel information based on a preset mapping function and the brightness point set.
[0160] In one embodiment of the present application, the first confirmation unit includes:
[0161] a first division unit, configured to divide the current luminance parameter to obtain a plurality of different candidate luminance intervals, and select a target luminance interval that meets a preset luminance condition from the plurality of candidate luminance intervals;
[0162] a first confirmation subunit, configured to determine the target brightness point set corresponding to the target brightness interval based on current pixel information corresponding to each current brightness parameter within the target brightness interval;
[0163] The second confirmation subunit is used to determine the intersection points of each candidate luminance interval, and the minimum luminance point and the maximum luminance point of all the current luminance parameters, and determine the candidate luminance point set based on the intersection points, the minimum luminance point and the maximum luminance point.
[0164] In one embodiment of the present application, the first confirmation subunit includes:
[0165] a first screening unit, configured to select first pixel information and second pixel information that meet a preset pixel condition from current pixel information within the target brightness interval, wherein the first pixel information is greater than adjacent second pixel information within the target brightness interval;
[0166] a first generating unit, configured to generate the first brightness point set according to the first pixel information and a first brightness parameter corresponding to the first pixel information;
[0167] The second generating unit is configured to generate the second luminance point set according to the second pixel information and a second luminance parameter corresponding to the second pixel information.
[0168] In one embodiment of the present application, the first confirmation subunit further includes:
[0169] a second division unit, configured to divide the target brightness interval into a plurality of sub-intervals according to the first brightness parameter and the second brightness parameter;
[0170] a second screening unit, configured to select, from each of the subintervals, a current luminance parameter that meets a preset position condition as a third luminance parameter, and obtain third pixel information corresponding to each of the third luminance parameters;
[0171] The third generating unit is used to generate the third brightness point set according to each of the third brightness parameters and the third pixel information.
[0172] In one embodiment of the present application, the second screening unit includes:
[0173] an acquisition subunit, configured to acquire an average pixel level of the currently displayed image, interval brightness balance information corresponding to each of the subintervals, and interval exposure information corresponding to each of the subintervals;
[0174] An adjustment unit is configured to determine, based on the average pixel level, the interval brightness balance information, and the interval exposure information, a third brightness parameter of each of the subintervals and third pixel information corresponding to each of the third brightness parameters.
[0175] In one embodiment of the present application, the image processing device further includes:
[0176] a calculation module, configured to calculate target exposure information and target brightness balance information of the target display image;
[0177] a screening module, configured to determine whether the target display image meets a preset image quality condition based on the target exposure information and the target brightness balance information;
[0178] The push module is configured to push the target display image to a target display interface if the target display image meets the preset image quality condition.
[0179] The image processing device proposed in this application realizes efficient and precise adjustment of image quality, and enables adaptive enhancement of images, thereby improving the image quality performance and making the image more three-dimensional. This application can also be applied to the fields of televisions and display screens to bring users better quality display images.
[0180] During specific implementation, the above modules can be implemented as independent entities, or they can be arbitrarily combined and implemented as the same or several entities. The specific implementation methods and corresponding beneficial effects of the above modules can be found in the previous method embodiments and will not be repeated here.
[0181] The present application also provides an electronic device, which may be a server or a terminal, etc. As shown in FIG5 , it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application. Specifically:
[0182] The electronic device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that the electronic device structure shown in FIG5 does not limit the electronic device and may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0183] Processor 601 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and circuits. It executes computer programs and / or modules stored in memory 602 and accesses data stored in memory 602 to perform various functions of the electronic device and process data. Optionally, processor 601 may include one or more processing cores. Preferably, processor 601 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 601.
[0184] Memory 602 can be used to store computer programs and modules. Processor 601 executes various functional applications and data processing by running the computer programs and modules stored in memory 602. Memory 602 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and computer programs required for at least one function (such as sound playback or image playback); the data storage area may store data generated based on the use of the electronic device. Memory 602 may also include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 602 may also include a memory controller to provide processor 601 with access to memory 602.
[0185] The electronic device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 603 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0186] The electronic device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0187] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 602 according to the following instructions, and the processor 601 will run the computer programs stored in the memory 602 to implement various functions, such as:
[0188] Obtaining a current brightness parameter corresponding to a currently displayed image and current pixel information corresponding to each current brightness parameter, wherein the currently displayed image includes a plurality of pixels, each of the pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values;
[0189] Determining a mapping relationship between the brightness parameter and the pixel information according to the current brightness parameter and the current pixel information;
[0190] Filtering the color channel values corresponding to the respective pixel points to obtain the target color channel values corresponding to the respective pixel points according to the preset filtering conditions, and determining the target pixel information corresponding to the target color channel values according to the mapping relationship;
[0191] The pixel points of the current display image are adjusted based on the target pixel information to obtain a target display image.
[0192] The electronic device proposed in this embodiment realizes efficient and precise adjustment of image quality, and enables adaptive enhancement of the image, thereby improving the image quality performance and making the image more three-dimensional. This application can also be applied to the fields of televisions and display screens to bring users better quality display images.
[0193] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the detailed description of the image processing method above, which will not be elaborated here.
[0194] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0195] To this end, an embodiment of the present application provides a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the image processing methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0196] Obtaining a current brightness parameter corresponding to a currently displayed image and current pixel information corresponding to each current brightness parameter, wherein the currently displayed image includes a plurality of pixels, each of the pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values;
[0197] Determining a mapping relationship between the brightness parameter and the pixel information according to the current brightness parameter and the current pixel information;
[0198] Filtering the color channel values corresponding to the respective pixel points to obtain the target color channel values corresponding to the respective pixel points according to the preset filtering conditions, and determining the target pixel information corresponding to the target color channel values according to the mapping relationship;
[0199] The pixel points of the current display image are adjusted based on the target pixel information to obtain a target display image.
[0200] The computer-readable storage medium proposed in this embodiment realizes efficient and precise adjustment of image quality, and enables adaptive enhancement of the image, thereby improving the image quality performance and making the image more three-dimensional. This application can also be applied to the fields of televisions and display screens to bring users better quality display images.
[0201] The specific implementation methods and corresponding beneficial effects of the above operations can be found in the previous embodiments and will not be described in detail here.
[0202] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0203] Since the computer program stored in the computer-readable storage medium can execute the steps of any image processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any image processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0204] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described image processing method.
[0205] The above is a detailed introduction to an image processing method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An image processing method, wherein: include: Acquire a current brightness parameter corresponding to a currently displayed image and current pixel information corresponding to each of the current brightness parameters, wherein the currently displayed image includes a plurality of pixels, each of the pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined according to the plurality of color channel values; Determining a mapping relationship between a brightness parameter and pixel information according to the current brightness parameter and the current pixel information; Filtering out color channel values that meet a preset filtering condition from the color channel values corresponding to the respective pixel points as target color channel values corresponding to the respective pixel points, and determining target pixel information corresponding to the respective target color channel values according to the mapping relationship; The pixel points of the current display image are adjusted based on the target pixel information to obtain a target display image.
2. The image processing method according to claim 1, wherein: The determining, according to the current brightness parameter and the current pixel information, a mapping relationship between the brightness parameter and the pixel information comprises: Determining a brightness point set corresponding to the currently displayed image according to the current brightness parameter and the current pixel information; Based on a preset mapping function and the brightness point set, a mapping relationship between brightness parameters and pixel information is determined.
3. The image processing method according to claim 2, wherein: The brightness point set includes a target brightness point set and a candidate brightness point set, and determining the brightness point set corresponding to the current displayed image according to the current brightness parameter and the current pixel information includes: Dividing the current brightness parameter to obtain a plurality of different candidate brightness intervals, and selecting a target brightness interval that meets a preset brightness condition from the plurality of candidate brightness intervals; Determining the target brightness point set corresponding to the target brightness interval according to current pixel information corresponding to each current brightness parameter within the target brightness interval; Determine the intersection points of each of the candidate brightness intervals, as well as the minimum brightness point and the maximum brightness point of all the current brightness parameters, and determine the candidate brightness point set based on the intersection points, the minimum brightness point and the maximum brightness point.
4. The image processing method according to claim 3, wherein: The current brightness parameter is divided to obtain a plurality of different candidate brightness intervals, including: According to the current brightness parameter and the current pixel information, a brightness histogram of the currently displayed image is constructed; the horizontal axis of the brightness histogram is the current brightness parameter, and the vertical axis of the brightness histogram is the current pixel information; The current brightness parameter is divided in the brightness histogram to obtain a plurality of different candidate brightness intervals.
5. The image processing method according to claim 3, wherein: The target brightness point set includes a first brightness point set and a second brightness point set, and determining the target brightness point set corresponding to the target brightness interval according to current pixel information corresponding to each current brightness parameter in the target brightness interval includes: Selecting first pixel information and second pixel information that meet a preset pixel condition from current pixel information within the target brightness interval, wherein the first pixel information in the target brightness interval is greater than the adjacent second pixel information; generating the first brightness point set according to the first pixel information and a first brightness parameter corresponding to the first pixel information; The second brightness point set is generated according to the second pixel information and a second brightness parameter corresponding to the second pixel information.
6. The image processing method according to claim 5, wherein: The preset pixel condition includes a maximum value condition and a minimum value condition, and selecting the first pixel information and the second pixel information that meet the preset pixel condition from the current pixel information in the target brightness interval includes: Constructing a brightness mapping curve corresponding to all current brightness parameters and current pixel information in the target brightness interval; Determine all pixel information corresponding to the maximum values on the brightness mapping curve as first pixel information within the target brightness interval; The pixel information corresponding to all minimum values on the brightness mapping curve is determined as the second pixel information within the target brightness range.
7. The image processing method according to claim 5, wherein: The target brightness point set further includes a third brightness point set, and after the second brightness point set is generated according to the second pixel information and the second brightness parameter corresponding to the second pixel information, further includes: Dividing the target brightness interval into a plurality of sub-intervals according to the first brightness parameter and the second brightness parameter; Selecting a current brightness parameter that meets a preset position condition from each of the sub-intervals as a third brightness parameter, and acquiring third pixel information corresponding to each of the third brightness parameters; The third brightness point set is generated according to each of the third brightness parameters and the third pixel information.
8. The image processing method according to claim 7, wherein: The selecting a current brightness parameter that meets a preset position condition from each of the sub-intervals as a third brightness parameter, and obtaining third pixel information corresponding to each of the third brightness parameters, includes: Acquire an average pixel level of the currently displayed image, interval brightness balance information corresponding to each of the subintervals, and interval exposure information corresponding to each of the subintervals; According to the average pixel level, the interval brightness balance information and the interval exposure information, the third brightness parameter of each of the sub-intervals and the third pixel information corresponding to each of the third brightness parameters are determined.
9. The image processing method according to claim 8, wherein: The interval brightness balance information is obtained by the following steps: Obtaining a pixel mean value of all pixel information of the currently displayed image; Calculate the difference between the pixel mean and the pixel information in each subinterval; A root mean square error or a mean absolute error is calculated according to the difference to obtain brightness equalization information of different intervals corresponding to different sub-intervals.
10. The image processing method according to claim 8, wherein: The determining, according to the average pixel level, the interval brightness balance information and the interval exposure information, the third brightness parameter of each of the sub-intervals and the third pixel information corresponding to each of the third brightness parameters comprises: Adjusting a first brightness point in the first brightness point set and a second brightness point in the second brightness point set according to the average pixel level to obtain a first updated brightness point and a second updated brightness point; Determining a third brightness parameter of each of the sub-intervals based on the interval brightness balance information, the first updated brightness point, and the second updated brightness point; Based on the interval exposure information, the first updated brightness point and the second updated brightness point, third pixel information corresponding to each of the third brightness parameters is determined.
11. The image processing method according to claim 10, wherein: The determining, based on the interval brightness balance information, the first updated brightness point, and the second updated brightness point, the third brightness parameter of each of the sub-intervals comprises: Summing the brightness parameter of the first updated brightness point and the brightness parameter of the second updated brightness point to obtain a sum value; The product of the brightness parameter of the first updated brightness point and the interval brightness balance information is calculated to obtain a product value; and the third brightness parameter of each sub-interval is determined according to the difference between the sum value and the product value.
12. The image processing method according to claim 10, wherein: The determining, based on the interval exposure information, the first updated brightness point, and the second updated brightness point, third pixel information corresponding to each third brightness parameter includes: Calculating a difference between a brightness parameter of the second updated brightness point and the third brightness parameter to obtain a first parameter value; Adjusting the interval exposure information according to preset parameters to obtain an adjusted exposure value; Adjust the first parameter value according to the adjusted exposure value and a preset constant to obtain a second parameter value; According to the third brightness parameter and the second parameter, third pixel information corresponding to each of the third brightness parameters is determined.
13. The image processing method according to any one of claims 1 to 12, wherein: After adjusting each pixel point of the current display image based on each target pixel information to obtain a target display image, the method further includes: Calculating target exposure information and target brightness balance information of the target display image; Determining whether the target display image is an image that meets a preset image quality condition according to the target exposure information and the target brightness balance information; If the target display image is an image that meets the preset image quality condition, the target display image is pushed to the target display interface.
14. The image processing method according to claim 13, wherein: The calculating target exposure information of the target display image includes: Determining an exposure value of the target display image according to each brightness parameter in the target display image, pixel information corresponding to the brightness parameter, and the number of brightness parameters in the target display image; Acquire a plurality of preset exposure levels, and determine the exposure level to which the exposure value of the target display image belongs; An exposure level to which the exposure value of the target display image belongs is determined as target exposure information of the target display image.
15. The image processing method according to claim 13, wherein: The calculating target brightness balance information of the target display image includes: Obtain pixel information corresponding to different brightness parameters of the target display image, and calculate the mean of all pixel information; Determine, according to the mean value, pixel information corresponding to different brightness parameters of the target display image and difference information of the mean value; According to the difference information, target brightness balance information of the target display image is determined.
16. The image processing method according to claim 13, wherein: The determining, according to the target exposure information and the target brightness balance information, whether the target display image is an image that meets a preset image quality condition includes: Obtaining preset image exposure level and image brightness balance level; If the exposure level of the target exposure information is less than or equal to the image exposure level, and the brightness balance level in the target brightness balance information is greater than or equal to the image brightness balance level, it is determined that the target display image is an image that meets the preset image quality conditions.
17. The image processing method according to claim 13, wherein: After determining whether the target display image is an image that meets the preset image quality condition according to the target exposure information and the target brightness balance information, the method includes: If the target display image is an image that does not meet the preset image quality condition, re-determining the mapping relationship between the brightness parameter and the pixel information of the target display image according to the brightness parameter and the pixel information of the target display image; Calculating the remapped target pixel information corresponding to the target color channel value of each pixel point in the target display image according to the re-determined mapping relationship; Iteratively adjust each pixel point of the target display image based on the remapped target pixel information until it is determined that the adjusted image is an image that meets the preset image quality conditions according to the exposure information and brightness balance information of the adjusted image.
18. An image processing device, wherein: include: An acquisition module, used to acquire a current brightness parameter corresponding to a currently displayed image, and current pixel information corresponding to each of the current brightness parameters, wherein the currently displayed image includes a plurality of pixels, each of the pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined according to the plurality of color channel values; A confirmation module, used to determine a mapping relationship between a brightness parameter and pixel information according to the current brightness parameter and the current pixel information; A mapping module, used to filter out color channel values that meet preset filtering conditions from the color channel values corresponding to the pixels, as target color channel values corresponding to the pixels, and determine target pixel information corresponding to the target color channel values according to the mapping relationship; The adjustment module is used to adjust each pixel point of the current display image based on each target pixel information to obtain a target display image.
19. An electronic device, wherein: It comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the image processing method according to any one of claims 1 to 17.
20. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the image processing method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Image display method and device
CN108806638A
Image processing method and device, computer equipment and storage medium
CN110580693A
Light spot detection method and device
CN111368819A
Image enhancement method and device, electronic equipment and storage medium
CN116912134A
Image processing method and device, electronic equipment and computer readable storage medium
CN117649817A