Image enhancement method and device, image processing equipment and storage medium
By acquiring global and regional feature information of the image, and optimizing image enhancement using transformation functions and filtering techniques, the problems of insufficient display quality and real-time processing performance in existing technologies are solved, achieving high-definition image display and efficient processing.
Patent Information
- Application Number
- CN202510922864.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-31
AI Technical Summary
Existing video image enhancement technologies may reduce the display effect of another type of image while improving the contrast of one type of image, potentially leading to color distortion. The high complexity of the algorithms also affects real-time processing performance, making it difficult to meet users' pursuit of high-definition image quality.
By acquiring global and regional feature statistics of the image to be processed, the image is transformed using global and local transformation functions, including polynomial or exponential transformations of brightness and chromaticity information. Combined with spatial filtering techniques, the image enhancement process is optimized.
Significantly improves display quality, suppresses block artifacts, ensures real-time processing performance, adapts to various application scenarios, and saves storage resources.
Smart Images

Figure CN120876240A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image enhancement method, apparatus, image processing device, and storage medium. Background Technology
[0002] During the transmission, reception, storage, and display of video signals, the quality of the video source often deteriorates to varying degrees due to both cost-saving measures and noise. Furthermore, display costs and technological limitations also contribute to the degradation of the video's display quality. These factors result in a final visual effect that fails to meet users' demands for high-definition picture quality. To address this, the industry widely employs image enhancement technology to optimize the image. This technology involves targeted adjustments to key parameters such as contrast, saturation, and chroma to achieve image output that better suits specific application scenarios and delivers superior visual effects.
[0003] Current video image enhancement technologies have limitations: some solutions improve the contrast of one type of image but reduce the display effect of another type of image; other solutions may cause obvious block artifacts. In addition, there are problems such as color distortion caused during processing or excessive algorithm complexity affecting real-time processing performance. These technical defects seriously restrict the actual effect of image enhancement.
[0004] Against this backdrop, there is an urgent need for an image enhancement method that can significantly improve display quality, ensure real-time processing performance, and meet the needs of most application scenarios, addressing the degradation of video sources or display effects due to cost-saving measures, noise interference, or technical limitations. Summary of the Invention
[0005] Therefore, it is necessary to provide an image enhancement method, apparatus, image processing device, and storage medium that can significantly improve display quality, ensure real-time processing performance, and meet the requirements of most application scenarios, in order to address the aforementioned technical problems.
[0006] An image enhancement method, the method comprising:
[0007] Obtain global feature statistics and regional feature statistics of the image to be processed;
[0008] Based on the global feature statistics, the global transformation function is obtained;
[0009] The global transformation function is adjusted based on the statistical information of each partition feature to obtain the local transformation function;
[0010] The image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0011] In one embodiment, when the global feature and the partition feature are brightness information, obtaining the brightness information includes:
[0012] If the color space of the image to be processed is YCbCr color space, then the Y channel values of all pixels of the image to be processed are obtained as the brightness information of the image to be processed.
[0013] If the color space of the image to be processed is RGB, then the color space of the image to be processed is converted to YCbCr color space according to the conversion formula, and then the Y channel values of all pixels of the image to be processed are obtained as the brightness information of the image to be processed. The specific conversion formula is as follows:
[0014] Y = 0.257R + 0.504G + 0.098B
[0015] C b =0.439R + 0.368G + 0.071B
[0016] C r =0.148R + 0.291G + 0.439B
[0017] Where Y is the luminance component, and C b It is the blue chromaticity component, C r R is the red chromaticity component, G is the chromaticity component of the red channel, and B is the chromaticity component of the green channel.
[0018] In one embodiment, obtaining the global feature statistics and partition feature statistics of the image to be processed includes:
[0019] Starting from the first pixel of the image or partition to be processed and ending at the last pixel, the feature value of the current pixel is sequentially determined to fall into the n1th and n2th levels, where n1 is an integer greater than or equal to 1 and less than or equal to N1, and n2 is an integer greater than or equal to 1 and less than or equal to N2; where N1 is the number of first-level statistical counters and N2 is the number of second-level statistical counters; the first-level statistical counter corresponding to the n1th level is incremented by one, and it is determined whether the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed. When the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed, the second-level statistical counter corresponding to the n2th level is incremented by one, and the value of the first-level statistical counter corresponding to the n1th level is reset to 0; the values of the N2 second-level statistical counters are determined as the statistical result.
[0020] In one embodiment, when the global features and partition features are brightness gradient information, obtaining the global feature statistics and partition feature statistics of the image to be processed includes:
[0021] Gradient maps are obtained by performing sliding convolution operations on the image or partition to be processed using a gradient extraction algorithm;
[0022] Extract the average value of the gradient map;
[0023] The average value is amplified by a preset fixed factor and truncated to a fixed interval, and then normalized to obtain the statistical result.
[0024] In one embodiment, the global feature statistics include luminance information and chrominance information; the global transformation function type includes polynomial transformation and exponential transformation; and obtaining the global transformation function based on the global feature statistics includes:
[0025] Taking the peak point of the statistical results as the inflection point, the coordinates (x_base) of the i-th peak point i y_base i ),x_base i y_base represents the pixel feature values corresponding to the statistical level. i The statistical results are as follows; the left and right cutoff points on either side of each inflection point are denoted as (x_left) and (x_right) respectively. i y_left i ) and (x_right i y_right i The statistical result of the cutoff point is equal to... p is a decimal between 0 and 1; the inflection point does not change the value before and after the transformation, the value range is widened after the transformation within the truncated interval, and the value range is compressed after the transformation within the non-truncated interval.
[0026] A global transformation function is fitted based on the function type, inflection point, and cutoff interval characteristics.
[0027] In one embodiment, adjusting the global transformation function based on the statistical information of each partition feature to obtain a local transformation function includes:
[0028] Based on the gradient feature statistics of each partition, the corresponding transformation intensity control parameters in the global transformation function are adjusted to obtain the partition transformation intensity matrix; the partition transformation intensity matrix is then subjected to spatial filtering, which includes any one or more combinations of custom mean filtering, low-pass filtering, or band-pass filtering.
[0029] Based on the filtered partition transformation intensity matrix, the local transformation function is fitted.
[0030] In one embodiment, transforming the image to be processed according to the global transformation function or the local transformation function to obtain the enhanced image includes:
[0031] The pixel feature values are processed by the global transformation function or the local transformation function to obtain the transformation feature values, and the stretching ratio is obtained by dividing the transformation feature values by the pixel feature values.
[0032] Based on the pixel feature type, the stretching ratio is further controlled by other specific features of the pixel, including saturation, chroma, and RGB maximum value.
[0033] The image to be processed is stretched according to the stretching ratio to obtain an enhanced image.
[0034] An image enhancement apparatus, the apparatus comprising:
[0035] The feature acquisition module is used to acquire global feature statistics and regional feature statistics of the image to be processed;
[0036] The first transformation module is used to obtain a global transformation function based on the global feature statistics.
[0037] The second transformation module is used to adjust the global transformation function according to the statistical information of each partition feature to obtain the local transformation function;
[0038] The image enhancement module is used to transform the image to be processed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0039] An image processing device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0040] Obtain global feature statistics and regional feature statistics of the image to be processed;
[0041] Based on the global feature statistics, the global transformation function is obtained;
[0042] The global transformation function is adjusted based on the statistical information of each partition feature to obtain the local transformation function;
[0043] The image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0044] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0045] Obtain global feature statistics and regional feature statistics of the image to be processed;
[0046] Based on the global feature statistics, the global transformation function is obtained;
[0047] The global transformation function is adjusted based on the statistical information of each partition feature to obtain the local transformation function;
[0048] The image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0049] The aforementioned image enhancement method, apparatus, image processing device, and storage medium acquire global feature statistics and partition feature statistics of the image to be processed; obtain a global transformation function based on the global feature statistics; adjust the global transformation function according to the partition feature statistics to obtain a local transformation function; and transform the image to be processed according to the global or local transformation function to obtain an enhanced image. This method generally provides better contrast and color effects, better adaptability to various image categories, effectively suppresses block artifacts and consumes less storage resources in further partition enhancement processing, significantly improves display quality, ensures real-time processing performance, and is suitable for most application scenarios. Attached Figure Description
[0050] Figure 1 This is an illustration of an application scenario of an image enhancement method in one embodiment;
[0051] Figure 2 This is a flowchart illustrating an image enhancement method in one embodiment;
[0052] Figure 3 This is a flowchart illustrating the image enhancement steps in one embodiment;
[0053] Figure 4 This is a structural block diagram of an image enhancement device in one embodiment;
[0054] Figure 5 This is an internal structural diagram of an image processing device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] In one embodiment, such as Figure 1As shown, an image enhancement method is provided. Taking the application of this method to an image processing device as an example, the method includes the following steps:
[0057] Step S101: Obtain global feature statistics and regional feature statistics of the image to be processed.
[0058] In this embodiment, the features include brightness information or brightness gradient information. When the global feature and the partition feature are brightness information, obtaining the brightness information includes: if the color space of the image to be processed is YCbCr color space, then obtaining the Y channel values of all pixels of the image to be processed as the brightness information of the image to be processed;
[0059] If the color space of the image to be processed is RGB, then the color space of the image to be processed is converted to YCbCr color space according to the conversion formula, and then the Y channel values of all pixels of the image to be processed are obtained as the brightness information of the image to be processed. The specific conversion formula is as follows:
[0060] Y = 0.257R + 0.504G + 0.098B
[0061] C b =0.439R + 0.368G + 0.071B
[0062] C r =0.148R + 0.291G + 0.439B
[0063] Where Y is the luminance component, and C b It is the blue chromaticity component, C r R is the red chromaticity component, G is the chromaticity component of the red channel, and B is the chromaticity component of the green channel.
[0064] Specifically, obtaining the global feature statistics and regional feature statistics of the image to be processed includes:
[0065] Starting from the first pixel of the image or partition to be processed and ending at the last pixel, the feature value of the current pixel is sequentially determined to fall into the n1th and n2th levels, where n1 is an integer greater than or equal to 1 and less than or equal to N1, and n2 is an integer greater than or equal to 1 and less than or equal to N2; where N1 is the number of first-level statistical counters and N2 is the number of second-level statistical counters; the first-level statistical counter corresponding to the n1th level is incremented by one, and it is determined whether the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed. If the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed, the second-level statistical counter corresponding to the n2th level is incremented by one, and the value of the first-level statistical counter corresponding to the n1th level is reset to 0; the values of the N2 second-level statistical counters are determined as the statistical result. The feature values include, but are not limited to, image brightness and chroma.
[0066] Additionally, when the global features and partition features are brightness gradient information, obtaining the global feature statistics and partition feature statistics of the image to be processed includes:
[0067] Gradient maps are obtained by performing sliding convolution operations on the image or partition to be processed using a gradient extraction algorithm;
[0068] Extract the average value of the gradient map;
[0069] The average value is amplified by a preset fixed factor and truncated to a fixed interval, and then normalized to obtain the statistical result.
[0070] Step S102: Obtain the global transformation function based on the global feature statistics.
[0071] In this embodiment, the global feature statistics include luminance information and chrominance information; the global transformation function type includes polynomial transformation and exponential transformation; and obtaining the global transformation function based on the global feature statistics includes:
[0072] The peak point of the statistical results is taken as the inflection point. The coordinate of the i-th peak point is denoted as the pixel feature value corresponding to the statistical level, and denoted as the statistical result value. The left and right truncation points on both sides of each inflection point are denoted as and , respectively. The statistical result value of the truncation point is equal to , which is a decimal between 0 and 1. The value of the inflection point remains unchanged before and after the transformation. The value range is widened after the transformation within the truncation interval and compressed after the transformation within the non-truncation interval.
[0073] A global transformation function is fitted based on the function type, inflection point, and cutoff interval characteristics.
[0074] In one possible implementation, please refer to Figure 2Based on the characteristics of the inflection points and cutoff intervals, a piecewise linear transformation function is fitted. The piecewise linear transformation function corresponding to each set of inflection points and cutoff points is constructed according to the following formula:
[0075] y = k i ×(x-x_base i )+x_base i +b i x_left i ≤x≤x_right i
[0076] k i and b i This refers to the transformation intensity control parameter for this segment.
[0077] Construct the linear transformation function for the corresponding piecewise segments between the i-th group and the (i+1)-th group using the following formula:
[0078]
[0079] Figure 2 This represents two inflection point scenarios, where g1 and g2 are inflection points, and d1, d2, d3, and d4 are cutoff points. It should be noted that the transformation function of feature ε2 can be fitted using the inflection points and cutoff intervals from the statistical results of feature ε1.
[0080] Step S103: Adjust the global transformation function according to the statistical information of each partition feature to obtain the local transformation function.
[0081] In this embodiment, adjusting the global transformation function based on the statistical information of each partition feature to obtain the local transformation function includes:
[0082] Based on the gradient feature statistics of each partition, the corresponding transformation intensity control parameters in the global transformation function are adjusted to obtain the partition transformation intensity matrix; the partition transformation intensity matrix is then subjected to spatial filtering, which includes any one or more combinations of custom mean filtering, low-pass filtering, or band-pass filtering.
[0083] Based on the filtered partition transformation intensity matrix, the local transformation function is fitted.
[0084] In one possible implementation, the control parameters of the global piecewise linear transformation function are adjusted based on the statistical information of each partition's characteristics. Specifically, this is achieved by multiplying the gradient characteristic statistics of each partition by the control parameters. The control parameters can be set based on experiments or experience.
[0085] Step S104: Transform the image to be processed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0086] In this embodiment, the specific implementation using a global transformation function or a local transformation function can be determined according to the user's configuration in different scenarios. For example, a global transformation function is used when SDR (Standard Dynamic Range) is required, while a local transformation function is used when HDR (High Dynamic Range) is required and the driver chip supports partitioned processing. The step of transforming the image to be processed according to the global or local transformation function to obtain an enhanced image includes:
[0087] The pixel feature values are processed by the global transformation function or the local transformation function to obtain the transformation feature values, and the stretching ratio is obtained by dividing the transformation feature values by the pixel feature values.
[0088] Based on the pixel feature type, the stretching ratio is further controlled by other specific features of the pixel, including saturation, chroma, and RGB maximum value.
[0089] The image to be processed is stretched according to the stretching ratio to obtain an enhanced image.
[0090] In one possible implementation, when other specific features are saturation, the image to be processed is transformed according to the global transformation function or the local transformation function; the stretching ratio can be further controlled by the saturation information of the pixel to balance the difference in brightness statistics between high-saturation and low-saturation images, as specifically shown below:
[0091]
[0092] Where s is the saturation characteristic value, σ i represents the preset higher-order polynomial coefficients, and μ represents the stretching ratio.
[0093] In one possible implementation, the color space of the image frame to be processed is the YCbCr color space. The pixel Y channel is multiplied by the stretching factor, and the Cb and Cr channels are adjusted accordingly to ensure that the chromaticity remains unchanged before and after the transformation.
[0094] In a preferred embodiment, brightness feature statistics of the image to be processed are extracted. A global piecewise linear function is determined based on the brightness feature statistics. A local piecewise linear function is determined based on the global piecewise linear function and the regional gradient features. A stretching ratio is calculated based on the local piecewise linear function and further controlled by pixel saturation information. The image to be processed is then transformed according to the stretching ratio to enhance image contrast, resulting in an enhanced image. The effect of the above process on the processed image is shown below. Figure 3 As shown, the left image is the image to be processed, and the right image is the enhanced image.
[0095] In the above image enhancement method, global feature statistics and partition feature statistics of the image to be processed are obtained; a global transformation function is obtained based on the global feature statistics; the global transformation function is adjusted according to the partition feature statistics to obtain a local transformation function; the image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image. This method can generally achieve better contrast and color effects in terms of visual effects, has better general adaptability to various image categories, effectively suppresses block artifacts and occupies less storage resources in further partition enhancement processing, can significantly improve display quality, and can ensure real-time processing performance, while meeting the needs of most application scenarios.
[0096] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0097] In one embodiment, such as Figure 4 As shown, an image enhancement device is provided, including: a feature acquisition module 41, a first transformation module 42, a second transformation module 43, and an image enhancement module 44, wherein:
[0098] The feature acquisition module 41 is used to acquire global feature statistics and regional feature statistics of the image to be processed;
[0099] The first transformation module 42 is used to obtain a global transformation function based on the global feature statistics.
[0100] The second transformation module 43 is used to adjust the global transformation function according to the statistical information of each partition feature to obtain a local transformation function;
[0101] The image enhancement module 44 is used to transform the image to be processed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0102] Furthermore, when the global feature and the partition feature are brightness information, the feature acquisition module 41 is further configured to, if the color space of the image to be processed is YCbCr color space, acquire the Y channel values of all pixels in the image to be processed as the brightness information of the image to be processed; if the color space of the image to be processed is RGB, convert the color space of the image to be processed to YCbCr color space according to the conversion formula, and then acquire the Y channel values of all pixels in the image to be processed as the brightness information of the image to be processed. The specific conversion formula is as follows:
[0103] Y = 0.257R + 0.504G + 0.098B
[0104] C b =0.439R + 0.368G + 0.071B
[0105] C r =0.148R + 0.291G + 0.439B
[0106] Where Y is the luminance component, and C b It is the blue chromaticity component, C r R is the red chromaticity component, G is the chromaticity component of the red channel, and B is the chromaticity component of the green channel.
[0107] Furthermore, when the global feature and the partition feature are brightness information, the feature acquisition module 41 is also used to determine, starting from the first pixel of the image to be processed or the partition and ending at the last pixel, the feature value of the current pixel falls into the n1th and n2th levels, where n1 is an integer greater than or equal to 1 and less than or equal to N1, and n2 is an integer greater than or equal to 1 and less than or equal to N2; where N1 is the number of first-level statistical counters and N2 is the number of second-level statistical counters; increment the first-level statistical counter corresponding to the n1th level by one, determine whether the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed, and when the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed, increment the second-level statistical counter corresponding to the n2th level by one, and reset the value of the first-level statistical counter corresponding to the n1th level to 0; determine the value of the N2 second-level statistical counters as the statistical result.
[0108] Furthermore, when the global features and the partition features are brightness gradient information, the feature acquisition module 41 is also used to perform sliding convolution operation on the image to be processed or the partition through a gradient extraction algorithm to obtain a gradient map; extract the average value of the gradient map; enlarge the average value by a preset fixed factor and truncate it to a fixed interval, and then normalize it to obtain the statistical result.
[0109] Furthermore, the global feature statistics include luminance information and chrominance information; the global transformation function type includes polynomial transformation and exponential transformation, and the first transformation module 42 is used to take the peak point of the statistical result as the inflection point, and the coordinates (x_base) of the i-th peak point. i y_base i ),x_base i y_base represents the pixel feature values corresponding to the statistical level. i The statistical results are as follows; the left and right cutoff points on either side of each inflection point are denoted as (x_left) and (x_right) respectively. i y_left i ) and (x_right i y_right i The statistical result of the cutoff point is equal to... p is a decimal between 0 and 1; the inflection point does not change the value before and after the transformation, the value range is widened after the transformation within the truncated interval, and the value range is compressed after the transformation within the non-truncated interval.
[0110] A global transformation function is fitted based on the function type, inflection point, and cutoff interval characteristics.
[0111] Furthermore, the second transformation module 43 is used to adjust the corresponding transformation intensity control parameters in the global transformation function according to the gradient feature statistics of each partition to obtain the partition transformation intensity matrix; and to perform spatial filtering on the partition transformation intensity matrix, wherein the spatial filtering includes any one or more combinations of custom mean filtering, low-pass filtering or band-pass filtering.
[0112] Based on the filtered partition transformation intensity matrix, the local transformation function is fitted.
[0113] Furthermore, the image enhancement module 44 is used to calculate the transformation feature value by the global transformation function or the local transformation function, and divide the transformation feature value by the pixel feature value to obtain the stretching ratio;
[0114] Based on the pixel feature type, the stretching ratio is further controlled by other specific features of the pixel, including saturation, chroma, and RGB maximum value.
[0115] The image to be processed is stretched according to the stretching ratio to obtain an enhanced image.
[0116] For specific limitations regarding the image enhancement device, please refer to the limitations of the image enhancement method above, which will not be repeated here. Each module in the aforementioned image enhancement device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the image processing device, or stored in software in the memory of the image processing device, so that the processor can call and execute the operations corresponding to each module.
[0117] In one embodiment, an image processing device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the image processing device includes a processor and a memory connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores a computer program. The internal memory provides an environment for the execution of the computer program in the non-volatile storage medium. When executed by the processor, the computer program implements an image enhancement method.
[0118] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the image processing device to which the present application is applied. A specific image processing device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0119] In one embodiment, an image processing apparatus is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to perform the following steps:
[0120] Obtain global feature statistics and regional feature statistics of the image to be processed;
[0121] Based on the global feature statistics, the global transformation function is obtained;
[0122] The global transformation function is adjusted based on the statistical information of each partition feature to obtain the local transformation function;
[0123] The image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0124] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0125] Obtain global feature statistics and regional feature statistics of the image to be processed;
[0126] Based on the global feature statistics, the global transformation function is obtained;
[0127] The global transformation function is adjusted based on the statistical information of each partition feature to obtain the local transformation function;
[0128] The image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image.
[0129] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0130] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0131] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. An image enhancement method, characterized in that, The method includes: Obtain global feature statistics and regional feature statistics of the image to be processed; Based on the global feature statistics, the global transformation function is obtained; The global transformation function is adjusted based on the statistical information of each partition feature to obtain the local transformation function; The image to be processed is transformed according to the global transformation function or the local transformation function to obtain an enhanced image.
2. The method according to claim 1, characterized in that, When the global feature and the partition feature are brightness information, obtaining the brightness information includes: If the color space of the image to be processed is YCbCr color space, then the Y channel values of all pixels of the image to be processed are obtained as the brightness information of the image to be processed. If the color space of the image to be processed is RGB, then the color space of the image to be processed is converted to YCbCr color space according to the conversion formula, and then the Y channel values of all pixels of the image to be processed are obtained as the brightness information of the image to be processed. The specific conversion formula is as follows: Y = 0.257R + 0.504G + 0.098B C b =0.439R+0.368G+0.071B C r =0.148R+0.291G+0.439B Where Y is the luminance component, and C b It is the blue chromaticity component, C r R is the red chromaticity component, G is the chromaticity component of the red channel, and B is the chromaticity component of the green channel.
3. The method according to claim 2, characterized in that, The acquisition of global feature statistics and regional feature statistics of the image to be processed includes: Starting from the first pixel of the image or partition to be processed and ending at the last pixel, the feature value of the current pixel is sequentially determined to fall into the n1th and n2th levels, where n1 is an integer greater than or equal to 1 and less than or equal to N1, and n2 is an integer greater than or equal to 1 and less than or equal to N2; where N1 is the number of first-level statistical counters and N2 is the number of second-level statistical counters; the first-level statistical counter corresponding to the n1th level is incremented by one, and it is determined whether the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed. When the value of the first-level statistical counter corresponding to the n1th level is equal to the width of the image to be processed, the second-level statistical counter corresponding to the n2th level is incremented by one, and the value of the first-level statistical counter corresponding to the n1th level is reset to 0; the values of the N2 second-level statistical counters are determined as the statistical result.
4. The method according to claim 1, characterized in that, When the global features and partition features are brightness gradient information, the acquisition of global feature statistics and partition feature statistics of the image to be processed includes: Gradient maps are obtained by performing sliding convolution operations on the image or partition to be processed using a gradient extraction algorithm; Extract the average value of the gradient map; The average value is amplified by a preset fixed factor and truncated to a fixed interval, and then normalized to obtain the statistical result.
5. The method according to claim 3 or 4, characterized in that, The global feature statistics include luminance information and chrominance information; The global transformation function types include polynomial transformation and exponential transformation, and obtaining the global transformation function based on the global feature statistics includes: Taking the peak point of the statistical results as the inflection point, the coordinates (x_base) of the i-th peak point i y_base i ),x_base i y_base represents the pixel feature values corresponding to the statistical level. i The statistical results are as follows; the left and right cutoff points on either side of each inflection point are denoted as (x_left) and (x_right) respectively. i y_left i ) and (x_right i y_right i The statistical result of the cutoff point is equal to... p is a decimal between 0 and 1; The inflection point means that the value remains unchanged before and after the transformation. Within the truncated interval, the value range is widened after the transformation, while within the untruncated interval, the value range is compressed after the transformation. A global transformation function is fitted based on the function type, inflection point, and cutoff interval characteristics.
6. The method according to claim 1, characterized in that, The step of adjusting the global transformation function based on the statistical information of each partition feature to obtain the local transformation function includes: Based on the gradient feature statistics of each partition, the corresponding transformation intensity control parameters in the global transformation function are adjusted to obtain the partition transformation intensity matrix; the partition transformation intensity matrix is then subjected to spatial filtering, which includes any one or more combinations of custom mean filtering, low-pass filtering, or band-pass filtering. Based on the filtered partition transformation intensity matrix, the local transformation function is fitted.
7. The method according to claim 1, characterized in that, The step of transforming the image to be processed according to the global transformation function or the local transformation function to obtain the enhanced image includes: The pixel feature values are processed by the global transformation function or the local transformation function to obtain the transformation feature values, and the stretching ratio is obtained by dividing the transformation feature values by the pixel feature values. Based on the pixel feature type, the stretching ratio is further controlled by other specific features of the pixel, including saturation, chroma, and RGB maximum value. The image to be processed is stretched according to the stretching ratio to obtain an enhanced image.
8. An image enhancement device, characterized in that, The device includes: The feature acquisition module is used to acquire global feature statistics and regional feature statistics of the image to be processed; The first transformation module is used to obtain a global transformation function based on the global feature statistics. The second transformation module is used to adjust the global transformation function according to the statistical information of each partition feature to obtain the local transformation function; The image enhancement module is used to transform the image to be processed according to the global transformation function or the local transformation function to obtain an enhanced image.
9. An image processing device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.