Method and system for enhancing image quality

By calculating and integrating multi-directional gradient values ​​and non-directional texture filtering results in image processing, the problems of image boundary recognition errors and noise residue in the existing technology are solved, effective retention of image boundaries and noise removal are achieved, and the quality of the image is improved. Overall quality.

CN119359590AActive Publication Date: 2025-01-24ZHEJIANG XINMAI SILICON CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411901418.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-01-24
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In the strengthening of image quality in the prior art, it is difficult to effectively identify and retain image boundaries, resulting in boundary loss or noise residue, which in turn affects the overall quality of the image.

Method used

By extracting the brightness component from the video stream, the first gradient value of each pixel in multiple preset directions is calculated, and combined with the range direction gradient value to determine the overall value of the filter, perform directional filtering; at the same time, perform Gaussian filtering on the brightness component, The gradient measure of the non-directional texture is subtracted to perform non-directional texture filtering; finally, the results of directional filtering and non-directional texture filtering are integrated through the overall gradient range.

Benefits of technology

Effectively retain the image boundary, remove noise, improve the overall quality of the image, ensure that the boundary is complete and noise removes clean.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359590A_ABST
    Figure CN119359590A_ABST
Patent Text Reader

Abstract

The invention discloses an image quality enhancement method and system, and relates to the technical field of image processing, and the method comprises the steps: extracting a brightness component of each frame from a video stream, and calculating a result image after the directional filtering of the brightness component through boundary filtering; calculating the image of the brightness component after the non-directional filtering; and calculating the overall gradient range of the image, and integrating the result image after the directional filtering and the image after the non-directional texture filtering through the overall gradient range. According to the method and the system disclosed by the invention, the image boundary is reserved, and the noise is also completely removed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for enhancing image quality. Background Art

[0002] As for the technology of image quality enhancement, the existing solutions are mostly single filtering algorithm effects, without considering the properties of the image itself for weighted combination, or there are missing boundaries in the image after filtering, or there are boundaries preserved but a lot of noise remains, which directly leads to the loss of pheromones in the image itself and may also cause misrecognition, resulting in pixels that do not exist in the image.

[0003] Existing algorithms have great errors in image boundary recognition. They cannot fully recognize image boundaries, and there are too many or too few points. When boundary filtering and non-directional filtering are combined, there is a lack of truly effective methods for recognition. For example, median filtering will lead to boundary loss, and limiting filtering will lead to residual noise. Summary of the invention

[0004] The present invention aims at at least one disadvantage of the prior art, and proposes a method for enhancing image quality, comprising the following steps: extracting a brightness component of each frame from a video stream, and calculating a first gradient value of each pixel of the brightness component in multiple preset directions; using a predefined function to integrate the first gradient values ​​of each direction, and calculating a range direction gradient value of each pixel; combining the first gradient value and the range direction gradient value to determine a filtering overall value in each direction; subtracting the filtering overall value in each direction from the brightness component to obtain a result image after directional filtering;

[0005] Performing Gaussian filtering on the brightness component to obtain a first filtering component, performing the same Gaussian filtering on the square of the brightness component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain a gradient measure of the non-directional texture, calculating a gradient value of the non-directional texture according to the gradient measure of the non-directional texture, and adding the gradient value of the non-directional texture to the first filtering component to obtain an image of the brightness component after non-directional filtering;

[0006] The overall gradient range of the image is calculated, and the result image after directional filtering and the image after non-directional texture filtering are integrated through the overall gradient range.

[0007] A system for enhancing image quality is further proposed, comprising the following structure:

[0008] The pre-processing unit implements the following method: extracting the brightness component of each frame from the video stream;

[0009] The boundary filtering unit implements the following method: calculating the first gradient value of each pixel of the brightness component in multiple preset directions; using a predefined function to integrate the first gradient values ​​of each direction to calculate the range direction gradient value of each pixel; combining the first gradient value and the range direction gradient value to determine the overall filtering value of each direction; subtracting the overall filtering value of each direction from the brightness component to obtain a result image after directional filtering;

[0010] The non-directional texture filtering unit implements the following method: performing Gaussian filtering on the brightness component to obtain a first filtering component, performing the same Gaussian filtering on the square of the brightness component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain a gradient measure of the non-directional texture, calculating a gradient value yd of the non-directional texture according to the gradient measure ff of the non-directional texture, and adding the first filtering component fn to the gradient value of the non-directional texture to obtain an image y2 of the brightness component after non-directional filtering;

[0011] The gradient integration unit implements the following method: calculating the overall gradient range of the image, and integrating the result image after directional filtering and the image after non-directional texture filtering through the overall gradient range.

[0012] The present invention mainly makes the distinction between boundaries and textures in image processing more effective through processes such as obtaining boundary filtering values, obtaining non-directional texture filtering values ​​and gradient integration processing, and the boundaries are kept intact and noise is removed cleanly. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0014] Figure 1 It is a general flow chart of the method for image quality enhancement. DETAILED DESCRIPTION

[0015] The present invention is further described in detail below in conjunction with the embodiments. The following embodiments are explanations of the present invention and the present invention is not limited to the following embodiments. Any changes or substitutions within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

[0016] Embodiment 1: A method for enhancing image quality, comprising the following steps:

[0017] Extract the brightness component of each frame from the video stream, calculate the first gradient value of each pixel of the brightness component in multiple preset directions; use a predefined function to integrate the first gradient values ​​of each direction to calculate the range direction gradient value of each pixel; combine the first gradient value and the range direction gradient value to determine the overall filtering value of each direction; subtract the overall filtering value of each direction from the brightness component to obtain the result image after directional filtering;

[0018] Performing Gaussian filtering on the brightness component to obtain a first filtering component, performing the same Gaussian filtering on the square of the brightness component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain a gradient measure of the non-directional texture, calculating a gradient value of the non-directional texture according to the gradient measure of the non-directional texture, and adding the gradient value of the non-directional texture to the first filtering component to obtain an image of the brightness component after non-directional filtering;

[0019] The overall gradient range of the image is calculated, and the image after directional filtering and the image after non-directional texture filtering are integrated through the overall gradient range.

[0020] (I) Boundary filtering is performed on the brightness component, wherein the multiple preset directions include: above, below, left, right and four diagonal directions of the pixel. Specifically, the method for calculating the first gradient value of each pixel of the brightness component in the multiple preset directions includes: setting a corresponding filter for each direction, and the filters for the eight directions are as follows:

[0021] Find the N filter of the gradient above the pixel to detect the influence of the upper pixel on the center pixel;

[0022] The S filter that finds the gradient below the pixel is used to detect the influence of the pixel below on the center pixel;

[0023] The E filter that finds the gradient of the pixel to the right is used to detect the influence of the right pixel on the center point;

[0024] The W filter that finds the gradient to the left of the pixel is used to detect the influence of the left pixel on the center point;

[0025] The SW filter that finds the gradient of the pixel 135 degrees downward is used to detect the impact of the 135-degree downward direction on the central pixel;

[0026] The NW filter that finds the gradient of the pixel 45 degrees above is used to detect the influence of the 45-degree filter above on the center pixel;

[0027] Find the NE filter of the gradient of the pixel 135 degrees above the oblique direction, which is used to detect the central pixel of the pixel 135 degrees above the oblique direction;

[0028] Find the SE filter of the pixel 45 degrees downward, which is used to detect the impact of the 45-degree downward filter on the center point.

[0029] , ,

[0030] , ,

[0031] , ,

[0032] , ,

[0033] The filtering formula is as follows. The gradient value images fn, fs, fe, fw, fsw, fnw, fne, and fse in eight directions are calculated by the above filter:

[0034] , ,

[0035] , ,

[0036] , ,

[0037] , ,

[0038] Exemplarily, commonly used operators include Sobel operator, Prewitt operator, Scharr operator, etc. A filter in each direction is applied to the Y component image, and a convolution operation is performed to obtain a gradient value image in that direction.

[0039] The method of using the predefined function u to integrate the first gradient values ​​in each direction to calculate the range direction gradient value of each pixel includes calculating by the following formula:

[0040] , , , ,

[0041] , ,

[0042] , ,

[0043] Among them, u is a configurable value function, the default value is 1.5, the smaller the u value is, the greater the directionality is, the larger the u value is, the more a non-directional filter is calculated later, ln, le, ls, lw, lsw, lnw, lne, lse are the range direction gradients in each direction respectively. The configurable value function u (predefined function) is used to process the gradient values ​​from different directions, which may be a simple weighted summation, maximum value selection or other more complex methods. This function should consider the importance or weight of each direction and can be adjusted according to the specific application scenario.

[0044] Combine the first gradient value and the range direction gradient value to determine the overall filtering value in each direction; including: find the product of the first gradient value in each direction and the range direction gradient value, add the products in all directions, and control the sum value through configurable parameters. Subtract the overall filtering value in each direction from the brightness component to obtain the result image after directional filtering. The specific calculation formula is as follows:

[0045] y1out is the result image after directional filtering, k is a configurable value, the default value is 1, the larger the k configuration, the less noise after directional image filtering, and the cleaner the image. For example, fn*ln in the formula is the influence of the upper point of a single pixel in the image on the image, fs*ls is the influence of the lower point of a single pixel in the image on the image, and so on.

[0046] ,

[0047] The above formula is equivalent to the overall value of the image to be filtered. Finally, the overall value is subtracted from the brightness component y to obtain the result image y1out after directional filtering.

[0048] ,

[0049] (ii) Perform non-directional texture filtering on the brightness component y and calculate the non-directional texture filter.

[0050] Step 1: Perform Gaussian filtering on the brightness component to obtain a first filtered component fk, as shown in the following formula.

[0051] ,

[0052] Here, k is a Gaussian filter whose parameters can be configured empirically.

[0053] Step 2: Perform the same Gaussian filter on the square of the brightness component to obtain a second filter component. Subtract the square of the first filter component fk from the second filter component to obtain the gradient metric ff of the non-directional texture, as shown in the following formula.

[0054] ,

[0055] ff is the gradient measure of the non-directional texture of a single pixel in the image. According to step 1 above, y is subjected to a Gaussian filter to obtain the first filtered component, which removes part of the noise. Then, according to step 2, filtering is performed to obtain a gradient measure of the non-directional texture.

[0056] The above steps calculate the local variance around each pixel. ff actually represents the gradient measure or intensity difference within the region, which reflects the existence of non-directional texture.

[0057] Step 3, calculating the gradient value of the non-directional texture according to the gradient metric of the non-directional texture, and adding the gradient value of the non-directional texture to the first filtering component to obtain the non-directional filtered image of the brightness component.

[0058] ,

[0059] ,

[0060] Among them, yd is equivalent to the final gradient of the non-directional texture, j defaults to 1, j is a configurable value used to adjust the degree of non-directional texture removal, the larger the j value is, the smaller the non-directional texture removal is, and max(ff,5) is to limit the value of ff to be greater than 5, which is used to adjust the filtering strength.

[0061] The gradient metric ff of the non-directional texture is the image after Gaussian filtering. With the non-directional texture added, y2out is equivalent to the image after non-directional filtering of the original image.

[0062] (III) Gradient integration processing, calculating the overall gradient range of the image, and integrating the result image after directional filtering and the image after non-directional texture filtering through the overall gradient range. The method for calculating the overall gradient range of the image includes calculating the sum of the first gradient values ​​of each direction of the pixel, and constraining the maximum value of the sum value through a threshold. During integration, the comparison value of the threshold (such as 128) and the overall gradient range is used as the weight of the image after non-directional texture filtering, and the overall gradient range is used as the weight of the result image after directional filtering.

[0063] In the following formula, ow is the overall gradient range, which is used to estimate the gradient weight ratio of the entire image at a single point. The specific operation is to sum the gradient values ​​of each pixel, traverse the pixels, and add them up to output the overall gradient range. Min(x, 128) is to limit the maximum value of the output, that is, the threshold.

[0064] ,

[0065] ,

[0066] y3out is the final output result, ow is the overall gradient range, the larger the ow is, the greater the boundary filtering is, which corresponds to the result of multiplying the y1out boundary filtering value, 128-ow is the weight of the image after the non-directional texture filtering, which corresponds to multiplying the y2out image after the non-directional texture filtering.

[0067] Embodiment 2: A system for enhancing image quality, comprising the following structure:

[0068] The pre-processing unit implements the following method: extracting the brightness component of each frame from the video stream;

[0069] The boundary filtering unit implements the following method: calculating the first gradient value of each pixel of the brightness component in multiple preset directions; using a predefined function to integrate the first gradient values ​​of each direction to calculate the range direction gradient value of each pixel; combining the first gradient value and the range direction gradient value to determine the overall filtering value of each direction; subtracting the overall filtering value of each direction from the brightness component to obtain a result image after directional filtering;

[0070] The non-directional texture filtering unit implements the following method: performing Gaussian filtering on the brightness component to obtain a first filtering component, performing the same Gaussian filtering on the square of the brightness component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain a gradient measure of the non-directional texture, calculating a gradient value yd of the non-directional texture according to the gradient measure ff of the non-directional texture, and adding the first filtering component fk to the gradient value of the non-directional texture to obtain an image y2 of the brightness component after non-directional filtering;

[0071] The gradient integration unit implements the following method: calculating the overall gradient range of the image, and integrating the result image after directional filtering and the image after non-directional texture filtering through the overall gradient range.

[0072] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0073] The units may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0074] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0075] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

Claims

1. A method for enhancing image quality, characterized in that: The following steps are involved: Extracting a brightness component of each frame from a video stream, and calculating a first gradient value of each pixel of the brightness component in a plurality of preset directions; The first gradient values ​​in each direction are integrated using a predefined function to calculate the range direction gradient value of each pixel; the overall filtering value in each direction is determined by combining the first gradient value and the range direction gradient value; Subtract the overall value of each directional filtering from the brightness component to obtain the result image after directional filtering; Performing Gaussian filtering on the brightness component to obtain a first filtering component, performing the same Gaussian filtering on the square of the brightness component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain a gradient measure of the non-directional texture, calculating a gradient value of the non-directional texture according to the gradient measure of the non-directional texture, and adding the gradient value of the non-directional texture to the first filtering component to obtain an image of the brightness component after non-directional filtering; The overall gradient range of the image is calculated, and the result image after directional filtering and the image after non-directional texture filtering are integrated through the overall gradient range.

2. The method for enhancing image quality as claimed in claim 1, characterized in that: The plurality of preset directions include: above, below, left, right and four diagonal directions of the pixel.

3. A method for enhancing image quality as claimed in claim 1 or 2, characterized in that: The method for calculating the first gradient value of each pixel in multiple preset directions includes: setting a corresponding filter for each direction, and calculating the first gradient value of the pixel in the preset direction through filters in different directions.

4. The method for enhancing image quality as claimed in claim 1, characterized in that: The method for calculating the overall gradient range of an image includes calculating the sum of the first gradient values ​​of pixels in various directions and constraining the maximum value of the sum by a threshold value.

5. The method for enhancing image quality as claimed in claim 4, characterized in that: The method for integrating the result image after directional filtering and the image after non-directional filtering through the overall gradient range includes: during the integration, the comparison value between the threshold and the overall gradient range is used as the weight of the image after the non-directional texture filtering, and the overall gradient range is used as the weight of the result image after the directional filtering.

6. The method for enhancing image quality as claimed in claim 1, characterized in that: The method for calculating the gradient value of the non-directional texture according to the gradient metric of the non-directional texture includes calculating using the following formula: , yd is the gradient value of the non-directional texture, j is a configurable value used to adjust the degree of non-directional texture removal. The larger the j value is, the less non-directional texture is removed. fn is the first filtering component, ff is the gradient metric of the non-directional texture, y is the original brightness component, and max(ff,5) is used to limit the maximum value of the gradient metric of the non-directional texture.

7. The method for enhancing image quality as claimed in claim 1, characterized in that: The method for determining the overall filtering value of each direction by combining the first gradient value and the range direction gradient value includes: calculating the product of the first gradient value and the range direction gradient value in each direction, adding the products of all directions, and controlling the sum value through configurable parameters.

8. A system for enhancing image quality, characterized in that: Includes the following structures: The pre-processing unit implements the following method: extracting the brightness component of each frame from the video stream; The boundary filtering unit implements the following method: calculating the first gradient value of each pixel of the brightness component in multiple preset directions; using a predefined function to integrate the first gradient values ​​of each direction to calculate the range direction gradient value of each pixel; combining the first gradient value and the range direction gradient value to determine the overall filtering value of each direction; subtracting the overall filtering value of each direction from the brightness component to obtain a result image after directional filtering; The non-directional texture filtering unit implements the following method: performing Gaussian filtering on the brightness component to obtain a first filtering component, performing the same Gaussian filtering on the square of the brightness component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain a gradient measure of the non-directional texture, calculating a gradient value yd of the non-directional texture according to the gradient measure of the non-directional texture, and adding the gradient value of the non-directional texture to the first filtering component to obtain an image of the brightness component after non-directional filtering; The gradient integration unit implements the following method: calculating the overall gradient range of the image, and integrating the result image after directional filtering and the image after non-directional texture filtering through the overall gradient range.

9. A computer storage medium, characterized in that: It stores a computer program, which is called by a processor to implement the method for enhancing image quality as described in any one of claims 1-5.

10. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method for enhancing image quality as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Adaptive image sharpening method for gradient correlation detection and storage medium

    CN108038833A

  • Low-illumination image enhancement method

    CN110969584A

  • Image quality enhancement method and system, electronic equipment and storage medium

    CN117575974A

  • Drilling positioning method of torque sensor based on image processing

    CN118014882A

  • Image processing apparatus and image processing method

    US20160165096A1