CLAHE image blurring enhancement method based on mixed membership function
By introducing a hybrid membership function into the CLAHE method and dynamically adjusting the cropping threshold, the problem of poor enhancement effect of the traditional CLAHE method in different regions is solved, achieving adaptive image enhancement and noise suppression, and improving image quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HARBIN ENG UNIV
- Filing Date
- 2026-03-12
- Publication Date
- 2026-05-29
AI Technical Summary
Traditional CLAHE methods struggle to adapt to differences in texture complexity across different regions during image enhancement, resulting in noise amplification in flat areas or insufficient contrast enhancement in detailed areas, leading to poor adaptability and edge preservation.
A hybrid membership function is used to dynamically fuse the exponent and the linear membership function. The weight allocation is guided by local variance, and the pruning threshold is adaptively adjusted to meet the enhancement needs of flat areas and areas with rich details.
It achieves adaptive enhancement of image enhancement effect, suppresses noise amplification, maintains edge sharpness, outputs image histogram distribution uniformly, avoids over-enhancement or under-enhancement, and has excellent objective evaluation indicators.
Smart Images

Figure CN122115226A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, and in particular to a CLAHE image blur enhancement method based on a hybrid membership function. Background Technology
[0002] Contrast-Limited Adaptive Histogram Equalization (CLAHE) is a widely studied image enhancement method. It effectively mitigates the over-enhancement and block artifacts common in traditional histogram equalization methods by introducing a cropping threshold to truncate local gray-level histograms and combining this with bilinear interpolation. However, traditional CLAHE methods typically use a uniform cropping threshold, making it difficult to adapt to differences in texture complexity across different regions of the image. Setting the threshold too high can amplify noise in flat areas, while setting it too low can result in insufficient contrast enhancement in areas with rich detail.
[0003] To improve the adaptability of the CLAHE method, existing technologies attempt to introduce fuzzy theory into the enhancement process and adjust the threshold clipping mechanism by designing different fuzzy membership functions. For example, methods based on piecewise linear membership functions improve adaptability by adjusting the threshold using piecewise functions (Reference: Li B, Xie W, Zhang L, et al. Adaptive fractional differential algorithm for image edge enhancement and texture preserve using fuzzy sets[J]. IET Image Processing, 2023, 17(7):2204-2213), while methods based on exponential membership functions avoid over-enhancement of images through exponential mapping (Reference: KONGL, WANG Y, CHEN J, et al. Research on the fuzzy enhancement algorithm for infrared images of power equipment based on membership function; proceedingsof the 2024 4th Power System and Green Energy Conference (PSGEC), F, 2024[C]. IEEE.). However, these methods based on a single membership function have fixed function characteristics, making it impossible to dynamically match the enhancement needs of different regions of the image. They also struggle to simultaneously address noise suppression in flat areas and edge preservation in detailed areas, leaving room for improvement in the overall enhancement effect.
[0004] In summary, this study presents a CLAHE blur enhancement method that can adaptively adjust the threshold cropping. By designing a membership function that dynamically adapts to different regional features, it can perform targeted processing on flat and detailed regions. This method is of great significance for enhancing histogram equalization, better preserving edge information while suppressing noise, and obtaining more natural image enhancement results. Summary of the Invention
[0005] The purpose of this invention is to address the problems in existing technologies by proposing a CLAHE image blur enhancement method based on a hybrid membership function. This method improves the single membership function in existing CLAHE methods based on fuzzy theory by replacing it with a hybrid membership function. By dynamically fusing exponential and linear membership functions during the threshold cropping process, it achieves differentiated processing for flat regions and regions rich in detail, thereby adaptively adjusting the cropping threshold. This solves problems such as insufficient histogram equalization capability, easy amplification of noise, and poor edge preservation in existing technologies.
[0006] This invention is achieved through the following technical solution: This invention proposes a CLAHE image blur enhancement method based on a hybrid membership function, the method comprising: Step 1: Input the grayscale image to be processed and divide the image into blocks; use rectangular sub-blocks of fixed size to divide the input grayscale image and completely cover the entire image area; for each sub-block, calculate its grayscale histogram one by one; traverse all pixels in the sub-block and record the number of pixels corresponding to each grayscale level to form histogram data that can reflect the grayscale distribution characteristics of the sub-block. Step 2: Calculate the adaptive pruning threshold based on the hybrid membership function; Step 2 specifically includes: Step 2.1: Use the local variance of each sub-block as an indicator to characterize its texture complexity and information richness; Step 2.2: Construct a weight allocation model based on normalized local variance to smoothly transition between the two basic membership functions; Step 2.3: Design the exponential membership function and the linear membership function, and dynamically fuse the two through the weight allocation model to adapt to the different enhancement requirements of flat regions and regions with rich details; Step 2.4: Map the fused mixed membership values to the pruning threshold domain to establish a positive correlation between membership and threshold; Step 2.5: After threshold correction and constraint, the adaptive pruning threshold for each sub-block is obtained; Step 3: Perform histogram cropping based on the cropping threshold; compare the grayscale histogram of each sub-block with the cropping threshold determined in Step 2; for grayscale levels whose pixel count in the histogram does not exceed the cropping threshold, keep their original count unchanged; redistribute the number of pixels in all grayscale levels that exceed the threshold evenly to all grayscale levels to avoid information loss. Step 4: Contrast mapping and interpolation to obtain the output image; For the gray-level histogram of each cropped sub-block, calculate its cumulative distribution function and normalize it, thereby mapping the original gray levels within the sub-block to the full gray range; Use bilinear interpolation to merge all mapped sub-blocks to eliminate inter-block boundary effects, and finally obtain the enhanced output image.
[0007] Furthermore, in step 2.1, local variance is a core feature reflecting the texture richness and noise level of a sub-block, and its calculation is based on the statistical characteristics of pixel grayscale values within the sub-block; firstly, the grayscale mean of the sub-block is calculated using the following formula: (1) in, For the first Line number The average grayscale value of the sub-blocks, and These are the number of rows and columns of the sub-block, respectively; For the first sub-block Line number The grayscale value of the column pixels, This represents the total number of pixels in the sub-block. The formula for calculating the sum of squared deviations of the grayscale value of each pixel within a sub-block from the mean is as follows: (2) Combining equations (1) and (2) above, the formula for local variance is derived as follows: (3) Substituting the formula for the sum of squared deviations, we get the following calculation: (4) in, For the first sub-block Line number The square of the grayscale value of the column pixel.
[0008] Further, in step 2.2, the extreme values of the local variance of all sub-blocks are first calculated, resulting in... and , are the minimum and maximum local variances of all sub-blocks, respectively; the local variance of any sub-block Normalization is performed to obtain the normalized local variance. The calculation formula is: (5) After normalization This is used to reflect the relative texture richness of sub-blocks; an S-shaped weighting function is designed based on normalized local variance. (6) In the formula Adjust the parameters for curve steepness to ensure smooth weight transitions; The weighting threshold is set so that dense texture areas are weighted by linear functions to ensure the integrity of grayscale relationships and avoid texture distortion, while flat areas are weighted by exponential functions and non-linear stretching to enhance the grayscale differences of potential details, while avoiding grayscale saturation and noise amplification caused by excessive stretching.
[0009] Furthermore, in step 2.3, the exponential membership function is defined. It is used to enhance the contrast of flat areas, and the calculation formula is: (7) In the formula This is the contrast adjustment coefficient. The average grayscale value of the sub-block. The standard deviation of the sub-blocks can be used to effectively stretch the gray values of flat regions through the exponential membership function.
[0010] Furthermore, in step 2.3, a linear membership function is defined. Used to preserve the grayscale relationships of detailed areas, the calculation formula is: (8) In the formula, The minimum grayscale value of the input image. The maximum grayscale value is used to maintain the grayscale ratio of the detailed area through linear mapping, thus avoiding over-enhancement.
[0011] Furthermore, in step 2.3, the hybrid membership function achieves the fusion of the two types of functions through weight allocation, as expressed in the following expression: (9) The function outputs in the range [0,1] and implements adaptive membership mapping guided by local variance.
[0012] Furthermore, in step 2.4, the range of values for the clipping threshold is set. The threshold mapping formula is: (10) In the formula, The original pruning threshold is obtained based on the membership degree mapping. This formula is used to pass the adaptive characteristics of membership degree to the threshold adjustment process, so as to realize the differentiated threshold allocation for different regions.
[0013] Furthermore, in step 2.5, the original threshold is first rounded down: (11) In the formula, This is a rounding function; then boundary constraints are applied to ensure that the threshold does not exceed the set range. (12) Finally, the number was obtained Line number Adaptive pruning threshold for sub-blocks The threshold is smoothly adjusted through a hybrid membership function guided by local variance, which not only adapts to the characteristics of different texture regions but also suppresses noise interference.
[0014] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the CLAHE image blur enhancement method based on a hybrid membership function.
[0015] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the CLAHE image blur enhancement method based on a hybrid membership function.
[0016] The beneficial effects of this invention are: This invention adaptively optimizes the CLAHE cropping threshold by introducing a hybrid membership function guided by local variance. Compared to traditional methods, this method significantly improves image enhancement quality across multiple scenarios. The hybrid membership function and dynamic weight allocation make the histogram equalization process more adaptive, resulting in a uniform histogram distribution in the output image without significant block artifacts. The differentiated enhancement strategy using exponential and linear membership functions effectively suppresses noise amplification and enhances the image's noise robustness. Simultaneously, the function design aligns with human visual perception, ensuring clear details and reasonable contrast stretching in the enhanced image, avoiding over-enhancement or under-enhancement, and demonstrating excellent performance across multiple objective evaluation metrics. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0018] Figure 1 This is an overall flowchart of the CLAHE image blur enhancement method based on hybrid membership functions as described in this invention.
[0019] Figure 2 This diagram illustrates the comparison between the enhancement effects of the method of this invention and the traditional CLAHE method.
[0020] Figure 3 This is a comparison chart showing the information entropy index between the method of this invention and the traditional method in different scenarios.
[0021] Figure 4 This is a comparison chart showing the average gradient index between the method of this invention and the traditional method in different scenarios. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] This invention first divides the input grayscale image into blocks and calculates the local variance of each sub-block, using this as a core feature reflecting the information richness and texture complexity of the sub-block. A weighting function (such as a sigmoid function) is constructed by normalizing the local variance, dynamically adjusting the proportions of exponential and linear membership functions in the mixture function to achieve adaptive adaptation to different texture regions. Specifically, the exponential membership function is designed for flat regions, effectively stretching concentrated grayscale values to improve contrast while suppressing noise amplification; the linear membership function is designed for densely detailed regions, maintaining the relative proportions of grayscale values and avoiding over-enhancement while preserving edges. Subsequently, the mixed membership values are converted into a cropping threshold through a mapping relationship, and after correction and constraints, are ultimately used to guide the equalization stretching of the image's grayscale histogram.
[0024] Specifically, in combination Figures 1-4 This invention proposes a CLAHE image blur enhancement method based on a hybrid membership function, the method comprising: Step 1: Input the grayscale image to be processed and divide the image into blocks; use rectangular sub-blocks of fixed size to divide the input grayscale image and completely cover the entire image area; for each sub-block, calculate its grayscale histogram one by one; traverse all pixels in the sub-block and record the number of pixels corresponding to each grayscale level to form histogram data that can reflect the grayscale distribution characteristics of the sub-block. Step 2: Calculate the adaptive pruning threshold based on the hybrid membership function; Step 2 specifically includes: Step 2.1: Use the local variance of each sub-block as an indicator to characterize its texture complexity and information richness; Step 2.2: Construct a weight allocation model based on normalized local variance to smoothly transition between the two basic membership functions; Step 2.3: Design the exponential membership function and the linear membership function, and dynamically fuse the two through the weight allocation model to adapt to the different enhancement requirements of flat regions and regions with rich details; Step 2.4: Map the fused mixed membership values to the pruning threshold domain to establish a positive correlation between membership and threshold; Step 2.5: After threshold correction and constraint, the adaptive pruning threshold for each sub-block is obtained; Step 3: Perform histogram cropping based on the cropping threshold; compare the grayscale histogram of each sub-block with the cropping threshold determined in Step 2; for grayscale levels whose pixel count in the histogram does not exceed the cropping threshold, keep their original count unchanged; redistribute the number of pixels in all grayscale levels that exceed the threshold evenly to all grayscale levels to avoid information loss. Step 4: Contrast mapping and interpolation to obtain the output image; For the gray-level histogram of each cropped sub-block, calculate its cumulative distribution function and normalize it, thereby mapping the original gray levels within the sub-block to the full gray range; Use bilinear interpolation to merge all mapped sub-blocks to eliminate inter-block boundary effects, and finally obtain the enhanced output image.
[0025] In step 2, an adaptive pruning threshold is calculated based on a hybrid membership function. Specifically, this includes calculating the local variance of sub-blocks. Construct a weight allocation model guided by local variance. Achieving a smooth transition between two types of basic membership functions based on normalized local variance; designing exponential and linear membership functions. and Weighted fusion is then performed; the mixed membership values are mapped and corrected to the final pruning threshold. The weight allocation model can be determined using various function forms such as sigmoid functions and piecewise functions, depending on requirements. The form of the exponential membership function is as follows: ,in It's about pixels. The processing expression can be customized according to specific requirements. The linear membership function takes the form of... = .in Pixel value; The maximum grayscale value of the image; The minimum grayscale value of the image; It is a constant with a value range of [0-1], which can be adjusted according to specific requirements.
[0026] Specifically, in step 2.1, local variance is a core feature reflecting the texture richness and noise level of a sub-block, and its calculation is based on the statistical characteristics of pixel grayscale values within the sub-block; firstly, the grayscale mean of the sub-block is calculated using the following formula: (1) in, For the first Line number The average grayscale value of the sub-blocks, and These are the number of rows and columns of the sub-block, respectively; For the first sub-block Line number The grayscale value of the column pixels, This represents the total number of pixels in the sub-block. The formula for calculating the sum of squared deviations of the grayscale value of each pixel within a sub-block from the mean is as follows: (2) Combining equations (1) and (2) above, the formula for local variance is derived as follows: (3) Substituting the formula for the sum of squared deviations, we get the following calculation: (4) in, For the first sub-block Line number The square of the grayscale value of the column pixel.
[0027] Further, in step 2.2, the extreme values of the local variance of all sub-blocks are first calculated, resulting in... and , are the minimum and maximum local variances of all sub-blocks, respectively; the local variance of any sub-block Normalization is performed to obtain the normalized local variance. The calculation formula is: (5) After normalization This is used to reflect the relative texture richness of sub-blocks; an S-shaped weighting function is designed based on normalized local variance. (6) In the formula Adjust the parameters for curve steepness to ensure smooth weight transitions; The weighting threshold is set so that dense texture areas are weighted by linear functions to ensure the integrity of grayscale relationships and avoid texture distortion, while flat areas are weighted by exponential functions and non-linear stretching to enhance the grayscale differences of potential details, while avoiding grayscale saturation and noise amplification caused by excessive stretching.
[0028] Furthermore, in step 2.3, the exponential membership function is defined. It is used to enhance the contrast of flat areas, and the calculation formula is: (7) In the formula This is the contrast adjustment coefficient. The average grayscale value of the sub-block. The standard deviation of the sub-blocks can be used to effectively stretch the gray values of flat regions through the exponential membership function.
[0029] Furthermore, in step 2.3, a linear membership function is defined. Used to preserve the grayscale relationships of detailed areas, the calculation formula is: (8) In the formula, The minimum grayscale value of the input image. The maximum grayscale value is used to maintain the grayscale ratio of the detailed area through linear mapping, thus avoiding over-enhancement.
[0030] Furthermore, in step 2.3, the hybrid membership function achieves the fusion of the two types of functions through weight allocation, as expressed in the following expression: (9) The function outputs in the range [0,1] and implements adaptive membership mapping guided by local variance.
[0031] Furthermore, in step 2.4, the range of values for the clipping threshold is set. The threshold mapping formula is: (10) In the formula, The original pruning threshold is obtained based on the membership degree mapping. This formula is used to pass the adaptive characteristics of membership degree to the threshold adjustment process, so as to realize the differentiated threshold allocation for different regions.
[0032] Furthermore, in step 2.5, the original threshold is first rounded down: (11) In the formula, This is a rounding function; then boundary constraints are applied to ensure that the threshold does not exceed the set range. (12) Finally, the number was obtained Line number Adaptive pruning threshold for sub-blocks The threshold is smoothly adjusted through a hybrid membership function guided by local variance, which not only adapts to the characteristics of different texture regions but also suppresses noise interference.
[0033] This invention proposes a CLAHE image blur enhancement method based on a hybrid membership function. This method innovatively introduces a hybrid membership function to adaptively adjust the contrast cropping threshold in the CLAHE method based on fuzzy theory. By dynamically fusing exponential and linear membership functions and assigning weights based on local image texture features, it adapts to the enhancement needs of different regions. The method effectively solves the problems of insufficient histogram equalization, easy amplification of noise, and poor edge preservation in the traditional CLAHE method. Experimental results show that this method can make the histogram distribution of the enhanced image more uniform in multiple scenarios, maintaining clear edges while effectively suppressing noise, and significantly improving the overall image enhancement effect.
[0034] Example like Figure 1 As shown, this embodiment provides a CLAHE image blur enhancement method based on a hybrid membership function, specifically including the following steps: Step 1: Input a grayscale image with a resolution of 1280×1024 and perform block processing. In this embodiment, the image is divided into 16 rectangular sub-blocks with a size of 4×4, and each sub-block is 320×256 pixels. For each sub-block, all its pixels are traversed, and the number of pixels at each gray level is counted to form the grayscale histogram of that sub-block.
[0035] Step 2: Calculate the adaptive pruning threshold for each sub-block based on the hybrid membership function. This is the core step, and the specific sub-steps are as follows: Step 2.1: Calculate the local variance of each sub-block.
[0036] Local variance is a core feature reflecting the texture richness and noise level of a sub-block, and its calculation is based on the statistical characteristics of pixel grayscale values within the sub-block. First, the mean grayscale value of the sub-block is calculated using the following formula: (1) in, For the first Line number The average grayscale value of the sub-blocks, and These are the number of rows and columns of the sub-block, respectively, which are 320 and 256 in this example. For the first sub-block Line number The grayscale value of the column pixels, This represents the total number of pixels in the sub-block, which is 81920 in this example.
[0037] The formula for calculating the sum of squared deviations of the grayscale value of each pixel within a sub-block from the mean is as follows: (2) Combining equations (1) and (2) above, the formula for local variance is derived as follows: (3) Substituting the formula for the sum of squared deviations, we get the following calculation: (4) in, For the first sub-block Line number The square of the grayscale value of the column pixel.
[0038] Step 2.2: Construct a weight allocation model guided by local variance To achieve adaptive enhancement of different texture regions, a weight allocation model is constructed based on local variance to dynamically adjust the proportions of the two basic functions in the mixed membership function. First, the extreme values of the local variance of all sub-blocks are calculated, yielding... and , where are the minimum and maximum local variances of all sub-blocks, respectively. The local variance for any sub-block... Normalization is performed to obtain the normalized local variance. The calculation formula is: (5) After normalization This is used to reflect the relative texture richness of sub-blocks. An S-shaped weighting function is designed based on normalized local variance: (6) In the formula Adjust the parameters for curve steepness to ensure smooth weight transitions; The weighting threshold is set so that dense texture areas are weighted by linear functions to ensure the integrity of grayscale relationships and avoid texture distortion, while flat areas are weighted by exponential functions and non-linear stretching to enhance the grayscale differences of potential details, while avoiding grayscale saturation and noise amplification caused by excessive stretching.
[0039] Step 2.3: Design the hybrid membership function Hybrid membership functions combine the characteristics of exponential and linear functions, dynamically adapting to different regional features through weighting functions. First, the exponential membership function is defined. It is used to enhance the contrast of flat areas, and the calculation formula is: (7) In the formula This is the contrast adjustment factor; in this example, c = 2.5. The average grayscale value of the sub-block. The standard deviation of the sub-blocks can be used to effectively stretch the gray values of flat regions through the exponential membership function.
[0040] Define linear membership function Used to preserve the grayscale relationships of detailed areas, the calculation formula is: (8) In the formula, The minimum grayscale value of the input image. The maximum grayscale value is used to maintain the grayscale ratio of the detailed area through linear mapping, thus avoiding over-enhancement.
[0041] The hybrid membership function achieves the fusion of two types of functions through weight allocation, and its expression is: (9) The function outputs in the range [0,1] and implements adaptive membership mapping guided by local variance.
[0042] Step 2.4: Membership Mapping and Pruning Threshold Calculation By mapping the mixed membership values to the clipping threshold domain, a positive correlation is established between membership and clipping threshold; that is, higher membership indicates richer sub-block information, and a larger corresponding clipping threshold. The range of values for the clipping threshold is then defined. The threshold mapping formula is: (10) In the formula, The original pruning threshold is obtained based on the membership degree mapping. This formula is used to pass the adaptive characteristics of membership degree to the threshold adjustment process, so as to realize the differentiated threshold allocation for different regions.
[0043] Step 2.5: Threshold Correction and Constraints To ensure the clipping threshold meets practical application requirements, the original threshold is modified to be a positive integer within the defined universe of discourse. First, the original threshold is rounded down: (11) In the formula, This is a rounding function. Boundary constraints are then applied to ensure the threshold does not exceed the set range. (12) Finally, the number was obtained Line number Adaptive pruning threshold for sub-blocks The threshold is smoothly adjusted through a hybrid membership function guided by local variance, which not only adapts to the characteristics of different texture regions but also suppresses noise interference.
[0044] Step 3: Histogram cropping. Compare the statistical values of each gray level in the histogram of each sub-block with the corresponding threshold. Crop the parts that exceed the threshold and redistribute the cropped pixels evenly across all gray levels.
[0045] Step 4: Contrast Mapping and Interpolation Output. Calculate the cumulative distribution function and normalize the histogram of each cropped sub-block, then perform grayscale mapping. Finally, use bilinear interpolation to fuse all sub-blocks, eliminate boundaries, and output the final enhanced image.
[0046] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the CLAHE image blur enhancement method based on a hybrid membership function.
[0047] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the CLAHE image blur enhancement method based on a hybrid membership function.
[0048] The memory in this application embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the methods described in this invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0049] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0050] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.
[0051] It should be noted that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or as a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above methods.
[0052] The above provides a detailed description of the CLAHE image blur enhancement method based on hybrid membership functions proposed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A CLAHE image blur enhancement method based on mixed membership functions, characterized in that, The method includes: Step 1: Input the grayscale image to be processed and divide the image into blocks; use rectangular sub-blocks of fixed size to divide the input grayscale image and completely cover the entire image area; for each sub-block, calculate its grayscale histogram one by one; traverse all pixels in the sub-block and record the number of pixels corresponding to each grayscale level to form histogram data that can reflect the grayscale distribution characteristics of the sub-block. Step 2: Calculate the adaptive pruning threshold based on the hybrid membership function; Step 2 specifically includes: Step 2.1: Use the local variance of each sub-block as an indicator to characterize its texture complexity and information richness; Step 2.2: Construct a weight allocation model based on normalized local variance to smoothly transition between the two basic membership functions; Step 2.3: Design the exponential membership function and the linear membership function, and dynamically fuse the two through the weight allocation model to adapt to the different enhancement requirements of flat regions and regions with rich details; Step 2.4: Map the fused mixed membership values to the pruning threshold domain to establish a positive correlation between membership and threshold; Step 2.5: After threshold correction and constraint, the adaptive pruning threshold for each sub-block is obtained; Step 3: Perform histogram cropping based on the cropping threshold; compare the grayscale histogram of each sub-block with the cropping threshold determined in Step 2; for grayscale levels whose pixel count in the histogram does not exceed the cropping threshold, keep their original count unchanged; redistribute the number of pixels in all grayscale levels that exceed the threshold evenly to all grayscale levels to avoid information loss. Step 4: Contrast mapping and interpolation to obtain the output image; For the gray-level histogram of each cropped sub-block, calculate its cumulative distribution function and normalize it, thereby mapping the original gray levels within the sub-block to the full gray range; Use bilinear interpolation to merge all mapped sub-blocks to eliminate inter-block boundary effects, and finally obtain the enhanced output image.
2. The method according to claim 1, characterized in that, In step 2.1, local variance is a core feature reflecting the texture richness and noise level of a sub-block, and its calculation is based on the statistical characteristics of pixel grayscale values within the sub-block. First, the mean grayscale value of the sub-block is calculated using the following formula: (1) in, For the first Line number The average grayscale value of the sub-blocks, and These are the number of rows and columns of the sub-block, respectively; For the first sub-block Line number The grayscale value of the column pixels, This represents the total number of pixels in the sub-block. The formula for calculating the sum of squared deviations of the grayscale value of each pixel within a sub-block from the mean is as follows: (2) Combining equations (1) and (2) above, the formula for local variance is derived as follows: (3) Substituting the formula for the sum of squared deviations, we get the following calculation: (4) in, For the first sub-block Line number The square of the grayscale value of the column pixel.
3. The method according to claim 2, characterized in that, In step 2.2, the extreme values of the local variance of all sub-blocks are first calculated, and then... and , are the minimum and maximum local variances of all sub-blocks, respectively; the local variance of any sub-block Normalization is performed to obtain the normalized local variance. The calculation formula is: (5) After normalization This is used to reflect the relative texture richness of sub-blocks; an S-shaped weighting function is designed based on normalized local variance. (6) In the formula Adjust the parameters for curve steepness to ensure smooth weight transitions; The weighting threshold is set so that dense texture areas are weighted by linear functions to ensure the integrity of grayscale relationships and avoid texture distortion, while flat areas are weighted by exponential functions and non-linear stretching to enhance the grayscale differences of potential details, while avoiding grayscale saturation and noise amplification caused by excessive stretching.
4. The method according to claim 3, characterized in that, In step 2.3, the exponential membership function is defined. It is used to enhance the contrast of flat areas, and the calculation formula is: (7) In the formula This is the contrast adjustment coefficient. The average grayscale value of the sub-block. The standard deviation of the sub-blocks can be used to effectively stretch the gray values of flat regions through the exponential membership function.
5. The method according to claim 4, characterized in that, In step 2.3, the linear membership function is defined. Used to preserve the grayscale relationships of detailed areas, the calculation formula is: (8) In the formula, The minimum grayscale value of the input image. The maximum grayscale value is used to maintain the grayscale ratio of the detailed area through linear mapping, thus avoiding over-enhancement.
6. The method according to claim 5, characterized in that, In step 2.3, the hybrid membership function achieves the fusion of the two types of functions through weight allocation, and the expression is: (9) The function outputs in the range [0,1] and implements adaptive membership mapping guided by local variance.
7. The method according to claim 6, characterized in that, In step 2.4, the range of values for the clipping threshold is set. The threshold mapping formula is: (10) In the formula, The original pruning threshold is obtained based on the membership degree mapping. This formula is used to pass the adaptive characteristics of membership degree to the threshold adjustment process, so as to realize the differentiated threshold allocation for different regions.
8. The method according to claim 7, characterized in that, In step 2.5, the original threshold is first rounded down: (11) In the formula, This is a rounding function; then boundary constraints are applied to ensure that the threshold does not exceed the set range. (12) Finally, the number was obtained Line number Adaptive pruning threshold for sub-blocks The threshold is smoothly adjusted through a hybrid membership function guided by local variance, which not only adapts to the characteristics of different texture regions but also suppresses noise interference.
9. An electronic 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-8.
10. A computer-readable storage medium for storing computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-8.