A method and system for enhancing image quality

By extracting the direction and directionless filtering of the brightness components in the image processing, combined with the overall gradient range integration processing, the problems of image boundary recognition errors and noise residues in the prior art are solved, effective retention of image boundaries and noise removal are achieved, and image quality and processing accuracy of images are improved.

CN119359590BActive Publication Date: 2025-06-10ZHEJIANG XINMAI SILICON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411901418.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-06-10
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, and noise residues are prone to occur after filtering, resulting in loss of image information and incorrect recognition.

Method used

By extracting the brightness component from the video stream, calculating the first gradient value of each pixel in multiple preset directions, and determining the overall filtering value in combination with the range direction gradient value, and performing direction filtering; at the same time, the brightness component is Gaussian filtered, calculating the gradient value of the directionless texture, and performing directionless filtering; finally, the results of directional filtering and directionless filtering are integrated through the overall gradient range.

Benefits of technology

Effectively preserve image boundaries, remove noise, improve image processing accuracy and clarity, and avoid information loss and misidentification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359590B_ABST
    Figure CN119359590B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for enhancing image quality, relating to the technical field of image processing. The method includes: extracting the luminance component of each frame from a video stream, calculating the resultant image after directional filtering of the luminance component through boundary filtering; calculating the image after non-directional filtering of the luminance component; calculating the overall gradient range of the image, and integrating the resultant image after directional filtering and the image after non-directional texture filtering through the overall gradient range. The method and system disclosed by the present invention enable the retention of image boundaries and the thorough removal of noise.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] For the technology of enhancing image quality, existing solutions mostly have the effect of a single filtering algorithm, without considering the nature of the image itself for weighted combination, or there is a situation of boundary loss in the filtered image, or there is a large amount of noise residue while the boundary is retained, directly resulting in the loss of the information elements of the image itself, and may also lead to misidentification, causing pixels that do not exist in the image itself to appear.

[0003] Existing algorithms have great mistakes in image boundary recognition, cannot completely recognize the image boundary, there are multiple points or missing points, and when combining boundary filtering and non-directional filtering, there is a lack of a truly effective method for recognition; for example, median filtering will cause boundary loss, and for example, the clipping filtering method will cause noise residue. Summary of the Invention

[0004] In view of at least one of the disadvantages in the prior art, the present invention proposes a method for enhancing image quality, including the following steps: extracting the luminance component of each frame from the video stream, and calculating the first gradient value of each pixel of the luminance component in multiple preset directions; using a predefined function to integrate the first gradient values in each direction, and calculating 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 in each direction; subtracting the overall filtering value in each direction from the luminance component to obtain the result image after directional filtering;

[0005] Performing Gaussian filtering on the luminance component to obtain a first filtering component, performing the same Gaussian filtering on the square of the luminance component to obtain a second filtering component, subtracting the square of the first filtering component from the second filtering component to obtain the gradient measure of the non-directional texture, calculating the 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 the image of the luminance component after non-directional filtering;

[0006] 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.

[0007] Furthermore, a system for enhancing image quality is proposed, including the following structure:

[0008] A preprocessing unit, which implements the following method: extracting the luminance 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 luminance component in multiple preset directions; integrating the first gradient values in each direction using a predefined function 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 in each direction; subtracting the overall filtering value in each direction from the luminance component to obtain the result image after directional filtering;

[0010] The non-directional texture filtering unit implements the following method: performing Gaussian filtering on the luminance component to obtain the first filtered component, performing the same Gaussian filtering on the square of the luminance component to obtain the second filtered component, subtracting the square of the first filtered component from the second filtered component to obtain the gradient measure of the non-directional texture, calculating the gradient value yd of the non-directional texture according to the gradient measure ff of the non-directional texture, and adding the gradient value of the non-directional texture to the first filtered component fn to obtain the image y2 of the luminance 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, retains the boundaries completely, and removes the noise completely through processes such as obtaining the boundary filtering value, obtaining the non-directional texture filtering value, and gradient integration processing. Description of the Drawings

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0014] Figure 1 It is the general flowchart of the method for enhancing image quality. Detailed Embodiments

[0015] The following will further elaborate on the present invention in conjunction with 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 includes the following steps:

[0017] Extract the luminance component of each frame from the video stream, calculate the first gradient value of each pixel of the luminance component in multiple preset directions; use a predefined function to integrate the first gradient values in 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 in each direction; subtract the overall filtering value in each direction from the luminance component to obtain the result image after directional filtering;

[0018] Perform Gaussian filtering on the luminance component to obtain the first filtered component, perform the same Gaussian filtering on the square of the luminance component to obtain the second filtered component, subtract the square of the first filtered component from the second filtered component to obtain the gradient measure of the texture without direction, calculate the gradient value of the texture without direction according to the gradient measure of the texture without direction, and add the gradient value of the texture without direction to the first filtered component to obtain the image after non-directional filtering of the luminance component;

[0019] Calculate the overall gradient range of the image, and integrate the image after directional filtering and the image after non-directional texture filtering through the overall gradient range.

[0020] (1) Perform boundary filtering on the luminance component. Among them, the multiple preset directions include: above, below, left, right of the pixel, and four diagonal directions. Specifically, the method for calculating the first gradient value of each pixel of the luminance component in multiple preset directions includes: setting corresponding filters for each direction. The filters for the eight directions are as follows:

[0021] The N filter for finding the gradient above the pixel point, which is used to detect the influence of the pixel above on the central pixel;

[0022] The S filter for finding the gradient below the pixel point, which is used to detect the influence of the pixel below on the central pixel;

[0023] The E filter for finding the gradient to the right of the pixel point, which is used to detect the influence of the pixel to the right on the center;

[0024] The W filter for finding the gradient to the left of the pixel point, which is used to detect the influence of the pixel to the left on the central pixel;

[0025] The SW filter for finding the gradient diagonally below at 135 degrees of the pixel point, which is used to detect the influence of the direction below at 135 degrees on the central pixel;

[0026] The NW filter for finding the gradient diagonally above at 45 degrees of the pixel point, which is used to detect the influence of the above at 45 degrees of the filter on the central pixel;

[0027] The NE filter for finding the gradient diagonally above at 135 degrees of the pixel point, which is used to detect the influence of the pixel diagonally above at 135 degrees on the center pixel;

[0028] The SE filter for finding the gradient diagonally below at 45 degrees of the pixel point, which is used to detect the influence of the filter diagonally below at 45 degrees on the central pixel.

[0029] , ,

[0030] , ,

[0031] , ,

[0032] , ,

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

[0034] , ,

[0035] , ,

[0036] , ,

[0037] , ,

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

[0039] Among them, the method of calculating the range direction gradient value of each pixel by integrating the first gradient values in each direction using a predefined function u includes calculating through the following formula:

[0040] , , , ,

[0041] , ,

[0042] , ,

[0043] Where u is an assignable function with a default value of 1.5. The smaller the value of u is configured, the greater the directivity. The larger the value of u is configured, the more non-directional the subsequent calculation is for filtering. ln, le, ls, lw, lsw, lnw, lne, lse are the range direction gradients in each direction respectively. The assignable function u (predefined function) is used to process the gradient values from different directions, which may be 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] Combining the first gradient value and the range direction gradient value, determine the overall filtering value in each direction; including: 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. Subtract the overall filtering value in each direction from the luminance 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 with a default value of 1. The larger k is configured, the less noise there is in the image after directional image filtering, and the cleaner the image is. For example, fn*ln in the formula is the influence of the upper point of a single pixel in the image on the image, and fs*ls is the influence of the lower point of a single point in the image on the image, and so on.

[0046] ,

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

[0048] ,

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

[0050] Step 1, perform Gaussian filtering on the luminance component to obtain the first filtering component fk, as shown in the following formula.

[0051] ,

[0052] Among them, k is a Gaussian filter, and its parameters can be configured according to experience.

[0053] Step 2, perform the same Gaussian filtering on the square of the luminance component to obtain the second filtering component. Subtract the square of the first filtering component fk from the second filtering component to obtain the gradient measure ff of the non-directional texture, as shown in the following formula.

[0054] ,

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

[0056] The above steps calculate the local variance around each pixel point. ff actually represents the gradient measure or intensity difference within this area, which reflects the existence of the undirected texture.

[0057] Step 3: Calculate the gradient value of the undirected texture based on the gradient measure of the undirected texture, and add the gradient value of the undirected texture to the first filtering component to obtain the image of the undirected filtered luminance component.

[0058] ,

[0059] ,

[0060] Among them, yd is equivalent to the final gradient of the undirected texture. j is defaulted to 1 and j is a configurable value used to adjust the degree of removal of the undirected texture. The larger the configured value of j, the smaller the removal of the undirected texture. max(ff, 5) is to limit the value of ff to be greater than 5, which is used to adjust the filtering intensity.

[0061] The gradient measure ff of the undirected texture is the image after Gaussian filtering plus the undirected texture. y2out is equivalent to the image of the original image after undirected filtering.

[0062] (3) Gradient integration processing: Calculate the overall gradient range of the image, and integrate the result image after directional filtering and the image after undirected 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 in each direction of the pixel and constraining the maximum value of the sum through a threshold. When integrating, the comparison value between the threshold (such as 128) and the overall gradient range is used as the weight of the image after undirected 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 proportion of the gradient weight of the entire image at a single point. The specific operation is to sum the gradient values of each pixel point, traverse the pixel points, and add them to output the overall gradient range. min(x, 128) is to limit the maximum output value, that is, the threshold.

[0064] ,

[0065] ,

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

[0067] Embodiment 2: An image quality enhancement system includes the following structures:

[0068] A preprocessing unit, which implements the following method: extracting the luminance component of each frame from the video stream;

[0069] A boundary filtering unit, which implements the following method: calculating the first gradient value of each pixel of the luminance component in multiple preset directions; using a predefined function to integrate the first gradient values in 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 in each direction; subtracting the overall filtering value in each direction from the luminance component to obtain the result image after direction filtering;

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

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

[0072] In several embodiments provided in the present 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 merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, 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. The components shown as units may be a physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0074] In addition, each functional unit in various embodiments of the present invention may be integrated into a processing unit, may exist physically alone for each unit, 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 a software functional unit.

[0075] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to enable a device (which may be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc 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; Calculate the overall gradient range of the image, and integrate the result image after directional filtering and the image after non-directional texture filtering through the overall gradient range; 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: ; 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 directional gradients in each direction respectively; Determine the overall filtering value in each direction by combining the first gradient value and the gradient value in the range direction; including: calculating the product of the first gradient value in each direction and the gradient value in the range direction, adding the products in all directions, and controlling the sum value through configurable parameters; The method for calculating the gradient value of the non-directional texture according to the gradient metric of the non-directional texture includes 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. j The larger the value configuration, the smaller the non-directional texture removal. fn is the first filtering component. ff is the gradient measure 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.

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. 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 the directional filtering and the image after the non-directional texture filtering through the overall gradient range; 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: ; 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 directional gradients in each direction respectively; Determine the overall filtering value in each direction by combining the first gradient value and the gradient value in the range direction; including: calculating the product of the first gradient value in each direction and the gradient value in the range direction, adding the products in all directions, and controlling the sum value through configurable parameters; The method for calculating the gradient value of the non-directional texture according to the gradient metric of the non-directional texture includes 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. j The larger the value configuration, the smaller the non-directional texture removal. fn is the first filtering component. ff is the gradient measure 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. 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.

8. 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

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

    CN117575974A

  • Drilling positioning method of torque sensor based on image processing

    CN118014882A