An image enhancement method and system based on double histogram equalization
By using a dual histogram equalization method, the image is divided into target and background regions for independent equalization processing. Combined with local grayscale correction, the problems of brightness shift and detail loss in existing technologies are solved, and high-quality image enhancement in low-light environments is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGXI UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2023-04-11
- Publication Date
- 2026-06-09
Smart Images

Figure CN116402729B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to an image enhancement method and system based on dual histogram equalization. Background Technology
[0002] my country's industrial manufacturing sector is transforming towards electrification, connectivity, and intelligence. Machine vision-based automated measurement can shorten measurement time and save labor costs, making it an important way to improve efficiency while ensuring quality. However, this also places higher demands on the accuracy, speed, and automation level of measurement systems. It is necessary to continuously improve and optimize inspection technologies to adapt to today's rapidly developing science and technology, and explore faster, more accurate, more efficient, and cost-effective inspection methods.
[0003] In the industrial field, machine vision systems can quickly measure targets. However, in actual work, environmental issues (rain, fog, smoke, etc.), imaging equipment problems, and lighting issues can lead to low image quality and low contrast, which is not conducive to subsequent image processing.
[0004] Nanjing University of Science and Technology has invented a histogram equalization method based on block statistics (CN 110223241 A). First, the input image is divided into M equal blocks. N sub-image blocks are used; then, histogram statistics are performed on each sub-image block, with different judgment conditions set for uniform and rich scenes to obtain histogram mapping functions; finally, the pixels of the original image are bilinearly interpolated according to their position and the histogram mapping function values of neighboring blocks to obtain the final mapped value. The specific process is as follows: Figure 1 As shown. However, this method performs global histogram equalization on the image, which is prone to brightness shift. After image enhancement, it cannot guarantee the enhancement of image details while improving contrast.
[0005] Huaqiao University has invented a global histogram equalization method with adaptive thresholding (CN 109801246 A). The method involves statistically analyzing and scaling histogram data to achieve a mean of 1, preprocessing the data, calculating an adaptive optimal truncation threshold, and then truncating and post-processing the histogram based on this threshold. A mapping table is calculated, and a lookup operation is performed on the image to obtain the final grayscale enhanced image. The specific process is as follows: Figure 2 As shown, this method divides the input image into equal blocks, which can effectively avoid the loss of image details, but it is prone to noise and "blocking artifacts," resulting in local distortion of the processed image and unsatisfactory processing results.
[0006] In the patent "An Improved Low-Buffer Histogram Equalization Method and System Based on FPGA" (CN 110148101 B), a time-division multiplexing control signal is generated by a time-division multiplexing module, and a buffer control module generates timing control signals for the buffering of three histogram statistical branches. This solves the problems of noise amplification, image distortion and loss of detail in traditional image enhancement methods. However, this method is highly specific and only applicable to visible light and infrared image enhancement processing, and its real-time performance is poor.
[0007] Therefore, given the technical deficiencies in existing image enhancement processing technologies, how to provide an image enhancement method that can enhance image contrast and detail information while protecting average brightness and significantly improve image quality is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0008] In view of this, the present invention provides an image enhancement method and system based on dual histogram equalization.
[0009] To achieve the above objectives, the present invention provides the following technical solution:
[0010] An image enhancement method based on dual histogram equalization includes the following steps:
[0011] Step 1: Obtain the image to be processed;
[0012] Step 2: Perform grayscale processing on the image to be processed to obtain the original grayscale image F, and perform grayscale statistics on the original grayscale image to obtain the grayscale histogram;
[0013] Step 3: Determine the original grayscale image F Optimal split point And based on the optimal split point Original grayscale image F The region is divided into target area A and background area B according to gray level.
[0014] Step 4: Based on the optimal segmentation point Determine the segmentation threshold of the grayscale sub-histogram of target region A. T A And the segmentation threshold of the grayscale sub-histogram of background region B. T B ;
[0015] Step 5: Perform independent equalization on the grayscale sub-histograms of target region A and background region B to obtain the equalized grayscale histogram. P S ;
[0016] Step 6: Based on the segmentation threshold TA and the segmentation threshold T B The equalized grayscale histogram P S Enhancement suppression was performed to obtain the image. P T ;
[0017] Step 7: Process the image P T Local grayscale correction is performed to obtain the enhanced image.
[0018] Optionally, in step 3, an improved Otsu algorithm is used to determine the original grayscale image. F Optimal split point The specific method is as follows:
[0019] ;
[0020] ;
[0021] in, Indicates threshold t When the dividing point is used, the proportion occupied by target region A; Indicates threshold t When the dividing point is used, the proportion of the background region B is determined. Indicates threshold t The mean gray value of target region A when the dividing point is used; Indicates threshold t The average gray value of background region B when the dividing point is used; Indicates threshold t When the dividing point is A, the average variance of the target region A is denoted as A. Indicates threshold t When the dividing point is , the average variance of the background region B is .
[0022] Optionally, in step 3, the target region A is determined by grayscale values in... The background region B is composed of pixels within a certain range, with gray values ranging from... The composition of pixels within the interval, MIN This represents the minimum pixel value in the original grayscale image F. MAX This represents the maximum pixel value in the original grayscale image F.
[0023] Optionally, in step 4, a segmentation threshold is determined. T A and segmentation threshold T B The method is as follows:
[0024] ;
[0025] in, This represents the value of the gray level with the highest frequency of occurrence in the gray-level sub-histogram of target region A. This represents the value of the gray level with the highest frequency of occurrence in the gray-level sub-histogram of background region B. MIN Represents the original grayscale image F The minimum pixel value in MAX Represents the original grayscale image F The maximum pixel value in the range.
[0026] Optionally, in step 5, the method for independently equalizing the grayscale sub-histograms of the target region A and the background region B is as follows:
[0027] ;
[0028] in, Represents the original grayscale image F medium gray level The total number of pixels, n Represents the original grayscale image F The total number of all pixels in Indicates grayscale level as Gray-level histogram after time equalization This represents the total number of gray levels in the target area A. This represents the total number of gray levels in background region B. MIN Represents the original grayscale image F The minimum pixel value in MAX Represents the original grayscale image F The maximum pixel value in the range.
[0029] Optionally, in step 6, based on the segmentation threshold T A and the segmentation threshold T B The equalized grayscale histogram P S The method for enhanced inhibition is as follows:
[0030] ;
[0031] in, Indicates grayscale level as Grayscale histogram after cropping.
[0032] Optionally, in step 7, the image... P T The method for local grayscale correction is as follows:
[0033] For images PT The grayscale value of the center pixel is corrected, specifically...
[0034] ;
[0035] in, Indicates the corrected image P T The grayscale value of the center pixel. Represents the original grayscale image F Center pixel grayscale value, Representing an image The grayscale value of the center pixel. Original grayscale image F China and Israel Centered The average grayscale value of the pixels within the window. This indicates that in the grayscale image after independent equalization in step 5, the grayscale values are... Centered The average grayscale value of the pixels within the window. Represents the original grayscale image F The gradient matrix, This represents the gradient matrix of the grayscale image after independent equalization in step 5.
[0036] Optionally, use the Sobel operator on the original grayscale image. F Perform gradient matrix convolution to obtain the gradient matrix. :
[0037] ;
[0038] The gradient matrix is convolved using the Sobel operator on the independently equalized grayscale image to obtain the gradient matrix. :
[0039] ;
[0040]
[0041] in, , , , These represent the Sobel operators for the 0°, 180°, 45°, and 135° directions, respectively.
[0042] Optionally, a segmentation threshold is determined in step 4. T A Segmentation threshold T BBefore performing independent equalization in step 5, one-dimensional median filtering is required on the grayscale sub-histograms of target region A and background region B. The specific method is as follows:
[0043] Obtain the sets of non-zero cells from the grayscale sub-histograms of target region A and background region B, respectively. , :
[0044] ;
[0045] in, Indicates pixel grayscale level, Indicates pixel grayscale level Units;
[0046] For sets , conduct One-dimensional median filtering.
[0047] This invention also discloses an image enhancement system based on dual histogram equalization, comprising:
[0048] The image acquisition module is used to acquire the image to be processed.
[0049] The grayscale processing module is used to perform grayscale processing on the image to be processed to obtain the original grayscale image F, and to perform grayscale statistics on the original grayscale image to obtain a grayscale histogram.
[0050] The image segmentation module is used to determine the original grayscale image. F Optimal split point And based on the optimal split point Original grayscale image F The region is divided into target area A and background area B according to gray level.
[0051] The segmentation threshold determination module is used to determine the segmentation threshold based on the optimal segmentation point. Determine the segmentation threshold of the grayscale sub-histogram of target region A. T A And the segmentation threshold of the grayscale sub-histogram of background region B. T B ;
[0052] The independent equalization processing module is used to independently equalize the grayscale sub-histograms of target region A and background region B, obtaining the equalized grayscale histogram. P S ;
[0053] Over-enhancement suppression module, used to suppress over-enhancement based on the segmentation threshold. T Aand the segmentation threshold T B The equalized grayscale histogram P S Enhancement suppression was performed to obtain the image. P T ;
[0054] A local grayscale correction module is used to correct the grayscale of the image. P T Local grayscale correction is performed to obtain the enhanced image.
[0055] As can be seen from the above technical solution, the present invention provides an image enhancement method and system based on dual histogram equalization, which has the following advantages compared with the prior art:
[0056] (1) Global histogram equalization algorithms can cause brightness shifts during image equalization, resulting in the loss of image detail information. Therefore, this invention uses an improved Otsu algorithm to segment the image into two sub-histograms, the target and the background, and performs independent equalization to protect the average brightness of the input image and avoid the problem of brightness shift after enhancement.
[0057] (2) Compared with the traditional Otsu method, the image segmented by the improved Otsu algorithm of this invention can show more image details and achieve better segmentation results.
[0058] (3) Traditional histogram equalization algorithms can lead to over-enhancement of images due to excessive stretching, resulting in unnatural enhanced images. Therefore, this invention adaptively obtains a threshold to suppress gray levels to avoid over-enhancement of images. The improved algorithm has a protective effect on image edge details, and the image quality is significantly improved.
[0059] (4) Using the local grayscale correction algorithm for grayscale correction effectively avoids the grayscale merging problem, protects the image detail information, and reasonably enhances the image contrast and edge detail information. The image details are clearer and have better visual effects, which can effectively improve the accuracy of machine vision measurement in low light environment.
[0060] In summary, this invention can enhance image contrast and detail while protecting average brightness, and at the same time minimize noise amplification. It is highly robust, stable, and widely applicable, significantly improving image quality.
[0061] This invention is particularly suitable for low-light image enhancement in low-light environments such as factories and mines, so as to measure more accurate industrial data, promote the implementation of enterprise engineering projects, and improve production efficiency. Attached Figure Description
[0062] 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.
[0063] Figure 1 This is a schematic diagram of the process of a histogram balancing method based on block statistics (CN 110223241 A) published in the patent.
[0064] Figure 2 This is a flowchart illustrating a global histogram equalization method with an adaptive threshold (CN 109801246 A) that has been disclosed in a patent.
[0065] Figure 3 A flowchart of an image enhancement method based on dual histogram equalization provided by the present invention;
[0066] Figure 4 A schematic diagram of an image enhancement system module based on dual histogram equalization provided by the present invention;
[0067] Figure 5(a) shows the original image of Scene 1;
[0068] Figure 5(b) shows the effect of processing the original image of Scene 1 using the traditional Otsu algorithm;
[0069] Figure 5(c) shows the effect of processing the original image of Scene 1 using the improved Otsu algorithm;
[0070] Figure 5(d) shows the original image of scene 2;
[0071] Figure 5(e) shows the effect of processing the original image of Scene 2 using the traditional Otsu algorithm;
[0072] Figure 5(f) shows the effect of processing the original image of Scene 2 using the improved Otsu algorithm;
[0073] Figure 6(a) shows the original grayscale image in an embodiment of the present invention;
[0074] Figure 6(b) is the grayscale histogram of the original grayscale image in an embodiment of the present invention;
[0075] Figure 7(a) shows the image after image enhancement in an embodiment of the present invention;
[0076] Figure 7(b) is the grayscale histogram of the image after image enhancement in an embodiment of the present invention. Detailed Implementation
[0077] 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.
[0078] This invention discloses an image enhancement method based on dual histogram equalization, which can be applied to enhance images containing detection targets in low-light environments in industrial fields, enabling industrial measurement in low-light conditions and improving industrial production efficiency. See also... Figure 3 Specifically, it includes the following steps:
[0079] Step 1: Obtain the image to be processed.
[0080] Image data of the target under test in low-light environment is obtained by capturing images of the target using an industrial camera.
[0081] Step 2: Perform grayscale processing on the image to be processed to obtain the original grayscale image F, and perform grayscale statistics on the original grayscale image to obtain the grayscale histogram.
[0082] Step 3: Use the improved Otsu algorithm to determine the original grayscale image. F Optimal split point And based on the optimal split point Original grayscale image F The target area is divided into a grayscale region A and a background area B.
[0083] Among them, the improved Otsu algorithm is used to determine the original grayscale image. F Optimal split point The specific process is as follows:
[0084] Set threshold Using grayscale points as segmentation points, the image is divided into target region A and background region B according to grayscale levels. Target region A is defined by grayscale values ranging from... The background region B is composed of pixels within a certain range, with gray values ranging from... The composition of pixels within the interval. Then the ratio of class A to class B. , for:
[0085] ;
[0086] Where L is the number of gray levels. Indicates grayscale value The probability of time, based on the probabilities of class A and class B, can be obtained from... , express:
[0087] ;
[0088] Then, the average gray level of the input image is calculated. :
[0089] ;
[0090] Then the variance between classes Defined as:
[0091] ;
[0092] To measure the cohesion of pixels, let's assume a distance metric, namely:
[0093] ;
[0094] Introducing the average variance of the target region and the background region , :
[0095] ;
[0096] ;
[0097] The new threshold calculation formula is obtained:
[0098] ;
[0099] when When taking the maximum value, the corresponding The value is the optimal split point. Therefore, the optimal split point... The formula for obtaining is as follows:
[0100] .
[0101] Based on the optimal segmentation point Original grayscale image F Based on grayscale levels, the region is divided into target region A and background region B. Target region A is determined by grayscale values ranging from... The background region B is composed of pixels within a certain range, with gray values ranging from... The composition of pixels within the interval, MIN This represents the minimum pixel value in the original grayscale image F. MAX This represents the maximum pixel value in the original grayscale image F.
[0102] Figures 5(a)-5(c) show the comparison of the effects of using the traditional Otsu algorithm and the improved Otsu algorithm of this invention in Scene 1. Figures 5(d)-5(f) show the comparison of the effects of using the traditional Otsu algorithm and the improved Otsu algorithm of this invention in Scene 2. It can be seen that the improved Otsu algorithm proposed in this invention can show more image details and achieve better segmentation results.
[0103] In practical applications, it is also necessary to perform one-dimensional median filtering on the grayscale sub-histograms of target region A and background region B to facilitate the next step of processing. The specific method is as follows:
[0104] Obtain the sets of non-zero cells from the grayscale sub-histograms of target region A and background region B, respectively. , :
[0105] ;
[0106] in, Indicates pixel grayscale level, Indicates pixel grayscale level Units;
[0107] For sets , conduct One-dimensional median filtering.
[0108] Step 4: Based on the optimal segmentation point Determine the segmentation threshold of the grayscale sub-histogram of target region A. T A And the segmentation threshold of the grayscale sub-histogram of background region B. T B :
[0109] ;
[0110] in, This represents the value of the gray level with the highest frequency of occurrence in the gray-level sub-histogram of target region A. This represents the value of the gray level with the highest frequency of occurrence in the gray-level sub-histogram of background region B. MIN Represents the original grayscale image F The minimum pixel value in MAX Represents the original grayscale image F The maximum pixel value in the range.
[0111] Step 5: Perform independent equalization on the gray-level sub-histograms of target region A and background region B, and statistically analyze the gray levels of the equalized image to obtain the equalized gray-level histogram. PS The equilibrium formula is:
[0112] ;
[0113] in, Represents the original grayscale image F medium gray level The total number of pixels, n Represents the original grayscale image F The total number of all pixels in Indicates grayscale level as Gray-level histogram after time equalization This represents the total number of gray levels in the target area A. This represents the total number of gray levels in background region B. MIN Represents the original grayscale image F The minimum pixel value in MAX Represents the original grayscale image F The maximum pixel value in the range.
[0114] Step 6: Based on the segmentation threshold T A and the segmentation threshold T B The equalized grayscale histogram P S Over-enhancement suppression was performed, meaning that in the target region A, the value was greater than the segmentation threshold. The value becomes In background region B, the value is greater than the segmentation threshold. The value becomes With other values remaining unchanged, the image is obtained. P T :
[0115] ;
[0116] in, Indicates grayscale level as Grayscale histogram after cropping.
[0117] Step 7: Process the image P T By performing local grayscale correction, the enhanced image is obtained:
[0118] ;
[0119] in, Indicates the corrected image P T The grayscale value of the center pixel. Represents the original grayscale image F Center pixel grayscale value, Representing an image The grayscale value of the center pixel. Original grayscale image F China and Israel Centered The average grayscale value of the pixels within the window. This indicates that in the grayscale image after independent equalization in step 5, the grayscale values are... Centered The average grayscale value of the pixels within the window. Represents the original grayscale image F The gradient matrix, This represents the gradient matrix of the grayscale image after independent equalization in step 5.
[0120] Use the Sobel operator on the original grayscale image F Perform gradient matrix convolution to obtain the gradient matrix. :
[0121] ;
[0122] The gradient matrix is convolved using the Sobel operator on the independently equalized grayscale image to obtain the gradient matrix. :
[0123] ;
[0124]
[0125] in, , , , These represent the Sobel operators for the 0°, 180°, 45°, and 135° directions, respectively.
[0126] Another embodiment of the present invention discloses an image enhancement system based on dual histogram equalization, see [link to relevant documentation]. Figure 4 ,include:
[0127] The image acquisition module is used to acquire the image to be processed.
[0128] The grayscale processing module is used to perform grayscale processing on the image to be processed to obtain the original grayscale image F, and to perform grayscale statistics on the original grayscale image to obtain a grayscale histogram.
[0129] The image segmentation module is used to determine the original grayscale image. F Optimal split point And based on the optimal split point Original grayscale image F The region is divided into target area A and background area B according to gray level.
[0130] The segmentation threshold determination module is used to determine the segmentation threshold based on the optimal segmentation point. Determine the segmentation threshold of the grayscale sub-histogram of target region A. T A And the segmentation threshold of the grayscale sub-histogram of background region B. T B ;
[0131] The independent equalization processing module is used to independently equalize the grayscale sub-histograms of target region A and background region B, obtaining the equalized grayscale histogram. P S ;
[0132] Over-enhancement suppression module, used to suppress over-enhancement based on the segmentation threshold. T A and the segmentation threshold T B The equalized grayscale histogram P S Enhancement suppression was performed to obtain the image. P T ;
[0133] A local grayscale correction module is used to correct the grayscale of the image. P T Local grayscale correction is performed to obtain the enhanced image.
[0134] In the industrial field, machine vision systems can quickly measure targets. However, in actual work, environmental problems (rain, fog, dust, etc.), imaging equipment problems, and lighting problems can lead to low image quality and low contrast, which is not conducive to subsequent image processing. Therefore, the image enhancement technology of this invention can improve image contrast, so as to obtain more accurate industrial data and improve the robustness of automatic detection systems.
[0135] Similarly, besides the aforementioned industrial fields, the technical solution of this invention can also be applied to other scenarios requiring image enhancement. For example, the technical solution of this invention can also be applied to visible light and infrared image enhancement processing. Infrared imaging technology is widely used in defense, security, non-destructive testing, and toxic gas detection. For instance, in an automatic visual inspection system for faulty components, faulty components often generate excessive heat. During assembly, infrared images are generated from the distribution of heat energy. By enhancing these infrared images, faulty components can be accurately identified during assembly. This improves image quality, enhances image details, and increases the robustness of the inspection system.
[0136] Furthermore, this invention can also be applied to lung disease identification, heart disease identification, and digital mammograms, achieving image enhancement in biomedicine. Because the original images obtained by imaging equipment are limited by the hardware performance of the equipment itself and are affected by various factors such as acquisition conditions, medical images obtained directly from medical instruments may suffer from image quality degradation, such as low contrast and unclear images. This invention can improve the contrast of medical images, thereby assisting doctors in automatic diagnosis and improving work efficiency.
[0137] Referring to Figures 6(a) and 6(b), which are the original grayscale images and their grayscale histograms of a low-light image, and Figures 7(a) and 7(b), which are the images and their grayscale histograms of the low-light image after image enhancement using the scheme of the present invention, it can be seen that the present invention can enhance the image contrast and detail information while protecting the average brightness, and at the same time, it can minimize the amplification of noise and improve the image quality.
[0138] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0139] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image enhancement method based on dual histogram equalization, characterized in that, Includes the following steps: Step 1: Obtain the image to be processed; Step 2: Perform grayscale processing on the image to be processed to obtain the original grayscale image F, and perform grayscale statistics on the original grayscale image to obtain the grayscale histogram; Step 3: Determine the original grayscale image F Optimal split point And based on the optimal split point Original grayscale image F The region is divided into target area A and background area B according to gray level. Step 4: Based on the optimal segmentation point Determine the segmentation threshold of the grayscale sub-histogram of target region A. T A And the segmentation threshold of the grayscale sub-histogram of background region B. T B ; Step 5: Perform independent equalization on the grayscale sub-histograms of target region A and background region B to obtain the equalized grayscale histogram. P S ; Step 6: Based on the segmentation threshold T A and the segmentation threshold T B For the equalized grayscale histogram P S Enhancement suppression was performed to obtain the image. P T ; Step 7: Process the image P T Perform local grayscale correction to obtain the enhanced image; In step 3, the improved Otsu algorithm is used to determine the original grayscale image. F Optimal split point The specific method is as follows: ; ; in, Indicates threshold t When the dividing point is used, the proportion occupied by target region A; Indicates threshold t When the dividing point is used, the proportion of the background region B is determined. Indicates threshold t The mean gray value of target region A when the dividing point is used; Indicates threshold t The average gray value of background region B when the dividing point is used; Indicates threshold t When the dividing point is A, the average variance of the target region A is denoted as A. Indicates threshold t When the dividing point is the average variance of the background region B; In step 5, the method for independently equalizing the grayscale sub-histograms of target region A and background region B is as follows: ; in, Represents the original grayscale image F medium gray level The total number of pixels, n Represents the original grayscale image F The total number of all pixels in Indicates grayscale level as Gray-level histogram after time equalization This represents the total number of gray levels in the target area A. This represents the total number of gray levels in background region B. MIN Represents the original grayscale image F The minimum pixel value in MAX Represents the original grayscale image F The maximum pixel value in; In step 6, based on the segmentation threshold T A and the segmentation threshold T B For the equalized grayscale histogram P S The method for enhanced inhibition is as follows: ; in, Indicates grayscale level as Grayscale histogram after cropping; In step 7, the image P T The method for local grayscale correction is as follows: For images P T The grayscale value of the center pixel is corrected, specifically... ; in, Indicates the corrected image P T The grayscale value of the center pixel. Represents the original grayscale image F Center pixel grayscale value, Representing an image The grayscale value of the center pixel. For the original grayscale image F, with Centered The average grayscale value of the pixels within the window. This indicates that in the grayscale image after independent equalization in step 5, the grayscale values are... Centered The average grayscale value of the pixels within the window. The gradient matrix of the original grayscale image F is represented by... This represents the gradient matrix of the grayscale image after independent equalization in step 5.
2. The image enhancement method based on dual histogram equalization according to claim 1, characterized in that, In step 3, the target region A is determined by the grayscale value in... The background region B is composed of pixels within a certain range, with gray values ranging from... The composition of pixels within the interval, MIN This represents the minimum pixel value in the original grayscale image F. MAX This represents the maximum pixel value in the original grayscale image F.
3. The image enhancement method based on dual histogram equalization according to claim 1, characterized in that, In step 4, the segmentation threshold is determined. T A and segmentation threshold T B The method is as follows: ; in, This represents the value of the gray level with the highest frequency of occurrence in the gray-level sub-histogram of target region A. This represents the value of the gray level with the highest frequency of occurrence in the gray-level sub-histogram of background region B. MIN Represents the original grayscale image F The minimum pixel value in MAX Represents the original grayscale image F The maximum pixel value in the range.
4. The image enhancement method based on dual histogram equalization according to claim 1, characterized in that, Use the Sobel operator on the original grayscale image F Perform gradient matrix convolution to obtain the gradient matrix. : ; The gradient matrix is convolved using the Sobel operator on the independently equalized grayscale image to obtain the gradient matrix. : ; in, , , , These represent the Sobel operators for the 0°, 180°, 45°, and 135° directions, respectively.
5. The image enhancement method based on dual histogram equalization according to claim 1, characterized in that, Determine the segmentation threshold in step 4 T A Segmentation threshold T B Before performing independent equalization in step 5, one-dimensional median filtering is required on the grayscale sub-histograms of target region A and background region B. The specific method is as follows: Obtain the sets of non-zero cells from the grayscale sub-histograms of target region A and background region B, respectively. , : ; in, Indicates pixel grayscale level, Indicates pixel grayscale level Units; For sets , conduct One-dimensional median filtering.
6. An image enhancement system based on dual histogram equalization, employing the image enhancement method based on dual histogram equalization as described in any one of claims 1 to 5, characterized in that, include: The image acquisition module is used to acquire the image to be processed. The grayscale processing module is used to perform grayscale processing on the image to be processed to obtain the original grayscale image F, and to perform grayscale statistics on the original grayscale image to obtain a grayscale histogram. The image segmentation module is used to determine the original grayscale image. F Optimal split point And based on the optimal split point Original grayscale image F The region is divided into target area A and background area B according to gray level. The segmentation threshold determination module is used to determine the segmentation threshold based on the optimal segmentation point. Determine the segmentation threshold of the grayscale sub-histogram of target region A. T A And the segmentation threshold of the grayscale sub-histogram of background region B. T B ; The independent equalization processing module is used to independently equalize the grayscale sub-histograms of target region A and background region B, obtaining the equalized grayscale histogram. P S ; Over-enhancement suppression module, used to suppress over-enhancement based on the segmentation threshold. T A and the segmentation threshold T B For the equalized grayscale histogram P S Enhancement suppression was performed to obtain the image. P T ; A local grayscale correction module is used to correct the grayscale of the image. P T Local grayscale correction is performed to obtain the enhanced image.