Image enhancement method and device, electronic equipment and storage medium

By combining high-pass filtering and weighted analysis with low-pass filtering, the construction of the adaptive gain function is simplified, enabling accurate enhancement of high-frequency details and noise suppression in images, thereby improving image quality.

CN121190338BActive Publication Date: 2026-11-06ZHEJIANG UNIVIEW TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410803066.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2026-11-06
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

In existing technologies, it is difficult to construct adaptive gain functions that simultaneously enhance image details and suppress noise, resulting in poor image enhancement effects.

Method used

High-frequency components of the image are extracted by high-pass filtering, high-frequency and low-frequency regions are distinguished by weighted analysis, noise is removed by low-pass filtering and high-frequency details are extracted, and image enhancement is performed by combining linear gain coefficients.

Benefits of technology

It achieves accurate enhancement of high-frequency details in images and effective suppression of noise, simplifies the construction process of adaptive gain function, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121190338B_ABST
    Figure CN121190338B_ABST
Patent Text Reader

Abstract

The application provides an image enhancement method and device, electronic equipment and storage medium, the method comprises: obtaining a gray image to be enhanced, and performing high-pass filtering processing on the gray image to obtain a first high-frequency image; performing low-pass filtering processing on the first high-frequency image according to the gray value difference of each pixel point in the first high-frequency image, determining a second high-frequency image and a weight analysis diagram; the weight analysis diagram includes a target weight value of each pixel point, and the target weight value is used to represent that the corresponding pixel point in the first high-frequency image belongs to a high-frequency region pixel point or a low-frequency region pixel point; according to the weight analysis diagram, the gray value corresponding to the pixel point belonging to the high-frequency region in the second high-frequency image is extracted to obtain a third high-frequency image; and according to the third high-frequency image and the gray image, a target image after image enhancement is determined. The technical scheme of the application can more easily distinguish the high-frequency details and noise in the image, so as to realize accurate enhancement of the detail part.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Digital image enhancement technology is an important and commonly used technique in digital image processing. Digital image enhancement generally enhances the details or edges of an image to make the details more prominent or the edges clearer, with the aim of improving the quality of the digital image. Therefore, digital image enhancement technology is particularly important.

[0003] In related technologies, when enhancing digital images, the process typically involves first convolving the image with the original image using methods such as the Laplacian operator to extract high-frequency components. Then, an adaptive gain function is constructed, and the constructed adaptive gain function is used to accurately distinguish between details and noise in the high-frequency components. Subsequently, the distinguished details are enhanced and the noise is suppressed.

[0004] However, constructing an adaptive gain function in the above techniques is quite difficult, meaning that the above techniques cannot simultaneously achieve both detail enhancement and noise suppression. Summary of the Invention

[0005] This invention provides an image enhancement method, apparatus, electronic device, and storage medium to address the shortcomings of existing technologies where it is difficult to construct an adaptive gain function that distinguishes between details and noise in an image. This invention enables easier differentiation of high-frequency details and noise in an image, thereby achieving accurate enhancement of the details.

[0006] This invention provides an image enhancement method, comprising the following steps: The grayscale image to be enhanced is obtained, and a high-pass filter is applied to the grayscale image to obtain the first high-frequency image corresponding to the grayscale image. The first high-frequency image is low-pass filtered based on the difference in grayscale values ​​of each pixel in the first high-frequency image to determine the second high-frequency image and the weight analysis map. The weight analysis map includes the target weight value of each pixel in the first high-frequency image. The target weight value is used to characterize whether the corresponding pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region. Based on the target weight value of each pixel in the weight analysis diagram, the gray values ​​corresponding to the pixels belonging to the high-frequency region in the second high-frequency image are extracted to obtain the third high-frequency image; Based on the third high-frequency image and the grayscale image, the target image after image enhancement is determined.

[0007] According to an image enhancement method provided by the present invention, the above-mentioned method involves performing low-pass filtering on the first high-frequency image based on the grayscale value differences of each pixel in the first high-frequency image to determine the second high-frequency image and the weight analysis map, including: The filtering window of the range filter is determined based on the preset filtering radius and initial filtering size. Based on the difference between the gray values ​​of each element in the filtering window and the gray values ​​of each pixel in the first high-frequency image, the weight matrix corresponding to the filtering kernel of the value range filter is determined; the gray value of each element is the gray value of the corresponding element at the corresponding position in the first high-frequency image, and the weight matrix includes the filtering weight value corresponding to each element in the filtering window. A value range filter is used to perform low-pass filtering on the first high-frequency image to determine the second high-frequency image and the weight analysis map.

[0008] According to an image enhancement method provided by the present invention, each pixel corresponds to a weight matrix; the above-mentioned low-pass filtering of a first high-frequency image using a value-domain filter to determine a second high-frequency image and a weight analysis map includes: for each pixel in the first high-frequency image, low-pass filtering of the pixel using the weight matrix corresponding to the pixel in the value-domain filter to determine the second high-frequency image. Based on the weight matrix corresponding to each pixel in the value range filter, the target weight value corresponding to each pixel is determined, and the weight analysis map is determined based on the target weight value of each pixel.

[0009] According to an image enhancement method provided by the present invention, determining the target weight value corresponding to each pixel based on the weight matrix corresponding to each pixel in the value range filter includes: The average value of each filter weight in the weight matrix corresponding to each pixel is processed to determine the average weight of each pixel, and the average weight of each pixel is used as the target weight value of the corresponding pixel.

[0010] According to an image enhancement method provided by the present invention, the above-mentioned extraction of gray values ​​corresponding to pixels belonging to high-frequency regions in a second high-frequency image based on a weighted analysis map to obtain a third high-frequency image includes: The target weight value corresponding to each pixel in the second high-frequency image is compared with the preset weight threshold. If the target weight value of any pixel in the second high-frequency image is less than the weight threshold, then any pixel is determined to be a pixel belonging to the high-frequency region, and the gray value corresponding to any pixel in the second high-frequency image is extracted to obtain the third high-frequency image.

[0011] According to an image enhancement method provided by the present invention, the above-mentioned determination of the enhanced target image based on a third high-frequency image and a grayscale image includes: Obtain the preset linear gain coefficient; The target image is obtained by multiplying the third high-frequency image and the linear gain coefficient, and then superimposing it with the grayscale image.

[0012] According to an image enhancement method provided by the present invention, the method further includes: The grayscale values ​​of the target image are standardized based on the preset maximum grayscale value to obtain the standardized target image.

[0013] The present invention also provides an image enhancement device, comprising the following modules: The acquisition module is used to acquire the grayscale image to be enhanced and perform high-pass filtering on the grayscale image to obtain the first high-frequency image corresponding to the grayscale image; The low-pass filtering module is used to perform low-pass filtering on the first high-frequency image based on the difference in gray values ​​of each pixel in the first high-frequency image, and to determine the second high-frequency image and the weight analysis map. The weight analysis map includes the target weight value of each pixel in the first high-frequency image. The target weight value is used to characterize whether the corresponding pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region. The extraction module is used to extract the gray values ​​corresponding to the high-frequency regions of the second high-frequency image based on the target weight values ​​of each pixel in the weight analysis map, so as to obtain the third high-frequency image. The enhanced image determination module is used to determine the target image after image enhancement based on the third high-frequency image and the grayscale image.

[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image enhancement method as described above.

[0015] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image enhancement method as described above.

[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the image enhancement method as described above.

[0017] The image enhancement method, apparatus, electronic device, and storage medium provided by the present invention obtain a first high-frequency image by acquiring a grayscale image to be enhanced and performing high-pass filtering. Then, based on the difference in grayscale values ​​of each pixel in the first high-frequency image, low-pass filtering is performed on the first high-frequency image to determine a second high-frequency image and a weight analysis map. Based on the target weight values ​​of each pixel in the weight analysis, the grayscale values ​​of pixels belonging to the high-frequency region in the second high-frequency image are extracted to obtain a third high-frequency image. Finally, the enhanced target image is obtained based on the third high-frequency image and the grayscale image. The target weight values ​​of each pixel included in the weight analysis map are used to characterize whether the pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region. In the technical solution of the present invention, since low-pass filtering can be performed on the difference in gray values ​​of the pixels in the denoised high-frequency image to obtain a weight analysis map, and then the weight analysis map can be used to guide the distinction between high-frequency details and noise in the image, this method is more sensitive to local gray value changes in the image and has more advantages in analyzing the degree of drastic local gray value changes in the image. Moreover, there is no need to construct an adaptive gain function to distinguish them. Therefore, it is easier to distinguish high-frequency details and noise in the image, and achieve accurate enhancement of the high-frequency detail part of the image while suppressing noise. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 This is one of the flowcharts illustrating the image enhancement method provided in this embodiment of the invention.

[0020] Figure 2 This is the second schematic flowchart of the image enhancement method provided in the embodiments of the present invention.

[0021] Figure 3 This is a schematic diagram of the image enhancement device provided in an embodiment of the present invention.

[0022] Figure 4 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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 embodiments of the present invention.

[0024] Digital image detail enhancement technology is a crucial step in the field of digital image processing, playing a vital role in enhancing image details and edges, and significantly improving image quality. As digital imaging systems have evolved, digital images are no longer limited to visible light images, infrared thermal images, infrared remote sensing images, radar radio frequency images, and X-ray images; they are now widely used in various fields such as industry, transportation, and medicine. However, images from other fields, compared to visible light images, often exhibit lower contrast, poorer sharpness, blurred edges, less detail, and higher noise levels, thus requiring noise suppression and detail enhancement processing.

[0025] In digital image processing, high-pass filters are used to extract high-frequency components of an image, such as the Sobel operator, Laplace operator, and Prewitt operator. These filters share the characteristic of being sensitive to changes in the value range within their neighborhood. The high-frequency components of an image passing through a high-frequency filter include both image details and noise. Related techniques typically attempt to construct an adaptive gain function that enhances image details and edge information while suppressing noise amplification. This requires the adaptive gain function to be able to distinguish between details and noise relatively accurately. However, experiments have shown that constructing an adaptive gain function that satisfies the above properties is extremely difficult; that is, constructing an adaptive gain function in practice is quite challenging, thus making it impossible to simultaneously achieve both detail enhancement and noise suppression.

[0026] In one specific technique, an X-ray image enhancement method is proposed, which includes a detail enhancement module. This module uses the Laplacian operator to convolve with the original image matrix f(i,j) to extract high-frequency components M(i,j). The extracted high-frequency components are then adaptively amplified and superimposed onto the original image matrix to highlight detail changes, as shown in the formula: g(i,j) = f(i,j) + λM(i,j). Here, λ is an adaptive high-frequency adjustment factor. In flat regions of the image, where high-frequency components are small, λ takes a smaller value; in high-frequency regions, where high-frequency components are large, λ takes a larger value. Based on these characteristics, image detail information can be enhanced while limiting noise amplification in the low-frequency region. However, the Laplacian operator has limited ability to distinguish between image noise and image detail information. Designing a reasonable adaptive high-frequency adjustment factor for the Laplacian high-frequency components is difficult, and such detail enhancement algorithms typically perform poorly, failing to simultaneously achieve noise suppression and detail enhancement.

[0027] Based on this, embodiments of the present invention provide an image enhancement method, apparatus, electronic device, and storage medium, which can solve the above-mentioned technical problems.

[0028] It should be noted that the execution subject of the embodiments of the present invention may be an image enhancement device, an electronic device including an image enhancement device, or a system including an image enhancement device or an electronic device, etc. The following embodiments will be described using an electronic device as an example.

[0029] The following is combined with Figures 1-2 The image enhancement method according to an embodiment of the present invention is described.

[0030] Figure 1 This is one of the flowcharts illustrating the image enhancement method provided by the present invention, such as... Figure 1 As shown, the method includes the following steps: S102, acquire the grayscale image to be enhanced, and perform high-pass filtering on the grayscale image to obtain the first high-frequency image corresponding to the grayscale image.

[0031] In this step, the target can be photographed in advance using the image acquisition device of the imaging system (such as a camera or video camera) to obtain the corresponding image. The image can be a visible light image, an infrared thermal image, an infrared remote sensing image, a radar radio frequency image, an X-ray image, etc. In addition, the image can be a digital image from any field, such as digital images from industrial, transportation, medical and other fields.

[0032] After obtaining the captured images, preprocessing can be performed. If the captured image is a visible light color image, preprocessing may include, but is not limited to, black level correction, bad pixel correction, depigmentation, white balance correction, and color correction. If the captured image is a grayscale image, preprocessing may include, but is not limited to, non-uniformity correction, bad pixel correction, and pot lid effect correction. Furthermore, if the captured image is a visible light color image, it can generally be represented as a YUV image, where the Y channel is the luminance channel and the UV channels are the chrominance channels. The Y channel image after preprocessing can generally be extracted as the grayscale image to be enhanced. If the captured image is directly a grayscale image, the preprocessed grayscale image can be used as the grayscale image to be enhanced.

[0033] It is understood that the grayscale image to be enhanced obtained above includes high-frequency details and noise, and the high-frequency details are not prominent. Therefore, it is necessary to enhance the high-frequency details and suppress the noise through the following embodiments. Specifically, a high-pass filter can be performed on the grayscale image to be enhanced. The high-pass filter is mainly used to extract the high-frequency components in the grayscale image to be enhanced, because the high-frequency components are likely to be the details of the image. When performing high-pass filtering, a high-pass filter can be used. The high-pass filter is usually implemented using an edge detection operator, such as the Roberts operator, Sobel operator, Laplace operator, Prewitt operator, etc. In this embodiment, the Laplace operator is preferred for high-pass filtering, which can improve the efficiency of high-pass filtering.

[0034] When using the Laplace operator for high-pass filtering, assuming the Laplace operator is a 3x3 filter, its filter kernel M can be expressed as follows:

[0035] Assuming the grayscale image to be enhanced is denoted as S, the high-frequency image, denoted as the first high-frequency image H1, can be obtained by convolving the grayscale image S with the filter kernel M. For the pixel S(i,j) in the i-th row and j-th column of the grayscale image S, the high-frequency image at the corresponding position is denoted as H1(i,j), and H1(i,j) is calculated as follows:

[0036] Where k and l are the row and column sizes of the filter window corresponding to the filter kernel or the row and column sizes of the filter size; S(k,l) represents the gray value of the element in the k-th row and l-th column within the filter window.

[0037] By performing convolution on each pixel in the grayscale image to be enhanced using the above formula, the high-frequency image corresponding to each pixel can be obtained. Combining these images yields the first high-frequency image.

[0038] S104, the first high-frequency image is subjected to low-pass filtering based on the difference in gray values ​​of each pixel in the first high-frequency image to determine the second high-frequency image and the weight analysis map; the weight analysis map includes the target weight value of each pixel in the first high-frequency image, and the target weight value is used to characterize whether the corresponding pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region.

[0039] In this step, after obtaining the first high-frequency image, the grayscale values ​​of each pixel in the first high-frequency image can also be obtained. Then, a low-pass filter can be constructed based on the differences in the grayscale values ​​of each pixel, and the first high-frequency image is subjected to low-pass filtering to remove high-frequency noise, resulting in a denoised second high-frequency image. Simultaneously, the low-pass filter constructed based on the differences in the grayscale values ​​of each pixel can also obtain the target weight value for each pixel. For example, the target weight value for each pixel can be obtained through the weights of the filter kernel in the low-pass filter (i.e., the values ​​of the elements in the filter kernel), and the target weight values ​​of each pixel are combined according to their corresponding pixel positions to obtain a weight analysis map. Here, the target weight value can be the average weight value obtained by averaging the weights of the filter kernel, or it can be the median value selected from the weights of the filter kernel, or the maximum value selected from the weights of the filter kernel, or other methods, which are not specifically limited here.

[0040] The target weight value of each pixel in the above weight analysis diagram can characterize the high-frequency or low-frequency characteristics of the pixel in the first high-frequency image, that is, whether the pixel belongs to the high-frequency region or the low-frequency region. By using the target weight values ​​in the weight analysis diagram, it is possible to distinguish whether the pixels in the denoised second high-frequency image (the high and low frequency regions in the second high-frequency image correspond to the high and low frequency regions in the first high-frequency image) belong to the high-frequency region or the low-frequency region. Among them, the high-frequency region is generally the region of important information such as details or edges, while the low-frequency region is generally the region of noise.

[0041] S106, Based on the target weight value of each pixel in the weight analysis diagram, extract the gray value corresponding to the pixel in the high-frequency region of the second high-frequency image to obtain the third high-frequency image.

[0042] In this step, after obtaining the weight analysis map and the target weight value of each pixel, the pixels belonging to the high-frequency region in the second high-frequency image can be found based on this. Then, the gray values ​​of the pixels in the high-frequency region in the second high-frequency image are extracted to obtain an image that only includes the high-frequency region, which is called the third high-frequency image.

[0043] In general, the gray values ​​of low-frequency regions of an image change slowly, and the high-frequency components extracted from these regions are more likely to be noise. In contrast, the gray values ​​of high-frequency regions generally change more drastically, and the high-frequency components extracted from these regions are more likely to be details and edge information. Therefore, the third high-frequency image obtained after extracting the gray values ​​of the high-frequency regions is an image of the details.

[0044] Furthermore, since the noise in the first high-frequency image is removed by the low-pass filter, and only the details of the high-frequency region are extracted in this step, the noise in the second high-frequency image is suppressed at the same time. Therefore, the method of this embodiment can more easily and better distinguish between the details and noise in the image, and can better suppress the noise.

[0045] S108, determine the target image after image enhancement based on the third high-frequency image and the grayscale image.

[0046] In this step, after obtaining the third high-frequency image containing only the details, the third high-frequency image can be superimposed on the grayscale image to be enhanced to enhance the details, resulting in the target image. Alternatively, the pixel positions of the details in the third high-frequency image can be located in the grayscale image to be enhanced, and the grayscale value at that pixel position in the grayscale image to be enhanced can be enhanced (e.g., by increasing the grayscale value) to obtain the target image with enhanced details. Other methods can also be used for detail enhancement, which are not specifically limited here.

[0047] In this embodiment, a first high-frequency image is obtained by high-pass filtering of the grayscale image to be enhanced. Then, a second high-frequency image and a weight analysis map are determined by low-pass filtering based on the grayscale value differences of each pixel in the first high-frequency image. The grayscale values ​​of pixels belonging to the high-frequency region in the second high-frequency image are extracted based on the target weight values ​​of each pixel in the weight analysis map to obtain a third high-frequency image. Finally, the enhanced target image is obtained based on the third high-frequency image and the grayscale image. The target weight values ​​of each pixel in the weight analysis map are used to characterize whether the pixel in the first high-frequency image belongs to the high-frequency or low-frequency region. In this invention, since a weight analysis map can be obtained by low-pass filtering based on the grayscale value differences of the pixels in the denoised high-frequency image, and then guided by this weight analysis map to distinguish high-frequency details and noise in the image, this method is more sensitive to local grayscale value changes in the image and has advantages in analyzing the degree of drastic local grayscale changes. Furthermore, it eliminates the need to construct an adaptive gain function for differentiation, thus making it easier to distinguish high-frequency details and noise in the image, achieving accurate enhancement of high-frequency detail parts of the image while suppressing noise.

[0048] The following example illustrates the specific process of performing low-pass filtering on a first high-frequency image to obtain a second high-frequency image and a weighted analysis graph.

[0049] In one embodiment, S104 above may include the following steps: Step A1: Determine the filtering window of the range filter based on the preset filtering radius and initial filtering size.

[0050] In this step, the value-domain filter, also known as a low-pass filter, is primarily constructed based on the differences between pixels in the first high-frequency image. When constructing a value-domain filter, it is generally necessary to construct the filter kernel corresponding to the filter window and the weight values ​​of each element within the filter window.

[0051] The following section explains the process of constructing the filter window / filter kernel size of the value range filter. The filter window of the value range filter can be specifically determined by the preset filter radius and the initial filter size.

[0052] The initial filter size refers to the size of the initial filter window, which can be set according to the actual situation. For example, if the initial filter size is 3×3, the initial filter window is a 3x3 matrix containing 9 elements.

[0053] The preset filter radius can be set according to actual conditions, such as 2, 3, or 4. The filter window of the value range filter can be obtained by adding the preset filter radius to the initial filter size. For example, with preset filter radii of 2, 3, or 4 and an initial filter size of 3×3, the filter window of the value range filter can be 5×5, 7×7, or 9×9.

[0054] The following explains the process of constructing the weight values ​​of each element within the filtering window of the range filter.

[0055] Step A2: Based on the difference between the gray values ​​of each element in the filtering window and the gray values ​​of each pixel in the first high-frequency image, determine the weight matrix corresponding to the filtering kernel of the value range filter; the gray value of each element is the gray value of the corresponding element at the corresponding position in the first high-frequency image, and the weight matrix includes the filtering weight value corresponding to each element in the filtering window.

[0056] In this step, after determining the filtering window of the value range filter, the filtering window can be mapped to the first high-frequency image. For example, taking a certain pixel in the first high-frequency image as an example, the position of the center pixel of the filtering window coincides with the pixel position of the pixel. Then, other elements in the filtering window can also be mapped to the first high-frequency image to obtain the gray value of each element at the corresponding position in the first high-frequency image, or it can also be called the pixel value.

[0057] After determining the grayscale value of each element at its corresponding position in the first high-frequency image, the grayscale value of the pixel corresponding to the filtering window can also be obtained. Then, the difference between the grayscale value of each element in the filtering window and the grayscale value of the pixel can be calculated, and the weight value corresponding to each element in the filtering window can be obtained through the difference, which is denoted as the filtering weight value.

[0058] For example, assuming any image I to be filtered has a preset filtering radius of r, for the pixel in the i-th row and j-th column of the first high-frequency image, its corresponding filtering window can be represented as {k, l | ir ≤ k ≤ i + r, jr ≤ l ≤ j + r}. The filtering weight value of each element in this filtering window can be calculated using the following formula:

[0059] Where ω(k,l) represents the filtering weight value of the element in the k-th row and l-th column within the filtering window; σ represents the standard deviation, which needs to be adjusted according to the bit depth of the imaging system. Taking an 8-bit imaging system as an example, its value range can be [15,25]; I(k,l) represents the gray value of the element in the k-th row and l-th column within the filtering window; I(k,l) represents the gray value of the pixel in the i-th row and j-th column of the first high-frequency image.

[0060] The filter weight values ​​of each element within the filter window can be calculated using the above formula. Then, the filter weight values ​​of each element within the filter window are combined into a matrix to obtain the weight matrix of the filter kernel in the range filter. It can be understood that the form of the weight matrix of the filter kernel of the range filter is similar to that of the filter kernel of the high-pass filter mentioned above, where the filter weight value of each element is the value of each element.

[0061] Step A3: Use a value range filter to perform low-pass filtering on the first high-frequency image to determine the second high-frequency image and the weight analysis map.

[0062] In this step, as described above, each pixel has a filter window / filter kernel for low-pass filtering. The weight matrix corresponding to the filter window of each pixel can be calculated using the formula for calculating the filter weight value, thus obtaining the filter kernel corresponding to each pixel. In other words, each pixel corresponds to a weight matrix or a filter kernel, and the filter kernels corresponding to pixels with different gray values ​​may also be different.

[0063] By using the defined filtering window and the filtering weight values ​​of each element within the filtering window, the constructed range filter, i.e., the low-pass filter, can be obtained. Optionally, for each pixel in the first high-frequency image, the pixel is low-pass filtered using the weight matrix corresponding to that pixel in the range filter to determine the second high-frequency image; based on the weight matrix corresponding to each pixel in the range filter, the target weight value for each pixel is determined, and a weight analysis map is determined based on the target weight values ​​of each pixel.

[0064] Specifically, the weight matrix of the filter kernel corresponding to each pixel in the value range filter can be used to perform convolution processing on the corresponding pixels in the first high-frequency image to achieve low-pass filtering processing of the pixel, that is, to filter out the high-frequency noise present in the first high-frequency image, thereby suppressing the noise and obtaining the high-frequency image corresponding to the pixel. The high-frequency images of each point in the first high-frequency image can be combined to obtain the second high-frequency image.

[0065] For example, for pixel H1(i,j) in the i-th row and j-th column of the first high-frequency image H1, the high-frequency image at the corresponding position is denoted as H2(i,j), and H2(i,j) is calculated as shown in the following formula:

[0066] Where H1(k,l) represents the gray value of the element in the k-th row and l-th column of the filtering window in the first high-frequency image; ω(k,l) represents the filtering weight value of the element in the k-th row and l-th column of the filtering window.

[0067] Furthermore, for each pixel in the first high-frequency image, the average weight value of each pixel can be obtained through the weight matrix of the filter kernel corresponding to each pixel in the value range filter. Optionally, the average weight value of each filter weight value in the weight matrix corresponding to each pixel can be calculated to determine the average weight value corresponding to each pixel, and the average weight value of each pixel can be used as the target weight value of the corresponding pixel. That is, the filter weight values ​​of each element in the filter window corresponding to each pixel in the first high-frequency image can be summed, and the average weight value can be calculated. The obtained average weight value is recorded as the target weight value corresponding to that pixel. Then, the target weight values ​​of all pixels in the first high-frequency image can be arranged according to their respective pixel positions to obtain the weight analysis map.

[0068] For example, the target weight value for each pixel in the first high-frequency image can be calculated using the following formula:

[0069] Where W1(i,j) represents the target weight value of the element in the i-th row and j-th column of the first high-frequency image; ω(k,l) represents the filter weight value of the element in the k-th row and l-th column within the filter window.

[0070] The target weight value of each pixel in the first high-frequency image can be calculated using the above formula.

[0071] As described above, the value range filter constructed in this embodiment determines the filter kernel weight matrix based on the difference in image grayscale values. It can better reflect the trend of numerical changes within the filter, that is, it is more sensitive to numerical changes, which is more conducive to distinguishing noise from image details and edges.

[0072] In this embodiment, the filtering window and weight matrix of the filtering kernel of the value range filter are constructed based on the gray value differences of each pixel in the first high-frequency image. This constructed value range filter is determined by the gray value changes / differences within the first high-frequency image itself, making it more sensitive to local numerical changes in the first high-frequency image. This gives it an advantage in analyzing situations with drastic local gray value changes, making it easier to distinguish between details and noise in the first high-frequency image. Simultaneously, low-pass filtering further suppresses high-frequency noise in the first high-frequency image, improving the accuracy of subsequently obtained details. Furthermore, the second high-frequency image is obtained by performing low-pass filtering on each pixel in the first high-frequency image using the weight matrix of the constructed value range filter kernel, thus balancing noise suppression and detail enhancement. Further, the target weight value for each pixel is determined by the average of the filtering weight values ​​of each element in the weight matrix. This better represents the degree of gray value change within the filtering window of each pixel, thereby maximizing the limitation of image noise amplification while enhancing image detail.

[0073] The following example illustrates the specific process of extracting grayscale values ​​from high-frequency regions using target weight values ​​in a weighted analysis graph.

[0074] In one embodiment, S106 above may include the following steps: Step B1: Compare the target weight value corresponding to each pixel in the second high-frequency image with the preset weight threshold.

[0075] The preset weight threshold can be set according to the actual situation, for example, its value range can be [0.3, 0.7].

[0076] In this step, the degree of drastic change in the grayscale value of each pixel in the second high-frequency image is inversely proportional to the target weight value of that pixel in the weight analysis graph. That is, the more drastic the change in the grayscale value of a pixel in the second high-frequency image, the smaller its corresponding target weight value. Furthermore, the grayscale value changes slowly in the low-frequency region of the image, and the high-frequency components extracted from this region are more likely to be noise; the grayscale value changes drastically in the high-frequency region, and the high-frequency components extracted from this region are more likely to be details and edge information. Based on this, in this embodiment, an appropriate weight threshold can be set to distinguish between high-frequency and low-frequency regions in the second high-frequency image.

[0077] Specifically, after obtaining the weight analysis map, the target weight value of each pixel in the second high-frequency image can be obtained. Then, the target weight value of each pixel can be compared with the preset weight threshold to determine whether the target weight value of each pixel is less than the weight threshold.

[0078] Step B2: If the target weight value of any pixel in the second high-frequency image is less than the weight threshold, then the pixel is determined to be a pixel belonging to the high-frequency region, and the gray value corresponding to the pixel in the second high-frequency image is extracted to obtain the third high-frequency image.

[0079] In this step, by determining whether the target weight value of each pixel is less than the weight threshold, the judgment result for each pixel can be obtained. Suppose that the judgment result for a pixel in the second high-frequency image is that its target weight value is less than the weight threshold, it indicates that the grayscale values ​​around that pixel change drastically, and therefore that pixel belongs to the high-frequency region of the second high-frequency image. Using this method, all pixels in the second high-frequency image whose target weight values ​​are less than the weight threshold can be obtained. The grayscale values ​​of these pixels in the second high-frequency image are then extracted to obtain the high-frequency image of the details, which is denoted as the third high-frequency image.

[0080] Optionally, the third high-frequency image can be obtained by filling the corresponding pixel position in a preset image with the gray value of any pixel in the second high-frequency image, thereby obtaining the third high-frequency image; the size of the preset image is the same as the size of the second high-frequency image. Alternatively, the gray values ​​of pixels in the second high-frequency image whose target weight value is not less than (greater than or equal to) a weight threshold can be removed to obtain the third high-frequency image.

[0081] In addition, if the judgment result of a certain pixel in the second high-frequency image is that the target weight value of the pixel is not less than (greater than or equal to) the weight threshold, it means that the gray value change around the pixel is relatively smooth, and the pixel belongs to the low-frequency region of the second high-frequency image.

[0082] For example, the third high-frequency image can be extracted using the following formula:

[0083] Where H3(i,j) represents the gray value of the pixel in the i-th row and j-th column of the third high-frequency image; H2(i,j) represents the gray value of the pixel in the i-th row and j-th column of the second high-frequency image; W(i,j) represents the target weight value of the pixel in the i-th row and j-th column; τ W This represents the weight threshold.

[0084] It can be seen that the pixels in the second high-frequency image with target weight values ​​less than the weight threshold are pixels in the high-frequency region, and their gray values ​​need to be retained in the third high-frequency image. On the other hand, the pixels in the second high-frequency image with target weight values ​​greater than or equal to the weight threshold are pixels in the low-frequency region, and their gray values ​​are 0 in the third high-frequency image, that is, the pixels in the low-frequency region are removed, and the third high-frequency image with only high-frequency details is obtained.

[0085] In this embodiment, the target weight value and weight threshold of each pixel in the second high-frequency image are compared to distinguish the pixels in the high-frequency region or the low-frequency region. The gray value of the pixels in the high-frequency region is extracted to obtain the high-frequency image of the details. This method is simple and intuitive, so it can easily and quickly distinguish the details and noise in the second high-frequency image.

[0086] The following examples illustrate the specific process of obtaining an enhanced target image through a grayscale image and a third high-frequency image.

[0087] In one embodiment, the above S108 may include the following steps: Step C1: Obtain the preset linear gain coefficient.

[0088] The linear gain coefficient is mainly used to enhance the details in the image. It can be preset or adjusted according to the user's needs.

[0089] The range of values ​​for the aforementioned linear gain coefficient can be, for example, [0.2, 2]. Users can pre-select the desired value within this range and input it into the electronic device. The electronic device will then obtain the preset linear gain coefficient and display an enhanced detail image based on the selected coefficient. Users can also change the value of the linear gain coefficient as needed to display the desired enhanced detail image. Alternatively, the electronic device can pre-select a default value from the aforementioned range as the preset linear gain coefficient.

[0090] Step C2: Multiply the third high-frequency image and the linear gain coefficient, and then superimpose it with the grayscale image to obtain the target image.

[0091] In this step, after obtaining the preset linear gain coefficient, the third high-frequency image from which the high-frequency details are extracted can be multiplied by the linear gain coefficient and then superimposed onto the grayscale image to be enhanced to obtain the target image with enhanced details.

[0092] For example, the target image can be obtained using the following formula: D(i,j)=S(i,j)+α·H3(i,j).

[0093] Where D(i,j) represents the gray value of the pixel in the i-th row and j-th column of the target image; H3 represents the third high-frequency image; α represents the linear gain coefficient; by multiplying the third high-frequency image by the linear gain coefficient and then superimposing it onto the original gray-scale image to be enhanced, the target image with enhanced details can be obtained.

[0094] In this embodiment, the target image with enhanced details is obtained by multiplying the high-frequency image of the detailed portion with a linear gain coefficient and then superimposing it onto the grayscale image to be enhanced. This method can enhance image details while suppressing noise. Furthermore, the linear gain coefficient can be set according to user needs, allowing for personalized detail enhancement effects.

[0095] After enhancing the grayscale image to obtain the target image, the target image may contain illegal grayscale values, including negative values ​​and values ​​exceeding the system maximum value (the maximum grayscale value supported by the electronic device). This can lead to the enhanced image displayed on the electronic device not meeting the requirements. Therefore, it is necessary to standardize the enhanced target image to limit the grayscale values ​​within a certain range. The following examples illustrate the specific process of standardizing the target image.

[0096] Figure 2 This is a second schematic flowchart of the image enhancement method provided in this embodiment of the invention. See also... Figure 2 As shown, the above method may further include the following steps: S202, standardize the gray values ​​of the target image according to the preset maximum gray value to obtain the standardized target image.

[0097] The preset maximum grayscale value is the maximum grayscale value supported by the electronic device, and the target image can be standardized using the following formula:

[0098] Where D' represents the target image after standardization; D represents the target image; min(D) represents the minimum value / minimum grayscale value in the target image D; max(D) represents the maximum value / maximum grayscale value in the target image D; and MAX represents the maximum grayscale value supported by the electronic device.

[0099] In this embodiment, by standardizing the target image for detail enhancement, the problem of data overflow can be avoided, making the final displayed detail-enhanced image more consistent with the actual situation.

[0100] As can be seen from the above description of the embodiments, in the embodiments of the present invention, after the grayscale image to be enhanced / source image is passed through a high-pass filter, the high-frequency components obtained by the high-pass filter are filtered by the constructed low-pass filter / value range filter to remove some noise in the high-frequency components, and the high and low frequency regions are distinguished by the weight analysis graph of the value range filter, and effective details are further extracted from the denoised high-frequency components.

[0101] It can be seen that the technical solution of the embodiments of the present invention has the following technical effects: Unlike bilateral filters used to filter high-frequency images, the technical solution of this invention uses a low-pass filter / range filter whose filtering weights are entirely determined by numerical changes. When a bilateral filter is applied to a natural image, it can fully utilize its edge-preserving performance to filter noise in flat areas. However, when a bilateral filter is applied to a high-frequency image that has passed through a high-frequency filter, its excessively strong spatial filtering performance weakens the sensitivity of the low-pass filter to numerical changes, making it difficult for the bilateral filter to distinguish image details from noise, and also increasing the design difficulty of the adaptive high-frequency adjustment factor. The technical solution of this invention differs from the bilateral filter in that the weight matrix of the filter kernel of the range filter is determined only by the difference in grayscale values ​​between pixels in the image. Therefore, the range filter is more sensitive to local numerical changes in the image and has an advantage in analyzing the degree of drastic local grayscale changes, making it easier to distinguish details from noise in high-frequency images.

[0102] Meanwhile, experiments revealed that in the calculation of the range filter, the average value of the weight matrix of the filter window corresponding to each pixel can effectively represent the drastic change in numerical / grayscale values ​​within the window. If there is no grayscale change within the filter window, the average weight value / target weight value of that pixel will be a maximum of 1, as shown in the aforementioned formulas for calculating filter weight and target weight. Conversely, if there is a drastic change in numerical / grayscale values ​​within the filter window, the exponential part of the filter weight calculation formula will decrease rapidly, leading to a decrease in the weight value and consequently a decrease in the average weight value / target weight value. Therefore, when a pixel is located at image details or edges, the average weight value / target weight value will decrease rapidly. The average weight value corresponding to each pixel can be used to construct a weight analysis graph. Using the above numerical relationships, a weight threshold can be set to distinguish between low-frequency and high-frequency regions in the denoised high-frequency image. The high-frequency region in the denoised high-frequency image is retained as effective detail and then superimposed onto the source image with a fixed linear gain. This approach maximizes the limitation of image noise amplification while enhancing image detail, achieving a balance between detail enhancement and noise suppression.

[0103] The image enhancement apparatus provided by the present invention will be described below. The image enhancement apparatus described below can be referred to in correspondence with the image enhancement method described above.

[0104] Figure 3 This is a schematic diagram of the image enhancement device provided in an embodiment of the present invention. See also: Figure 3 As shown, the device may include the following modules: The acquisition module 310 is used to acquire the grayscale image to be enhanced and perform high-pass filtering on the grayscale image to obtain the first high-frequency image corresponding to the grayscale image; The low-pass filtering module 320 is used to perform low-pass filtering on the first high-frequency image based on the difference in gray values ​​of each pixel in the first high-frequency image, and to determine the second high-frequency image and the weight analysis map. The weight analysis map includes the target weight value of each pixel in the first high-frequency image. The target weight value is used to characterize whether the corresponding pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region. The extraction module 330 is used to extract the gray values ​​corresponding to the pixels belonging to the high-frequency region in the second high-frequency image according to the target weight values ​​of each pixel in the weight analysis map, so as to obtain the third high-frequency image. The enhanced image determination module 340 is used to determine the target image after image enhancement based on the third high-frequency image and the grayscale image.

[0105] In one embodiment, the low-pass filter module 320 is specifically used for

[0106] Based on the preset filtering radius and initial filtering size, the filtering window of the value range filter is determined; based on the difference between the gray values ​​of each element in the filtering window and the gray values ​​of each pixel in the first high-frequency image, the weight matrix corresponding to the filtering kernel of the value range filter is determined; the gray value of each element is the gray value of the corresponding element at the corresponding position in the first high-frequency image, and the weight matrix includes the filtering weight value corresponding to each element in the filtering window; the value range filter is used to perform low-pass filtering on the first high-frequency image to determine the second high-frequency image and the weight analysis map.

[0107] Optionally, each pixel corresponds to a weight matrix; the low-pass filter module 320 described above is specifically used for

[0108] For each pixel in the first high-frequency image, the pixel is low-pass filtered using the weight matrix corresponding to the pixel in the value range filter to determine the second high-frequency image; according to the weight matrix corresponding to each pixel in the value range filter, the target weight value corresponding to each pixel is determined, and the weight analysis map is determined according to the target weight value of each pixel.

[0109] Optionally, the aforementioned low-pass filter module 320 is specifically used for

[0110] The average value of each filter weight in the weight matrix corresponding to each pixel is processed to determine the average weight of each pixel, and the average weight of each pixel is used as the target weight value of the corresponding pixel.

[0111] In one embodiment, the extraction module 330 is specifically used for

[0112] The target weight value corresponding to each pixel in the second high-frequency image is compared with the preset weight threshold. If the target weight value of any pixel in the second high-frequency image is less than the weight threshold, then any pixel is determined to be a pixel in the high-frequency region, and the gray value corresponding to any pixel in the second high-frequency image is extracted to obtain the third high-frequency image.

[0113] In one embodiment, the enhanced image determination module 340 described above is specifically used for

[0114] Obtain the preset linear gain coefficient; multiply the third high-frequency image and the linear gain coefficient, and then superimpose them with the grayscale image to obtain the target image.

[0115] In one embodiment, the above-mentioned apparatus may further include: The standardization processing module is used to standardize the gray values ​​of the target image according to the preset maximum gray value to obtain the standardized target image.

[0116] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0117] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute an image enhancement method, which includes: acquiring a grayscale image to be enhanced and performing high-pass filtering on the grayscale image to obtain a first high-frequency image corresponding to the grayscale image; performing low-pass filtering on the first high-frequency image based on the grayscale value differences of each pixel in the first high-frequency image to determine a second high-frequency image and a weight analysis map; the weight analysis map includes a target weight value for each pixel in the first high-frequency image, the target weight value being used to characterize whether the corresponding pixel in the first high-frequency image belongs to a high-frequency region or a low-frequency region; extracting the grayscale values ​​corresponding to pixels belonging to the high-frequency region in the second high-frequency image based on the target weight values ​​of each pixel in the weight analysis map to obtain a third high-frequency image; and determining the target image after image enhancement based on the third high-frequency image and the grayscale image.

[0118] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0119] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the image enhancement method provided by the above methods. The method includes: acquiring a grayscale image to be enhanced and performing high-pass filtering on the grayscale image to obtain a first high-frequency image corresponding to the grayscale image; performing low-pass filtering on the first high-frequency image based on the grayscale value differences of each pixel in the first high-frequency image to determine a second high-frequency image and a weight analysis map; the weight analysis map includes a target weight value for each pixel in the first high-frequency image, the target weight value being used to characterize whether the corresponding pixel in the first high-frequency image belongs to a high-frequency region or a low-frequency region; extracting the grayscale values ​​corresponding to pixels belonging to a high-frequency region in the second high-frequency image based on the target weight values ​​of each pixel in the weight analysis map to obtain a third high-frequency image; and determining the target image after image enhancement based on the third high-frequency image and the grayscale image.

[0120] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs the image enhancement method provided by the methods described above. The method includes: acquiring a grayscale image to be enhanced and performing high-pass filtering on the grayscale image to obtain a first high-frequency image corresponding to the grayscale image; performing low-pass filtering on the first high-frequency image based on the grayscale value differences of each pixel in the first high-frequency image to determine a second high-frequency image and a weight analysis map; the weight analysis map includes a target weight value for each pixel in the first high-frequency image, the target weight value being used to characterize whether the corresponding pixel in the first high-frequency image belongs to a high-frequency region or a low-frequency region; extracting the grayscale values ​​corresponding to pixels belonging to a high-frequency region in the second high-frequency image based on the target weight values ​​of each pixel in the weight analysis map to obtain a third high-frequency image; and determining the target image after image enhancement based on the third high-frequency image and the grayscale image.

[0121] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0122] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image enhancement method, characterized in that, include: Obtain the grayscale image to be enhanced, and perform high-pass filtering on the grayscale image to obtain the first high-frequency image corresponding to the grayscale image; The first high-frequency image is subjected to low-pass filtering based on the difference in grayscale values ​​of each pixel in the first high-frequency image to determine the second high-frequency image and the weight analysis map; the weight analysis map includes the target weight value of each pixel in the first high-frequency image, and the target weight value is used to characterize whether the corresponding pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region. Based on the target weight value of each pixel in the weight analysis diagram, the gray value corresponding to the pixel in the high-frequency region in the second high-frequency image is extracted to obtain the third high-frequency image; Based on the third high-frequency image and the grayscale image, determine the target image after image enhancement; The step of performing low-pass filtering on the first high-frequency image based on the grayscale value differences of each pixel in the first high-frequency image to determine the second high-frequency image and the weight analysis map includes: The filtering window of the range filter is determined based on the preset filtering radius and initial filtering size. The weight matrix corresponding to the filtering kernel of the value range filter is determined based on the difference between the gray values ​​of each element in the filtering window and the gray values ​​of each pixel in the first high-frequency image; the gray value of each element is the gray value of the corresponding element at the corresponding position in the first high-frequency image, and the weight matrix includes the filtering weight value corresponding to each element in the filtering window. The first high-frequency image is low-pass filtered using the value range filter to determine the second high-frequency image and the weight analysis map.

2. The image enhancement method according to claim 1, characterized in that, Each pixel corresponds to a weight matrix; the step of using the value range filter to perform low-pass filtering on the first high-frequency image to determine the second high-frequency image and the weight analysis map includes: For each pixel in the first high-frequency image, the pixel is low-pass filtered using the weight matrix corresponding to the pixel in the value range filter to determine the second high-frequency image; Based on the weight matrix corresponding to each pixel in the value range filter, the target weight value corresponding to each pixel is determined, and the weight analysis map is determined based on the target weight value of each pixel.

3. The image enhancement method according to claim 2, characterized in that, The step of determining the target weight value corresponding to each pixel based on the weight matrix corresponding to each pixel in the value range filter includes: The average value of each filter weight in the weight matrix corresponding to each pixel is processed to determine the average weight value corresponding to each pixel, and the average weight value of each pixel is used as the target weight value of the corresponding pixel.

4. The image enhancement method according to any one of claims 1 to 3, characterized in that, The step of extracting the gray values ​​corresponding to pixels belonging to the high-frequency region in the second high-frequency image according to the weight analysis map to obtain the third high-frequency image includes: The target weight value corresponding to each pixel in the second high-frequency image is compared with a preset weight threshold. If the target weight value of any pixel in the second high-frequency image is less than the weight threshold, then the pixel is determined to be a pixel in the high-frequency region, and the gray value corresponding to the pixel in the second high-frequency image is extracted to obtain the third high-frequency image.

5. The image enhancement method according to any one of claims 1 to 3, characterized in that, The step of determining the enhanced target image based on the third high-frequency image and the grayscale image includes: Obtain the preset linear gain coefficient; The target image is obtained by multiplying the third high-frequency image and the linear gain coefficient, and then superimposing them on the grayscale image.

6. The image enhancement method according to any one of claims 1 to 3, characterized in that, The method further includes: The grayscale values ​​of the target image are standardized according to the preset maximum grayscale value to obtain the standardized target image.

7. An image enhancement device, characterized in that, include: The acquisition module is used to acquire the grayscale image to be enhanced and perform high-pass filtering on the grayscale image to obtain the first high-frequency image corresponding to the grayscale image; The low-pass filtering module is used to perform low-pass filtering on the first high-frequency image based on the difference in grayscale values ​​of each pixel in the first high-frequency image, and to determine the second high-frequency image and the weight analysis map; the weight analysis map includes the target weight value of each pixel in the first high-frequency image, and the target weight value is used to characterize whether the corresponding pixel in the first high-frequency image belongs to the high-frequency region or the low-frequency region. The extraction module is used to extract the gray values ​​corresponding to the pixels belonging to the high-frequency region in the second high-frequency image according to the target weight values ​​of each pixel in the weight analysis map, so as to obtain the third high-frequency image. An enhanced image determination module is used to determine the target image after image enhancement based on the third high-frequency image and the grayscale image; The low-pass filtering module is specifically used to determine the filtering window of the value range filter based on a preset filtering radius and an initial filtering size; to determine the weight matrix corresponding to the filtering kernel of the value range filter based on the difference between the gray values ​​of each element in the filtering window and the gray values ​​of each pixel in the first high-frequency image; the gray value of each element is the gray value of the corresponding element at the corresponding position in the first high-frequency image, and the weight matrix includes the filtering weight values ​​corresponding to each element in the filtering window; and to perform low-pass filtering processing on the first high-frequency image using the value range filter to determine the second high-frequency image and the weight analysis map.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the image enhancement method as described in any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the image enhancement method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image denoising method

    CN106056555A

  • An image enhancement method and apparatus

    CN106228520A