CN115063314A - Self-adaptive video sharpening method, device and equipment based on table lookup method and storage medium - Google Patents
Self-adaptive video sharpening method, device and equipment based on table lookup method and storage medium Download PDFInfo
- Publication number
- CN115063314A CN115063314A CN202210712883.3A CN202210712883A CN115063314A CN 115063314 A CN115063314 A CN 115063314A CN 202210712883 A CN202210712883 A CN 202210712883A CN 115063314 A CN115063314 A CN 115063314A
- Authority
- CN
- China
- Prior art keywords
- image
- sharpening
- gradient
- component
- calculating
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 97
- 238000004364 calculation method Methods 0.000 claims abstract description 29
- 238000012545 processing Methods 0.000 claims abstract description 18
- 230000003044 adaptive effect Effects 0.000 claims description 23
- 238000009499 grossing Methods 0.000 claims description 9
- 230000015654 memory Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012935 Averaging Methods 0.000 claims description 3
- 238000000605 extraction Methods 0.000 claims 1
- 230000008859 change Effects 0.000 description 7
- 238000004422 calculation algorithm Methods 0.000 description 6
- 238000003707 image sharpening Methods 0.000 description 5
- 101100269850 Caenorhabditis elegans mask-1 gene Proteins 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000003706 image smoothing Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a table lookup method-based self-adaptive video sharpening method, a table lookup method-based self-adaptive video sharpening device, table lookup equipment and a storage medium, wherein the method comprises the following steps: extracting a Y component in a video frame image to be sharpened; calculating the gradient and the gradient intermediate value of the image; initializing based on a table lookup method, and retrieving the table lookup method according to the pixel value and the gradient intermediate value of the gradient image to obtain a corresponding sharpening weight; obtaining a smoothed image by adopting Gaussian blur; calculating to obtain a high-frequency information image according to the Y component image and the smoothed image; calculating to obtain a sharpening mask according to the high-frequency information image and the sharpening weight and outputting an image after the sharpening mask; and merging the sharpened masked image and the smoothed image, and merging the output sharpened Y component image and the UV component image. The table look-up method is utilized to solve the problem of large calculation amount of the self-adaptive sharpening, realize the self-adaptive sharpening adjustment of the high-frequency information of the image, reduce the generation of noise under the condition of making the image clear, and can be applied to real-time video processing.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a table lookup method-based adaptive video sharpening method, device, equipment and storage medium.
Background
Image sharpening (image sharpening) is to compensate the outline of an image, enhance the edge of the image and the part with jump gray level, make the image become clear, and is divided into two types, namely spatial domain processing and frequency domain processing. Image sharpening is to highlight edges, contours, or features of some linear target elements of a terrain on an image. This filtering method improves the contrast between the feature edges and the surrounding picture elements and is therefore also referred to as edge enhancement.
In computer algorithm processing, image sharpening is an image processing method for making image edges clearer, detail enhancement (detail enhancement) includes image sharpening, and it is a common practice to extract high-frequency components of an image and superimpose the high-frequency components onto an original image. The high-frequency components of the image are extracted by two methods, one is to obtain the high-frequency components by using a high-pass filter, and the other is to reduce the frequency by using the original image to obtain the high frequency components by using a low-pass filter.
At present, the self-adaptive sharpening algorithm mainly processes images, and due to the reasons of large calculation amount of the algorithm and the like, the processing speed is low, and real-time roll-out cannot be realized in the video processing. The adaptive sharpening algorithm based on gradient calculation needs to construct a core function to calculate the sharpening weight of each pixel point, the calculation amount is large, image processing is mainly performed, and research and processing are not performed on real-time transcoding of videos.
In view of this, it is necessary to provide an adaptive video sharpening method, which can suppress the generation of noise while greatly improving the image sharpness and has a better effect in enhancing the video quality.
Disclosure of Invention
The invention aims to provide a table look-up method based self-adaptive video sharpening method, a table look-up method based self-adaptive video sharpening device, table look-up equipment and a storage medium.
The invention provides a table lookup method-based self-adaptive video sharpening method, which comprises the following steps:
inputting and decoding a video and outputting a video frame image to be sharpened;
extracting a Y component in the video frame image to be sharpened, and outputting a Y component image;
calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient intermediate value;
based on table lookup method initialization, searching a table lookup method according to pixel values of the gradient image and the gradient intermediate values to obtain corresponding first sharpening weights, and storing corresponding pixel points of the first sharpening weights to obtain second sharpening weights;
adopting Gaussian blur to the Y component image to obtain a smoothed image;
calculating to obtain a high-frequency information image according to the Y component image and the smoothed image;
calculating to obtain a sharpening mask according to the high-frequency information image and the second sharpening weight and outputting an image after the sharpening mask;
merging the sharpened masked image and the smoothed image, outputting a sharpened Y component image, merging the sharpened Y component image and a UV component to obtain a final sharpening result image, and encoding the final sharpening result image to obtain a sharpened video.
Preferably, the initializing based on a table lookup method, retrieving a table lookup method according to the pixel value of the gradient image and the gradient intermediate value to obtain a corresponding first sharpening weight, and storing a corresponding pixel point of the first sharpening weight to obtain a second sharpening weight includes:
the sharpening weight is calculated as follows:
wherein the input value is a gradient image pixel value v i And the intermediate value v of the gradient image d Output value w i In order to sharpen the weight of the image,
the calculation formula of the gradient intermediate value is as follows:
wherein v is min Is the minimum value of the gradient, v max Is the maximum of the gradient.
Preferably, sharpening weights of different video frame images to be sharpened under different gradients are calculated to realize adaptive sharpening of the images/videos.
Preferably, the initializing based on a table lookup method, retrieving the table lookup method according to the pixel value of the gradient image and the gradient intermediate value to obtain a corresponding first sharpening weight, and storing a corresponding pixel point of the first sharpening weight to obtain a second sharpening weight includes:
the table lookup method comprises the following steps: and calculating the pixel value of the gradient image and the gradient intermediate value as input values through a sharpening weight formula, wherein the output value is a corresponding value obtained through calculation, namely the gradient intermediate value, and storing the output value.
Preferably, the calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient median value includes:
performing gradient calculation on the Y component image by using a sobel operator to obtain a gradient image;
carrying out smoothing processing on the gradient image to remove strong noise points in the image;
and calculating the gradient intermediate value of the gradient image by a maximum and minimum value averaging method to obtain the gradient intermediate value.
Preferably, the calculating a high-frequency information image according to the Y component image and the smoothed image includes: the calculation formula is as follows: the high-frequency information image is the Y component image — the smoothed image.
Preferably, the calculating the sharpening mask according to the image after sharpening mask and the second sharpening weight and outputting the image after sharpening mask includes:
the calculation formula is as follows: and sharpening the masked image as the second sharpening weight.
The invention also provides a self-adaptive video sharpening system based on the table look-up method, which comprises the following steps:
the video input module is used for inputting and decoding a video and outputting a video frame image to be sharpened;
the component image acquisition module is used for extracting a Y component in the video frame image to be sharpened and outputting a Y component image;
the image gradient calculation module is used for calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient intermediate value;
the table lookup method initialization module is used for carrying out table lookup method retrieval according to the pixel values of the gradient image and the gradient intermediate values to obtain corresponding first sharpening weights and storing corresponding pixel points of the first sharpening weights to obtain second sharpening weights based on table lookup method initialization;
the smooth image generation module is used for obtaining a smooth image by adopting Gaussian blur on the Y component image;
the high-frequency information image acquisition module is used for calculating to obtain a high-frequency information image according to the Y component image and the smoothed image;
the sharpening mask generation module is used for calculating a sharpening mask according to the high-frequency information image and the second sharpening weight and outputting an image after the sharpening mask;
and the sharpening result output module is used for merging the image subjected to the sharpening mask and the smoothed image, outputting a sharpened Y component image, merging the sharpened Y component image and a UV component to obtain a final sharpening result image, and encoding the final sharpening result image to obtain a sharpened video.
The invention also provides a self-adaptive video sharpening device based on the table lookup method, which comprises a memory and a processor, wherein the memory is stored with computer readable instructions, and when the processor executes the computer readable instructions, the self-adaptive video sharpening device based on the table lookup method is realized.
The present invention also provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by one or more processors, implements a table lookup based adaptive video sharpening method as an embodiment of the present invention.
Aiming at the prior art, the invention has the following beneficial effects:
the table look-up method based adaptive sharpening method realizes the adaptive sharpening adjustment of the high-frequency information of the image, reduces the generation of noise under the condition of making the image clear, has high processing speed and can be applied to the advantage of real-time video processing;
the table look-up method is used for solving the problem of large calculation amount of self-adaptive sharpening, and can be used for real-time transcoding processing of videos.
Drawings
FIG. 1 is a schematic diagram illustrating steps of the table lookup-based adaptive video sharpening method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a specific step of step S3 according to an embodiment of the present invention;
FIG. 3 is a general flowchart of the adaptive video sharpening method according to the embodiment of the present invention;
FIG. 4 is a flowchart of sharpening weight calculation according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating image high frequency information calculation according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
As shown in fig. 1, the present invention provides a table lookup based adaptive video sharpening method, including:
s1: inputting and decoding a video and outputting a video frame image to be sharpened;
s2: extracting a Y component in the video frame image to be sharpened, and outputting a Y component image, namely a gray image; YUV separates luminance and chrominance, representing one color using three components, Y (brightness), U, and V (chrominance, density). The UV component of the three components is only color information, and if the image is only a Y component image, the image is a black and white image.
S3: calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient intermediate value; gradient image, i.e. image edge, horizontal, vertical, image pixel change rate in both X and Y directions (compared with adjacent pixels), is a two-dimensional vector, consisting of 2 components, X-axis change, Y-axis change.
Where the change in the X-axis is the pixel value to the right of the current pixel (X plus 1) minus the pixel value to the left of the current pixel (X minus 1).
Similarly, the change in the Y-axis is the pixel value below the current pixel (Y plus 1) minus the pixel value above the current pixel (Y minus 1).
The 2 components are calculated to form a two-dimensional vector, and the image gradient of the pixel is obtained.
S4: based on table lookup method initialization, searching a table lookup method according to pixel values of the gradient image and the gradient intermediate values to obtain corresponding first sharpening weights, and storing corresponding pixel points of the first sharpening weights to obtain second sharpening weights; the first sharpening weight is a coefficient value, and the second sharpening weight is a two-dimensional array; for the edge part of the image, the gray value change is large, and the gradient value is also large; conversely, for a smoother portion of the image, the gray value variation is smaller, and the corresponding gradient value is also smaller. Typically, the image gradient is computed as edge information of the image.
S5: adopting Gaussian blur to the Y component image to obtain a smoothed image;
s6: calculating to obtain a high-frequency information image according to the Y component image and the smoothed image;
s7: calculating to obtain a sharpening mask according to the high-frequency information image and the second sharpening weight and outputting an image after the sharpening mask;
s8: merging the sharpened masked image and the smoothed image, outputting a sharpened Y component image, merging the sharpened Y component image and a UV component to obtain a final sharpening result image, and encoding the final sharpening result image to obtain a sharpened video.
As shown in fig. 2, the step S3 of calculating the gradient of the Y component image, and outputting a gradient image and calculating a gradient median includes:
s31: carrying out gradient calculation on the Y component image by adopting a sobel operator to obtain a gradient image; the Sobel operator is a discrete differential operator that combines gaussian smoothing and differential derivation operations. The operator finds edges using local differences, and the result of the calculation is an approximation of the gradient.
S32: carrying out smoothing processing on the gradient image to remove strong noise points in the image; image smoothing may be denoising or image block stylizing, and a general smoothing method is filtering with some smoothing convolution kernels (such as gaussian blur kernel, uniform filtering, etc.) which blur the edges of the sacrificial image. Gradient-based smoothing methods remove smaller gradients (de-noising, smoothing) while preserving larger gradients (image edges).
S33: and calculating the gradient intermediate value of the gradient image by a maximum and minimum value averaging method to obtain the gradient intermediate value.
The skilled in the art can understand that the invention firstly obtains each frame of image through video (YUV, 8bit) decoding, and performs real-time processing of adaptive sharpening on the image, wherein the overall processing can be divided into two parts, the first part is calculation of sharpening weight of image pixel points, and the second part is acquisition of image high-frequency information.
As shown in fig. 3, for a YUV, 8-bit video file, a frame of image is first decoded by ffmpeg video, and each frame of image is sent to an adaptive sharpening algorithm based on a table lookup method, and the following steps are performed: extracting a Y component image; calculating a gradient and obtaining a gradient intermediate value; initializing a table lookup method, and retrieving the table lookup method through the gradient value and the gradient intermediate value to obtain a weight value; calculating and storing a high-frequency information image of the Y component image; multiplying the weighted value by the calculated high-frequency information image to obtain a sharpening mask; and adding the sharpening mask and the smoothed image, and combining YUV components to obtain a final sharpened image. And (4) encoding the output processed image through ffmpeg to finally obtain a sharpened YUV, 8bit video file.
As shown in fig. 4, the processing steps of the sharpening weight of the pixel point of the first partial image are as follows:
and Step1, extracting the Y component in the 8-bit depth video frame to obtain a Y component image I.
And Step2, performing gradient calculation on the Y component image I by using a sobel operator to obtain a gradient image.
And Step3, smoothing the gradient image to remove strong noise points in the image.
Step4, calculating the gradient intermediate value of the gradient image, and obtaining the gradient intermediate value v of the image by a maximum and minimum value average method d (rounding off).
Step5, initializing a table lookup method, and searching and outputting an output value through the table lookup method to obtain each pixel point v of the image i And the median value v of the gradient d Corresponding sharpening weight w i And storing the corresponding pixel points of the sharpening weight to obtain mask 1.
The core formula of the table lookup method of the invention is as follows:the input value being a gradient image pixel value v i And the intermediate value v of the gradient image d Output value w i Is the sharpening weight.
The table lookup method is constructed as follows: all possible input values are calculated by a core formula, and the pixel value v of the gradient image i And the intermediate value v of the gradient image d All input ranges of (1) are [0, 255 ]]And the output value is the corresponding value calculated by the core formula, and all data are stored.
Table 1 is a 3-dimensional table, containing all data possibilities,the data of the invention are part of the data, and the limiting conditions are as follows:wherein v is min Is the minimum value of the gradient, v max Is the maximum of the gradient. v. of i And v d Has a value range of [0, 255 ]]Output value w of the present invention using a table lookup method under the constraint conditions i Is [0.5, 1 ]]. The input value of the lookup table is 2 16 And storing the output values obtained by calculating the core formula according to each input value to form a 3-dimensional table. After table initialization, it can be according to v i And v d Two values are directly searched for corresponding output value w i . In the algorithm of the invention, the kernel function fixes the sharpening weight range to 0.5, 1]Meanwhile, for the pixel points near the middle value range needing main enhancement, the sharpening weight approaches to 1, and for the pixel points in the smooth and high-frequency regions needing no strength enhancement, the sharpening weight approaches to 0.5, and the enhancement is carried out to a lower degree.
The table lookup method is implemented by inputting values: gradient image pixel value v i And the median value v of the gradient d For the weighted value w i The sharpening weight is obtained quickly by searching, and part of data is shown in table 1:
input values are as follows: v. of d | Input values are as follows: v. of i | And (3) outputting a value: w is a i |
124 | 0 | 0.50 |
124 | 110 | 0.83 |
124 | 124 | 1.00 |
124 | 240 | 0.51 |
128 | 0 | 0.50 |
128 | 90 | 0.72 |
128 | 120 | 0.88 |
128 | 200 | 0.61 |
128 | 255 | 0.50 |
Table 1 shows part of data of a table lookup method
In the table, the closer the pixel point to the intermediate value is, the larger the output value is, and the more the pixel point is different from the intermediate value, the smaller the output value is.
As shown in fig. 5, the calculation of the second part of high frequency information mainly comprises the following steps:
step1, applying Gaussian blur to the Y component image I to obtain a smoothed image blu _ img.
And Step2, calculating a high-frequency information image, wherein the formula is G _ img-I-blu _ img.
Step3: the high-frequency information image G _ img and the second sharpening weight mask1 are merged to obtain a final sharpening mask2, and mask2 is G _ img × mask 1.
And Step4, merging the mask image mask2 and the blu _ img, merging YUV components, and obtaining a final sharpening result image.
And (4) encoding the output processed image through ffmpeg to finally obtain a sharpened YUV, 8-bit video file.
Further, calculating sharpening weights of different to-be-sharpened video frame images under different gradients to realize self-adaptive sharpening of the images/videos.
Further, the initializing based on a table lookup method, retrieving the table lookup method according to the pixel value of the gradient image and the gradient intermediate value to obtain a corresponding first sharpening weight, and storing a corresponding pixel point of the first sharpening weight to obtain a second sharpening weight includes:
the table lookup method comprises the following steps: and calculating the pixel value of the gradient image and the gradient intermediate value as input values through a sharpening weight formula, wherein the output value is a corresponding value obtained through calculation, namely the gradient intermediate value, and storing the output value.
Further, the calculating a high-frequency information image according to the Y component image and the smoothed image includes: the calculation formula is as follows: the high-frequency information image is the Y component image — the smoothed image. The high frequency is that the frequency changes rapidly, that is, the gray level difference between adjacent regions is large, that is, the frequency changes rapidly. The edge of an image and the background in the image usually has a significant difference, that is, the edge is changed, and the gray scale changes rapidly, that is, the change frequency is high. Therefore, the gray value of the image edge changes rapidly, and the image edge is displayed with high frequency.
Further, the calculating the sharpening mask according to the image after the sharpening mask and the second sharpening weight and outputting the image after the sharpening mask includes:
the calculation formula is as follows: and sharpening the masked image as the second sharpening weight.
Example two
The invention also provides a self-adaptive video sharpening device based on the table lookup method, which comprises the following steps:
the video input module is used for inputting and decoding a video and outputting a video frame image to be sharpened;
the component image acquisition module is used for extracting a Y component in the video frame image to be sharpened and outputting a Y component image;
the image gradient calculation module is used for calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient intermediate value;
the table lookup method initialization module is used for carrying out table lookup method retrieval according to the pixel values of the gradient image and the gradient intermediate values to obtain corresponding first sharpening weights and storing corresponding pixel points of the first sharpening weights to obtain second sharpening weights based on table lookup method initialization;
the smooth image generation module is used for obtaining a smooth image by adopting Gaussian blur on the Y component image;
the high-frequency information image acquisition module is used for calculating to obtain a high-frequency information image according to the Y component image and the smoothed image;
the sharpening mask generation module is used for calculating a sharpening mask according to the high-frequency information image and the second sharpening weight and outputting an image after the sharpening mask;
and the sharpening result output module is used for merging the image subjected to the sharpening mask and the smoothed image, outputting a sharpened Y component image, merging the sharpened Y component image and a UV component to obtain a final sharpening result image, and encoding the final sharpening result image to obtain a sharpened video.
The specific contents and implementation methods of the video input module, the component image acquisition module, the image gradient calculation module, the table lookup initialization module, the smooth image generation module, the high-frequency information image acquisition module, the sharpening mask generation module, and the sharpening result output module are as described in the first embodiment, and are not described herein again.
EXAMPLE III
The invention also provides a self-adaptive video sharpening device based on the table lookup method, which comprises a memory and a processor, wherein the memory is stored with computer readable instructions, and when the processor executes the computer readable instructions, the self-adaptive video sharpening device based on the table lookup method is realized.
The adaptive video sharpening device based on the table lookup method may generate large differences due to different configurations or performances, and may include one or more processors (CPUs) and memories, one or more storage media (e.g., one or more mass storage devices) for storing applications or data. The memory and storage medium may be, among other things, transient or persistent storage. The program stored on the storage medium may include one or more modules, each of which may include a sequence of instructions operating on an adaptive video sharpening device based on a table lookup.
Further, the processor may be configured to communicate with the storage medium to execute a series of instruction operations in the storage medium on the video image color enhancement device.
The adaptive video sharpening device based on lookup table may also include one or more power supplies, one or more wired or wireless network interfaces, one or more input-output interfaces, and/or one or more operating systems, such as Windows Server, Vista, and the like.
The present invention also provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by one or more processors, implements a table lookup based adaptive video sharpening method as an embodiment of the present invention. The modules in the second embodiment, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in software, which is a non-volatile computer-readable storage medium, or which may be a volatile computer-readable storage medium, or a part or all of the technical solution that contributes to the prior art. The computer-readable storage medium has stored therein instructions that, when executed on a computer, cause the computer to perform the step of adaptive video sharpening based on a table lookup method in the first embodiment.
Those skilled in the art will appreciate that the technical solution of the present invention, which is substantially or partly contributed by the prior art, or all or part of the technical solution, can be embodied in software stored in a storage medium, and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a read-only memory ROM, a random access memory RAM, a magnetic disk, or an optical disk. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above-described device may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A self-adaptive video sharpening method based on a table lookup method is characterized by comprising the following steps:
inputting and decoding a video and outputting a video frame image to be sharpened;
extracting a Y component in the video frame image to be sharpened, and outputting a Y component image;
calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient intermediate value;
based on table lookup method initialization, searching a table lookup method according to pixel values of the gradient image and the gradient intermediate values to obtain corresponding first sharpening weights, and storing corresponding pixel points of the first sharpening weights to obtain second sharpening weights;
adopting Gaussian blur to the Y component image to obtain a smoothed image;
calculating to obtain a high-frequency information image according to the Y component image and the smoothed image;
calculating to obtain a sharpening mask according to the high-frequency information image and the second sharpening weight and outputting an image after the sharpening mask;
merging the sharpened masked image and the smoothed image, outputting a sharpened Y component image, merging the sharpened Y component image and a UV component to obtain a final sharpening result image, and encoding the final sharpening result image to obtain a sharpened video.
2. The method of claim 1, wherein initializing based on a lookup table, retrieving a lookup table according to pixel values of the gradient image and the gradient intermediate values to obtain a corresponding first sharpening weight, and storing corresponding pixel points of the first sharpening weight to obtain a second sharpening weight comprises:
the sharpening weight is calculated as follows:
wherein the input value is a gradient image pixel value v i And the intermediate value v of the gradient image d Output value w i In order to sharpen the weight of the image,
the calculation formula of the gradient intermediate value is as follows:
wherein v is min Is the minimum value of the gradient, v max Is the maximum of the gradient.
3. The adaptive video sharpening method based on the table lookup method as claimed in claim 1, wherein sharpening weights of different video frame images to be sharpened under different gradients are calculated to realize adaptive sharpening of images/videos.
4. The method of claim 1, wherein initializing based on a lookup table, retrieving a lookup table according to pixel values of the gradient image and the gradient intermediate values to obtain a corresponding first sharpening weight, and storing corresponding pixel points of the first sharpening weight to obtain a second sharpening weight comprises:
the table lookup method comprises the following steps: and calculating the pixel value of the gradient image and the gradient intermediate value as input values through a sharpening weight formula, wherein the output value is a corresponding value obtained through calculation, namely the gradient intermediate value, and storing the output value.
5. The method of claim 1, wherein calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient median value comprises:
performing gradient calculation on the Y component image by using a sobel operator to obtain a gradient image;
carrying out smoothing processing on the gradient image to remove strong noise points in the image;
and calculating the gradient intermediate value of the gradient image by a maximum and minimum value averaging method to obtain the gradient intermediate value.
6. The method of claim 1, wherein the calculating a high frequency information image from the Y component image and the smoothed image comprises: the calculation formula is as follows: the high-frequency information image is the Y component image — the smoothed image.
7. The method of claim 1, wherein calculating a sharpening mask according to the image after sharpening mask and the second sharpening weight and outputting the image after sharpening mask comprises:
the calculation formula is as follows: and sharpening the masked image as the second sharpening weight.
8. An adaptive video sharpening device based on a table lookup method, comprising:
the video input module is used for inputting and decoding a video and outputting a video frame image to be sharpened;
the component image extraction module is used for extracting a Y component in the video frame image to be sharpened and outputting a Y component image;
the image gradient calculation module is used for calculating the gradient of the Y component image, outputting a gradient image and calculating a gradient intermediate value;
the table lookup method initialization module is used for carrying out table lookup method retrieval according to the pixel values of the gradient image and the gradient intermediate values to obtain corresponding first sharpening weights and storing corresponding pixel points of the first sharpening weights to obtain second sharpening weights based on table lookup method initialization;
the smooth image generation module is used for obtaining a smooth image by adopting Gaussian blur on the Y component image;
the high-frequency information image acquisition module is used for calculating to obtain a high-frequency information image according to the Y component image and the smoothed image;
the sharpening mask generation module is used for calculating a sharpening mask according to the high-frequency information image and the second sharpening weight and outputting an image after the sharpening mask;
and the sharpening result output module is used for merging the image subjected to the sharpening mask and the smoothed image, outputting a sharpened Y component image, merging the sharpened Y component image and a UV component to obtain a final sharpening result image, and encoding the final sharpening result image to obtain a sharpened video.
9. An adaptive video sharpening device based on a table lookup method, comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the adaptive video sharpening method based on the table lookup method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the table lookup based adaptive video sharpening method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210712883.3A CN115063314A (en) | 2022-06-22 | 2022-06-22 | Self-adaptive video sharpening method, device and equipment based on table lookup method and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210712883.3A CN115063314A (en) | 2022-06-22 | 2022-06-22 | Self-adaptive video sharpening method, device and equipment based on table lookup method and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115063314A true CN115063314A (en) | 2022-09-16 |
Family
ID=83202837
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210712883.3A Pending CN115063314A (en) | 2022-06-22 | 2022-06-22 | Self-adaptive video sharpening method, device and equipment based on table lookup method and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115063314A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115619683A (en) * | 2022-11-07 | 2023-01-17 | 腾讯科技(深圳)有限公司 | Image processing method, apparatus, device, storage medium and computer program product |
-
2022
- 2022-06-22 CN CN202210712883.3A patent/CN115063314A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115619683A (en) * | 2022-11-07 | 2023-01-17 | 腾讯科技(深圳)有限公司 | Image processing method, apparatus, device, storage medium and computer program product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9978121B2 (en) | Adaptive sharpening in image processing and display | |
Gupta et al. | Review of different local and global contrast enhancement techniques for a digital image | |
WO2016206087A1 (en) | Low-illumination image processing method and device | |
WO2016159884A1 (en) | Method and device for image haze removal | |
CN109743473A (en) | Video image 3 D noise-reduction method, computer installation and computer readable storage medium | |
Deng et al. | A guided edge-aware smoothing-sharpening filter based on patch interpolation model and generalized gamma distribution | |
Cadena et al. | Noise reduction techniques for processing of medical images | |
WO2009107197A1 (en) | Picture processor, picture processing method and picture processing program | |
CN112508816B (en) | Infrared image sharpening method, sharpening processing system and terminal equipment | |
CN111415317B (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
CN109214996B (en) | Image processing method and device | |
US11222412B2 (en) | Image processing device and method | |
JP7265316B2 (en) | Image processing device and image processing method | |
CN110378860A (en) | Method, apparatus, computer equipment and the storage medium of restored video | |
CN115063314A (en) | Self-adaptive video sharpening method, device and equipment based on table lookup method and storage medium | |
CN107481203B (en) | Image-oriented filtering method and computing device | |
Hu et al. | A novel retinex algorithm and its application to fog-degraded image enhancement | |
JP5652272B2 (en) | Image processing apparatus, image processing program, and image processing method | |
CN114092407A (en) | Method and device for processing video conference shared document in clear mode | |
CN112884662A (en) | Three-dimensional digital map image processing method based on aerial image of aircraft | |
CN113096014B (en) | Video super processing method, electronic device and storage medium | |
CN115311161B (en) | Image enhancement method, device, equipment and storage medium based on artificial intelligence | |
Hsieh et al. | Improving DCP haze removal scheme by parameter setting and adaptive gamma correction | |
CN111986095B (en) | Image processing method and image processing device based on edge extraction | |
Nguyen et al. | FPGA-based Haze removal architecture using multiple-exposure fusion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |