Video processing method and device and readable storage medium

By segmenting the content of the video stream and determining the scene categories, video enhancement processing is performed for different scene categories, which solves the problem of uncontrollable enhancement processing effects when the video content is complex, and achieves better visual effects.

CN118803384APending Publication Date: 2024-10-18MIGU VIDEO TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410865041.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing video enhancement processing technology has uncontrollable effects when the video content is complex, and cannot effectively improve the visual effect.

Method used

By segmenting the content of the video stream, the scene category of each video clip is determined, and targeted video enhancement processing is performed based on the category, including color balance, sharpening, and light adjustment, and finally merged into the target video.

Benefits of technology

It achieves effective enhancement processing of complex video content, improves visual effects, and is more controllable and effective than a single enhancement strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803384A_ABST
    Figure CN118803384A_ABST
Patent Text Reader

Abstract

The invention provides a video processing method and device and a readable storage medium, and the method comprises the steps: segmenting a video stream according to the video content of the video stream, and obtaining a plurality of video segments; for each video clip, determining a scene category to which the video clip belongs; according to the scene category to which the video clip belongs, performing video enhancement processing on the video clip to obtain an enhanced video clip; and combining the plurality of video clips after enhancement processing into a target video. According to the scheme, the video clips of different scene categories from the same video stream are subjected to corresponding enhancement processing in different modes, so that the problem that the effect of complex video content enhancement processing is uncontrollable is solved, and compared with a single enhancement strategy, a better visual effect can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and in particular to a video processing method, device and readable storage medium. Background Art

[0002] Video enhancement processing mainly processes video frames in terms of contrast, dynamic range, brightness, noise, etc., so that the video frames have better display effects.

[0003] At present, video enhancement processing is only an enhancement algorithm designed for a single scene or a single enhancement strategy. When the video content is complex, the enhancement processing effect is uncontrollable. Summary of the invention

[0004] The object of the present invention is to provide a video processing method, device and readable storage medium, which are used to solve the problem that the enhancement processing effect is uncontrollable when the video content is complex.

[0005] In order to solve the above technical problem, an embodiment of the present invention provides a video processing method, which includes:

[0006] Segment the video stream according to the video content of the video stream to obtain multiple video clips;

[0007] For each of the video clips, determining the scene category to which the video clip belongs;

[0008] According to the scene category to which the video clip belongs, performing video enhancement processing on the video clip to obtain an enhanced video clip;

[0009] Merge the plurality of enhanced video clips into a target video.

[0010] In some embodiments, determining the scene category to which the video clip belongs includes:

[0011] Determining, based on the video parameters of the video clip, whether the video clip is a video clip supporting a standard dynamic range (SDR);

[0012] When it is determined that the video clip is a video clip supporting SDR, and the contrast of an image in the video clip is less than a first preset threshold, and the saturation is less than a second preset threshold, determining that the scene category to which the video clip belongs is a category to be color and hue balanced;

[0013] The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises:

[0014] The first deep neural network is used to perform color balance and tone adjustment processing on the image in the video clip to obtain an enhanced video clip.

[0015] In some embodiments, determining the scene category to which the video clip belongs includes:

[0016] Using the YCbCr color model to perform skin color recognition on the image in the video clip to obtain the skin color ratio of the video clip, where Y represents the brightness and concentration of the color, Cb represents the blue concentration offset of the color, and Cr represents the red concentration offset of the color;

[0017] When the skin color ratio of the video clip is greater than or equal to a third preset threshold, or the skin color ratio of the video clip is less than a fourth preset threshold, determining that the scene category to which the video clip belongs is a category to be partially adjusted;

[0018] When the skin color proportion of the video clip is greater than or equal to the third preset threshold, the video clip is subjected to skin color protection enhancement processing to obtain the enhanced video clip; or, when the skin color proportion of the video clip is less than the fourth preset threshold, the video clip is subjected to adaptive color enhancement processing to obtain the enhanced video clip.

[0019] In some embodiments, determining the scene category to which the video clip belongs includes:

[0020] When the saturation of the image in the video clip is less than a fifth preset threshold, determining that the scene category to which the video clip belongs is a category to be sharpened;

[0021] The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises:

[0022] The image in the video clip is sharpened to obtain an enhanced video clip.

[0023] In some embodiments, determining the scene category to which the video clip belongs includes:

[0024] When the illumination of the image in the video clip is less than a sixth preset threshold, or when the illumination of the image in the video clip is greater than or equal to a seventh preset threshold, determining that the scene category to which the video clip belongs is a light category to be adjusted;

[0025] The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises:

[0026] For a first image in the video clip whose illumination is less than the sixth preset threshold, estimating and adjusting a reflection component of the first image to obtain a processed first image;

[0027] For a second image in the video clip whose illumination is greater than or equal to the seventh preset threshold, performing migration and adjustment processing on color information of the second image to obtain a processed second image;

[0028] The processed first image and the processed second image are combined to obtain an enhanced video segment.

[0029] In some embodiments, the method further comprises:

[0030] Obtaining the brightness of each frame image in the target video;

[0031] When the brightness of the target image meets a preset condition, a first average brightness of multiple frames of images is calculated, and the brightness of each frame of the multiple frames of images is adjusted to the first average brightness; wherein the multiple frames of images include the target image and N frames of images before and after the target image, where N is a positive integer; the brightness of the target image meets the preset condition including one of the following:

[0032] The brightness of the target image is greater than an eighth preset threshold;

[0033] The brightness of the target image is less than or equal to a ninth preset threshold, and the eighth preset threshold is greater than the ninth preset threshold.

[0034] In some embodiments, the obtaining the brightness of each frame image in the target video;

[0035] For each frame image in the target video, convert the frame image into a YUV image, wherein the Y channel represents brightness information, and the U channel and the V channel represent chrominance information;

[0036] Extract the pixel value of the Y channel in the YUV image;

[0037] The second average value of the pixel values ​​of the Y channel is determined as the brightness of the frame image.

[0038] The embodiment of the present invention further provides a video processing device, comprising:

[0039] A video segmentation module, used to segment the video stream according to the video content of the video stream to obtain multiple video clips;

[0040] A first processing module, configured to determine, for each of the video clips, a scene category to which the video clip belongs;

[0041] An enhancement processing module, used for performing video enhancement processing on the video clip according to the scene category to which the video clip belongs, to obtain the enhanced video clip;

[0042] The video merging module is used to merge the multiple enhanced video clips into a target video.

[0043] An embodiment of the present invention further provides a video processing device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; when the processor executes the program, the above-mentioned video processing method is implemented.

[0044] The embodiment of the present invention further provides a readable storage medium on which a program is stored. When the program is executed by a processor, the steps in the above-mentioned video processing method are implemented.

[0045] The present invention also provides a computer program product, comprising computer instructions, which implement the steps in the video processing method as described above when executed by a processor.

[0046] The beneficial effects of the above technical solution of the present invention are as follows:

[0047] In the above scheme, the video stream is divided according to the video content of the video stream to obtain multiple video clips; then for each of the video clips, the scene category to which each of the video clips belongs is determined; according to the scene category to which the video clips belong, the video enhancement processing is performed on the video clips to obtain enhanced video clips; finally, the multiple enhanced video clips are merged into a target video. In this way, by performing corresponding different enhancement processing methods on video clips of different scene categories from the same video stream, the problem of uncontrollable enhancement processing effects of complex video content is solved, and better visual effects can be achieved compared with a single enhancement strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a flow chart of a video processing method according to an embodiment of the present invention;

[0049] Figure 2 FIG2 is a second flow chart of the video processing method according to an embodiment of the present invention;

[0050] Figure 3 FIG. 4 is a module diagram of a video processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0052] The present invention provides a video processing method to solve the problem that the enhancement processing effect is uncontrollable when the existing video content is complex.

[0053] The video processing method provided by the embodiment of the present invention is further described below.

[0054] like Figure 1 As shown, an embodiment of the present invention provides a video processing method, which may include:

[0055] Step 101, dividing the video stream according to the video content of the video stream to obtain multiple video segments;

[0056] In order to enhance the video stream more accurately, the acquired video stream is segmented according to the video content to obtain multiple video clips. Since the application scenario of the method of the present invention has requirements on speed and performance, in some embodiments, step 101 includes:

[0057] Step 1011, using a second deep neural network to learn the video content of the video stream to obtain feature information of the video content;

[0058] Step 1012: based on the feature information of the video content, segment the video stream to obtain multiple video segments.

[0059] Optionally, the second deep neural network is a three-dimensional convolutional neural network (3D-CNN). Accordingly, the three-dimensional convolutional neural network is used to learn the spatiotemporal features of the video content; and then the video stream is segmented into multiple different video segments using the spatiotemporal features of the video content.

[0060] Step 102, for each of the video clips, determining the scene category to which the video clip belongs;

[0061] Optionally, based on the content features of each video clip, the scene category to which each video clip belongs is determined. Specifically, the scene category to which the video clip belongs is determined by classifying the video clip using the content features (such as color, texture, shape, motion, brightness, etc.) of the video clip. For example, by analyzing the brightness information in the video clip, the video clip can be divided into high brightness and low illumination categories.

[0062] Optionally, the scene categories to which the video clip belongs include, but are not limited to: a category to be balanced in color and tone, a category to be locally adjusted, a category to be sharpened, and a category to be adjusted in light.

[0063] Step 103, performing video enhancement processing on the video clip according to the scene category to which the video clip belongs, to obtain an enhanced video clip;

[0064] It should be noted that the video clips belong to different scene categories, and the corresponding video enhancement processing methods are different. That is, the present invention can perform different degrees of video enhancement processing for different scene categories to achieve better visual effects.

[0065] Step 104: merge the plurality of enhanced video clips into a target video.

[0066] Specifically, based on the timing information of the video stream, a plurality of enhanced video segments are merged into a target video.

[0067] Since the above are video clips obtained after performing different degrees of video enhancement processing on the scene categories to which different video clips belong, these enhanced video clips are merged into a target video, which can achieve better visual effects than a single enhancement strategy.

[0068] In some embodiments, in the above step 102, determining the scene category to which the video clip belongs includes:

[0069] Determining, based on the video parameters of the video clip, whether the video clip is a video clip supporting a standard dynamic range (SDR);

[0070] Here, Standard Dynamic Range (SDR) is compared with High-Dynamic Range (HDR). SDR images do not have more comprehensive details and do not have a wider color range. When the image is overexposed, the information of the brighter part of the image will be lost; similarly, when the image is underexposed, the information of the darker part of the image will also be lost.

[0071] When it is determined that the video clip is a video clip supporting SDR, and the contrast of an image in the video clip is less than a first preset threshold, and the saturation is less than a second preset threshold, determining that the scene category to which the video clip belongs is a category to be color and hue balanced;

[0072] Correspondingly, the above step 103, performing video enhancement processing on the video clip according to the scene category to which the video clip belongs, to obtain the enhanced video clip, includes:

[0073] The first deep neural network is used to perform color balance and tone adjustment processing on the image in the video clip to obtain an enhanced video clip.

[0074] It should be noted that each image in the video clip is input into the first deep neural network for color balance and tone adjustment according to the time sequence information.

[0075] Here, the color balance and hue adjustment of an image refers to: in case that the overall color of the image is unbalanced or the hue is inappropriate, the color effect of the image can be improved by adjusting the color balance and hue.

[0076] For example, color enhancement technology based on deep learning, combined with convolutional networks, fully connected networks, and regression algorithms, can achieve color enhancement effects by automatically adjusting the brightness, contrast, and saturation of the video.

[0077] Optionally, the first deep neural network includes an image resizing module, a lightweight neural network (such as mobileNetV2), a Lab color histogram, a feature connection layer, a fully connected network, and a regression layer. Based on this, after the image in the video clip passes through the resizing module, an image of a preset size is obtained; then, the image is respectively passed through the lightweight neural network and the Lab color histogram, one, after the lightweight neural network processing, the feature information of the image is obtained; the other, after the Lab color histogram, the image lab color value is obtained; then, the image feature information and the image lab color value are passed through the feature connection layer for feature connection processing; finally, they are sequentially input into the fully connected network and the regression layer to obtain an image after color balance and hue adjustment.

[0078] In some embodiments, in the above step 102, determining the scene category to which the video clip belongs includes:

[0079] Using the YCbCr color model to perform skin color recognition on the image in the video clip to obtain the skin color ratio of the video clip, where Y represents the brightness and concentration of the color, Cb represents the blue concentration offset of the color, and Cr represents the red concentration offset of the color;

[0080] When the skin color ratio of the video clip is greater than or equal to a third preset threshold, or the skin color ratio of the video clip is less than a fourth preset threshold, determining that the scene category to which the video clip belongs is a category to be partially adjusted;

[0081] Correspondingly, the above step 103, performing video enhancement processing on the video clip according to the scene category to which the video clip belongs, to obtain the enhanced video clip, includes:

[0082] When the skin color proportion of the video clip is greater than or equal to the third preset threshold, the video clip is subjected to skin color protection enhancement processing to obtain the enhanced video clip; or, when the skin color proportion of the video clip is less than the fourth preset threshold, the video clip is subjected to adaptive color enhancement processing to obtain the enhanced video clip.

[0083] It should be noted that local adjustments can enhance the colors and details of specific areas.

[0084] In some embodiments, in the above step 102, determining the scene category to which the video clip belongs includes:

[0085] When the saturation of the image in the video clip is less than a fifth preset threshold, determining that the scene category to which the video clip belongs is a category to be sharpened;

[0086] Here, the saturation of the image in the video clip is less than the fifth preset threshold, indicating that the image details are not clear enough or need to be emphasized, and the visual effect of the image can be improved by performing the following sharpening processing on the image.

[0087] Correspondingly, step 103, performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip, includes:

[0088] The image in the video clip is sharpened to obtain an enhanced video clip.

[0089] In some embodiments, in the above step 102, determining the scene category to which the video clip belongs includes:

[0090] When the illumination of the image in the video clip is less than a sixth preset threshold, or when the illumination of the image in the video clip is greater than or equal to a seventh preset threshold, determining that the scene category to which the video clip belongs is a light category to be adjusted;

[0091] Correspondingly, the above step 103, performing video enhancement processing on the video clip according to the scene category to which the video clip belongs, to obtain the enhanced video clip, includes:

[0092] (1) for a first image in the video clip whose illumination is less than the sixth preset threshold, estimating and adjusting the reflection component of the first image to obtain a processed first image;

[0093] It should be understood that the illumination of an image refers to the light intensity of the image. In view of the influence of different lighting conditions on the color of the image, the overall color effect of the image can be improved by processing under different lighting conditions.

[0094] Here, the illumination of the first image is less than the sixth preset threshold, that is, the first image is a low-illuminance image. The image enhancement algorithm based on Retinex theory can be used to estimate and adjust the reflection component of the first image to obtain the processed first image.

[0095] The color enhancement algorithm based on Retinex theory can be used for video color enhancement. The algorithm decomposes the video frame (first image) into reflection component and illumination component, and enhances the color and contrast of the video by estimating and adjusting the reflection component. For low-light videos, multi-scale Retinex algorithm, adaptive Retinex algorithm, etc. can be used to adapt to videos under different lighting conditions.

[0096] (2) for a second image in the video clip whose illumination is greater than or equal to the seventh preset threshold, performing migration and adjustment processing on color information of the second image to obtain a processed second image;

[0097] Here, the illumination of the second image is greater than or equal to the seventh preset threshold, that is, the second image is a high-brightness image, and a color enhancement algorithm based on color migration can be used to perform color enhancement on the second image.

[0098] The color enhancement algorithm based on color migration achieves color enhancement of the video by migrating the color information in the video frame (second image) to other color spaces. You can also use methods based on color gamut transformation or color gamut expansion to migrate and adjust the color information in the video frame to enhance the color and contrast of the video. For videos shot under strong light, you can choose a suitable color space for migration and adjustment to achieve a better enhancement effect.

[0099] (3) The processed first image and the processed second image are combined to obtain an enhanced video clip.

[0100] Specifically, based on the time sequence information of the video segment, the processed first image and the processed second image are merged to obtain the enhanced video segment.

[0101] High-quality video is consistent in time, but because video enhancement is performed on each frame, each block, or the entire video, the video will flicker. The flickering factor is caused by the excessive change in brightness of the previous and next frames. In order to solve this problem, in some embodiments, the method of the present invention also includes:

[0102] 1. Obtain the brightness of each frame image in the target video;

[0103] Optionally, this step includes:

[0104] For each frame image in the target video, convert the frame image into a YUV image, wherein the Y channel represents brightness information, and the U channel and the V channel represent chrominance information;

[0105] Extract the pixel value of the Y channel in the YUV image;

[0106] The second average value of the pixel values ​​of the Y channel is determined as the brightness of the frame image.

[0107] It should be noted that in the YUV space, each color has a brightness signal Y and two chrominance signals U and V. The brightness signal represents the intensity, which is disconnected from the chrominance signal so that the intensity can be changed without affecting the color. For the brightness detection of the Y channel, it is actually processing the brightness component. For example, in the JPEG image format, the brightness information is stored in the Y channel.

[0108] Here, the pixel value of each pixel in the Y channel represents the brightness of the pixel. The brightness of the entire image (zero-degree average) is the average value of the pixel values ​​of the Y channel.

[0109] 2. When the brightness of the target image meets a preset condition, a first average brightness of multiple frames of images is calculated, and the brightness of each frame of the multiple frames of images is adjusted to the first average brightness; wherein the multiple frames of images include the target image and N frames of images before and after the target image, where N is a positive integer; the brightness of the target image meets the preset condition including one of the following:

[0110] The brightness of the target image is greater than an eighth preset threshold;

[0111] The brightness of the target image is less than or equal to a ninth preset threshold, and the eighth preset threshold is greater than the ninth preset threshold.

[0112] Here, the brightness of the target image greater than the eighth preset threshold value indicates that the brightness of the target image is too bright, and the brightness of the target image less than or equal to the ninth preset threshold value indicates that the brightness of the target image is too dark. Images that are too bright or too dark are likely to cause video flicker. Therefore, the brightness of the target image and N frames of images before and after the target image are averaged (i.e., the first average value) and the brightness of each frame of the multiple frames is adjusted to the first average value. This process is the process of removing flicker.

[0113] Optionally, a Long Short-Term Memory (LSTM) network is used to capture temporal dependencies in the target video. The LSTM network typically includes multiple LSTM layers and fully connected layers, and is used to learn and remove flicker from an input video sequence (such as a video sequence of the target video).

[0114] See also Figure 2 The following is an example to illustrate the overall process of the method of the present invention. The details are as follows:

[0115] 1) Perform scene segmentation and picture feature analysis on the video stream.

[0116] Specifically, shot segmentation (i.e., scene segmentation) is performed based on deep learning (deep neural network) multimodal information analysis technology; the autoencoder recognizes the characteristics of the picture to perform scene classification, that is, obtains the scene category to which the video clip belongs.

[0117] 2) Perform denoising enhancement, image sharpening and image denoising on the video clips; select the corresponding enhancement processing model for video clips of different scene categories to perform video enhancement. This part can be defined as an adaptive enhancement decision maker.

[0118] 3) For video clips to be balanced in color and tone, image enhancement is performed based on a neural network method.

[0119] For example, the neural network includes a resize module, mobileNetV2, Lab color histogram, feature connection layer, fully connected network (consisting of 3 fully connected layers) and regression layer.

[0120] 4) For the video clips to be partially adjusted, skin color recognition is performed based on the YCbCr color model to determine whether the skin color ratio of the obtained video clip is greater than or equal to the threshold; if so, the video clip is enhanced using the skin color protection enhancement algorithm; if not, the video clip is enhanced using the adaptive color enhancement algorithm.

[0121] 5) For the video clips to be sharpened, the images in the video clips are sharpened and enhanced.

[0122] 6) For video clips with different lighting conditions; for low-light images in video clips, the color enhancement algorithm based on Retinex theory is used for image enhancement; for high-exposure images in video clips, the color enhancement algorithm based on color migration is used for image enhancement;

[0123] 7) After the processed video clips are merged into a target video, brightness anomaly detection is performed on the target video. If flicker is detected, de-flickering is performed.

[0124] The specific process of de-flickering processing can be found in the above-mentioned embodiment, which will not be described in detail here.

[0125] like Figure 3 As shown, an embodiment of the present invention provides a video processing device, the device comprising:

[0126] The video segmentation module 301 is used to segment the video stream according to the video content of the video stream to obtain multiple video segments;

[0127] A first processing module 302 is used to determine, for each of the video clips, the scene category to which the video clip belongs;

[0128] An enhancement processing module 303 is used to perform video enhancement processing on the video clip according to the scene category to which the video clip belongs, so as to obtain the enhanced video clip;

[0129] The video merging module 304 is used to merge the multiple enhanced video clips into a target video.

[0130] Optionally, the first processing module 302 includes:

[0131] A first processing unit, configured to determine whether the video clip is a video clip supporting a standard dynamic range (SDR) based on a video parameter of the video clip;

[0132] A second processing unit is configured to determine that the scene category to which the video clip belongs is a category to be color and hue balanced when it is determined that the video clip is a video clip supporting SDR and the contrast of an image in the video clip is less than a first preset threshold and the saturation is less than a second preset threshold;

[0133] Accordingly, the enhanced processing module 303 includes:

[0134] The third processing unit is used to use the first deep neural network to perform color balance and tone adjustment processing on the image in the video clip to obtain an enhanced video clip.

[0135] Optionally, the first processing module 302 includes:

[0136] a fourth processing unit, configured to perform skin color recognition on the image in the video clip by using a YCbCr color model to obtain a skin color ratio in the video clip, wherein Y represents the brightness and concentration of a color, Cb represents a blue concentration offset of a color, and Cr represents a red concentration offset of a color;

[0137] a fifth processing unit, configured to determine that the scene category to which the video clip belongs is a category to be partially adjusted when the skin color ratio of the video clip is greater than or equal to a third preset threshold or the skin color ratio of the video clip is less than a fourth preset threshold;

[0138] Accordingly, the enhanced processing module 303 includes:

[0139] The sixth processing unit is used to perform skin color protection enhancement processing on the video clip to obtain the enhanced video clip when the skin color proportion of the video clip is greater than or equal to the third preset threshold value; or to perform adaptive color enhancement processing on the video clip to obtain the enhanced video clip when the skin color proportion of the video clip is less than the fourth preset threshold value.

[0140] Optionally, the first processing module 302 includes:

[0141] a seventh processing unit, configured to determine, when the saturation of the image in the video clip is less than a fifth preset threshold, that the scene category to which the video clip belongs is a category to be sharpened;

[0142] Accordingly, the enhanced processing module 303 includes:

[0143] The eighth processing unit is used to perform sharpening processing on the image in the video clip to obtain an enhanced video clip.

[0144] Optionally, the first processing module 302 includes:

[0145] a ninth processing unit, configured to determine that the scene category to which the video clip belongs is a light category to be adjusted when the illumination of the image in the video clip is less than a sixth preset threshold or when the illumination of the image in the video clip is greater than or equal to a seventh preset threshold;

[0146] Accordingly, the enhanced processing module 303 includes:

[0147] A tenth processing unit, configured to estimate and adjust the reflection component of the first image in the video clip whose illumination is less than the sixth preset threshold, to obtain a processed first image;

[0148] an eleventh processing unit, configured to migrate and adjust color information of a second image in the video clip whose illumination is greater than or equal to the seventh preset threshold value, to obtain a processed second image;

[0149] The twelfth processing unit is used to merge the processed first image and the processed second image to obtain an enhanced video clip.

[0150] Optionally, the device in the embodiment of the present invention further includes:

[0151] An acquisition module, used to acquire the brightness of each frame image in the target video;

[0152] A brightness adjustment module is used to calculate a first average brightness of multiple frames of images when the brightness of the target image meets a preset condition, and adjust the brightness of each frame of the multiple frames to the first average brightness; wherein the multiple frames of images include the target image and N frames of images before and after the target image, where N is a positive integer; the brightness of the target image meets the preset condition including one of the following:

[0153] The brightness of the target image is greater than an eighth preset threshold;

[0154] The brightness of the target image is less than or equal to a ninth preset threshold, and the eighth preset threshold is greater than the ninth preset threshold.

[0155] Optionally, the acquisition module includes:

[0156] An image format conversion unit, for converting each frame image in the target video into a YUV image, wherein the Y channel represents brightness information, and the U channel and the V channel represent chrominance information;

[0157] A brightness extraction unit, used to extract the pixel value of the Y channel in the YUV image;

[0158] An acquisition unit is used to determine the second average value of the pixel values ​​of the Y channel as the brightness of the frame image.

[0159] The video processing device of the embodiment of the present invention divides the video stream according to the video content of the video stream to obtain multiple video clips; then determines the scene category to which each video clip belongs for each of the video clips; performs video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip; finally, merges the multiple enhanced video clips into a target video. In this way, by performing corresponding different enhancement processing methods on video clips of different scene categories from the same video stream, the problem of uncontrollable enhancement processing effect of complex video content is solved, and compared with a single enhancement strategy, better visual effects can be achieved.

[0160] An embodiment of the present invention further provides a video processing device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; when the processor executes the program, the above-mentioned video processing method is implemented.

[0161] Among them, the implementation embodiments of the above-mentioned video processing method are all applicable to the embodiments of the video processing device and can achieve the same technical effects.

[0162] The embodiment of the present invention further provides a readable storage medium on which a program is stored. When the program is executed by a processor, the steps in the above-mentioned video processing method are implemented.

[0163] Among them, the implementation embodiments of the above-mentioned video processing method are all applicable to the embodiments of the readable storage medium and can achieve the same technical effects.

[0164] An embodiment of the present invention further provides a computer program product, including computer instructions, which implement the steps in the above-mentioned video processing method when executed by a processor.

[0165] Among them, the implementation embodiments of the above-mentioned video processing method are all applicable to the embodiments of the readable storage medium and can achieve the same technical effects.

[0166] It should be noted that many functional components described in this specification are referred to as modules in order to more particularly emphasize the independence of their implementation methods.

[0167] In the embodiment of the present invention, module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.

[0168] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.

[0169] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.

[0170] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary personnel in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A video processing method, characterized in that: include: Segment the video stream according to the video content of the video stream to obtain multiple video clips; For each of the video clips, determining the scene category to which the video clip belongs; According to the scene category to which the video clip belongs, performing video enhancement processing on the video clip to obtain an enhanced video clip; Merge the plurality of enhanced video clips into a target video.

2. The method according to claim 1, characterized in that The determining the scene category to which the video clip belongs includes: Determining, based on the video parameters of the video clip, whether the video clip is a video clip supporting a standard dynamic range (SDR); When it is determined that the video clip is a video clip supporting SDR, and the contrast of an image in the video clip is less than a first preset threshold, and the saturation is less than a second preset threshold, determining that the scene category to which the video clip belongs is a category to be color and hue balanced; The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises: The first deep neural network is used to perform color balance and tone adjustment processing on the image in the video clip to obtain an enhanced video clip.

3. The method according to claim 1, characterized in that The determining the scene category to which the video clip belongs includes: Using the YCbCr color model to perform skin color recognition on the image in the video clip to obtain the skin color ratio of the video clip, where Y represents the brightness and concentration of the color, Cb represents the blue concentration offset of the color, and Cr represents the red concentration offset of the color; When the skin color ratio of the video clip is greater than or equal to a third preset threshold, or the skin color ratio of the video clip is less than a fourth preset threshold, determining that the scene category to which the video clip belongs is a category to be partially adjusted; The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises: When the skin color proportion of the video clip is greater than or equal to the third preset threshold, the video clip is subjected to skin color protection enhancement processing to obtain the enhanced video clip; or, when the skin color proportion of the video clip is less than the fourth preset threshold, the video clip is subjected to adaptive color enhancement processing to obtain the enhanced video clip.

4. The method according to claim 1, characterized in that: The determining the scene category to which the video clip belongs includes: When the saturation of the image in the video clip is less than a fifth preset threshold, determining that the scene category to which the video clip belongs is a category to be sharpened; The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises: The image in the video clip is sharpened to obtain an enhanced video clip.

5. The method according to claim 1, characterized in that The determining the scene category to which the video clip belongs includes: When the illumination of the image in the video clip is less than a sixth preset threshold, or when the illumination of the image in the video clip is greater than or equal to a seventh preset threshold, determining that the scene category to which the video clip belongs is a light category to be adjusted; The step of performing video enhancement processing on the video clip according to the scene category to which the video clip belongs to obtain the enhanced video clip comprises: For a first image in the video clip whose illumination is less than the sixth preset threshold, estimating and adjusting a reflection component of the first image to obtain a processed first image; For a second image in the video clip whose illumination is greater than or equal to the seventh preset threshold, performing migration and adjustment processing on color information of the second image to obtain a processed second image; The processed first image and the processed second image are combined to obtain an enhanced video segment.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining the brightness of each frame image in the target video; When the brightness of the target image meets a preset condition, a first average brightness of multiple frames of images is calculated, and the brightness of each frame of the multiple frames of images is adjusted to the first average brightness; wherein the multiple frames of images include the target image and N frames of images before and after the target image, where N is a positive integer; the brightness of the target image meets the preset condition including one of the following: The brightness of the target image is greater than an eighth preset threshold; The brightness of the target image is less than or equal to a ninth preset threshold, and the eighth preset threshold is greater than the ninth preset threshold.

7. The method according to claim 6, characterized in that The step of obtaining the brightness of each frame image in the target video; For each frame image in the target video, convert the frame image into a YUV image, wherein the Y channel represents brightness information, and the U channel and the V channel represent chrominance information; Extract the pixel value of the Y channel in the YUV image; The second average value of the pixel values ​​of the Y channel is determined as the brightness of the frame image.

8. A video processing device, characterized in that: include: A video segmentation module, used to segment the video stream according to the video content of the video stream to obtain multiple video clips; A first processing module, configured to determine, for each of the video clips, a scene category to which the video clip belongs; An enhancement processing module, used for performing video enhancement processing on the video clip according to the scene category to which the video clip belongs, to obtain the enhanced video clip; The video merging module is used to merge the multiple enhanced video clips into a target video.

9. A video processing device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; characterized in that: When the processor executes the program, the video processing method according to any one of claims 1 to 7 is implemented.

10. A readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps in the video processing method according to any one of claims 1 to 7 are implemented.