Video processing method and apparatus, computer device, and storage medium

By performing image denoising and super-resolution processing in the graphics processor and reducing data transmission between the CPU and GPU, the problem of low data transmission and storage efficiency in traditional video processing technology is solved, and efficient video stream processing and Improved equipment utilization.

WO2024199009A1PCT designated stage expired Publication Date: 2024-10-03DOUYIN VISION CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/082452
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-28
Filing Date
2024-03-19
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

Traditional video processing technology cannot meet the needs of high resolution and high image quality, especially due to the additional data transmission and storage overhead caused by multiple intermediate processing result data exchanges between the CPU and GPU, which reduces the processing performance and equipment of the video stream. Storage space utilization.

Method used

By implementing image denoising and super-resolution processing in the graphics processor, and reducing data transmission between the central processor and the graphics processor, parallel processing and fusion operator technology are used to avoid additional intermediate processing result data transmission and improve video quality. Real-time processing performance of streams and device storage space utilization.

Benefits of technology

Significantly improves the real-time processing performance of video streams, reduces data transmission time and storage space occupation, enables the GPU card to process more video streams at the same time, and improves the overall utilization and image quality of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082452_03102024_PF_FP_ABST
    Figure CN2024082452_03102024_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure provides a video processing method and apparatus, a computer device, and a storage medium. The video processing method comprises: receiving a first target image from a central processing unit, wherein the first target image comprises an image decoded by the central processing unit from a source video; performing first fusion processing on the first target image and a second target image to obtain a third target image, the second target image being a denoised first target image; and performing second fusion processing on a fourth target image and an amplified third target image to obtain a fifth target image, the fourth target image being a third target image having undergone super-resolution processing.
Need to check novelty before this filing date? Find Prior Art

Description

Video processing method and device, computer equipment, and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on and claims priority to an application filed in China with application number 202310318135.1 and filing date March 28, 2023. The disclosed content of the Chinese application is hereby introduced as a whole into this application. Technical Field

[0003] The present disclosure relates to the field of video processing, and in particular to a video processing method and apparatus, computer equipment, and storage media. Background Art

[0004] As users demand ever-higher video resolution and image clarity, traditional video processing technologies are no longer able to meet these demands. Traditional video processing solutions typically use a single device (e.g., a CPU, Central Processing Unit) to process video streams, but this is no longer sufficient for practical applications. Consequently, related technologies are using devices with large-scale computing capabilities (e.g., GPUs, Graphics Processing Units) to process video streams, improving performance.

[0005] Summary of the Invention

[0006] The present disclosure can provide a video processing method and apparatus, computer equipment, and storage medium.

[0007] The present disclosure can provide a video processing method, which is applied to a graphics processor. The method includes: receiving a first target image from a central processing unit, wherein the first target image includes an image decoded by the central processing unit from a source video; performing a first fusion process on the first target image and a second target image to obtain a third target image, the second target image is the first target image after denoising, and the first fusion process is used to fuse the first target image and the second target image, both of which have a first size; performing a second fusion process on the fourth target image and the third target image after enlargement to obtain a fifth target image, the fourth target image is the third target image after super-resolution; the second fusion process is used to fuse the fourth target image, both of which have a second size, with the third target image after enlargement.

[0008] The present disclosure can also provide a video processing device, which is applied to a graphics processor. The device includes: an image receiving module, which is used to receive a first target image from a central processing unit, wherein the first target image includes an image decoded by the central processing unit from a source video; a first fusion module, which is used to perform a first fusion process on the first target image and the second target image to obtain a third target image, the second target image is the first target image after denoising, and the first fusion process is used to fuse the first target image and the second target image, both of which have a first size; a second fusion module, which is used to perform a second fusion process on the fourth target image and the third target image after enlargement to obtain a fifth target image, the fourth target image is the third target image after super-resolution; the second fusion process is used to fuse the fourth target image, both of which have a second size, with the third target image after enlargement.

[0009] The present disclosure can also provide a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the video processing method described in any embodiment of the present disclosure.

[0010] The present disclosure can also provide a storage medium storing computer-readable instructions, which, when executed by one or more processors, enables the one or more processors to execute the video processing method described in any embodiment of the present disclosure.

[0011] The present disclosure can also provide a computer program, which, when executed by a processor, implements the video processing method described in any embodiment of the present disclosure.

[0012] The present disclosure can also provide a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the video processing method described in any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] FIG1 shows a schematic flow chart of a video processing method in one or more embodiments of the present disclosure.

[0014] FIG2 is a schematic diagram showing a flow chart of performing a first fusion process on a first target image and a second target image in one or more embodiments of the present disclosure.

[0015] FIG3 shows a schematic flow chart of processing a first target image and a second target image in parallel in one or more embodiments of the present disclosure.

[0016] FIG4 is a schematic diagram showing a flow chart of edge extraction processing on a first target image after Gaussian blur processing in one or more embodiments of the present disclosure.

[0017] FIG5 is a schematic diagram showing a flow chart of performing a second fusion process on the fourth target image and the amplified third target image in one or more embodiments of the present disclosure.

[0018] FIG6 is a schematic diagram showing a flow chart of executing a preset number of edge point conversion processes in one or more embodiments of the present disclosure.

[0019] FIG7 is a schematic flow chart showing an implementation of a video processing method in one or more embodiments of the present disclosure.

[0020] FIG8 shows a schematic structural diagram of a video processing device in one or more embodiments of the present disclosure.

[0021] FIG9 is a schematic diagram showing the internal structure of a computer device in one or more embodiments of the present disclosure. DETAILED DESCRIPTION

[0022] With the continuous development of computer technology, deep neural networks have become increasingly popular in fields such as natural language processing and video processing. Implementing video processing functions based on neural network models requires the use of a large number of matrix or convolution operators. Using CPUs alone often fails to meet the needs of practical applications. Therefore, related technologies need to be combined with GPUs for heterogeneous computing to better implement video processing functions.

[0023] In related technologies, neural network models are generally deployed in GPUs. The first intermediate processing result data generated by the GPU is sent to the CPU, and the second intermediate processing result data generated by the CPU is sent to the GPU. During a video processing process, it is often necessary to go through multiple interactions of the above intermediate processing result data. This situation leads to additional data transmission, which leads to a decrease in the processing performance of the video stream and additional storage overhead.

[0024] In view of this, the present disclosure provides a video processing method and apparatus, a computer device, and a storage medium to solve at least one problem existing in the related art.

[0025] As shown in FIG1 , at least one embodiment of the present disclosure can provide a video processing method, which is applied to a graphics processor. The processing method may include but is not limited to steps S101 to S103 , which are described in detail below.

[0026] Step S101 : receiving a first target image from a central processing unit, wherein the first target image comprises an image decoded by the central processing unit from a source video.

[0027] In the embodiment of the present disclosure, the source video is one or more videos in a video stream to be processed.

[0028] In the embodiment of the present disclosure, the video stream includes multiple source videos, and the central processing unit is used to obtain the source videos from the video stream, decode the first target image from the source videos, and send the first target image to the graphics processor.

[0029] Optionally, decoding the first target image from the source video includes: extracting the first target image from the source video at a predetermined frequency, or extracting each frame of image from the source video as the first target image, and the number of the first target images is multiple.

[0030] As an example, this embodiment parses the first target image from the source video using a pre-written program (eg, a C / C++, Python, or Golang program).

[0031] In step S102, a first fusion process is performed on the first target image and the second target image to obtain a third target image, where the second target image is the first target image after denoising. The first fusion process is used to fuse the first target image and the second target image, both of which have a first size.

[0032] The first target image and the second target image have the same image size, which is the first size.

[0033] In this embodiment, the graphics processor is used to perform denoising on the first target image, and specifically performs denoising on the input image through a denoising neural network model set in the graphics processor; wherein the denoising neural network model is a trained denoising neural network model.

[0034] Specifically, the denoising neural network model may be a decompression distortion model based on a residual network. The denoising neural network model includes, but is not limited to, convolutional layers, activation layers, residual blocks, maximum pooling layers, and average pooling layers. Based on the convolutional layers, activation layers, and residual blocks, the denoising neural network model is used to perform feature extraction on the first target image and, based on the feature extraction results, to denoise the first target image to obtain a second target image.

[0035] Among them, the size of the first target image is H×W×C, and the size of the second target image is H×W×C, where H represents the image height, W represents the image width, and C represents the number of image channels, that is, the dimensions of the first target image and the second target image are consistent.

[0036] Denoising the input image is an important application in the field of video processing based on deep neural networks. The input image is denoised through the neural network to generate a clearer image.

[0037] In this embodiment, the first target image and the second target image are fused into a third target image. Compared with the first target image and the second target image, the third target image is an image with enhanced image quality.

[0038] Step S103 is used to perform a second fusion process on the fourth target image and the third target image after the enlargement process to obtain a fifth target image, where the fourth target image is the third target image after the super-resolution process; the second fusion process is used to fuse the fourth target image and the third target image after the enlargement process, both of which have a second size.

[0039] The fourth target image and the enlarged third target image have the same image size, which is the second size. For example, the second size is 2000×2000 pixels and the first size is 1000×1000 pixels.

[0040] In this embodiment, the graphics processor is used to perform super-resolution processing on the third target image, and specifically can perform super-resolution processing on the input image through a super-resolution neural network model set in the graphics processor; wherein the super-resolution neural network model is a trained super-resolution neural network model.

[0041] Specifically, the super-resolution neural network model may be a super-resolution model based on a residual network, which may include but is not limited to convolutional layers, activation layers, and residual blocks. Based on the convolutional layers, activation layers, and residual blocks, the super-resolution model is used to perform feature extraction on the third target image and to super-resolution the third target image based on the feature extraction results, thereby obtaining a fourth target image with a higher resolution.

[0042] In one or more embodiments of the present disclosure, the size of the third target image may be, for example, H×W×C, and the size of the fourth target image may be, for example, 2H×2W×C. It can be seen that this embodiment obtains a fourth target image with a resolution twice that of the third target image, but of course it is not limited to this.

[0043] Super-resolution processing of input images is an important application in the field of video processing based on deep neural networks. Super-resolution processing of input images is performed through neural networks to generate images with higher resolution.

[0044] In one or more embodiments of the present disclosure, the process of the second fusion processing of the third target image and the fourth target image may be the same as the working process of the first fusion processing of the first target image and the second target image.

[0045] After generating the fifth target image, this embodiment sends the fifth target image to the central processing unit, and the central processing unit is further configured to encode the fifth target image into a target video.

[0046] The central processing unit of this embodiment is used to receive the fifth target image and to encode the fifth target image into a target video with better image quality and higher resolution.

[0047] Compared with the existing video stream heterogeneous processing solutions, the present disclosure avoids the additional data transmission process and reduces the data transmission time, thereby greatly improving the real-time processing performance of the video stream; and compared with the related technologies that cause additional data storage problems due to the transmission of intermediate processing result data, for example, the related technologies often face the problem of insufficient storage space when using a GPU card, the present disclosure can also significantly improve the utilization rate of device storage space, thereby improving device utilization, so that a GPU card can process more video streams simultaneously.

[0048] As shown in FIG. 2 , in at least one embodiment of the present disclosure, a first fusion process is performed on the first target image and the second target image, including but not limited to step S201 and step S202 .

[0049] Step S201 : Processing a first target image and a second target image in parallel to extract a first image sub-region from the first target image and a second image sub-region from the second target image.

[0050] In this embodiment, the parallel processing of the first target image and the second target image includes: processing the first target image and the second target image simultaneously, wherein a first relative position of the first image subregion in the first target image is different from a second relative position of the second image subregion in the second target image.

[0051] Step S202: Form a third target image using the first image sub-region and the second image sub-region. For example, the third target image is formed by combining the first image sub-region and the second image sub-region.

[0052] By performing parallel processing of the first target image and the second target image by the GPU, this embodiment can improve the efficiency of image fusion processing, and forming a third target image based on the first image sub-region and the second image sub-region helps to significantly improve the image quality of the third target image.

[0053] In one or more embodiments of the present disclosure, the first image subregion is an edge region image in the first target image, and the second image subregion is a non-edge region image in the second target image. The "edge region" involved in the present disclosure refers to a region where a set of pixel points with step changes or roof-like changes in image characteristics (such as pixel grayscale or texture, etc.) are located. The edge region image involved in the present disclosure is an image composed of edge regions in the first target image, and the non-edge region image is an image composed of non-edge regions in the second target image.

[0054] This embodiment forms a third target image using the first image sub-region and the second image sub-region, including: stitching the edge region image and the non-edge region image into the third target image.

[0055] Based on the above improved solution, this embodiment retains the edge area of ​​the first target image on the basis of denoising the first target image. This approach can effectively alleviate the image over-smoothing phenomenon that may be caused by denoising.

[0056] As shown in FIG3 , in one or more embodiments of the present disclosure, the first target image and the second target image are processed in parallel, including but not limited to step S301 and step S302 .

[0057] Step S301 : Processing a first target image based on a first fusion operator to obtain a first mask image; and processing a second target image based on a second fusion operator to obtain a second mask image.

[0058] In this embodiment, the first mask image is used as a mask for subsequent extraction processing of the first target image, and the second mask image is used as a mask for subsequent extraction processing of the second target image.

[0059] Step S302 : extracting a first image sub-region from the first target image according to the first mask image, and extracting a second image sub-region from the second target image according to the inverse mask image corresponding to the second mask image.

[0060] In this embodiment, the first target image can be represented by a first input vector and the first mask image can be represented by a first mask vector. The values ​​in the first mask vector include 1 and 0, 1 corresponds to the retained image area (for example, a pixel point), and 0 corresponds to the non-retained image area (for example, a pixel point).

[0061] Specifically, this embodiment can obtain a vector for representing the first image sub-region by multiplying the first input vector by the first mask vector, and determine the first image sub-region by the vector for representing the first image sub-region, so as to extract the first image sub-region from the first target image.

[0062] In this embodiment, the second target image can be represented by a second input vector, and the second mask image can be represented by a second mask vector. The values ​​in the second mask vector include 1 and 0, 1 corresponds to the retained image area, and 0 corresponds to the non-retained image area. The reverse mask image corresponding to the second mask image is represented by a third mask vector. The values ​​in the third mask vector include 0 and 1, 0 in the third mask vector corresponds to 1 in the second mask vector, and 1 in the third mask vector corresponds to 0 in the second mask vector. In this embodiment, the vector used to represent the second image sub-region can be obtained by multiplying the second input vector by the third mask vector, and then the second image sub-region is determined by the vector used to represent the second image sub-region, so as to realize the extraction of the second image sub-region from the second target image.

[0063] The first fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing, and dilation processing on the first target image, and the second fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing, and dilation processing on the second target image.

[0064] The second fusion operator involved in the present disclosure has the same function and implementation logic as the first fusion operator, and both are implemented in a parallel programming language based on the CUDA (Compute Unified Device Architecture) framework.

[0065] Based on the above-mentioned improved technical solution, the present disclosure can also provide a video processing method based on a fusion operator. Based on the method of extracting the first image sub-region from the first target image and extracting the second image sub-region from the second target image, this embodiment respectively utilizes the respective advantages of the first image sub-region and the second image sub-region to achieve the purpose of constructing an image with enhanced image quality through the first image sub-region and the second image sub-region.

[0066] As shown in FIG. 4 , in at least one embodiment of the present disclosure, the first target image is processed based on the first fusion operator, including performing edge extraction on the first target image after Gaussian blur processing.

[0067] Specifically, in at least one embodiment of the present disclosure, edge extraction processing is performed on the first target image after Gaussian blur processing, including but not limited to step S401 and step S402.

[0068] In step S401 , each pixel point on the first target image after Gaussian blur processing is classified into a non-edge point, a weak edge point, and a strong edge point.

[0069] After classification, the pixel points on the first target image include three types: non-edge points, weak edge points and strong edge points.

[0070] In this embodiment, feature recognition is performed on the first target image after Gaussian blur processing, and pixels are identified as non-edge points, weak edge points, or strong edge points based on the feature recognition results. The feature recognition results may be grayscale values. For example, pixels with grayscale values ​​within a first preset threshold range are identified as strong edge points, pixels with grayscale values ​​within a second preset threshold range are identified as weak edge points, and pixels with grayscale values ​​within a third preset threshold range are identified as non-edge points.

[0071] As shown in FIG6 , this embodiment marks pixels that are non-edge points as “0”, pixels that are weak edge points as “1”, and pixels that are strong edge points as “2”, but this is not limited to this.

[0072] In step S402, all weak edge points that meet preset conditions are converted into strong edge points to obtain an image after edge extraction processing. The preset conditions include that there are strong edge points among the pixels within a preset area centered on the weak edge point.

[0073] Based on the technical means of edge extraction provided above, the embodiment of the present disclosure can also accurately determine the pixel points belonging to the edge area with pixels as the smallest unit, thereby accurately dividing the edge area in the image.

[0074] In one or more embodiments of the present disclosure, all weak edge points that meet preset conditions are converted into strong edge points, including: executing a preset number of edge point conversion processes, the edge point conversion process including: determining weak edge points by parallel identification of multiple pixel points and converting weak edge points that meet the preset conditions into strong edge points until each pixel point is identified.

[0075] Among them, the preset number of times is at least two, and the specific value of the preset number of times can be set according to actual conditions. In the preferred embodiment of the present disclosure, the preset number of times is 16 times, but it is certainly not limited to this.

[0076] In this embodiment, during each edge point conversion process, multiple pixel points are processed in parallel, including identifying the multiple pixel points and converting the identified weak edge points into strong edge points.

[0077] For any weak edge point, if the edge point conversion process is only performed once, the problem of missing weak edge point conversion (i.e., missed detection) may occur. As shown in FIG6 , there are two weak edge points "1". If the edge point conversion process is only performed once, and the preset condition is, for example, that there are strong edge points among the pixels adjacent to the weak edge point, then only the weak edge point adjacent to the strong edge point "2" will be converted to a strong edge point, and the other weak edge point will not be converted to a strong edge point. In fact, after a weak edge point is converted to a new strong edge point, the weak edge points around the new strong edge point also need to be converted to strong edge points. To solve this problem, this embodiment performs multiple edge point conversion processes.

[0078] Therefore, the embodiment of the present disclosure can effectively reduce or even avoid the problem of missed detection that may occur in the edge point conversion process by executing the edge point conversion process a preset number of times, improve the reliability of the edge point conversion process of the present disclosure, and help improve the image quality of the processed image.

[0079] In one or more embodiments of the present disclosure, weak edge points are determined by performing parallel identification on multiple pixel points and weak edge points that meet preset conditions are converted into strong edge points, including: allocating a preset number of threads, and identifying weak edge points from multiple pixel points and converting weak edge points that meet preset conditions into strong edge points through the preset number of threads.

[0080] The preset number of threads is provided by the GPU, and in one or more embodiments of the present disclosure, the preset number of threads is, for example, 8192 threads. Taking 8192 threads as an example, 8192 pixels can be recognized simultaneously and weak edge points that meet the preset conditions can be converted into strong edge points.

[0081] Based on the above-mentioned improved technical solution, the embodiment of the present disclosure can give full play to the advantages of multi-threaded simultaneous execution of the GPU, improve the efficiency of pixel processing, thereby significantly improving device utilization, and further improving the video processing performance of the present disclosure.

[0082] In one or more embodiments of the present disclosure, the preset condition is that there are strong edge points among the pixels adjacent to the weak edge points.

[0083] The pixel points adjacent to the weak edge point in this embodiment include eight pixel points distributed around the weak edge point.

[0084] As shown in FIG6 , the weak edge point “1” illustrated in the figure includes two. During one edge point conversion process, a weak edge point “1” adjacent to a strong edge point “2” is converted to a new strong edge point “2”; during another edge point conversion process, a weak edge point “1” adjacent to the aforementioned new strong edge point “2” is also converted to a strong edge point “2”.

[0085] Based on the judgment of strong edge points adjacent to weak edge points, the embodiments of the present disclosure can further improve the accuracy of the edge point conversion process, thereby more accurately determining the edge area in the image, obtaining a more accurate mask image, and thus achieving the purpose of significantly enhancing the image quality.

[0086] In one or more embodiments of the present disclosure, processing the first target image based on the first fusion operator also includes dilating the image after edge extraction.

[0087] In this embodiment, the dilation process is performed on the image after edge extraction, including: performing maximum pooling process on the image after edge extraction to obtain a first mask image; the first mask image is a binary image.

[0088] For example, in this embodiment, a first mask image having grayscale values ​​of 0 and 255 may be obtained by maximum pooling processing, thereby achieving the purpose of enhancing image edges and image background.

[0089] In this embodiment, the maximum pooling layer in the denoising neural network model can be reused, and the maximum pooling layer is used to perform maximum pooling processing on the image after edge extraction processing, thereby further improving the model utilization rate.

[0090] The present disclosure is based on the method of performing maximum pooling processing on the image, which can effectively enhance the image edge and background, etc., and obtain a first mask image in the form of a binary image to achieve the purpose of more accurately selecting the first image sub-region from the first target image, etc.

[0091] In one or more embodiments of the present disclosure, processing the first target image based on the first fusion operator further includes: performing Gaussian blur processing on the first target image to obtain the first target image after Gaussian blur processing.

[0092] In this embodiment, performing Gaussian blur processing on the first target image includes performing convolution processing and pooling processing on the first target image. The convolution processing, for example, uses Gaussian blur convolution to process the first target image, and the pooling processing, for example, uses average pooling processing.

[0093] Among them, the Gaussian blur convolution processing in one or more embodiments of the present disclosure can reuse the convolution layer and average pooling layer in the denoising neural network model, significantly improving the utilization rate of the denoising neural network model.

[0094] Based on the above-mentioned scheme, the present disclosure can preprocess the first target image through Gaussian blur processing. The preprocessed image can effectively reduce the misjudgment in the edge extraction process, so as to more accurately identify the pixel points as non-edge points, weak edge points or strong edge points.

[0095] As shown in FIG. 5 , in at least one embodiment of the present disclosure, the fourth target image and the amplified third target image are subjected to a second fusion process, including but not limited to step S501 and step S502 .

[0096] Step S501 : performing linear interpolation processing on the third target image to obtain a linearly enlarged third target image.

[0097] As shown in FIG7 , this embodiment can linearly magnify the third target image by 2 times by linear interpolation. For example, this embodiment interpolates a 1000×1000 pixel image into a 2000×2000 pixel image by interpolation, but is certainly not limited thereto.

[0098] Step S502 : performing a second fusion process on the linearly amplified third target image and the fourth target image.

[0099] This embodiment utilizes the linearly amplified third target image to fuse with the fourth target image, which helps to further improve the fusion effect of the third target image and the fourth target image, that is, to further improve the resolution of the input image.

[0100] In at least one embodiment of the present disclosure, a second fusion process is performed on the fourth target image and the amplified third target image, including: processing the amplified third and fourth target images in parallel to extract a third image subregion from the third target image and a fourth image subregion from the fourth target image; and forming a fifth target image using the third and fourth image subregions. This embodiment improves the efficiency of the image fusion process by processing the third and fourth target images in parallel, thereby significantly improving the image quality of the fifth target image.

[0101] In at least one embodiment of the present disclosure, the third image subregion is an edge region image in the third target image, and the fourth image subregion is a non-edge region image in the fourth target image. The third image subregion and the fourth image subregion are used to form a fifth target image, including: stitching the edge region image in the third target image and the non-edge region image in the fourth target image into the fifth target image. Based on the above-mentioned improved scheme, this embodiment retains the edge region in the third target image on the basis of super-resolution processing. This method can effectively alleviate the phenomenon of over-sharpening of the image that may be caused by super-resolution processing.

[0102] In one or more embodiments of the present disclosure, forming a fifth target image using a third image subregion and a fourth image subregion includes: processing the third target image based on a third fusion operator to obtain a third mask image, and processing the fourth target image based on a fourth fusion operator to obtain a fourth mask image; extracting the third image subregion from the third target image based on the third mask image, and extracting the fourth image subregion from the fourth target image based on the fourth mask image. The third fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing, and dilation processing on the third target image, and the fourth fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing, and dilation processing on the fourth target image.

[0103] The disclosed embodiments can respectively utilize the respective advantages of the third image sub-region and the fourth image sub-region to achieve the purpose of constructing an image with higher resolution through the third image sub-region and the fourth image sub-region.

[0104] The third target image is processed based on the third fusion operator, including edge extraction processing on the third target image after Gaussian blur processing. The edge extraction processing on the third target image after Gaussian blur processing includes: classifying each pixel point on the third target image after Gaussian blur processing as a non-edge point, a weak edge point and a strong edge point; converting all weak edge points that meet the preset conditions into strong edge points to obtain an image after edge extraction processing, wherein the preset conditions include the presence of strong edge points in the pixel points within a preset area centered on the weak edge point. The embodiment of the present disclosure can accurately determine the pixel points belonging to the edge area with pixels as the smallest unit, thereby achieving more accurate division of the edge area in the image.

[0105] In the disclosed embodiment, all weak edge points that meet preset conditions are converted to strong edge points, including: executing an edge point conversion process a preset number of times; the edge point conversion process includes: determining weak edge points by performing parallel identification on multiple pixels, and converting weak edge points that meet the preset conditions to strong edge points until every pixel is identified. By executing the edge point conversion process a preset number of times, the disclosed embodiment can also effectively reduce or even avoid the problem of missed detection that may occur during the edge point conversion process.

[0106] In one or more embodiments of the present disclosure, weak edge points are determined by performing parallel identification on multiple pixel points and weak edge points that meet preset conditions are converted into strong edge points, including: allocating a preset number of threads, and using the preset number of threads to identify weak edge points from multiple pixel points and convert weak edge points that meet preset conditions into strong edge points. The preset condition is that there are strong edge points among the pixel points adjacent to the weak edge points. Based on the above scheme, the present disclosure can give full play to the advantages of multi-threaded simultaneous execution of the GPU, improve the efficiency of pixel processing, significantly improve device utilization, and further enhance the video processing performance of the present disclosure.

[0107] In one or more embodiments of the present disclosure, processing the third target image based on the third fusion operator also includes dilating the edge-extracted image. Dilating the edge-extracted image includes performing maximum pooling on the edge-extracted image to obtain a third mask image; the third mask image is a binary image. The present disclosure utilizes the maximum pooling method to effectively enhance image edges and background, thereby obtaining a third mask image in the form of a binary image to more accurately select a third image subregion from the third target image.

[0108] As shown in Figure 7, when the present disclosure is implemented, the first target image is input into the GPU in the form of a first input vector (input_tensor), and then the first input vector can be processed by a denoising neural network model (such as ar_model, an autoregressive model) to obtain an ar result vector (ar_tensor) and an original input vector (origin_tensor); wherein the ar result vector (or can be described as a second input vector) represents the second target image, and the original input vector is the same as the first input vector.

[0109] The ar result vector is fused with the original input vector, including performing Gaussian blur (Gaussian Blur), edge extraction (Canny) and dilation processing (dilate) on the ar result vector and the original input vector respectively to obtain the first mask vector and the second mask vector, calculating the first vector product of the first mask vector and the original input vector, and calculating the third mask vector and the second vector product of the ar result vector. The third mask vector represents the inverse mask image corresponding to the second mask image, and the sum of the first vector product and the second vector product is used as the enhancement result vector (enhance_tensor), thereby realizing the function of image enhancement stage fusion (combine_enhance).

[0110] Next, the enhanced result vector is super-resolved by the super-resolution model (sr_model, super-resolution_model) to obtain an sr result vector; the disclosed embodiment can linearly amplify the enhanced result vector, specifically by linear interpolation to achieve linear amplification, to obtain a linearly amplified enhanced vector (enhance_resize_tensor), and the sr result vector is fused with the linearly amplified enhanced vector, and Gaussian blurring, edge extraction, and expansion processing are performed on the sr result vector and the linearly amplified enhanced vector respectively to obtain a fourth mask vector and a fifth mask vector, and the final result vector (result_tensor) is calculated based on the fourth mask vector and the fifth mask vector. The logical process of calculating the final result vector is the same as the logical process of calculating the enhanced result vector, thereby realizing the super-resolution stage (combine_sr) fusion function.

[0111] The video processing method provided by the embodiments of the present disclosure can greatly reduce the data transmission process between the GPU and the CPU, and significantly reduce the read and write operations and memory consumption of intermediate result data such as intermediate calculation quantities in the storage space. In some embodiments of the present disclosure, real-time, high-quality super-resolution processing of three video streams can be simultaneously achieved on a single GPU card (such as a single T4 card). Actual measurements have shown that the embodiments of the present disclosure can increase the video stream processing speed from the traditional 17 frames per second to 39 frames per second.

[0112] As shown in Figure 8, based on the same inventive technical concept as the video processing method provided by one or more embodiments of the present disclosure, one or more embodiments of the present disclosure can also provide a video processing device, which is applied to a graphics processor, that is, the video processing device can be integrated on the graphics processor.

[0113] The video processing device includes but is not limited to an image receiving module 801 , a first fusion module 802 and a second fusion module 803 .

[0114] The image receiving module 801 is configured to receive a first target image from a central processing unit, wherein the first target image includes an image decoded by the central processing unit from a source video.

[0115] The first fusion module 802 is used to perform a first fusion process on the first target image and the second target image to obtain a third target image, where the second target image is the first target image after denoising. The first fusion process is used to fuse the first target image and the second target image, both of which have a first size.

[0116] Optionally, the first fusion module includes a parallel processing module and an image forming module.

[0117] The parallel processing module is used to process the first target image and the second target image in parallel to extract a first image sub-region from the first target image and a second image sub-region from the second target image.

[0118] The image forming module is configured to form a third target image using the first image sub-region and the second image sub-region.

[0119] Optionally, the first image sub-region is an edge region image in the first target image, and the second image sub-region is a non-edge region image in the second target image. The image forming module is configured to stitch the edge region image and the non-edge region image into a third target image.

[0120] Optionally, the parallel processing module includes an image processing module and an image extraction module.

[0121] The image processing module is used to process the first target image based on the first fusion operator to obtain a first mask image, and to process the second target image based on the second fusion operator to obtain a second mask image.

[0122] The image extraction module is used to extract a first image sub-region from a first target image according to a first mask image, and to extract a second image sub-region from a second target image according to a reverse mask image corresponding to a second mask image.

[0123] The first fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing, and dilation processing on the first target image, and the second fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing, and dilation processing on the second target image.

[0124] Optionally, the image processing module is used to perform edge extraction processing on the first target image after Gaussian blur processing. The image processing module includes a pixel classification module and a pixel conversion module.

[0125] The pixel classification module is used to classify each pixel on the first target image after Gaussian blur processing into a non-edge point, a weak edge point and a strong edge point.

[0126] The pixel conversion module is used to convert all weak edge points that meet preset conditions into strong edge points to obtain an image after edge extraction processing. The preset conditions include the presence of strong edge points among the pixels within a preset area centered on the weak edge point.

[0127] Optionally, the pixel point conversion module is used to perform a preset number of edge point conversion processes.

[0128] The edge point conversion process includes: determining weak edge points by performing parallel recognition on multiple pixel points and converting weak edge points that meet preset conditions into strong edge points until each pixel point is recognized.

[0129] Optionally, the pixel conversion module is configured to allocate a preset number of threads, and identify weak edge points from a plurality of pixel points through the preset number of threads and convert the weak edge points meeting preset conditions into strong edge points.

[0130] Optionally, the preset condition is that there is a strong edge point among the pixel points adjacent to the weak edge point.

[0131] Optionally, the image processing module is further configured to dilate the image after edge extraction. The image processing module further includes a maximum pooling module.

[0132] The maximum pooling module is used to perform maximum pooling processing on the image after edge extraction processing to obtain a first mask image; the first mask image is a binary image.

[0133] Optionally, the image processing module is further configured to perform Gaussian blur processing on the first target image to obtain the first target image after Gaussian blur processing.

[0134] The second fusion module 803 is used to perform a second fusion process on the fourth target image and the third target image after the enlargement process to obtain a fifth target image, where the fourth target image is the third target image after the super-resolution process; the second fusion process is used to fuse the fourth target image and the third target image after the enlargement process, both of which have a second size.

[0135] Optionally, the second fusion module 803 includes a linear interpolation module and a third fusion module.

[0136] The linear interpolation module is used to perform linear interpolation processing on the third target image to obtain a linearly enlarged third target image.

[0137] The third fusion module is used to fuse the linearly amplified third target image with the fourth target image.

[0138] The video processing device in the embodiment of the present disclosure may further include an image sending module, which is used to send the fifth target image to the central processing unit, and the central processing unit is further used to encode the fifth target image into a target video.

[0139] In summary, the beneficial effects of the present disclosure include at least: compared with the related art, the present disclosure performs the data processing processes of image reception, image denoising, first image fusion, image super-resolution, and secondary image fusion through the graphics processor, thereby avoiding the additional intermediate processing result data transmission process. It can be seen that the present disclosure only transmits images to be processed and processed images between the central processing unit and the graphics processor, which significantly reduces the data transmission process between the central processing unit and the graphics processor, improves video processing efficiency and equipment utilization, and thus greatly improves the real-time processing performance of video streams. More video streams can be processed under the same hardware conditions.

[0140] As shown in Figure 9, based on the same inventive technical concept as the video processing method provided in one or more embodiments of the present disclosure, one or more embodiments of the present disclosure may also provide a computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the video processing method in any embodiment of the present disclosure. The detailed process of the video processing method has been described in detail in this specification and will not be repeated here.

[0141] As shown in Figure 9, based on the same inventive technical concept as the video processing method provided in one or more embodiments of the present disclosure, one or more embodiments of the present disclosure may also provide a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the video processing method in any embodiment of the present disclosure. The detailed process of the video processing method has been described in detail in this specification and will not be repeated here.

[0142] As shown in Figure 9, based on the same technical concept as the video processing method provided in one or more embodiments of the present disclosure, one or more embodiments of the present disclosure may also provide a computer program that, when executed by a processor, implements the video processing method described in any embodiment of the present disclosure. The detailed process of the video processing method has been described in detail in this specification and will not be repeated here.

[0143] As shown in Figure 9, based on the same inventive technical concept as the video processing method provided by one or more embodiments of the present disclosure, one or more embodiments of the present disclosure may also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the video processing method described in any embodiment of the present disclosure.

[0144] The logic and / or steps represented in a flowchart or otherwise described herein, which can be considered, for example, as a program listing of executable instructions for implementing the logical functions, can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate, or transmit a computer program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM, or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0145] It should be understood that various parts of the present disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement the present invention: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0146] In the description of this specification, the description with reference to the terms "this embodiment", "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are mutually inconsistent.

[0147] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0148] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent replacements, and simple improvements made to the essential contents of the present disclosure shall be included in the scope of protection of the present disclosure.

Claims

1. A video processing method, applied to a graphics processor, the method comprising: Receive a first target image from a central processor, wherein the first target image comprises an image decoded by the central processor from a source video; Performing a first fusion process on the first target image and the second target image to obtain a third target image, wherein the second target image is the first target image after denoising, and the first fusion process is used to fuse the first target image and the second target image both having a first size; The fourth target image is subjected to a second fusion process with the third target image after the enlargement process to obtain a fifth target image, wherein the fourth target image is the third target image after the super-resolution process; the second fusion process is used to fuse the fourth target image and the third target image after the enlargement process, both of which have a second size.

2. The video processing method according to claim 1, wherein the first target image and the second target image are subjected to a first fusion process, comprising: Processing the first target image and the second target image in parallel to extract a first image sub-region from the first target image and a second image sub-region from the second target image; The third target image is formed using the first image sub-region and the second image sub-region.

3. The video processing method according to claim 2, wherein the first image sub-region is an edge region image in the first target image, and the second image sub-region is a non-edge region image in the second target image; The forming the third target image by using the first image sub-region and the second image sub-region comprises: The edge area image and the non-edge area image are stitched together to form the third target image.

4. The video processing method according to claim 2 or 3, wherein the parallel processing of the first target image and the second target image comprises: Processing the first target image based on a first fusion operator to obtain a first mask image; and processing the second target image based on a second fusion operator to obtain a second mask image; Extracting a first image sub-region from the first target image according to the first mask image, and extracting a second image sub-region from the second target image according to the reverse mask image corresponding to the second mask image; The first fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing and dilation processing on the first target image, and the second fusion operator is used to sequentially perform Gaussian blur processing, edge extraction processing and dilation processing on the second target image. Edge extraction and expansion processing.

5. The video processing method according to claim 4, wherein the processing of the first target image based on the first fusion operator comprises performing edge extraction processing on the first target image after Gaussian blur processing; The edge extraction process of the first target image after the Gaussian blur process comprises: Classify each pixel point on the first target image after Gaussian blur processing into a non-edge point, a weak edge point and a strong edge point; All weak edge points that meet preset conditions are converted into strong edge points to obtain an image after edge extraction processing. The preset conditions include the presence of strong edge points in pixels within a preset area centered on the weak edge point.

6. The video processing method according to claim 5, wherein the step of converting all weak edge points that meet a preset condition into strong edge points comprises: The edge point conversion process is performed a preset number of times, wherein the edge point conversion process includes: determining weak edge points by identifying multiple pixel points in parallel and converting weak edge points that meet preset conditions into strong edge points until each pixel point is identified.

7. The video processing method according to claim 6, wherein the determining of weak edge points by parallel recognition of multiple pixel points and converting weak edge points that meet preset conditions into strong edge points comprises: A preset number of threads are allocated, and weak edge points are identified from the plurality of pixel points through the preset number of threads, and weak edge points that meet preset conditions are converted into strong edge points.

8. The video processing method according to any one of claims 5 to 7, wherein the preset condition is that there are strong edge points among the pixel points adjacent to the weak edge points.

9. The video processing method according to any one of claims 4 to 8, wherein the processing of the first target image based on the first fusion operator further comprises dilating the image after edge extraction processing; The step of dilating the image after edge extraction includes: Performing maximum pooling processing on the image after edge extraction processing to obtain the first mask image; The first mask image is a binary image.

10. The video processing method according to any one of claims 1 to 9, wherein the performing a second fusion process on the fourth target image and the amplified third target image comprises: Performing linear interpolation processing on the third target image to obtain a linearly enlarged third target image; The linearly enlarged third target image and the fourth target image are subjected to a second fusion process.

11. A video processing device, comprising: An image receiving module, configured to receive a first target image from a central processing unit, wherein the first target image comprises an image decoded by the central processing unit from a source video; a first fusion module, configured to perform a first fusion process on the first target image and the second target image to obtain a third target image, wherein the second target image is the first target image after denoising, and the first fusion process is configured to fuse the first target image and the second target image both having a first size; The second fusion module is used to perform a second fusion process on the fourth target image and the third target image after the enlargement process to obtain a fifth target image, wherein the fourth target image is the third target image after the super-resolution process; the second fusion process is used to fuse the fourth target image and the third target image after the enlargement process, both of which have a second size.

12. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the video processing method according to any one of claims 1 to 10.

13. A storage medium storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the video processing method according to any one of claims 1 to 10.

14. A computer program, wherein when the computer program is executed by a processor, the computer program implements the video processing method according to any one of claims 1 to 10.

15. A computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the video processing method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Image processing method, model training method and device, medium and equipment

    CN112381717A

  • Image processing method and device, electronic equipment and storage medium

    CN112991203A

  • Parallel optical flow method moving target detection method and system based on CUDA (Compute Unified Device Architecture)

    CN114913194A

  • Automated capturing of images comprising a desired feature

    US20220114806A1