Image processing method and apparatus, and electronic device and computer-readable storage medium
Patent Information
- Application Number
- EP2024884205
- Authority / Receiving Office
- EP · EP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-01
- Filing Date
- 2024-08-29
- Publication Date
- 2026-09-09
AI Technical Summary
Traditional global methods cannot balance both local bright areas and details in local dark areas.
Smart Images

Figure IMGAF001_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 202311444903.4, filed with the China National Intellectual Property Administration on November 01, 2023, and titled "IMAGE PROCESSING METHOD AND APPARATUS, AND ELECTRONIC DEVICE AND COMPUTER-READABLE STORAGE MEDIUM", the entire contents of which are incorporated herein by reference.TECHNICAL FIELD
[0002] The present application relates to the field of image processing technologies, and specifically, to an image processing method, an apparatus, an electronic device, and a computer-readable storage medium.BACKGROUND
[0003] With the rapid development of science and technology, users have increasingly higher requirements for the image quality of display screens. When choosing to purchase a television or a display screen, users often refer to the image quality it presents. Excellent image quality technology can enhance the user's viewing experience, so image quality enhancement technology has become very important.Invention OverviewTechnical problem
[0004] However, in most image scenes, the brightness levels of different areas in an image often vary greatly. The prior art typically uses global methods to adjust the image. Traditional global methods cannot balance both local bright areas and details in local dark areas. This can easily cause overexposure in bright areas and brightness loss in dark areas, leading to the problem of difficult observation.SUMMARY
[0005] Embodiments of the present application provide an image processing method, an apparatus, an electronic device, and a computer-readable storage medium, which can solve the technical problem of image quality detail loss caused by inaccurate image adjustment.
[0006] An embodiment of the present application provides an image processing method, comprising: acquiring a current brightness parameter corresponding to a current display image, and current pixel information corresponding to each of the current brightness parameters, the current display image includes multiple pixels, each of the pixels corresponds to multiple 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 brightness parameters and pixel information according to the current brightness parameter and the current pixel information; screening out, from color channel values respectively corresponding to each of the pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the pixels, and determining target pixel information corresponding to each of the target color channel values according to the mapping relationship; and adjusting each of the pixels of the current display image based on the respective target pixel information to obtain a target display image.
[0007] Further, the step of determining the mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information includes: determining a set of brightness points corresponding to the current display image according to the current brightness parameter and the current pixel information; and determining the mapping relationship between brightness parameters and pixel information based on a preset mapping function and the set of brightness points.
[0008] Further, the set of brightness points includes a target set of brightness points and a candidate set of brightness points, and the step of determining the set of brightness points corresponding to the current display image according to the current brightness parameter and the current pixel information includes: dividing the current brightness parameter to obtain multiple different candidate brightness intervals, and screening out a target brightness interval that meets a preset brightness condition from the plurality of candidate brightness intervals; determining the target set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each current brightness parameter within the target brightness interval; and determining boundary points of each of the candidate brightness intervals, and a minimum brightness point and a maximum brightness point of all the current brightness parameters, and determining the candidate set of brightness points according to the boundary points, the minimum brightness point, and the maximum brightness point.
[0009] Further, the step of dividing the current brightness parameter to obtain the plurality of different candidate brightness intervals includes: constructing a brightness histogram of the current display image according to the current brightness parameter and the current pixel information, a horizontal axis of the brightness histogram is the current brightness parameter, and a vertical axis of the brightness histogram is the current pixel information; and dividing the current brightness parameter in the brightness histogram to obtain the plurality of different candidate brightness intervals.
[0010] Further, the target set of brightness points includes a first set of brightness points and a second set of brightness points, and the step of determining the target set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each current brightness parameter within the target brightness interval includes: selecting, from the current pixel information within the target brightness interval, first pixel information and second pixel information that meet a preset pixel condition, on the target brightness interval, the first pixel information is greater than an adjacent second pixel information; generating the first set of brightness points according to the first pixel information and a first brightness parameter corresponding to the first pixel information; and generating the second set of brightness points according to the second pixel information and a second brightness parameter corresponding to the second pixel information.
[0011] Further, the preset pixel condition includes a local maximum condition and a local minimum condition, and the step of selecting, from the current pixel information within the target brightness interval, the first pixel information and the second pixel information that meet the preset pixel condition includes: constructing a brightness mapping curve corresponding to all current brightness parameters and current pixel information of the target brightness interval; determining pixel information corresponding to all local maxima on the brightness mapping curve as the first pixel information within the target brightness interval; and determining pixel information corresponding to all local minima on the brightness mapping curve as the second pixel information within the target brightness interval.
[0012] Further, the target set of brightness points also includes a third set of brightness points, and after the step of generating the second set of brightness points according to the second pixel information and the second brightness parameter corresponding to the second pixel information, the method further includes: dividing the target brightness interval according to the first brightness parameter and the second brightness parameter to obtain multiple sub-intervals; selecting, from each of the sub-intervals, a current brightness parameter that meets a preset position condition as a third brightness parameter, and acquiring third pixel information corresponding to each of the third brightness parameters; and generating the third set of brightness points according to each of the third brightness parameters and the third pixel information.
[0013] Further, the step of selecting, from each of the sub-intervals, the current brightness parameter that meets the preset position condition as the third brightness parameter, and acquiring the third pixel information corresponding to each of the third brightness parameters includes: acquiring an average pixel level of the current display image, interval brightness balance information corresponding to each of the sub-intervals, and interval exposure information corresponding to each of the sub-intervals; and determining the third brightness parameter of each of the sub-intervals, and the third pixel information corresponding to each of the third brightness parameters, according to the average pixel level, the interval brightness balance information, and the interval exposure information.
[0014] Further, the interval brightness balance information is obtained by the following steps: acquiring a pixel mean value of all pixel information of the current display image; calculating a difference between the pixel mean value and pixel information within each of the sub-intervals; and calculating a root mean square error or a mean absolute error according to the difference to obtain different interval brightness balance information corresponding to different sub-intervals.
[0015] Further, the step of determining the third brightness parameter of each of the sub-intervals, and the third pixel information corresponding to each of the third brightness parameters, according to the average pixel level, the interval brightness balance information, and the interval exposure information includes: adjusting a first brightness point in the first set of brightness points and a second brightness point in the second set of brightness points according to the average pixel level to obtain a first updated brightness point and a second updated brightness point; determining the 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; and determining the third pixel information corresponding to each of the third brightness parameters based on the interval exposure information, the first updated brightness point, and the second updated brightness point.
[0016] Further, the step of determining the 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 includes: summing a brightness parameter of the first updated brightness point and a brightness parameter of the second updated brightness point to obtain a sum value; calculating a product of the brightness parameter of the first updated brightness point and the interval brightness balance information to obtain a product value; and determining the third brightness parameter of each of the sub-intervals according to a difference between the sum value and the product value.
[0017] Further, the step of determining the third pixel information corresponding to each of the third brightness parameters based on the interval exposure information, the first updated brightness point, and the second updated brightness point 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 a preset parameter to obtain an adjusted exposure value; adjusting the first parameter value according to the adjusted exposure value and a preset constant to obtain a second parameter value; and determining the third pixel information corresponding to each of the third brightness parameters according to the third brightness parameter and the second parameter value.
[0018] Further, after the step of adjusting each of the pixels of the current display image based on the respective target pixel information to obtain the target display image, the method further includes: calculating target exposure information and target brightness balance information of the target display image; 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; and if the target display image is an image that meets the preset image quality condition, pushing the target display image to a target display interface.
[0019] Further, the step of calculating the 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 a number of brightness parameters in the target display image; acquiring multiple preset exposure levels, and determining an exposure level to which the exposure value of the target display image belongs; and determining the exposure level to which the exposure value of the target display image belongs as the target exposure information of the target display image.
[0020] Further, the step of calculating the target brightness balance information of the target display image includes: acquiring pixel information corresponding to different brightness parameters in the target display image, and calculating a mean value of all the pixel information; determining, according to the mean value, difference information between the pixel information corresponding to the different brightness parameters of the target display image and the mean value; and determining the target brightness balance information of the target display image according to the difference information.
[0021] Further, the step of determining, according to the target exposure information and the target brightness balance information, whether the target display image is an image that meets the preset image quality condition includes: acquiring a preset image exposure level and a preset image brightness balance level; and if an exposure level of the target exposure information is less than or equal to the image exposure level, and a brightness balance level in the target brightness balance information is greater than or equal to the image brightness balance level, determining that the target display image is an image that meets the preset image quality condition.
[0022] Further, after the step of determining, according to the target exposure information and the target brightness balance information, whether the target display image is an image that meets the preset image quality condition, 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 brightness parameters and pixel information of the target display image according to the brightness parameters and the pixel information of the target display image; calculating, according to the re-determined mapping relationship, remapped target pixel information corresponding to the target color channel value of each pixel in the target display image; and iteratively adjusting each pixel of the target display image based on the remapped target pixel information, until it is determined, according to exposure information and brightness balance information of an adjusted image, that the adjusted image is an image that meets the preset image quality condition.
[0023] Correspondingly, an embodiment of the present application provides an image processing apparatus, comprising: an acquisition module, configured to acquire a current brightness parameter corresponding to a current display image, and current pixel information corresponding to each of the current brightness parameters, the current display image includes multiple pixels, each of the pixels corresponds to multiple color channel values, and the current brightness parameter is a parameter determined according to the plurality of color channel values; a determination module, configured to determine a mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information; a mapping module, configured to screen out, from color channel values respectively corresponding to each of the pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the pixels, and determine target pixel information corresponding to each of the target color channel values according to the mapping relationship; and an adjustment module, configured to adjust each of the pixels of the current display image based on the respective target pixel information to obtain a target display image.
[0024] In addition, an embodiment of the present application also provides an electronic device, comprising a processor and a memory, the memory stores a computer program, and the processor is configured to run the computer program in the memory to implement the image processing method provided by the embodiments of the present application.
[0025] In addition, an embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor to execute any of the image processing methods provided by the embodiments of the present application.
[0026] In addition, an embodiment of the present application also provides a computer program product, comprising a computer program, the computer program, when executed by a processor, implements any of the image processing methods provided by the embodiments of the present application.TECHNICAL EFFECT
[0027] In an embodiment of the present application, precise acquisition of a brightness parameter in a current display image is achieved by acquiring a current brightness parameter corresponding to the current display image and current pixel information corresponding to each current brightness parameter. The current display image includes multiple pixels, each pixel corresponds to multiple color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values. Then, a mapping relationship between brightness parameters and pixel information is determined based on the current brightness parameter and the current pixel information, such that the mapping relationship can accurately express the relationship between the brightness parameters and the pixel information, thereby improving the accuracy of image adjustment. Subsequently, a color channel value that satisfies a preset screening condition is selected from the color channel values corresponding to each pixel to be a target color channel value for that pixel. Target pixel information corresponding to each target color channel value is determined according to the mapping relationship, thereby achieving precise acquisition of the target pixel information for each pixel in the current display image. Finally, each pixel of the current display image is adjusted based on the target pixel information for each pixel to obtain a target display image. This achieves efficient and precise adjustment of image quality, enables adaptive enhancement of image, improves image quality performance, and gives the image a more three-dimensional quality. The present application may also be applied to the fields of televisions and display screens to provide users with higher-quality display images.BRIEF DESCRIPTION OF THE DRAWINGS
[0028] To more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings to be used in the description of the embodiments will be briefly introduced below. It should be apparent that the accompanying drawings in the following description are only some embodiments of the present application, and a person of ordinary skill in the art may derive other drawings from these drawings without creative labor. FIG. 1 is a schematic flowchart of an image processing method provided by the present application; FIG. 2 is a schematic diagram of a target brightness interval of an image processing method provided by the present application; FIG. 3 is a schematic diagram of a brightness mapping curve of an image processing method provided by the present application; FIG. 4 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application; FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. It should be apparent that the described embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor shall fall within the protection scope of the present application.
[0030] Embodiments of the present application provide an image processing method, an apparatus, an electronic device, and a computer-readable storage medium. The image processing apparatus may be integrated into an electronic device, which may be a server, a terminal device, or the like.
[0031] The server may 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 communication, middleware services, domain name services, security services, a Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0032] The terminal may be a smartphone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smartwatch, or the like, but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication methods. The present application imposes no limitation in this regard.
[0033] In addition, "multiple" in the embodiments of the present application refers to two or more. "First," "second," and the like in the embodiments of the present application are used for distinguishing between descriptions and should not be construed as indicating or implying relative importance.
[0034] A detailed description is provided below. It should be noted that the order of description of the following embodiments does not constitute a limitation on the preferred order of the embodiments.
[0035] Referring to FIG. 1, FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application. The image processing method may include: S101. Acquiring a current brightness parameter corresponding to a current display image, and current pixel information corresponding to each current brightness parameter, the current display image includes multiple pixels, each pixel corresponds to multiple color channel values, and the current brightness parameter is a parameter determined according to the plurality of color channel values.
[0036] In this embodiment, the current display image includes multiple pixels, and each pixel corresponds to multiple color channel values, such as R, G, and B color channel values. The color channel value is the signal intensity value of each pixel in different color channels. The greater the signal intensity value, the brighter the color represented by that color channel. Taking an image signal with a grayscale bit depth of 8 bits as an example, the range of this signal intensity value is from 0 to 255, where 0 represents black, 255 represents white, and the middle number represents different levels of grayscale values. The brightness value of each pixel can be determined according to the plurality of color channel values corresponding to each pixel, and this brightness value is the current brightness parameter. Specifically, a preset ratio for each color channel is acquired, and the current brightness parameter of each pixel is obtained by performing a weighted sum calculation according to the preset ratio and the color channel values of the pixel. Then, the current pixel information corresponding to the current brightness parameter is acquired, where the current pixel information is the statistical count of pixels corresponding to the current brightness parameter in the current display image. Based on the current brightness parameter and the current pixel information, a brightness histogram corresponding to the current display 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 acquired, and then image analysis is performed on the brightness histogram to obtain the current brightness parameter and the current pixel information.
[0037] S102. Determining a mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information.
[0038] In this embodiment, when the current brightness parameter and the current pixel information are obtained, a current brightness parameter and its corresponding current pixel information are treated as a brightness point. Multiple current brightness parameters and their corresponding current pixel information are combined to obtain a set of brightness points corresponding to the current display image. A brightness histogram is constructed based on the current brightness parameter and the current pixel information, and the brightness histogram is divided into different intervals to obtain multiple candidate brightness intervals. Brightness points are selected from each candidate brightness interval to obtain target brightness points. All the target brightness points are fitted to obtain a brightness mapping function corresponding to the current display image, and this brightness mapping function reflects the mapping relationship between brightness parameters and pixel information in the current display image.
[0039] S103. Selecting, from color channel values corresponding to each pixel, a color channel value that satisfies a preset filter condition to be a target color channel value for each pixel, and determining target pixel information corresponding to each target color channel value according to the mapping relationship.
[0040] In this embodiment, each pixel is composed of multiple color channels, such as the three colors channels of Red, Green, and Blue (RGB). One color channel corresponds to one color channel value, and the color channel values for the different color channels of a pixel may be different. A color channel value that satisfies a preset filter condition is selected from the color channel values corresponding to each pixel to be the target color channel value for each pixel. The preset filter condition may select the maximum color channel value from the plurality of color channel values of a pixel as the target color channel value for that pixel. For example, if the color channel values of pixel A on the R, G, and B color channels are 30, 40, and 50, the target color channel value for pixel A is 50; if the color channel values of pixel B on the R, G, and B color channels are 20, 90, and 60, the target color channel value for pixel B is 90.
[0041] Further, in one implementation, the brightness mapping function representing the mapping relationship between brightness parameters and pixel information is uniformly sampled at 2^n-1 levels, and the data range of the brightness mapping function can be adjusted to 8-bit, 10-bit, or 12-bit according to actual needs. Then, the adjusted brightness mapping function is stored by means of a Look-Up Table (LUT). When the image processing method of the present application is applied in a television, the look-up table may be stored in the chip's flash memory. 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 pixel-by-pixel lookup table and interpolation on the input target color channel value.
[0042] S104. Adjusting each pixel of the current display image based on the target pixel information for each pixel to obtain a target display image.
[0043] In this embodiment, when the target pixel information for each pixel is obtained, each pixel of the current display image is adjusted according to the target pixel information to obtain a 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 the target pixel information for each pixel is obtained, the ratio of the target pixel information to the current pixel information for each pixel is calculated, and this ratio is used as a pixel gain value. Then, each pixel gain value is applied to the different color channels of the corresponding pixel, and pixel compensation is performed on the different color channels of each pixel in the current display image according to the pixel gain value to obtain the target display image.
[0044] This embodiment achieves precise acquisition of the brightness parameter in the current display image by acquiring the current brightness parameter corresponding to a current display image and the current pixel information corresponding to each current brightness parameter. The current display image includes multiple pixels, each pixel corresponds to multiple color channel values, and the current brightness parameter is a parameter determined based on the plurality of color channel values. Then, a mapping relationship between brightness parameters and pixel information is determined based on the current brightness parameter and the current pixel information, such that the mapping relationship can accurately express the relationship between the brightness parameters and the pixel information, thereby improving the accuracy of image adjustment. Subsequently, a color channel value that satisfies a preset screening condition is selected from the color channel values corresponding to each pixel to be a target color channel value for that pixel. Target pixel information corresponding to each target color channel value is determined according to the mapping relationship, thereby achieving precise acquisition of the target pixel information for each pixel in the current display image. Finally, each pixel of the current display image is adjusted based on the target pixel information for each pixel to obtain a target display image. This achieves efficient and precise adjustment of image quality, enables adaptive image enhancement, improves image quality performance, and gives the image a more three-dimensional quality. The present application may also be applied to the fields of televisions and display screens to provide users with higher-quality display images.
[0045] In some embodiments of the present application, the step of determining the mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information includes: determining a set of brightness points corresponding to the current display image according to the current brightness parameter and the current pixel information; and determining the mapping relationship between brightness parameters and pixel information based on a preset mapping function and the set of brightness points.
[0046] In this embodiment, when the current brightness parameter and the current pixel information are obtained, a set of brightness points corresponding to the current display image is determined according to the current brightness parameter and the current pixel information. Specifically, brightness parameters that meet target conditions are selected from all current brightness parameters as target brightness parameters. A target brightness parameter and its corresponding current pixel information are taken as one brightness point. A collection of all brightness points corresponding to the target brightness parameters forms the set of brightness points corresponding to the current display image. Then, a preset mapping function is acquired. The mapping function may be constructed using shape-preserving piecewise cubic interpolation based on the set of brightness points, or it may be constructed through a linear function, different sets of brightness points may correspond to different mapping functions. Once the preset mapping function is obtained, the mapping relationship between brightness parameters and pixel information is determined by using the mapping function to express the relationship between the brightness parameter and pixel information for each brightness point in the set of brightness points.
[0047] This embodiment achieves precise determination of the mapping relationship between brightness parameters and pixel information by determining a set of brightness points corresponding to the current display image according to the current brightness parameter and current pixel information, and determining the mapping relationship between brightness parameters and pixel information based on a preset mapping function and the set of brightness points.
[0048] In some embodiments of the present application, the set of brightness points includes a target set of brightness points and a candidate set of brightness points, and said determining the set of brightness points corresponding to the current display image according to the current brightness parameter and the current pixel information includes: dividing the current brightness parameter to obtain multiple 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 set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each current brightness parameter within the target brightness interval; and determining boundary points of each candidate brightness interval, and the minimum brightness point and the maximum brightness point of all the current brightness parameters, and determining the candidate set of brightness points according to the boundary points, the minimum brightness point, and the maximum brightness point.
[0049] In this embodiment, the set of brightness points includes a target set of brightness points and a candidate set of brightness points. After all current brightness parameters of the current display image and the current pixel information corresponding to each current brightness parameter are obtained, all current brightness parameters are divided to obtain multiple different candidate brightness intervals. Specifically, all current brightness parameters and current pixel information are used to construct a brightness histogram of the current display image. In this brightness histogram, the horizontal axis represents brightness, and the vertical axis represents the pixel statistical count, which is the pixel information. In this brightness histogram, the current brightness parameter is divided to obtain multiple different candidate brightness intervals. For example, the interval between the minimum brightness point and a first preset brightness threshold is divided into an absolute dark interval, the interval between the first preset brightness threshold and a second preset brightness threshold is divided into a moderately bright interval, and the interval between the second preset brightness threshold and the maximum brightness point is divided into an absolute bright interval, where the first preset brightness threshold is less than the second preset brightness threshold. The absolute bright interval, the absolute dark interval, and the moderately bright interval are the candidate brightness intervals.
[0050] When multiple candidate brightness intervals are obtained, a target brightness interval that meets a preset brightness condition is selected from the plurality of candidate brightness intervals. For example, if the preset brightness condition is the brightness range corresponding to the moderately bright interval, then the moderately bright interval is selected as the target brightness interval. Then, the target set of brightness points corresponding to the target brightness interval is determined according to the current pixel information corresponding to each current brightness parameter within the target brightness interval. Specifically, the curve trend in the brightness histogram is acquired, and the peak points where the pixel statistical count changes from increasing to decreasing, and the valley points where the pixel statistical count changes from decreasing to increasing, are determined as target brightness points. All target brightness points constitute the target set of brightness points.
[0051] When the candidate set of brightness points is determined, the boundary points of each candidate brightness interval, and the minimum and maximum brightness points of all current brightness parameters are determined. The minimum brightness point is (0, 0). When the grayscale bit depth of the image signal is 8 bits, the maximum brightness point of the current brightness parameter is (255, 255). When the candidate brightness intervals include an absolute bright interval, an absolute dark interval, and a reasonable bright interval, the boundary points include the boundary point (g_light, g_light) between the absolute bright interval and the reasonable bright interval, and the boundary point (g_dark, g_dark) between the reasonable bright interval and the absolute dark interval. The boundary points, the minimum brightness point, and the maximum brightness point constitute the candidate set of brightness points.
[0052] In this embodiment, the current brightness parameter is divided to obtain multiple different candidate brightness intervals, and a target brightness interval that meets a preset brightness condition is screened out from the multiple candidate brightness intervals. Then, a target set of brightness points corresponding to the target brightness interval is determined according to the current pixel information corresponding to each current brightness parameter within the target brightness interval. The boundary points of each candidate brightness interval, as well as the minimum and maximum brightness points of all current brightness parameters, are determined, and a candidate set of brightness points is determined based on the boundary points, the minimum brightness point, and the maximum brightness point. This process realizes the determination of the target set of brightness points and the candidate set of brightness points, such that the mapping relationship between brightness parameters and pixel information can be accurately determined using the target set of brightness points and the candidate set of brightness points, thereby improving the accuracy of image adjustment.
[0053] In some embodiments of the present application, the target set of brightness points includes a first set of brightness points and a second set of brightness points, and the step of determining the target set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each current brightness parameter within the target brightness interval includes: selecting, from the current pixel information within the target brightness interval, first pixel information and second pixel information that meet a preset pixel condition, within the target brightness interval, the first pixel information is greater than an adjacent second pixel information; generating the first set of brightness points according to the first pixel information and a first brightness parameter corresponding to the first pixel information; generating the second set of brightness points according to the second pixel information and a second brightness parameter corresponding to the second pixel information.
[0054] In this embodiment, after the current pixel information corresponding to each current brightness parameter within the target brightness interval is obtained, first pixel information and second pixel information that meet a preset pixel condition are selected from the current pixel information within the target brightness interval. The preset pixel condition includes a local maximum condition and a local minimum condition. A brightness mapping curve is constructed corresponding to all current brightness parameters and current pixel information of the target brightness interval. The pixel information corresponding to all local maxima on the brightness mapping curve is the first pixel information within the target brightness interval, and the pixel information corresponding to all local minima on the brightness mapping curve is the second pixel information within the target brightness interval. Within the target brightness interval, where all current brightness parameters are arranged in ascending order of value, the first pixel information is greater than an adjacent second pixel information.
[0055] After the first- and second-pixel information are obtained, their corresponding current brightness parameters are acquired as first and second brightness parameters, respectively. A first brightness point is composed of a first brightness parameter and its corresponding first pixel information, and multiple first brightness points form the first set of brightness points. Likewise, a second brightness point is composed of a second brightness parameter and its corresponding second pixel information, and multiple second brightness points form the second set of brightness points. As shown in FIG. 2, which is a schematic diagram of a target brightness interval, the pixel information at the local maximum corresponding to g_peak is the first pixel information, and g_peak is the first brightness parameter. The pixel information at the local minimum corresponding to g_valley is the second pixel information, and g_valley is the second brightness parameter. R represents a preset range, and V represents brightness.
[0056] Furthermore, the mapping relationship between brightness parameters and pixel information, determined according to a preset mapping function and the first and second sets of brightness points, can be F(g)=g, where g is a brightness parameter and F(g) is the pixel information mapped from the brightness parameter. This means that for a first brightness point in the first set of brightness points, its horizontal axis coordinate value and vertical axis coordinate value in the brightness histogram are identical. Similarly, for a second brightness point in the second set of brightness points, its horizontal and vertical axis coordinate values are also identical.
[0057] In this embodiment, first pixel information and second pixel information that meet a preset pixel condition are selected from the current pixel information within the target brightness interval, where the first pixel information is greater than an adjacent second pixel information within the target brightness interval. Then, the first set of brightness points is generated based on the first pixel information and its corresponding first brightness parameter, and the second set of brightness points is generated based on the second pixel information and its corresponding second brightness parameter. This process achieves precise acquisition of the first and second brightness points, allowing the mapping relationship between brightness and pixels to be accurately obtained using these sets of brightness points, thereby improving the precision and accuracy of image adjustment.
[0058] In some embodiments of the present application, the target set of brightness points further includes a third set of brightness points. After the step of generating the second set of brightness points according to the second pixel information and the second brightness parameter corresponding to the second pixel information, the method further includes: dividing the target brightness interval according to the first brightness parameter and the second brightness parameter to obtain multiple sub-intervals; selecting, from each of the sub-intervals, a current brightness parameter that meets a preset position condition as a third brightness parameter, and acquiring third pixel information corresponding to the third brightness parameter; and generating the third set of brightness points according to the third brightness parameter and the third pixel information.
[0059] In this embodiment, the target set of brightness points also includes a third set of brightness points. After the second set of brightness points is generated based on the second pixel information and its corresponding second brightness parameter, the target brightness interval is divided into multiple sub-intervals according to the first and second brightness parameters. Specifically, the first brightness parameter is the brightness parameter corresponding to each local maximum of pixel information within the target brightness interval, and the second brightness parameter is the brightness parameter corresponding to each local minimum of pixel information within the target brightness interval. Adjacent first and second brightness parameters within the target brightness interval are acquired. The range between each adjacent first brightness parameter and second brightness parameter defines a sub-interval, thereby obtaining multiple sub-intervals for the target brightness interval. Here, "adjacent" means that all brightness parameters within the target brightness interval are arranged sequentially in ascending order to form a brightness sequence. A first brightness parameter and a second brightness parameter that are adjacent in position within this sequence are considered adjacent within the target brightness interval.
[0060] Taking a brightness histogram as an example, the brightness histogram is divided into multiple candidate brightness intervals, and a target brightness interval is screened out. The horizontal axis of the brightness histogram represents the sequence of brightness parameters, and the vertical axis represents the pixel count. In the target brightness interval of the brightness histogram, the brightness parameter corresponding to each peak is the first brightness parameter, and the brightness parameter corresponding to each valley is the second brightness parameter. An adjacent first brightness parameter and second brightness parameter on the horizontal axis form a sub-interval. When multiple sub-intervals in the target brightness interval are obtained, a current brightness parameter that meets a preset position condition is selected from each sub-interval as a third brightness parameter, and the third pixel information corresponding to each third brightness parameter is acquired, thereby obtaining a third brightness point. Specifically, the third brightness parameter can be determined based on the first brightness parameter, the second brightness parameter, and the interval brightness balance information corresponding to each sub-interval. The third pixel information corresponding to each third brightness parameter can be determined based on the first brightness parameter, the second brightness parameter, and the interval exposure information corresponding to each sub-interval.
[0061] The third set of brightness points is generated according to these third brightness parameters and their corresponding third pixel information. Here, a single third brightness parameter and its corresponding third pixel information constitute a single third brightness point. As shown in FIG. 3, which is a schematic diagram of a brightness mapping curve, v represents brightness, V' represents the pixel count, g_dark is the boundary point between the absolute dark interval and the reasonable bright interval, g_light is the boundary point between the reasonable bright interval and the absolute bright interval, and a third brightness parameter exists between the first and second brightness parameters. Furthermore, for the third set of brightness points, the mapping relationship between brightness parameters and pixel information, constructed based on a preset mapping function and the third set of brightness points, can be determined directly from the third brightness points.
[0062] In this embodiment, the target brightness interval is divided into multiple sub-intervals based on the first and second brightness parameters. From each sub-interval, a current brightness parameter that meets a preset position condition is selected as a third brightness parameter, and its corresponding third pixel information is acquired. The third set of brightness points is then generated based on these third brightness parameters and third pixel information. This process achieves precise acquisition of the third brightness points in the target brightness interval, further improving the precision and accuracy of image adjustment.
[0063] In some embodiments of the present application, the step of selecting, from each of the sub-intervals, a current brightness parameter that meets a preset position condition as a third brightness parameter, and acquiring the third pixel information corresponding to the third brightness parameter, includes: acquiring an average pixel level of the current display image, interval brightness balance information corresponding to each of the sub-intervals, and interval exposure information corresponding to each of the sub-intervals; and determining the third brightness parameter of each of the sub-intervals, and the third pixel information corresponding to the third brightness parameter, according to the average pixel level, the interval brightness balance information, and the interval exposure information.
[0064] In this embodiment, the Average Pixel Level (APL) is the average pixel value of the target display image. The interval brightness balance information is the brightness balance information for each sub-interval, i.e., the brightness distribution within each sub-interval. Specifically, the mean value of all pixel information of the current display image is acquired. A difference between this mean value and the pixel information within each sub-interval is calculated. Then, a root means square error or a mean absolute error is calculated based on the difference to obtain distinct interval brightness balance information for different sub-intervals. A sub-exposure parameter is obtained by performing a product calculation on each brightness parameter and its corresponding pixel information in the current display image. The sub-exposure parameters for all brightness parameters in the current display image are summed to obtain a total exposure parameter. The pixel information corresponding to all brightness parameters in the current display image is summed to obtain a total pixel count. A ratio of the total exposure parameter to the total pixel count is calculated. This ratio is then 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 grayscale bit depth of the image. When the grayscale bit depth of the image is n, the number of brightness parameters is 2n - 1. Multiple preset exposure levels are acquired, such as 1 to E exposure levels. Different exposure levels represent different degrees of exposure, and a larger level value indicates a higher degree of exposure. The exposure level to which the exposure value belongs is determined, and this exposure level is the target exposure information of the current display image.
[0065] After the APL of the current display image, the interval brightness balance information for each sub-interval, and the interval exposure information for each sub-interval are obtained, the third brightness parameter for each sub-interval and the third pixel information corresponding to each third brightness parameter are determined based on the APL, the interval brightness balance information, and the interval exposure information. Specifically, a first brightness point in the first set of brightness points and a second brightness point in the second set of brightness points can be adjusted based on the APL to obtain a first updated brightness point and a second updated brightness point. Each third brightness parameter is then determined based on the interval brightness balance information, the first updated brightness point, and the second updated brightness point. The third pixel information corresponding to each third brightness parameter is determined based on the interval exposure information, the first updated brightness point, and the second updated brightness point.
[0066] Specifically, different regions on the target brightness interval correspond to different APLs. The target brightness interval is divided based on the APL to obtain a dark region, a reasonable region, and a bright region. A preset dark region threshold and a bright region threshold are acquired. A region in the target brightness interval where the APL is less than the dark region threshold is defined as the dark region. A region where the APL is between the dark region threshold and the bright region threshold is defined as the reasonable region. A region where the APL is greater than the bright region threshold is defined as the bright region. When a first brightness point or a second brightness point is located in the dark region, its corresponding pixel information is adjusted by adding or subtracting a preset constant. This calculation results in an updated first brightness point or an updated second brightness point. Alternatively, a preset brightness mapping table can be acquired, and the updated first brightness point corresponding to the first brightness point, or the updated second updated brightness point corresponding to the second brightness point, is determined from this mapping table. In the dark region, compared to the first brightness point and the second brightness point, the adjusted first updated brightness point is located below the first brightness point, and the adjusted second updated brightness point is located below the second brightness point. Similarly, when a first brightness point or a second brightness point is located in the bright region, its corresponding pixel information is adjusted by adding or subtracting a preset constant to calculate the updated first updated brightness point or the updated second updated brightness point. In the bright region, compared to the first brightness point and the second brightness point, the adjusted first updated brightness point is located above the first brightness point, and the adjusted second updated brightness point is located above the second brightness point. This can make the details in the dark and bright parts of the image clearer.
[0067] Furthermore, for the first and second updated brightness points obtained after updating, the constructed mapping relationship between brightness parameters and pixel information is determined by these updated points. Since the first and second updated brightness points are obtained by adjusting the first and second brightness points vertically (up or down), the mapping relationship between brightness parameters and pixel information determined from these updated points is different from the aforementioned F(g)=g, and F(g) is not equal to g.
[0068] Then, when determining the third brightness point between a first brightness point and a second brightness point, the starting brightness point of the sub-interval is determined. The target region to which the third brightness point belongs is then determined based on this starting brightness point. Specifically, if the starting brightness point of the sub-interval is a first brightness point and the ending brightness point is a second brightness point, the target region corresponding to the third brightness point is determined to be the upper triangular region located between the first and second brightness points. Conversely, if the starting brightness point of the sub-interval is a second brightness point and the ending brightness point is a first brightness point, the target region corresponding to the third brightness point is determined to be the lower triangular region located between the second and first brightness points.
[0069] Based on the interval brightness balance information, the first updated brightness point, and the second updated brightness point, a third brightness parameter for each target region is determined. Specifically, the brightness parameter of the first updated brightness point and the brightness parameter of the second updated brightness point are summed to obtain a sum value. Then, a product of the brightness parameter of the first updated brightness point and the interval brightness balance information is calculated to obtain a product value. A third brightness parameter is obtained from the difference between the sum value and the product value, where the third brightness parameter is the horizontal-axis coordinate value of the third brightness point in the target region of the target brightness interval. Based on the third brightness parameter, the interval exposure information, the first updated brightness point, and the second updated brightness point, third pixel information corresponding to the third brightness parameter for each target region can be calculated. This third pixel information is the vertical-axis coordinate value of the third brightness point in the target region of the target brightness interval. Specifically, a first parameter value is obtained by calculating a difference between the brightness parameter of the second updated brightness point and the third brightness parameter. The interval exposure information is adjusted according to a preset parameter to obtain an adjusted exposure value. The first parameter value is adjusted based on the adjusted exposure value and a preset constant (e.g., by multiplication) to obtain a second parameter value. Finally, the third pixel information is calculated based on the third brightness parameter and the second parameter value (e.g., by summation).
[0070] In this embodiment, the third pixel information is calculated precisely, which enables a precise mapping between brightness and pixels using the third brightness point and the third pixel information, thereby further improving the accuracy of image adjustment.
[0071] In some embodiments of the present application, after each of the plurality of pixels of the current display image is adjusted based on each of the 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, 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; and if the target display image is the image that meets the preset image quality condition, pushing the target display image to a target display interface.
[0072] In this embodiment, the target exposure information is the degree of exposure of the target display image. An exposure value of the target display image is calculated based on each brightness parameter in the target display image, the pixel information corresponding to the brightness parameter, and the number of brightness parameters in the target display image. Multiple preset exposure levels, such as 1 to E exposure levels, are obtained. The exposure level to which the exposure value of the target display image belongs is determined, and this exposure level serves as the target exposure information of the target display image.
[0073] The target brightness balance information is information representing the brightness distribution of the target display image. Pixel information corresponding to different brightness parameters in the target display image is obtained, and a mean value of all the pixel information is calculated. Then, based on the mean value, difference information between the pixel information corresponding to the different brightness parameters of the target display image and the mean value is determined. The target brightness balance information of the target display image is determined based on this difference information. The difference information can be obtained by calculating the difference between the pixel value corresponding to each brightness parameter and the mean value. Then, a root mean square error (RMSE) or a mean absolute error (MAE) of the target display image is calculated based on the difference to obtain a target brightness balance value for the target display image. The target brightness balance value is normalized to obtain a normalized value. A balance level to which the normalized value belongs is determined to obtain a target brightness balance level for the target display image, and this target brightness balance level is the target brightness balance information of the target display image.
[0074] After the target exposure information and the target brightness balance information of the target display image are obtained, a preset image exposure level and a preset image brightness balance level are acquired. Based on the target exposure information, the target brightness balance information, the image exposure level, and the image brightness balance level, it is determined whether the target display image is an image that meets a preset image quality condition. 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 condition. When it is determined that 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.
[0075] If it is determined that the target display image is an image that does not meet the preset image quality condition, the mapping relationship between brightness parameters and pixel information of the target display image is re-determined based on the brightness parameters and the pixel information of the target display image. According to the re-determined mapping relationship, remapped target pixel information corresponding to the target color channel value of each pixel in the target display image is calculated. Each pixel of the target display image is iteratively adjusted based on the remapped target pixel information to obtain an adjusted image, until it is determined, based on exposure information and brightness balance information of the adjusted image, that the adjusted image is an image that meets the preset image quality condition.
[0076] This embodiment achieves precise evaluation of the adjusted image by calculating the target exposure information and the target brightness balance information of the target display image; 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; and if the target display image is the image that meets the preset image quality condition, pushing the target display image to the target display interface. This allows for further iterative adjustment of the adjusted image when it does not meet the preset image quality condition, thereby improving the image display quality.
[0077] To facilitate the implementation of the image processing method provided in the embodiments of the present application, an embodiment of the present application also provides an apparatus based on the aforementioned image processing method. The meanings of the terms used herein are the same as in the description of the image processing method above, and reference can be made to the description of the method embodiments for specific implementation details.
[0078] For example, as shown in FIG. 4, the image processing apparatus may include: an acquisition module 401, a determination module 402, a mapping module 403, and an adjustment module 404.
[0079] The acquisition module 401 is configured to acquire a current brightness parameter corresponding to a current display image, and current pixel information corresponding to each said current brightness parameter, the current display image includes multiple pixels, each of the plurality of pixels corresponds to multiple color channel values, and the current brightness parameter is a parameter determined according to the plurality of said color channel values; the determination module 402 is configured to determine a mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information; the mapping module 403 is configured to screen out, from color channel values respectively corresponding to each of the plurality of pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the plurality of pixels, and determine target pixel information corresponding to each of the target color channel value according to the mapping relationship; and the adjustment module 404 is configured to adjust each of the plurality of pixels of the current display image based on each of the target pixel information to obtain a target display image.
[0080] In an embodiment of the present application, the determination module 402 includes: a first determination unit, configured to determine a set of brightness points corresponding to the current display image according to the current brightness parameter and the current pixel information; and a second determination unit, configured to determine the mapping relationship between brightness parameters and pixel information based on a preset mapping function and the set of brightness points.
[0081] In an embodiment of the present application, the first determination unit includes: a first division unit, configured to divide the current brightness parameter to obtain multiple different candidate brightness intervals, and screen out a target brightness interval that meets a preset brightness condition from the plurality of said candidate brightness intervals; a first confirmation sub-unit, configured to determine a target set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each current brightness parameter within the target brightness interval; and a second confirmation sub-unit, configured to determine boundary points of each said candidate brightness interval, and a minimum brightness point and a maximum brightness point of all the current brightness parameters, and determine a candidate set of brightness points according to the boundary points, the minimum brightness point, and the maximum brightness point.
[0082] In an embodiment of the present application, the first confirmation sub-unit includes: a first selection unit, configured to select, from the current pixel information within the target brightness interval, first pixel information and second pixel information that meet a preset pixel condition, on the target brightness interval, the first pixel information is greater than an adjacent second pixel information; a first generation unit, configured to generate a first set of brightness points according to the first pixel information and a first brightness parameter corresponding to the first pixel information; and a second generation unit, configured to generate a second set of brightness points according to the second pixel information and a second brightness parameter corresponding to the second pixel information.
[0083] In an embodiment of the present application, the first confirmation sub-unit further includes: a second division unit, configured to divide the target brightness interval according to the first brightness parameter and the second brightness parameter to obtain multiple sub-intervals; a second selection unit, configured to select, from each of the sub-intervals, a current brightness parameter that meets a preset position condition as a third brightness parameter, and acquire third pixel information corresponding to the third brightness parameter; and a third generation unit, configured to generate a third set of brightness points according to the third brightness parameter and the third pixel information.
[0084] In an embodiment of the present application, the second selection unit includes: an acquisition sub-unit, configured to acquire an average pixel level of the current display image, interval brightness balance information corresponding to each of the sub-intervals, and interval exposure information corresponding to each of the sub-intervals; and an adjustment unit, configured to determine the third brightness parameter of each of the sub-intervals, and the third pixel information corresponding to the third brightness parameter, according to the average pixel level, the interval brightness balance information, and the interval exposure information.
[0085] In an embodiment of the present application, the image processing apparatus further includes: a calculation module, configured to calculate target exposure information and target brightness balance information of the target display image; a screening module, configured to determine, 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; and a pushing module, configured to, if the target display image is the image that meets the preset image quality condition, push the target display image to a target display interface.
[0086] The image processing apparatus proposed in the present application achieves efficient and precise adjustment of image quality, enables adaptive image enhancement, improves image quality performance, and gives the image an enhanced three-dimensional quality. The present application can also be applied to the fields of televisions and display screens, providing users with higher-quality display images.
[0087] In a specific implementation, each of the above modules can be implemented as an independent entity, or can be arbitrarily combined and implemented as one or several entities. The specific implementation methods of each of the above modules and their corresponding beneficial effects can be found in the foregoing method embodiments, and are not repeated herein.
[0088] An embodiment of the present application also provides an electronic device, which can be a server or a terminal. FIG. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
[0089] Specifically: The electronic device may include 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, among other components. Those skilled in the art will understand that the structure of the electronic device shown in FIG. 5 does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have a different arrangement of components.
[0090] The processor 601 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing computer programs and / or modules stored in the memory 602, and calling data stored in the memory 602, it performs various functions and processes data of the electronic device. Optionally, the processor 601 may include one or more processing cores. Preferably, the processor 601 may integrate an application processor and a modem processor, the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It can be understood that the aforementioned modem processor may also not be integrated into the processor 601.
[0091] The memory 602 can be used to store computer programs and modules. The processor 601 executes various functional applications and data processing by running the computer programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, computer programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area may store data created according to the use of the electronic device. In addition, the memory 602 may include high-speed random-access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Correspondingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0092] The electronic device also includes a power supply 603 that supplies power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption through the power management system. The power supply 603 may also include any components such as one or more DC or AC power sources, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0093] The electronic device may also include an input unit 604, which can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0094] Although not shown, the electronic device may also include a display unit, etc., which are not repeated herein. Specifically, in this embodiment, the processor 601 in the electronic device will load 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: acquiring a current brightness parameter corresponding to a current display image, and current pixel information corresponding to each said current brightness parameter, the current display image includes multiple pixels, each of the plurality of pixels corresponds to multiple color channel values, and the current brightness parameter is a parameter determined according to the plurality of said color channel values; determining a mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information; screening out, from color channel values respectively corresponding to each of the plurality of pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the plurality of pixels, and determining target pixel information corresponding to each of the target color channel value according to the mapping relationship; and adjusting each of the plurality of pixels of the current display image based on each of the target pixel information to obtain a target display image.
[0095] The electronic device provided in this embodiment achieves efficient and precise adjustment of image quality, enables adaptive image enhancement, improves image quality performance, and imparts a more stereoscopic quality to the image. The present application can also be applied to the fields of televisions and display screens, providing users with higher-quality display images.
[0096] The specific implementations of the foregoing operations and their corresponding beneficial effects are detailed in the description of the image processing method above and are not repeated herein.
[0097] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program or by having a computer program control relevant hardware. The computer program can be stored in a computer-readable storage medium, and loaded and executed by a processor.
[0098] For this purpose, an embodiment of the present application provides a computer-readable storage medium storing a computer program thereon. The computer program can be loaded by a processor to execute the steps in any of the image processing methods provided by the embodiments of the present application. For example, the computer program can execute the following steps: acquiring a current brightness parameter corresponding to a current display image, and current pixel information corresponding to each of the current brightness parameters, the current display image includes multiple pixels, each of the pixels corresponds to multiple 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 brightness parameters and pixel information according to the current brightness parameter and the current pixel information; screening out, from color channel values respectively corresponding to each of the pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the pixels, and determining target pixel information corresponding to each of the target color channel values according to the mapping relationship; adjusting each of the pixels of the current display image based on each of the target pixel information to obtain a target display image.
[0099] The computer-readable storage medium provided in this embodiment achieves efficient and precise adjustment of image quality, enables adaptive image enhancement, improves image quality performance, and imparts a more stereoscopic quality to the image. The present application can also be applied to the fields of televisions and display screens, providing users with higher-quality display images.
[0100] The specific implementations of the foregoing operations and their corresponding beneficial effects can be referred to in the preceding embodiments and are not repeated herein.
[0101] The computer-readable storage medium may include a Read-Only Memory (ROM), a Random-Access Memory (RAM), a magnetic disk, or an optical disc, and the like.
[0102] 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 achievable by any image processing method provided in the embodiments of the present application can be realized. For details, reference is made to the foregoing embodiments, and such details are not repeated herein.
[0103] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or computer program includes 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 to cause the computer device to perform the image processing method described above.
[0104] The foregoing has described in detail an image processing method, an apparatus, an electronic device, and a computer-readable storage medium provided by the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementations of the present application. The description of the above embodiments is merely for facilitating the understanding of the method of the present application and its core ideas. Furthermore, for a person skilled in the art, various changes can be made to the specific implementations and application scope based on the ideas of the present application. In conclusion, the content of this specification should not be construed as a limitation on the present application.
Examples
Embodiment Construction
[0029]The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. It should be apparent that the described embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor shall fall within the protection scope of the present application.
[0030]Embodiments of the present application provide an image processing method, an apparatus, an electronic device, and a computer-readable storage medium. The image processing apparatus may be integrated into an electronic device, which may be a server, a terminal device, or the like.
[0031]The server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or...
Claims
1. An image processing method, comprising: acquiring current brightness parameters corresponding to a current display image, and current pixel information corresponding to each of the current brightness parameters, wherein the current display image comprises a plurality of pixels, each of the plurality of pixels corresponds to a plurality of color channel values, and each of the current brightness parameters is a parameter determined according to the plurality of the color channel values; determining a mapping relationship between brightness parameters and pixel information according to the current brightness parameters and the current pixel information; screening out, from color channel values respectively corresponding to each of the plurality of pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the plurality of pixels, and determining target pixel information corresponding to each of the target color channel value according to the mapping relationship; and adjusting each of the plurality of pixels of the current display image based on each of the target pixel information to obtain a target display image.
2. The image processing method according to claim 1, wherein the determining the mapping relationship between brightness parameters and pixel information according to the current brightness parameters and the current pixel information comprises: determining a set of brightness points corresponding to the current display image according to the current brightness parameters and the current pixel information; and determining the mapping relationship between brightness parameters and pixel information based on a preset mapping function and the set of brightness points.
3. The image processing method according to claim 2, wherein the set of brightness points comprises a target set of brightness points and a candidate set of brightness points, and the determining the set of brightness points corresponding to the current display image according to the current brightness parameters and the current pixel information comprises: dividing the current brightness parameters to obtain a plurality of different candidate brightness intervals, and screening out a target brightness interval that meets a preset brightness condition from the plurality of different candidate brightness intervals; determining the target set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each of the current brightness parameters within the target brightness interval; and determining boundary points of each of the plurality of different candidate brightness intervals, and a minimum brightness point and a maximum brightness point of all the current brightness parameters, and determining the candidate set of brightness points according to the boundary points, the minimum brightness point, and the maximum brightness point.
4. The image processing method according to claim 3, wherein the dividing the current brightness parameters to obtain the plurality of different candidate brightness intervals comprises: constructing a brightness histogram of the current display image according to the current brightness parameters and the current pixel information, wherein a horizontal axis of the brightness histogram corresponds to the current brightness parameters, and a vertical axis of the brightness histogram corresponds to the current pixel information; and dividing the brightness histogram at the current brightness parameters to obtain the plurality of different candidate brightness intervals.
5. The image processing method according to claim 3, wherein the target set of brightness points comprises a first set of brightness points and a second set of brightness points, and the determining the target set of brightness points corresponding to the target brightness interval according to the current pixel information corresponding to each of the current brightness parameters within the target brightness interval comprises: selecting, from the current pixel information within the target brightness interval, a first pixel information and a second pixel information that meet a preset pixel condition, wherein within the target brightness interval, the first pixel information is greater than an adjacent second pixel information; generating the first set of brightness points according to the first pixel information and a first brightness parameter corresponding to the first pixel information; and generating the second set of brightness points 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 comprises a local maximum condition and a local minimum condition, and the selecting, from the current pixel information within the target brightness interval, the first pixel information and the second pixel information that meet the preset pixel condition comprises: constructing a brightness mapping curve corresponding to all current brightness parameters and current pixel information within the target brightness interval; determining pixel information corresponding to all local maxima on the brightness mapping curve as the first pixel information within the target brightness interval; and determining pixel information corresponding to all local minima on the brightness mapping curve as the second pixel information within the target brightness interval.
7. The image processing method according to claim 5, wherein the target set of brightness points further comprises a third set of brightness points, and after the generating the second set of brightness points according to the second pixel information and the second brightness parameter corresponding to the second pixel information, the method further comprises: dividing the target brightness interval according to the first brightness parameter and the second brightness parameter to obtain a plurality of sub-intervals; selecting, from each of the sub-intervals, current brightness parameters that meets a preset position condition as third brightness parameters, and acquiring third pixel information corresponding to the third brightness parameters; and generating the third set of brightness points according to the third brightness parameter and the third pixel information.
8. The image processing method according to claim 7, wherein the selecting, from each of the sub-intervals, the current brightness parameters that meets the preset position condition as the third brightness parameter, and acquiring the third pixel information corresponding to the third brightness parameter comprises: acquiring an average pixel level of the current display image, interval brightness balance information corresponding to each of the sub-intervals, and interval exposure information corresponding to each of the sub-intervals; and determining the third brightness parameter of each of the sub-intervals, and the third pixel information corresponding to the third brightness parameter, according to the average pixel level, the interval brightness balance information, and the interval exposure information.
9. The image processing method according to claim 8, wherein the interval brightness balance information is obtained by: acquiring a pixel mean value of all pixel information of the current display image; calculating a difference between the pixel mean value and pixel information within each of the sub-intervals; and calculating a root mean square error or a mean absolute error according to the difference to obtain different interval brightness balance information corresponding to different sub-intervals.
10. The image processing method according to claim 8, wherein the determining the third brightness parameter of each of the sub-intervals, and the third pixel information corresponding to the third brightness parameter, according to the average pixel level, the interval brightness balance information, and the interval exposure information comprises: adjusting a first brightness point in the first set of brightness points and a second brightness point in the second set of brightness points according to an average pixel level to obtain a first updated brightness point and a second updated brightness point; determining the 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; and determining the third pixel information corresponding to the third brightness parameter based on the interval exposure information, the first updated brightness point, and the second updated brightness point.
11. The image processing method according to claim 10, wherein the determining the 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 comprises: summing a brightness parameter of the first updated brightness point and a brightness parameter of the second updated brightness point to obtain a sum value; calculating a product of the brightness parameter of the first updated brightness point and the interval brightness balance information to obtain a product value; and determining the third brightness parameter of each of the sub-intervals according to a difference between the sum value and the product value.
12. The image processing method according to claim 10, wherein the determining the third pixel information corresponding to the third brightness parameter based on the interval exposure information, the first updated brightness point, and the second updated brightness point comprises: 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 a preset parameter to obtain an adjusted exposure value; adjusting the first parameter value according to the adjusted exposure value and a preset constant to obtain a second parameter value; and determining the third pixel information corresponding to the third brightness parameter according to the third brightness parameter and the second parameter value.
13. The image processing method according to any one of claims 1-12, wherein after the adjusting each of the plurality of pixels of the current display image based on each of the target pixel information to obtain the target display image, the method further comprises: calculating target exposure information and target brightness balance information of the target display image; 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; and when the target display image is the image that meets the preset image quality condition, pushing the target display image to a target display interface.
14. The image processing method according to claim 13, wherein the calculating the target exposure information of the target display image comprises: 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 a number of brightness parameters in the target display image; acquiring a plurality of preset exposure levels, and determining an exposure level to which the exposure value of the target display image belongs; and determining the exposure level to which the exposure value of the target display image belongs as the target exposure information of the target display image.
15. The image processing method according to claim 13, wherein the calculating the target brightness balance information of the target display image comprises: acquiring pixel information corresponding to different brightness parameters in the target display image, and calculating a mean value of all the pixel information; determining, according to the mean value, difference information between the pixel information corresponding to the different brightness parameters of the target display image and the mean value; and determining the target brightness balance information of the target display image according to the difference information.
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 the image that meets the preset image quality condition comprises: acquiring a preset image exposure level and a preset image brightness balance level; and when an exposure level of the target exposure information is less than or equal to the image exposure level, and a brightness balance level in the target brightness balance information is greater than or equal to the image brightness balance level, determining that the target display image is the image that meets the preset image quality condition.
17. The image processing method according to claim 13, wherein after the determining, according to the target exposure information and the target brightness balance information, whether the target display image is the image that meets the preset image quality condition, the method comprises: when the target display image is an image that does not meet the preset image quality condition, re-determining the mapping relationship between brightness parameters and pixel information of the target display image according to the brightness parameters and the pixel information of the target display image; calculating, according to the re-determined mapping relationship, remapped target pixel information corresponding to the target color channel value of each pixel in the target display image; iteratively adjusting each pixel in the target display image based on the remapped target pixel information, until determining, according to exposure information and brightness balance information of an adjusted image, that the adjusted image is an image that meets the preset image quality condition.
18. An image processing apparatus, comprising: an acquisition module, configured to acquire a current brightness parameter corresponding to a current display image, and current pixel information corresponding to the current brightness parameter, wherein the current display image comprises a plurality of pixels, each of the plurality of pixels corresponds to a plurality of color channel values, and the current brightness parameter is a parameter determined according to the plurality of the color channel values; a determination module, configured to determine a mapping relationship between brightness parameters and pixel information according to the current brightness parameter and the current pixel information; a mapping module, configured to screen out, from color channel values respectively corresponding to each of the plurality of pixels, a color channel value that satisfies a preset screening condition as a target color channel value corresponding to each of the plurality of pixels, and determine target pixel information corresponding to each of the target color channel value according to the mapping relationship; and an adjustment module, configured to adjust each of the plurality of pixels of the current display image based on each of the target pixel information to obtain a target display image.
19. An electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is configured 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 adapted to be loaded by a processor to execute the image processing method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and computer readable storage medium
CN117649817A