An image enhancement processing method, device, equipment and medium

By correcting the original histogram and determining the mapping range, the problems of block artifacts and poor performance in image enhancement processing of the CLAHE algorithm are solved, achieving higher quality image enhancement results that are applicable to various image types.

CN115661008BActive Publication Date: 2026-05-29CHONGQING GANGYU HI-TECH DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING GANGYU HI-TECH DEV CO LTD
Filing Date
2022-09-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing CLAHE algorithm suffers from block artifacts and poor enhancement effects in image enhancement processing, especially when processing bright or wide dynamic range images, and its application range is relatively narrow.

Method used

By correcting the original histogram to obtain a corrected histogram, and determining a reasonable mapping range and shearing coefficient, image enhancement processing is performed using the corrected histogram. This avoids the image being divided into multiple non-overlapping sub-blocks, and improves the visualization of image details and the levels of grayscale information.

Benefits of technology

It improves the signal-to-noise ratio and visual perception of images, reduces block artifacts, enhances the grayscale information levels of images, and is suitable for more types of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115661008B_ABST
    Figure CN115661008B_ABST
Patent Text Reader

Abstract

An image enhancement processing method, device, equipment and medium, obtain the original histogram of the input image and the parameter information of the original histogram, the parameter information includes the number of effective gray levels; correct the original histogram to obtain a corrected histogram, and obtain the parameter information of the corrected histogram, which includes the number of effective gray levels of the corrected histogram; analyze the original histogram and the corrected histogram to determine the mapping range of the corrected histogram; determine the clipping coefficient of the corrected histogram according to the number of effective gray levels of the image histogram and the corrected histogram; clip the corrected histogram using the clipping coefficient, equalize the clipped histogram based on the mapping range, and use the mapping relationship matrix obtained after processing as the histogram mapping rule; perform image enhancement processing on the image to be processed based on the histogram mapping rule, and output the processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image enhancement processing method, apparatus, device and medium. Background Technology

[0002] The main purpose of image enhancement is to improve the quality and recognizability of images, making them more suitable for observation or further analysis. Image enhancement techniques generally highlight or enhance certain features of an image, such as edge information, contour information, and contrast, purposefully emphasizing the overall or local features of the image. This makes originally blurry images clearer or emphasizes certain features of interest, amplifies the differences between features of different objects in the image, and suppresses features of little interest, thereby improving image quality, enriching information, better displaying useful information in the image, enhancing image interpretation and recognition, and meeting the needs of certain special analyses.

[0003] Currently, image enhancement methods typically employ the CLAHE algorithm (Contrast Limiting Adaptive Histogram Equalization) to enhance image contrast. Existing CLAHE algorithms divide the image into equal-sized, non-overlapping sub-blocks, calculate the histogram for each sub-block, and then perform thresholding on each histogram. While this method can enhance local image processing, the processed image exhibits significant block artifacts in flat or regularly patterned regions. Furthermore, existing CLAHE algorithms suffer from poor enhancement results when processing bright or wide dynamic range images. Therefore, current CLAHE algorithms are generally suitable for natural landscapes or infrared images, limiting their applicability.

[0004] Application content

[0005] In view of the shortcomings of the prior art described above, this application provides an image enhancement processing method, system, device and medium to solve the technical problems of block effect and poor image enhancement effect in the above image enhancement processing.

[0006] In a first aspect, this application provides an image enhancement processing method, the method comprising:

[0007] Obtain the original histogram and parameter information of the original histogram of the input image, wherein the parameter information includes the number of effective gray levels;

[0008] The original histogram is corrected to obtain a corrected histogram, and the parameter information of the corrected histogram is obtained, including the number of effective gray levels in the corrected histogram.

[0009] Analyze the original histogram and the modified histogram to determine the mapping range of the modified histogram;

[0010] The shearing coefficient of the modified histogram is determined based on the number of effective gray levels in the image histogram and the modified histogram.

[0011] The modified histogram is sheared using a shearing coefficient, and the sheared histogram is equalized based on the mapping range. The resulting mapping matrix is ​​then used as the histogram mapping rule.

[0012] Based on histogram mapping rules, image enhancement processing is performed on the image to be processed, and then the image is output.

[0013] In one possible implementation, the original histogram and the modified histogram are analyzed to determine the mapping range of the modified histogram, including:

[0014] The parameter information of the original histogram and the modified histogram also includes the minimum gray value and the maximum gray value, respectively;

[0015] Based on the minimum and maximum gray values ​​of the original and modified histograms, determine the minimum and maximum gray values ​​of the input image. Based on the minimum and maximum gray values ​​of the input image, determine the mapping range of the modified histogram.

[0016] In one possible implementation, determining the mapping range of the corrected histogram based on the minimum and maximum gray values ​​of the input image further includes:

[0017] The parameter information of the original histogram also includes gray-level centroid;

[0018] The lower limit gain of the mapping range is determined based on the minimum and maximum gray values ​​of the input image. The lower limit of the mapping is determined based on the lower limit gain, the minimum gray value of the input image, the gray centroid of the original histogram, and the preset visual sensitivity centroid. If the lower limit of the mapping is less than the preset minimum mapping gray value, then the minimum mapping gray value is used as the lower limit of the mapping.

[0019] Based on the maximum and minimum gray values ​​of the input image, the gray centroid of the original histogram, and the preset visual sensitivity centroid, the upper limit gain of the mapping range is determined. The upper limit of the mapping is determined based on the upper limit gain. If the upper limit of the mapping is greater than the preset maximum mapping gray value, the maximum mapping gray value is used as the upper limit of the mapping.

[0020] Both the lower limit gain and the lower limit gain are within the set gain range;

[0021] The mapping range of the modified histogram is determined based on the lower and upper bounds of the mapping.

[0022] In one possible implementation, the shearing coefficient of the modified histogram is determined based on the number of effective gray levels in the image histogram and the modified histogram, including:

[0023] The actual number of gray levels is determined based on the number of effective gray levels in the original histogram and the modified histogram.

[0024] Based on the actual number of gray levels, a shearing system model is established, as follows.

[0025]

[0026] In the formula, Kclip represents the initial shearing coefficient, GrayNum represents the actual number of gray levels, and V l V m V h These represent the preset lower limit, median, and upper limit of the shear coefficient, respectively; Thr l Thr m Thr h These represent the lower limit, middle value, and upper limit of the preset number of gray levels, respectively;

[0027] Based on the degree of centroid shift in the input image, an intensity correction coefficient is determined, and based on the intensity correction coefficient, the final shearing coefficient is determined.

[0028] In one possible implementation, the modified histogram is sheared using a shearing coefficient, and the sheared histogram is then equalized based on the mapping range. The resulting mapping matrix is ​​used as the histogram mapping rule, including:

[0029] Based on the shearing coefficient, determine the shearing limit value and the pixels exceeding the shearing limit value, and perform threshold shearing on the modified histogram to obtain a contrast-limited histogram.

[0030] For the contrast-limited histogram after threshold clipping, a mapping matrix is ​​determined based on the cumulative distribution function, and this mapping matrix is ​​used as the histogram mapping rule.

[0031] In one possible implementation, it also includes:

[0032] If the input image is a series of consecutive frames in a video, the damping adjustment amount is determined according to the histogram mapping rule of two adjacent frames in the video, and the histogram mapping rule is adjusted once by adjusting the damping.

[0033] The mean difference between two adjacent frames in the video is used as the offset adjustment amount, and the mapping rule after the first adjustment is adjusted a second time by the offset adjustment amount.

[0034] In one possible implementation, the original histogram is modified to obtain a modified histogram, including:

[0035] Determine the number of gray levels contained in the original histogram;

[0036] An adaptive correction model is fitted based on the prior method. The number of gray levels contained in the initial histogram is input into the adaptive correction model to obtain the dynamic correction value.

[0037] The initial histogram is exponentially adjusted using dynamic correction values ​​to obtain the corrected histogram.

[0038] In a second aspect, this application also provides an image enhancement processing apparatus, comprising:

[0039] The histogram acquisition module acquires the original histogram of the input image and the parameter information of the original histogram, wherein the parameter information includes the number of effective gray levels in the original histogram;

[0040] The histogram correction module corrects the original histogram to obtain a corrected histogram and acquires the parameter information of the corrected histogram, including the number of effective gray levels in the corrected histogram.

[0041] The histogram analysis module analyzes the original histogram and the modified histogram to determine the mapping range of the modified histogram.

[0042] The shearing coefficient determination module determines the shearing coefficient of the modified histogram based on the number of effective gray levels in the image histogram and the modified histogram.

[0043] The mapping rule acquisition module uses a shearing coefficient to shear the modified histogram, performs equalization processing on the sheared histogram based on the mapping range, and uses the resulting mapping relationship matrix as the histogram mapping rule.

[0044] The image processing module performs image enhancement processing on the image to be processed based on histogram mapping rules and then outputs the result.

[0045] In a third aspect, this application also provides an electronic device, including a processor, a memory, and a communication bus;

[0046] The communication bus is used to connect the processor and the memory;

[0047] The processor is used to execute computer programs stored in the memory to implement the image enhancement processing method as described in any of the above embodiments.

[0048] In a fourth aspect, a computer-readable storage medium is characterized in that it stores a computer program thereon, the computer program being used to cause a computer to perform the image enhancement processing method as described in any of the preceding embodiments.

[0049] The beneficial effects of the above technical solution are as follows: This application treats the histogram as a whole for histogram acquisition. By correcting the original histogram and preprocessing its information, the obtained corrected histogram, compared with the original histogram, can increase the proportion of gray values ​​with low grayscale values, making the image's detailed information more visible. By comprehensively analyzing the original and corrected histograms, a reasonable shearing coefficient and mapping range are determined, making the histogram's shearing range and distribution range more reasonable. Grayscale mapping of the image is performed within an appropriate range. In this way, the signal-to-noise ratio of the image can be improved, the grayscale information is richer, and the visualization information is more prominent, thereby displaying the information of each signal interval with high quality and improving the overall visual perception effect of the image. Attached Figure Description

[0050] Figure 1 This is a schematic flowchart of an image enhancement processing method provided in one embodiment of this application;

[0051] Figure 2 This is a flowchart of an image enhancement algorithm provided in one embodiment of this application;

[0052] Figure 3 This is a flowchart of histogram correction provided in one embodiment of this application;

[0053] Figure 4 This is a schematic diagram of piecewise linear enhancement provided in one embodiment of this application;

[0054] Figure 5 This is a flowchart of the bias adjustment process for histogram mapping rules provided in one embodiment of this application;

[0055] Figure 6 This is a frame diagram of an image enhancement processing apparatus provided in one embodiment of this application;

[0056] Figure 7 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0057] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0058] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0059] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0060] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0061] See Figure 1 The following is a flowchart illustrating an embodiment of an image enhancement processing method provided in this application, detailed below.

[0062] Step S110: Obtain the original histogram of the input image and the parameter information of the original histogram, wherein the parameter information includes the number of effective gray levels;

[0063] Specifically, the input image is treated as a whole and its original histogram is obtained by grayscale level to avoid the input image being divided into multiple non-overlapping sub-blocks. The original histogram is a grayscale histogram. If the input image is a color image, it can be converted to a grayscale image first, and the original histogram can be obtained from the grayscale image.

[0064] Step S120: Correct the original histogram to obtain a corrected histogram, and obtain the parameter information of the corrected histogram, which includes the number of effective gray levels of the corrected histogram.

[0065] Specifically, determine the number of gray levels in the original histogram;

[0066] An adaptive correction model is fitted based on the prior method. The number of gray levels contained in the initial histogram is input into the adaptive correction model to obtain a dynamic correction value. This dynamic correction value can be automatically derived by the adaptive correction model according to different scenarios, making the information entropy of the input image higher and the detailed information of the input image more and richer.

[0067] The initial histogram is exponentially adjusted using dynamic correction values ​​to obtain the corrected histogram.

[0068] Step S130: Analyze the original histogram and the modified histogram to determine the mapping range of the modified histogram;

[0069] Specifically, the parameter information of the original histogram and the modified histogram also includes the minimum gray value and the maximum gray value, respectively;

[0070] The minimum and maximum gray values ​​are obtained by removing interference values ​​from the original histogram gray values, and the minimum and maximum gray values ​​are obtained by removing interference values ​​from the modified histogram gray values.

[0071] Based on the minimum and maximum gray values ​​of the original and modified histograms, the minimum and maximum gray values ​​of the input image after removing interference values ​​are determined, and thus the mapping range of the modified histogram is determined based on the minimum and maximum gray values ​​of the input image.

[0072] Furthermore, the parameter information of the original histogram also includes the gray-level centroid. The gray-level centroid can be calculated by accumulating the first centroid of the original histogram from low to high gray-level values ​​through cumulative distribution, and then calculating the second centroid of the original histogram from high to low through cumulative distribution. The weighted value of the first centroid and the second centroid is taken as the gray-level centroid of the original histogram.

[0073] The lower limit gain of the mapping range is determined based on the minimum and maximum gray values ​​of the input image. The lower limit of the mapping is determined based on the lower limit gain, the minimum gray value of the input image, the gray centroid of the original histogram, and the preset visual sensitivity centroid. If the lower limit of the mapping is less than the preset minimum mapping gray value, then the minimum mapping gray value is used as the lower limit of the mapping.

[0074] Based on the maximum and minimum gray values ​​of the input image, the gray centroid of the original histogram, and the preset visual sensitivity centroid, the upper limit gain of the mapping range is determined. The upper limit of the mapping is determined based on the upper limit gain. If the upper limit of the mapping is greater than the preset maximum mapping gray value, the maximum mapping gray value is used as the upper limit of the mapping.

[0075] Both the lower limit gain and the lower limit gain are within the set gain range;

[0076] The mapping range of the modified histogram is determined based on the lower and upper bounds of the mapping.

[0077] Step S140: Determine the shearing coefficient of the modified histogram based on the number of effective gray levels in the image histogram and the modified histogram;

[0078] Specifically, the actual number of gray levels is determined based on the number of effective gray levels in the original histogram and the modified histogram;

[0079] Based on the actual number of gray levels, a shearing system model is established, as follows.

[0080]

[0081] In the formula, Kclip represents the initial shearing coefficient, GrayNum represents the actual number of gray levels, and V l V m V h These represent the preset lower limit, median, and upper limit of the shear coefficient, respectively; Thr l Thr m Thr h These represent the lower limit, middle value, and upper limit of the preset number of gray levels, respectively;

[0082] Based on the degree of centroid shift in the input image, an intensity correction coefficient is determined, and based on the intensity correction coefficient, a final shearing coefficient is determined.

[0083] Step S150: Use the shearing coefficient to shear the modified histogram, perform equalization processing on the sheared histogram based on the mapping range, and use the resulting mapping relationship matrix as the histogram mapping rule.

[0084] Specifically, based on the shearing coefficient, the shearing limit value and the pixels exceeding the shearing limit value are determined, and the modified histogram is subjected to threshold shearing to obtain a contrast-limited histogram.

[0085] For the contrast-limited histogram after threshold clipping, a mapping matrix is ​​determined based on the cumulative distribution function, and this mapping matrix is ​​used as the histogram mapping rule.

[0086] Step S160: Based on the histogram mapping rules, perform image enhancement processing on the input image and output it;

[0087] The input image's pixels are enhanced according to histogram mapping rules, and the enhanced image is output.

[0088] See Figure 2 Here is a flowchart of the image enhancement algorithm of this application. In this embodiment, taking an image from a video as an example, the improved CLAHE algorithm of this application is used to enhance the input image as follows;

[0089] 1. Correct the original histogram.

[0090] 1) Obtain the original histogram of the input image using the following formula:

[0091] p′(s k ) = n k k = 0, 1, ..., L-1

[0092] In the formula, k is the gray level, L is the highest gray level of the input image, and L = 2. m , m represents the bit width of the input image, usually 8 bits, s kLet n be the k-th gray level. k For the input image with gray levels s k The number of.

[0093] 2) Normalize the original histogram.

[0094]

[0095] In the formula, n is the total number of pixels in the input image.

[0096] 3) Determine the number of gray levels contained in the original histogram.

[0097]

[0098]

[0099] In the formula, k is the gray level, L is the highest gray level of the input image, and s k For the k-th gray level, p(s) k ) represents the original histogram after normalization, and Thr is the engineering experience threshold;

[0100] 4) Calculate the dynamic correction value, fit an adaptive correction model based on the prior method, and determine the dynamic correction value according to the adaptive correction model, as follows.

[0101] Pow=K1×C b1

[0102] In the formula, C is the number of gray levels contained in the original histogram, Pow is the dynamic correction value, which can be automatically obtained according to different application scenarios, and K1 and b1 are coefficients preset based on experience, which can be selected according to the actual situation.

[0103] 5) Histogram correction: The original histogram is adjusted exponentially, such as... Figure 3 The diagram shown is a flowchart of the histogram correction process in this application.

[0104] p rev (s k )=(p(s k )) Pow

[0105] In the formula, k is the gray level, p(s) k () is the original histogram after normalization.

[0106] 2. Histogram Analysis

[0107] The mapping range of the corrected histogram is adaptively calculated based on the histogram distribution of the input image. See [link to relevant documentation]. Figure 4 The figure shows a piecewise linear enhancement schematic diagram of this application. The parameters in the figure are described as follows.

[0108] Ax1 represents the minimum gray value after removing interference values ​​from the original histogram;

[0109] Bx1 represents the maximum gray value after removing interference values ​​from the original histogram;

[0110] Gx represents the gray-level centroid of the original histogram, which is calculated through cumulative distribution;

[0111] Gy represents the preset visual sensitivity center;

[0112] Ay represents the lower bound of the mapping;

[0113] By indicates the upper limit of the mapping;

[0114] GrayL represents the preset minimum mapped gray value;

[0115] GrayH represents the preset maximum grayscale value.

[0116] 1) Calculate the centroid Gx of the original histogram. Calculate the first centroid of the original histogram by accumulating gray values ​​from low to high, and then calculate the second centroid of the original histogram by accumulating gray values ​​from high to low. Take the weighted value of the first and second centroids as the gray-level centroid Gx of the original histogram.

[0117] 2) Calculate the minimum grayscale value Ax and the maximum grayscale value Bx of the input image after removing interference values.

[0118] 2-1) Preset control parameter S1 = 0.02, i.e. histogram area S1, calculate the minimum gray value Ax1 corresponding to S1 of the original histogram, and calculate the minimum gray value Ax2 corresponding to S1 of the modified histogram.

[0119] 2-2) Preset control parameter S2 = 0.98, i.e. histogram area S2, calculate the maximum gray value Bx1 corresponding to S2 of the original histogram, and calculate the maximum gray value Bx2 corresponding to S2 of the modified histogram;

[0120] 2-3) Calculate the minimum gray value Ax and the maximum gray value Bx of the input image after removing interference values:

[0121]

[0122]

[0123] 3) Based on human visual sensitivity and engineering experience, determine the visual sensitivity centroid Gy of the actual enhanced image.

[0124] 4) Calculate the bandwidth of the original histogram and the mapping range of the modified histogram:

[0125] 4-1) Calculate the mapping lower limit Ay

[0126] ① Determine the lower gain K2 of the mapping range,

[0127]

[0128] In the formula, Ax is the minimum gray value of the input image after removing interference values, Bx is the maximum gray value of the input image after removing interference values, K2 ∈ [K min , K max , K min and K max are the preset minimum gain and maximum gain;

[0129] ② Calculate the mapping lower limit

[0130] Ay = K2 × (Ax - Gx) + Gy

[0131] In the formula, Gx is the gray center of gravity of the original histogram, Gy is the preset visual sensitivity center of gravity, and Ax is the minimum gray value of the input image after removing interference values;

[0132] ③ Underflow limit of the mapping lower limit Ay:

[0133] If Ay < GrayL, then Ay = GrayL

[0134] In the formula, GrayL is usually 35.

[0135] 4-2) Calculate the mapping upper limit By

[0136] ① Determine the upper gain K3 of the mapping range,

[0137]

[0138] In the formula, K3 ∈ [K min , K max , K min and K max are the preset minimum gain and maximum gain;

[0139] ② Calculate the mapping upper limit

[0140] By = K3 × (Bx - Ax) + Ay

[0141] In the formula, Ay is the mapping lower limit, Ax is the minimum gray value of the input image after removing interference values, and Bx is the maximum gray value of the input image after removing interference values;

[0142] ③ Overflow judgment of the mapping upper limit By

[0143] If By > GrayH, then By = GrayH

[0144] In the formula, GrayH is usually 255.

[0145] 4-3) Calculate the mapping range of the modified histogram and the shear value allocation range of the modified histogram:

[0146] Bin = By - Ay + 1

[0147] In the formula, Bin represents the mapping range of the modified histogram;

[0148] Bin x =Bx-Ax+1

[0149] In the formula, Bin x To correct the range of shear values ​​assigned to the histogram.

[0150] 5) Determine the shear coefficient

[0151] 5-1) Calculate the shearing coefficient KClip in the CLAHE algorithm:

[0152] In the CLAHE algorithm, the normalized shearing coefficient KClip needs to be automatically adjusted based on the image. The calculation process is as follows:

[0153] ① Determine the number of gray levels in the histogram

[0154] Calculate P(s) k ) and P rev (s k The effective gray levels of GrayEfc1 and GrayEfc2;

[0155] Determine the actual number of gray levels, GrayNum.

[0156]

[0157] ② Calculate the shear coefficient

[0158] Establish a shear coefficient model:

[0159]

[0160] In the formula, GrayNum represents the number of gray levels, and V l V m and V h These represent the preset lower limit, median, and upper limit of the shear coefficient, respectively; Thr l Thr m and Thr h These represent the lower limit, middle value, and upper limit of the preset number of gray levels, respectively.

[0161] 5-2) Determine the strength correction factor for the shear coefficient.

[0162] ① Correct the degree of histogram centroid offset:

[0163]

[0164] ② Calculate the strength correction factor:

[0165] HistMul=K4×b2 BwMul

[0166] Where BwMul represents the degree to which the values ​​in the input image deviate from the centroid, and K4 and b2 are adjustable parameters of the model that can be set based on experience;

[0167] 5-3) Determine the final shear coefficient N clip

[0168] N clip =Kclip×HistMul

[0169] To ensure smooth video footage, the final cropping factor N is adjusted. clip Perform recursive filtering.

[0170] 3. Cut and distribute the modified histogram.

[0171] 1) Crop the image histogram

[0172] 1-1) Calculate the average pixel value of the gray levels of the input image pixels.

[0173]

[0174] In the formula, Bin x To correct the range of shear values ​​assigned to the histogram, N x and N y These represent the number of pixels in the row and column directions of the input image, respectively.

[0175] 1-2) Calculate the actual shear limit value CL:

[0176]

[0177] In the formula, Indicates rounding down, N clip Let be the normalized shear limit coefficient, and 0. <N clip <1 means that the number of pixels contained in each gray level is limited to not exceeding N times the average. clip times.

[0178] 1-3) Assume that the grayscale pixels in the original image are P(i0, where i = i0, i1, ..., i nGiven the image's grayscale levels, crop all pixels that exceed the cropping limit CL. Let CP be the number of pixels cropped.

[0179] CP = ∑(max(P(i) - CL, 0))

[0180] 1-4) Calculate the average clipped pixels (ACP) across each gray level of the image:

[0181] N = ∑(P(i) > CL)

[0182]

[0183] In the formula, N is the sum of the number of gray levels in the image histogram that are greater than the clipping value.

[0184] 1-5) The contrast-limited histogram CH is obtained by the following formula:

[0185]

[0186] 2) Perform histogram equalization on the histogram after threshold clipping to obtain the mapping matrix after image histogram equalization.

[0187] 2-1) Calculate the cumulative distribution function of the new histogram CH

[0188]

[0189] Where, N x and N y These represent the number of pixels in the row and column directions of the image, respectively. cumsum represents the cumulative sum, and map(i) represents the cumulative distribution function.

[0190] 2-2) Histogram mapping

[0191]

[0192] Where Bin represents the mapping range of the modified histogram, and ML(i0) represents the histogram mapping rule.

[0193] In one embodiment of this application, such as Figure 5 The diagram shows the flowchart of the offset adjustment process for the histogram mapping rule. When the input image is a series of consecutive frames in a video, in order to make the video quality conform to subjective visual perception and smoothly transition between abrupt scene changes, the histogram mapping rule is damped and adjusted, and the offset is based on the difference in the mean of adjacent enhanced image frames to suppress image flicker.

[0194] When the input image is a series of consecutive frames in a video, the damping adjustment amount is determined according to the histogram mapping rule of two adjacent frames in the video, and the histogram mapping rule is adjusted once by the damping adjustment.

[0195] The mean difference between two adjacent frames in the video is used as the offset adjustment amount. The mapping rule after the first adjustment is then adjusted a second time using this offset adjustment amount, as follows:

[0196] 1) Histogram mapping rule damping adjustment

[0197] To broaden the algorithm's adaptability, especially in scenarios with rapid mutations, the mapping rule is damped and the histogram mapping rule (ML) is filtered.

[0198] Adjustment amount for histogram mapping rules:

[0199] step3 = K5 × |ML n -ML n-1 |

[0200] The filtered mapping rule ML_adj_f is:

[0201]

[0202] In the formula, n is the sequence number of the video frame, ML n-1 ML is the mapping rule for the output image of the previous frame. n For the mapping rules of the current frame, ML n-1 and ML n This represents a one-dimensional matrix, not a number; step3 is the adjustment amount, which is adaptively derived from the above formula; and K5 is the gain factor of step3.

[0203] 2) Adjust the bias

[0204] The formula for calculating the offset adjustment is as follows:

[0205]

[0206] M_adj=step4×(M n -M n-1 )

[0207] Where n is the sequence number of the video frame, M n-1 The mean value of the previous frame output image, M n K5 is the mean of the input image in the current frame, and K5 is the gain factor of step4; step4 is the adjustment amount, which is adaptively calculated by the above formula.

[0208] 3) Histogram mapping rule update

[0209] The mapping rule after bias adjustment is as follows:

[0210] ML_f_adj(k)=ML_f(k)+M_adj, k=0,1,...,L′-1

[0211] Where k is the gray level and L' is the highest gray level of the image bit width.

[0212] 4) Output image

[0213] Image enhancement is performed on the input image based on histogram mapping rules. Let L be a pixel in the input image. in Then the enhanced output value L out for:

[0214] L out (i,j)=ML_f_adj(L in (i,j)+1)

[0215] In the formula, L in (i,j) represents the pixel to be processed, L out (i,j) represents the pixel after enhancement processing.

[0216] In one embodiment of this application, if the input image is a color image, it is first converted into a grayscale image. The conversion method can use conventional methods, such as extracting each pixel from the color image, then taking the R, G, and B components of each pixel, and calculating the grayscale values ​​corresponding to the R, G, and B components using conventional grayscale conversion formulas. These grayscale conversion formulas are existing conventional techniques and will not be detailed here. The grayscale image obtained by the above method is then subjected to image enhancement processing. Finally, the enhanced grayscale image is restored to a color image. Various existing conventional methods can be used for restoration. The following formula is used in this embodiment to restore the grayscale image:

[0217] Y(i,j)=0.299*R(i,j)+0.587*G(i,j)+0.114*B(i,j)

[0218]

[0219]

[0220]

[0221] In the formula, R′(i,j) is the restored red component, R(i,j) is the red component of the input image, G′(i,j) is the restored green component, G(i,j) is the green component of the input image, B′(i,j) is the restored blue component, B(i,j) is the blue component of the input image, Y′(i,j) is the grayscale image after enhancement processing, and Y(i,j) is the grayscale image converted from the color image before enhancement processing.

[0222] like Figure 6 As shown, this embodiment provides an image enhancement processing apparatus, which includes:

[0223] The histogram acquisition module 601 is used to acquire the original histogram of the input image and the parameter information of the original histogram, wherein the parameter information includes the number of effective gray levels of the original histogram;

[0224] The histogram correction module 602 is used to correct the original histogram to obtain a corrected histogram and to obtain parameter information of the corrected histogram, including the number of effective gray levels of the corrected histogram.

[0225] The histogram analysis module 603 is used to analyze the original histogram and the modified histogram to determine the mapping range of the modified histogram.

[0226] The shearing coefficient determination module 604 is used to determine the shearing coefficient of the modified histogram based on the number of effective gray levels in the image histogram and the modified histogram.

[0227] The mapping rule acquisition module 605 is used to perform shearing processing on the modified histogram using shearing coefficients, perform equalization processing on the sheared histogram based on the mapping range, and use the resulting mapping relationship matrix as the histogram mapping rule.

[0228] The image processing module 606 is used to perform image enhancement processing on the image to be processed based on histogram mapping rules and output the result.

[0229] If the input image is a color image, the image enhancement processing device in this embodiment should also be provided with a grayscale conversion module for converting the color image into a grayscale image, and a color restoration module for restoring the enhanced grayscale image to a color image.

[0230] In this embodiment, the system is essentially configured with multiple modules to execute the methods described in the above embodiments. The specific functions and technical effects can be referred to in the above method embodiments, and will not be repeated here.

[0231] like Figure 7 As shown, this embodiment also provides an electronic device 700, which includes a processor 701, a memory 702, and a communication bus 703;

[0232] The communication bus 703 is used to connect the processor 701 and the memory 702;

[0233] The processor 701 is used to execute computer programs stored in the memory to implement the above method.

[0234] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions included in Embodiment 1 of this application.

[0235] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0236] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0237] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0238] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0239] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. An image enhancement processing method, characterized in that, The method includes: Obtain the original histogram and parameter information of the original histogram of the input image, wherein the parameter information includes the number of effective gray levels and the gray level centroid; The original histogram is corrected to obtain a corrected histogram, and the parameter information of the corrected histogram is obtained, including the number of effective gray levels in the corrected histogram. The original histogram and the modified histogram are analyzed to determine the mapping range of the modified histogram. Specifically, the lower limit gain of the mapping range is determined based on the minimum and maximum gray values ​​of the input image. The lower limit of the mapping range is determined based on the lower limit gain, the minimum gray value of the input image, the gray-level centroid of the original histogram, and a preset visual sensitivity centroid. If the lower limit of the mapping range is less than the preset minimum mapped gray value, then the minimum mapped gray value is used as the lower limit. The upper limit gain of the mapping range is determined based on the maximum and minimum gray values ​​of the input image, the gray-level centroid of the original histogram, and the preset visual sensitivity centroid. The upper limit of the mapping range is determined based on the upper limit gain. If the upper limit of the mapping range is greater than the preset maximum mapped gray value, then the maximum mapped gray value is used as the upper limit. Both the lower limit gain and the upper limit gain are within a set gain range. The mapping range of the modified histogram is determined based on the lower and upper limits of the mapping range. The shearing coefficient of the modified histogram is determined based on the number of effective gray levels in the image histogram and the modified histogram. The modified histogram is sheared using a shearing coefficient, and the sheared histogram is then equalized based on the mapping range. The resulting mapping matrix is ​​then used as the histogram mapping rule. Based on histogram mapping rules, image enhancement processing is performed on the image to be processed, and then the image is output.

2. The method as described in claim 1, characterized in that, The shearing coefficient of the modified histogram is determined based on the number of effective gray levels in the image histogram and the modified histogram, including: The actual number of gray levels is determined based on the number of effective gray levels in the original histogram and the modified histogram. Based on the actual number of gray levels, a shearing coefficient model is established, as follows. In the formula, Indicates the initial shear coefficient. Vl, Vm, and Vh represent the lower limit, middle value, and upper limit of the preset shearing coefficient, respectively; Thrl, Thrm, and Thrh represent the lower limit, middle value, and upper limit of the preset number of gray levels, respectively. The intensity correction is determined based on the degree of centroid shift in the input image, and the final shearing coefficient is determined based on the intensity correction.

3. The method according to any one of claims 1 to 2, characterized in that, The modified histogram is sheared using a shearing coefficient, and the sheared histogram is then equalized based on the mapping range. The resulting mapping matrix is ​​used as the histogram mapping rule, including: Based on the shearing coefficient, the shearing limit value and pixels exceeding the shearing limit value are determined. Threshold shearing is then applied to the modified histogram to obtain a contrast-limited histogram. For the contrast-limited histogram after threshold clipping, a mapping matrix is ​​determined based on the cumulative distribution function, and this mapping matrix is ​​used as the histogram mapping rule.

4. The method as described in claim 1, characterized in that, Also includes: If the input image is a series of consecutive frames in a video, the damping adjustment amount is determined according to the histogram mapping rule of two adjacent frames in the video, and the histogram mapping rule is adjusted once by adjusting the damping. The mean difference between two adjacent frames in the video is used as the offset adjustment amount, and the mapping rule after the first adjustment is adjusted a second time by the offset adjustment amount.

5. The method as described in claim 1, characterized in that, The original histogram is corrected to obtain the corrected histogram, including: Determine the number of gray levels contained in the original histogram; An adaptive correction model is fitted based on the prior method. The number of gray levels contained in the initial histogram is input into the adaptive correction model to obtain the dynamic correction value. The initial histogram is exponentially adjusted using dynamic correction values ​​to obtain the corrected histogram.

6. An image enhancement processing apparatus, characterized in that, include: The histogram acquisition module acquires the original histogram of the input image and the parameter information of the original histogram, wherein the parameter information includes the number of effective gray levels and the gray centroid of the original histogram; The histogram correction module corrects the original histogram to obtain a corrected histogram and acquires the parameter information of the corrected histogram, including the number of effective gray levels in the corrected histogram. The histogram analysis module analyzes the original histogram and the modified histogram to determine the mapping range of the modified histogram. Specifically, it determines the lower limit gain of the mapping range based on the minimum and maximum gray values ​​of the input image. The lower limit of the mapping range is determined based on the lower limit gain, the minimum gray value of the input image, the gray-level centroid of the original histogram, and a preset visual sensitivity centroid. If the lower limit is less than the preset minimum mapped gray value, then the minimum mapped gray value is used as the lower limit. The upper limit gain of the mapping range is determined based on the maximum and minimum gray values ​​of the input image, the gray-level centroid of the original histogram, and the preset visual sensitivity centroid. The upper limit of the mapping range is determined based on the upper limit gain. If the upper limit is greater than the preset maximum mapped gray value, then the maximum mapped gray value is used as the upper limit. Both the lower and upper limit gains are within a set gain range. The mapping range of the modified histogram is determined based on the lower and upper limits of the mapping range. The shearing coefficient determination module determines the shearing coefficient of the modified histogram based on the number of effective gray levels in the image histogram and the modified histogram. The mapping rule acquisition module uses a shearing coefficient to shear the modified histogram, performs equalization processing on the sheared histogram based on the mapping range, and uses the resulting mapping relationship matrix as the histogram mapping rule. The image processing module performs image enhancement processing on the image to be processed based on histogram mapping rules and then outputs the result.

7. An electronic device, characterized in that, Includes processor, memory, and communication bus; The communication bus is used to connect the processor and the memory; The processor is used to execute a computer program stored in the memory to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores a computer program thereon, the computer program being used to cause the computer to perform the method as described in any one of claims 1-5.