Video processing method, video processing device and readable storage medium
Patent Information
- Application Number
- CN202280005238.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2024-08-23
AI Technical Summary
It is difficult for the existing technology to effectively process the initial video of complex scenes, and a single HDR model cannot generate high-quality high dynamic range (HDR) video, and the cost is high.
High dynamic range video is generated by dividing the initial video into multiple video segments, adjusting the frames according to the display parameter set of each video segment, and utilizing the video processing network to perform high dynamic range conversion.
It achieves efficient processing of complex scene videos, improves the quality and generation efficiency of HDR videos, reduces costs, and avoids the intervention of professional colorists.
Smart Images

Figure CN118541978A
Abstract
Description
Video processing method, video processing device and readable storage medium Technical Field
[0001] Embodiments of the present disclosure relate to a video processing method, a video processing device, and a non-transitory readable storage medium. Background Art
[0002] Compared to ordinary images, high dynamic range (HDR) images offer greater dynamic range and image detail, enabling more accurate capture of the vast majority of color and lighting information in real scenes, while also displaying rich color detail and gradations of light and dark. By synthesizing low dynamic range (LDR) images with varying exposure times and using the LDR image with optimal detail at each exposure time to create a final HDR image, the resulting image better reflects how people see in real environments. HDR technology can be applied in fields requiring high image quality, such as medical imaging, video surveillance, satellite remote sensing, and computer vision.
[0003] Summary of the Invention
[0004] At least one embodiment of the present disclosure provides a video processing method, comprising: dividing a plurality of video frames included in an initial video into a plurality of video segments, each of the video segments including one or more video frames, and the plurality of video frames being continuous; determining, based on any one of the one or more video frames, a display parameter set of the video segment to which it belongs; adjusting other frames in the video segment according to the display parameter set to obtain an intermediate video segment; performing high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; and generating a high dynamic range video based on the high dynamic range video segment.
[0005] For example, in the method provided by at least one embodiment of the present disclosure, the display parameter set includes a first display parameter, a second display parameter, and a third display parameter, the first display parameter and the third display parameter are used to adjust the brightness of the video frame, and the second display parameter is used to adjust the contrast of the video frame.
[0006] For example, in the method provided by at least one embodiment of the present disclosure, the first display parameter is used to adjust the overall brightness level of the video frame, and the third display parameter is used to partially adjust the brightness level of the video frame.
[0007] For example, in the method provided by at least one embodiment of the present disclosure, multiple video frames included in an initial video are divided into multiple video segments, including: calculating the similarity between each video frame and the previous video frame in sequence according to the playback order of the multiple video frames included in the initial video; and dividing the initial video into multiple video segments based on the calculated similarity between each two adjacent video frames.
[0008] For example, in the method provided by at least one embodiment of the present disclosure, before calculating the similarity between each video frame and the previous video frame in sequence according to the playback order of the multiple video frames included in the initial video, the method also includes: performing dimensionality reduction processing on each initial video frame in the initial video to obtain the multiple video frames.
[0009] For example, in the method provided by at least one embodiment of the present disclosure, the sequentially calculating the similarity between each video frame and the previous video frame includes: for each video frame of the multiple video frames, based on the mean of the image data of the video frame and the mean of the image data of the previous video frame, the standard deviation of the image data of the video frame and the standard deviation of the image data of the previous video frame, and the covariance of the image data of the video frame and the image data of the previous video frame, determining the structural similarity between the video frame and the previous video frame; and determining the similarity between the video frame and the previous video frame based on the structural similarity between the video frame and the previous video frame.
[0010] For example, in the method provided by at least one embodiment of the present disclosure, determining the display parameter set of the video segment to which any frame of the one or more video frames belongs includes: using an image processing network to perform parameter analysis on the initial video frame to obtain the display parameter set; the image processing network includes a first image analysis module and a second image analysis module; the first image analysis module is used to extract features from the initial video frame; obtain a first intermediate video frame; the second image analysis module is used to perform feature extraction and scale transformation on the first intermediate video frame to output the display parameter set.
[0011] For example, in the method provided by at least one embodiment of the present disclosure, the first image analysis module includes a first convolution layer, an average pooling layer, an activation layer and a real column regularization normalization layer; the second image analysis module includes a second convolution layer and a global average pooling layer.
[0012] For example, in the method provided by at least one embodiment of the present disclosure, the image processing network includes a plurality of the first image analysis modules.
[0013] For example, in the method provided by at least one embodiment of the present disclosure, adjusting other frames in the video segment according to the display parameter set to obtain the intermediate video segment includes:
[0014] All video frame data in each video clip is adjusted according to the display parameter set corresponding to each video frame according to the following equation:
[0015]
[0016] where X in represents the input frame, X out represents the output frame, w1, w2, and w3 are the first display parameter, the second display parameter, and the third display parameter, respectively.
[0017] For example, in the method provided by at least one embodiment of the present disclosure, the intermediate video clip is converted into a high dynamic range to obtain a high dynamic range video clip, including: using a video processing network to convert the intermediate video clip into a high dynamic range; the video processing network includes a basic network and a weight network; the basic network is used to extract features and reconstruct features on the input frame to obtain a high dynamic range output frame; the weight network is used to extract features on the input frame to obtain feature matrix parameters, and information correction is performed on the basic network according to the feature matrix parameters.
[0018] For example, in the method provided by at least one embodiment of the present disclosure, the basic network includes at least one information adjustment node, and the information adjustment node is used to integrate the feature extraction information of the input frame by the basic network and the feature matrix parameter information of the weight network.
[0019] For example, in the method provided by at least one embodiment of the present disclosure, the basic network includes a first information regulation node, a second information regulation node, a third information regulation node, a fourth information regulation node, and a fifth information regulation node.
[0020] For example, in the method provided by at least one embodiment of the present disclosure, the weight network includes at least one feature correction network, and the feature correction network includes at least one attention module; the attention module uses dual channels to extract features from the input information, including: using the first channel to perform local feature extraction on the input frame to obtain a first feature; using the second channel to perform global feature extraction on the input frame to obtain a second feature; and fusing the first feature and the second feature to obtain output information.
[0021] For example, in the method provided by at least one embodiment of the present disclosure, the weight network includes a first feature correction network, a second feature correction network and a third feature correction network, and the method includes: inputting the input frame into the first feature correction network to obtain a first feature parameter matrix; inputting the first feature parameter matrix into the third information adjustment node; rearranging the feature channels of the first feature parameter matrix and the input frame and then inputting them into the second feature correction network to obtain a second feature parameter matrix; inputting the second feature parameter matrix into the second information adjustment node and the fourth information adjustment node; rearranging the feature channels of the second feature parameter matrix and the input frame and then inputting them into the third feature correction network to obtain a third feature parameter matrix; and inputting the third feature parameter matrix into the first information adjustment node and the fifth information adjustment node.
[0022] For example, the method provided by at least one embodiment of the present disclosure also includes: obtaining first sample data, the first sample data including a first version SDR image and a first version HDR image; using a first version HDR image corresponding to the first version SDR image as a first version true image; inputting the first version SDR image into a video processing network to obtain a first version predicted HDR image corresponding to the first version SDR image; inputting the first version predicted HDR image and the first version true image into a first loss function to obtain a first loss function value; and adjusting the model parameters of the video processing network according to the first loss function value; obtaining second sample data, wherein the second sample data includes a second version SDR image and a second version HDR image; using a second version HDR image corresponding to the second version SDR image as a second version true image; inputting the second version SDR image into the image processing network and the trained video processing network to obtain a second version predicted HDR image corresponding to the second version SDR image; fixing the parameters of the video processing network; inputting the second version predicted HDR image and the second version true image into a second loss function to obtain a second loss function value; and adjusting the model parameters of the image processing network according to the second loss function value.
[0023] For example, the method provided by at least one embodiment of the present disclosure also includes: obtaining third sample data, wherein the third sample data includes a third version SDR image and a third version HDR image; using the third version HDR image corresponding to the third version SDR image as the third version true image; inputting the third version SDR image into the image processing network and the video processing network to obtain a third version predicted HDR image corresponding to the third version SDR image; inputting the third version predicted HDR image and the third version true image into a third loss function to obtain a third loss function value; and adjusting the model parameters of the image processing network and the video processing network according to the third loss function value.
[0024] For example, at least one embodiment of the present disclosure further provides a video processing device, including a division module, an acquisition module, and a processing module. The division module is configured to divide the multiple video frames included in the initial video into multiple video segments, each of the video segments includes one or more video frames, and the multiple video frames are continuous. The acquisition module is configured to determine the display parameter set of the video segment to which it belongs based on any one of the one or more video frames; adjust the other frames in the video segment to which it belongs based on the display parameter set to obtain an intermediate video segment. The processing module is configured to perform high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; and generate a high dynamic range video based on the high dynamic range video segment.
[0025] For example, at least one embodiment of the present disclosure further provides a video processing device, comprising a processor and a memory. The memory includes one or more computer program modules. The one or more computer program modules are stored in the memory and configured to be executed by the processor, and the one or more computer program modules include instructions for executing the video processing method described in any of the above embodiments.
[0026] For example, at least one embodiment of the present disclosure further provides a non-transitory readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, perform the video processing method described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings described below only relate to some embodiments of the present disclosure, rather than limiting the present disclosure.
[0028] FIG1 is a schematic block diagram of a method for generating HDR video according to at least one embodiment of the present disclosure;
[0029] FIG2 is a flowchart illustrating an example of a video processing method according to at least one embodiment of the present disclosure;
[0030] FIG3 is a flowchart of scene segmentation of a video provided by at least one embodiment of the present disclosure;
[0031] FIG4 is a schematic diagram of the structure of an image processing network provided by at least one embodiment of the present disclosure;
[0032] FIG5 is a schematic diagram of a training process of an image processing network provided by at least one embodiment of the present disclosure;
[0033] FIG6 is a schematic block diagram of another HDR video generation method provided by at least one embodiment of the present disclosure;
[0034] FIG7 is a schematic block diagram of an HDR model provided by at least one embodiment of the present disclosure;
[0035] FIG8 is a schematic block diagram of another HDR model provided by at least one embodiment of the present disclosure;
[0036] FIG9A is a schematic diagram of the structure of an extraction subnetwork provided by at least one embodiment of the present disclosure;
[0037] FIG9B is a schematic diagram of the structure of a residual network provided by at least one embodiment of the present disclosure;
[0038] FIG10A is a schematic diagram of the structure of a correction network provided by at least one embodiment of the present disclosure;
[0039] FIG10B is a schematic diagram of the structure of an attention module provided by at least one embodiment of the present disclosure;
[0040] FIG11 is a schematic block diagram of a video processing device provided by at least one embodiment of the present disclosure;
[0041] FIG12 is a schematic block diagram of another video processing device according to at least one embodiment of the present disclosure;
[0042] FIG13 is a schematic block diagram of another video processing device provided by at least one embodiment of the present disclosure;
[0043] FIG14 is a schematic block diagram of a non-transitory readable storage medium provided by at least one embodiment of the present disclosure; and
[0044] FIG15 is a schematic block diagram of an electronic device according to at least one embodiment of the present disclosure. DETAILED DESCRIPTION
[0045] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0046] Flowcharts are used in this disclosure to illustrate the operations performed by the systems according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the various steps may be processed in reverse order or simultaneously, as needed. Furthermore, other operations may be added to these processes, or one or more operations may be removed from these processes.
[0047] Unless otherwise defined, the technical or scientific terms used in this disclosure should have the usual meanings understood by people with ordinary skills in the field to which this disclosure belongs. The words "first", "second" and similar words used in this disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one", "an" or "the" do not indicate a quantity limitation, but rather indicate the existence of at least one. Words such as "include" or "comprise" mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0048] FIG1 is a schematic block diagram of an HDR video generation method provided by at least one embodiment of the present disclosure.
[0049] For example, in at least one embodiment of the present disclosure, as shown in FIG1 , a simple HDR task can be understood as using a single HDR model (i.e., an HDR image generation algorithm) to complete the processing of the entire video. For example, after decoding the video to be processed, the frame information of each video frame / video frame is input into the HDR model, and the HDR model is used to map a frame of image (such as a standard dynamic range (SDR) image or an LDR image, etc.) to an HDR image. The mapping process may include dynamic range expansion, color gamut range expansion, and picture color adjustment. Then, the output information of the HDR model is encoded to generate an HDR video. The HDR video generation method shown in FIG1 requires that the video has relatively simple content, such as high-definition TV series and movies that have been broadcast. Such videos have been broadcast on high-definition channels, and the overall brightness, contrast, and color information of the video can basically remain consistent.
[0050] Complex HDR tasks can be understood as complex source scenes, such as documentaries, TV series from the same series, or multi-part variety shows, each of which may have slight variations in brightness, contrast, and color. In these cases, a single HDR model alone cannot fully process these complex source materials. When a single HDR model fails to handle a scene, hiring a professional colorist for color grading can significantly increase costs.
[0051] At least in order to overcome the above-mentioned technical problems, at least one embodiment of the present disclosure provides a video processing method, which includes: dividing multiple video frames included in an initial video into multiple video segments, each video segment includes one or more video frames, and the multiple video frames are continuous; determining a display parameter set of the video segment to which it belongs based on any one of the one or more video frames; adjusting other frames in the video segment according to the display parameter set to obtain an intermediate video segment; performing high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; and generating a high dynamic range video based on the high dynamic range video segment.
[0052] Accordingly, at least one embodiment of the present disclosure further provides a video processing device, a non-transitory readable storage medium, and an electronic device corresponding to the above-mentioned video processing method.
[0053] By using the video processing method provided by at least one embodiment of the present disclosure, the initial video can be divided into one or more video segments according to scene segmentation, the display parameter set corresponding to each video segment can be obtained, and the video frames in the video segment can be adjusted based on the display parameter set to obtain high dynamic range video segments, and further generate high dynamic range videos, so that a single HDR model can process the initial video with complex scenes, effectively improving the quality and efficiency of generating HDR videos.
[0054] The video processing method provided by the present disclosure is described below in a non-restrictive manner through multiple embodiments and examples. As described below, different features in these specific examples or embodiments can be combined with each other without conflicting with each other to obtain new examples or embodiments, and these new examples or embodiments also fall within the scope of protection of the present disclosure.
[0055] FIG2 is a flowchart illustrating an example of a video processing method according to at least one embodiment of the present disclosure.
[0056] For example, as shown in FIG2 , at least one embodiment of the present disclosure provides a video processing method 10. For example, in the embodiments of the present disclosure, the video processing method 10 can be applied to any application scenario requiring the generation of HDR images / videos, such as displays, video cameras, cameras, video players, mobile terminals, etc., and can also be applied to other aspects, which are not limited by the embodiments of the present disclosure. As shown in FIG2 , the video processing method 10 can include the following operations S101 to S105.
[0057] Step S101: Divide a plurality of video frames included in an initial video into a plurality of video segments, each video segment includes one or more video frames, and the plurality of video frames are continuous.
[0058] Step S102: determining a display parameter set of a video segment to which any one of the one or more video frames belongs.
[0059] Step S103: adjusting other frames in the corresponding video segment according to the display parameter set to obtain an intermediate video segment.
[0060] Step S104: performing high dynamic range conversion on the middle video segment to obtain a high dynamic range video segment;
[0061] Step S105: Generate a high dynamic range video according to the high dynamic range video clip.
[0062] For example, in the embodiments of the present disclosure, the initial video can be a captured video, a video downloaded from the Internet, or a locally stored video, and can also be an LDR video, an SDR video, etc., and the embodiments of the present disclosure do not impose any restrictions on this. It should be noted that the initial video can include various video scenes, such as an indoor scene, a scenic spot scene, etc., and the embodiments of the present disclosure do not impose any restrictions on this.
[0063] For example, in at least one embodiment of the present disclosure, for step S101, the initial video can be divided into video segments according to the video scene. For example, in some examples, the multiple video frames included in the initial video are divided into one or more video segments, and each video segment includes one or more video frames. For example, each video segment corresponds to a single video scene. For example, in some examples, the initial video is divided into two video segments, the scene corresponding to the first video segment is in the classroom, and the scene corresponding to the second video segment is on the playground. It should be noted that the embodiments of the present disclosure are not limited to specific scenes and can be set according to actual needs.
[0064] For example, in at least one embodiment of the present disclosure, various algorithms can be used to process the initial video according to scenes. The embodiments of the present disclosure do not limit this. As long as the scene division function of the video can be achieved, it can be set according to actual conditions.
[0065] For example, in at least one embodiment of the present disclosure, for step S101, the multiple video frames included in the initial video are divided into multiple video segments, including: calculating the similarity between each video frame and the previous video frame in sequence according to the playback order of the multiple video frames included in the initial video; and dividing the initial video into multiple video segments based on the calculated similarity between each two adjacent video frames.
[0066] For example, in at least one embodiment of the present disclosure, before calculating the similarity between each video frame and the previous video frame in the order in which the multiple video frames are played, dimensionality reduction processing is performed on each initial video frame in the initial video to obtain multiple video frames. This dimensionality reduction processing can significantly save computing costs and improve efficiency.
[0067] For example, in at least one embodiment of the present disclosure, the similarity between each video frame and the previous video frame is calculated in sequence, including: for each video frame in a plurality of video frames, based on the mean of image data of the video frame and the mean of image data of the previous video frame, the standard deviation of image data of the video frame and the standard deviation of image data of the previous video frame, and the covariance of image data of the video frame and image data of the previous video frame, determining the structural similarity between the video frame and the previous video frame; and, based on the structural similarity between the video frame and the previous video frame, determining the similarity between the video frame and the previous video frame.
[0068] FIG3 is a flowchart of scene segmentation of a video provided by at least one embodiment of the present disclosure.
[0069] For example, as shown in FIG. 3, in at least one embodiment of the present disclosure, the structural similarity (SSIM) algorithm may be used to perform scene division processing on the initial video. For example, in some examples, the SSIM algorithm is applied to segment the video content scene. Generally, SSIM is used to measure the structural similarity between two images (video frames), and is an index for measuring the similarity degree between two images (video frames). The larger the value of SSIM, the more similar the two images are. The value range of SSIM is [0, 1], and the calculation formula is shown in the following equation (1):
[0070]
[0071] In the above equation (1), x and y respectively represent the two input images (video frames), and SSIM(x, y) represents the similarity between the input images x and y, μ x represents the average value of the image data of the input image x, μ y represents the average value of the image data of the input image y, represents the standard deviation of the image data of the input image x, represents the standard deviation of the image data of the input image y, σ xy represents the covariance of the image data of the input images x and y, L represents the dynamic range of pixel values. For example, for an 8-bit image, L = 255 - 0, and for an 8-bit normalized image, L = 1.0 - 0, k1 = 0.01, and k2 = 0.03.
[0072] For example, in at least one embodiment of the present disclosure, according to the playing order of multiple video frames of the initial video, the video frame at the current moment (i.e., the current video frame) may be set as the input image x of the above equation (1), and the video frame at the previous moment of the current moment (i.e., the previous video frame of the current video frame) may be set as the input image y of the above equation (1). The structural similarity between the two adjacent video frames x and y can be calculated through the above equation (1).
[0073] For example, in at least one embodiment of the present disclosure, a threshold T = 0.5 is set. When SSIM(x, y) calculated for two adjacent frames (such as video frames x and y) is ≥ T, the two adjacent frames x and y are regarded as belonging to the same scene. When SSIM(x, y) < T, the current two frames y and x are regarded as not belonging to the same scene, the video frame x is the last frame of the previous scene, and the video frame y is the first frame of the subsequent scene.
[0074] It should be noted that the value of the threshold T can be set according to the actual situation, and the embodiments of the present disclosure do not limit this.
[0075] For example, in at least one embodiment of the present disclosure, since the SSIM algorithm does not require very precise pixel information, before calculating the similarity between each video frame and the previous video frame, each initial video frame in the initial video is subjected to dimensionality reduction processing (such as a downsampling operation), and then the SSIM is calculated, as shown in FIG3 , thereby greatly saving computing costs.
[0076] For example, in at least one embodiment of the present disclosure, SSIM is used as a scene segmentation algorithm. The SSIM algorithm is simple to calculate and only requires information of two consecutive frames of video. It can realize real-time calculation and processing of video streams and does not require offline analysis of the video for scene segmentation.
[0077] For example, in at least one embodiment of the present disclosure, step S102 includes: performing parameter analysis on the initial video frame using an image processing network to obtain a display parameter set. The image processing network includes a first image analysis module and a second image analysis module. The first image analysis module is configured to extract features from the initial video frame to obtain a first intermediate video frame; the second image feature analysis module is configured to extract features and perform scale transformation on the first intermediate video frame to output the display parameter set.
[0078] For example, in at least one embodiment of the present disclosure, the initial video frame is the first video frame in the video clip to which it belongs according to the video playback order. In this way, the video stream data can be processed in real time, and the display parameter set of the current video clip can be obtained based on the first video frame in the current video clip, and then the other frame images in the current video clip can be processed by the display parameter set. In this way, preprocessing is performed only based on the first frame of the current video clip (that is, the first video frame in the playback order), which can prevent the flickering of information such as brightness and contrast between frames during video playback. The same scene has content continuity, and only the information of the first video frame corresponding to the current scene can be used to adjust the display parameter set corresponding to the current scene.
[0079] For example, in at least one embodiment of the present disclosure, the initial video frame may be a randomly selected video frame from the corresponding video segment. The embodiments of the present disclosure do not impose any limitation on this and may be set according to actual needs.
[0080] For example, in at least one embodiment of the present disclosure, the image processing network includes a first image analysis module and a second image analysis module. The first image analysis module is used to extract features from the initial video frame; obtain a first intermediate video frame, and the second image analysis module is used to extract features and scale the first intermediate video frame to output a display parameter set. For example, in some examples, the first image analysis module includes a first convolution layer, an average pooling layer, an activation layer, and a real column regularization normalization layer. The second image analysis module includes a second convolution layer and a global average pooling layer. For example, in some examples, the image processing network includes multiple first image analysis modules.
[0081] It should be noted that in the embodiments of the present disclosure, the "first image analysis module" and the "second image analysis module" are used to represent image analysis modules with specific structures, respectively. They are not limited to a specific image analysis module or a specific type of image analysis module, nor are they limited to a specific order, and can be set according to actual conditions. It should also be noted that the "first convolutional layer" and the "second convolutional layer" are used to represent convolutional layers with specific convolution parameters, respectively. They are not limited to a specific convolutional layer or a specific type of convolutional layer, nor are they limited to a specific order, and can be set according to actual conditions.
[0082] FIG4 is a schematic diagram of the structure of an image processing network provided by at least one embodiment of the present disclosure.
[0083] For example, in at least one embodiment of the present disclosure, the image processing network can be any neural network model structure, also referred to as a preprocessing model. For example, the network model structure shown in Figure 4. For example, as shown in Figure 4, the image processing network (preprocessing model) includes multiple first image analysis modules and a second image analysis template. For example, each first image analysis module includes a first convolution layer Conv (k3f64), an average pooling layer AvgPool, an activation layer ReLU, and a real column regularization normalization layer IN. The second image analysis module includes a second convolution layer Conv (k3f3) and a global average pooling layer GlobalAvgPool. In the example shown in Figure 4, in the first convolution layer Conv (k3f64), k3f64 represents the convolution kernel k=3 and the number of output channels f=64, and in the second convolution layer Conv (k3f3), k3f3 represents the convolution kernel k=3 and the number of output channels f=3.
[0084] For example, in the example shown in FIG4 , the global average pooling layer GlobalAvgPool in the second image analysis module averagely pools the feature map output by the second convolutional layer Conv(k3f3) into parameters w1, w2, and w3 in the display parameter set.
[0085] It should be noted that the image processing network shown in FIG4 is only an example. In the embodiments of the present disclosure, the image processing network can adopt the architecture of any neural network model and is not limited to the model architecture shown in FIG4. The embodiments of the present disclosure do not impose any restrictions on this.
[0086] It should also be noted that the image processing network may include multiple first image analysis modules, for example, 3-6. The embodiments of the present disclosure do not limit the number of first image analysis modules. For example, in one example, the image processing network may include four first image analysis modules.
[0087] For example, in at least one embodiment of the present disclosure, the initial video frame (e.g., the first video frame) of the current video clip is input into an image processing network (preprocessing model) to obtain a display parameter set corresponding to the current video clip. Using the display parameter set, the current video clip can be preprocessed to ultimately generate a high-quality HDR video.
[0088] For example, in at least one embodiment of the present disclosure, a first display parameter set includes a first display parameter w1, a second display parameter w2, and a third display parameter w3. The first display parameter w1 and the third display parameter w3 are used to adjust the brightness of the video frame, and the second display parameter w2 is used to adjust the contrast of the video frame. For example, in some examples, the first display parameter w1 is used to adjust the overall brightness level of the video frame, and the third display parameter w3 is used to locally adjust (fine-tune) the brightness level of the video frame. For example, in some examples, when the first display parameter w1 is greater than 1, the overall brightness level of the current video frame image can be brightened, and when the first display parameter w1 is less than 1, the overall brightness level of the current video frame image can be reduced. For example, in some examples, when the second display parameter w2 is greater than 1, the contrast of the current video frame image can be increased, and when the second display parameter w2 is less than 1, the contrast of the current video frame image can be reduced. For example, in some examples, when the third display parameter w3 is greater than 0, the brightness level of the current video frame image can be increased, and when the third display parameter w3 is less than 0, the brightness level of the current video frame image can be reduced.
[0089] It should be noted that the first display parameter w1 , the second display parameter w2 or the third display parameter w3 is not limited to a specific one or a certain type of display parameter, nor is it limited to a specific order.
[0090] It should also be noted that, in the embodiment of the present disclosure, the display parameter set may also include other display parameters, such as display parameters for adjusting color components, etc. The embodiment of the present disclosure does not limit this and can be set according to actual conditions.
[0091] For example, in at least one embodiment of the present disclosure, for step S103, other frames in the corresponding video segment are adjusted based on the display parameter set to obtain an intermediate video segment, including: all video frame data in each video segment are adjusted according to the display parameter set corresponding to each video frame according to the following equation (2).
[0092] For example, in at least one embodiment of the present disclosure, a preprocessing operation is performed on the video frame data in the divided video segments. For example, in some examples, the following equation (2) is applied to each frame in the current video frame to obtain the corresponding intermediate video segment.
[0093]
[0094] In the above equation (2), X in represents the input frame, X out Indicates the corresponding output frame. w1, w2, w3 are the first display parameter, the second display parameter, and the third display parameter respectively.
[0095] For example, in at least one embodiment of the present disclosure, by using the display parameter set and the above equation (2), each video frame in a video clip of a certain scene can be preprocessed / adjusted so that the processed / adjusted video frames meet the brightness and contrast ranges that can be input to a subsequent HDR model (also referred to herein as a video processing network). In this way, a single HDR model can be used to process videos of more scenes.
[0096] For example, in at least one embodiment of the present disclosure, the operation of step S103 corresponds to a preprocessing operation or a preprocessing model (image processing network). For example, the preprocessing operation can use the above equation (2) to calculate the output, or other equations or algorithms can be used to calculate the output. The embodiments of the present disclosure are not limited to this and can be set according to actual needs. For another example, the preprocessing model can be a neural network. The embodiments of the present disclosure are not limited to this and can be set according to actual needs.
[0097] For example, in at least one embodiment of the present disclosure, for different video clips of different scenes, any frame image in the current video clip, such as the front frame image in the current video clip, is taken out and input into a neural network (e.g., a preprocessing model) for training to obtain a first display parameter w1, a second display parameter w2, and a third display parameter w3.
[0098] For example, at least one embodiment of the present disclosure provides a training method for an image processing network (preprocessing model) and a video processing network (HDR model).
[0099] For example, in one embodiment, first sample data is obtained, which includes a first version SDR image and a first version HDR image; the first version HDR image corresponding to the first version SDR image is used as the first version true image; the first version SDR image is input into the video processing network to obtain a first version predicted HDR image corresponding to the first version SDR image; the first version predicted HDR image and the first version true image are input into a first loss function to obtain a first loss function value; and according to the first loss function value, the model parameters of the video processing network (i.e., the above-mentioned HDR model) are adjusted; second sample data is obtained, which includes a second version SDR image and a second version HDR image; the second version HDR image corresponding to the second version SDR image is used as the second version true image; the second version SDR image is input into the image processing network (i.e., the above-mentioned preprocessing model) and the trained video processing network (i.e., the above-mentioned HDR model) to obtain a second version predicted HDR image corresponding to the second version SDR image; the video processing network parameters are fixed; the second version predicted HDR image and the second version true image are input into a second loss function to obtain a second loss function value; and according to the second loss function value, the model parameters of the image processing network are adjusted.
[0100] For example, in at least one embodiment of the present disclosure, the model parameters of the HDR model are adjusted using the first sample data, and then the model parameters of the image processing network (preprocessing model) are adjusted using the second sample data and with the parameters of the HDR model fixed.
[0101] It should be noted that in the embodiments of the present disclosure, the first version ground truth image, the second version ground truth image, and the third version ground truth image can be standard / desired HDR images corresponding to the first version SDR image, the second version SDR image, and the third version SDR image, respectively. For example, they can be HDR images processed by professional colorists or HDR images that meet the needs of clients / designers. The embodiments of the present disclosure do not impose any restrictions on this and can be set according to actual needs.
[0102] It should also be noted that, in the embodiments of the present disclosure, the "first sample data", "second sample data" and "third sample data" are not limited to a specific one or a certain type of sample data, nor are they limited to a specific order, and can be set according to actual conditions. The "first version SDR image", "second version SDR image" and "third version SDR image" are not limited to a specific one or a certain type of SDR image, nor are they limited to a specific order, and can be set according to actual conditions. The "first version HDR image", "second version HDR image" and "third version HDR image" are not limited to a specific one or a certain type of HDR image, nor are they limited to a specific order, and can be set according to actual conditions.
[0103] It should also be noted that in the embodiments of the present disclosure, the first loss function and the second loss function may be the same or different. The first loss function and the second loss function may adopt any loss function, such as a square loss function, a logarithmic loss function, an exponential loss function, etc. The embodiments of the present disclosure do not limit this and can be set according to actual conditions.
[0104] FIG5 is a schematic diagram of a training process of a preprocessing model provided by at least one embodiment of the present disclosure. For example, in at least one embodiment of the present disclosure, as shown in FIG5, the video frame to be processed / video frame X in Input to the preprocessing model to obtain display parameters w1, w2 and w3, and the output frame X is obtained based on the above equation (2) out . The preprocessed output frame X out Input to the HDR model, that is, the preprocessed output frame X out Apply the HDR image generation algorithm to finally generate the output frame Y out . Output frame Y of HDR model output out Compare with the corresponding HDR image of the standard, for example, by calculating the loss function. According to the comparison result, adjust / update the display parameters output by the preprocessing model, for example, the first display parameter w1, the second display parameter w2, and the third display parameter w3. After multiple training iterations, the desired display parameter set can be obtained, for example, so that the output frame Y out A set of display parameters for HDR images that is close to the standard.
[0105] For example, in at least one embodiment of the present disclosure, during the training of the display parameter set, the parameters of the HDR model are fixed parameters and do not need to be updated. That is, during the display parameter training, the parameters in the HDR image generation algorithm remain constant. For example, in some examples, the HDR model is a trained model that is only used for mapping and color grading of HDR images. It should be noted that the embodiments of the present disclosure do not impose specific restrictions on the various parameters in the HDR model, and they can be set according to actual conditions.
[0106] It should be noted that, in the embodiments of the present disclosure, the standard HDR image refers to an HDR image that meets expectations, for example, an HDR image processed by a professional colorist, an HDR image that meets the needs of a customer / designer, etc. The embodiments of the present disclosure are not limited to this and can be set according to actual needs. For example, in another embodiment, a third sample data is obtained, and the third sample data includes a third version SDR image and a third version HDR image; the third version HDR image corresponding to the third version SDR image is used as the third version true value image; the third version SDR image is input into the image processing network and the video processing network to obtain a third version predicted HDR image corresponding to the third version SDR image; the third version predicted HDR image and the third version true value image are input into the third loss function to obtain a third loss function value; and according to the third loss function value, the model parameters of the image processing network and the video processing network are adjusted.
[0107] For example, in at least one embodiment of the present disclosure, model parameters of the HDR model and the pre-processing model are adjusted simultaneously using a set of sample data (third sample data).
[0108] It should be noted that in the embodiments of the present disclosure, the first loss function, the second loss function, and the third loss function can be the same or different from each other, and the embodiments of the present disclosure are not limited to this. The first loss function, the second loss function, and the third loss function can adopt any loss function, such as a square loss function, a logarithmic loss function, an exponential loss function, etc., and the embodiments of the present disclosure are not limited to this and can be set according to actual conditions.
[0109] FIG6 is a schematic block diagram of another HDR video generation method provided by at least one embodiment of the present disclosure.
[0110] For example, in at least one embodiment of the present disclosure, as shown in FIG6 , the decoded initial video (i.e., the video to be processed) is scene segmented (e.g., by applying the SSIM algorithm) and input into the preprocessing model. The preprocessing model determines that the video has undergone a scene switch and is currently the first frame of the new scene. The preprocessing model processes the first frame of the current new scene to obtain display parameters w1, w2, and w3. Thereafter, all frames of the current scene are adjusted / preprocessed using this set of display parameters (w1, w2, and w3) until the last frame at the end of the scene, enter the next scene, and repeat the operation, thereby preprocessing / adjusting the entire video to be processed, i.e., preprocessing the output video. Therefore, before inputting the video into the HDR model, the initial video is preprocessed to adjust the brightness, contrast, etc. of the initial video so that the adjusted initial video meets the input requirements of the subsequent HDR model (e.g., close to or falling within the input brightness range, contrast range, etc. of the subsequent HDR model), so that a single HDR model can process complex videos of multiple scenes, effectively improving the quality and efficiency of the generated HDR video.
[0111] For example, in at least one embodiment of the present disclosure, a video clip corresponding to a scene in the initial video uses a single display parameter set. For example, in some examples, different video clips corresponding to different scenes in the initial video use different display parameter sets. For example, in other examples, different video clips corresponding to different scenes use the same display parameter set. The present disclosure does not impose any limitations on this, and this can be adjusted based on actual needs.
[0112] For example, in at least one embodiment of the present disclosure, an HDR image generation algorithm can be implemented using various neural network models, such as an HDR model. It should be noted that the embodiments of the present disclosure do not limit the HDR image generation algorithm, nor the specific network structure of the HDR model, as long as it can generate an HDR image.
[0113] For example, in at least one embodiment of the present disclosure, step S104 includes performing high dynamic range conversion on the intermediate video segment to obtain the high dynamic range video segment, which includes: performing high dynamic range conversion on the intermediate video segment using a video processing network. The video processing network includes a base network and a weight network. The base network is used to extract features and reconstruct features from input frames to obtain high dynamic range output frames. The weight network is used to extract features from the input frames to obtain feature matrix parameters, and information correction is performed on the base network based on the feature matrix parameters.
[0114] For example, in an embodiment of the present disclosure, the basic network can be any deep learning network in the prior art that can realize the conversion of SDR video to HDR video. For example, the residual network (ResNet), the ring generative adversarial network (CycleGAN) and the pixel-to-pixel generation network (Pixel 2Pixel) are algorithm models for image-to-image conversion. For example, the high dynamic range network (HDRNet), the conditional sequence image modification network (CSRNet) and the adaptive 3D lookup table (Ada-3DLUT) network are algorithm models for image modification. For another example, the deep super-resolution inverse tone-mapping method (Deep super-resolution inverse tone-mapping, Deep SR-ITM) and the super-resolution joint inverse tone mapping generative adversarial network (GAN-Based Joint Super-Resolution and InverseTone-Mapping, JSI-GAN) are algorithm models for SDR video to HDR video conversion. The embodiments of the present disclosure do not limit the specific structure of the basic network. As long as it contains multiple feature fusion nodes for fusing with weight information, the conversion between SDR video and HDR video can be achieved.
[0115] FIG7 is a schematic block diagram of a video processing network (HDR model) provided by at least one embodiment of the present disclosure.
[0116] For example, in at least one embodiment of the present disclosure, as shown in FIG7 , a video processing network (HDR model) includes a base network and a weight network. For example, in at least one embodiment of the present disclosure, the base network includes a feature extraction network and a feature reconstruction network. For example, in some examples, as shown in FIG7 , the feature extraction network includes multiple extraction subnetworks, for example, including five extraction subnetworks.
[0117] The video processing network shown in Figure 7 consists of two branches. The right branch is the base network, which is used to convert SDR or LDR images into HDR images, that is, to complete the task of generating HDR images. For example, the base network is used to extract and reconstruct features from the input frame to obtain a high dynamic range output frame. The left branch is the weight network, which is used to perform information correction on the base network. For example, the weight network is used to extract features from the input frame to obtain feature matrix parameters, and then perform information correction on the base network based on the feature matrix parameters.
[0118] For example, in at least one embodiment of the present disclosure, the video processing network (HDR model) may include only a single branch, for example, only the right branch in FIG7 , i.e., the basic network. The embodiments of the present disclosure are not limited to this, as long as the HDR image generation task can be achieved, and can be set according to actual conditions.
[0119] For example, in at least one embodiment of the present disclosure, the basic network shown in Figure 7 employs a UNET network structure. Typically, a UNET network structure consists of two symmetrical parts. The first half of the network downsamples the feature information image when calculating it. To ensure that the size of the network output is equal to the input, the second half of the UNET network upsamples the feature information. This upsampling task is typically accomplished using deconvolution or linear interpolation. In this way, the input image undergoes encoding and decoding, i.e., dimensionality reduction and abstraction, before being restored to the same form as the input, completing the regression task.
[0120] For example, in at least one embodiment of the present disclosure, the base network includes at least one information regulation node, which is used to integrate feature extraction information of the base network on the input frame and feature matrix parameter information of the weight network. For example, in at least one embodiment of the present disclosure, the base network includes a first information regulation node, a second information regulation node, a third information regulation node, a fourth information regulation node, and a fifth information regulation node.
[0121] For example, as shown in Figure 7, the nodes of the weight network and the basic network are combined This is the information adjustment node mentioned above, which represents the point-to-point multiplication of the feature matrix. The other node Indicates the rearrangement and combination of feature channels, that is, the connection layer. In the example shown in FIG7 , the basic network includes 5 information adjustment nodes. For example, in one example, the 5 information adjustment nodes shown in FIG7 From top to bottom, they are the first information regulation node, the second information regulation node, the third information regulation node, the fourth information regulation node, and the fifth information regulation node. It should be noted that the embodiments of the present disclosure do not limit the number of information regulation nodes, and can be set according to actual conditions.
[0122] For example, in at least one embodiment of the present disclosure, the feature reconstruction network in the HDR model shown in FIG7 is used to convert image features into video frame information output. For example, in some examples, the simplest feature reconstruction network can use a single convolutional layer (Conv), or a series of multiple convolution-activation functions (Conv-ReLU), or a series of residual networks, as long as the purpose of outputting video frames can be achieved. The embodiments of the present disclosure do not impose any restrictions on this, and can be set according to actual needs.
[0123] For example, in at least one embodiment of the present disclosure, a weighted network is used in the video processing network (HDR model) shown in FIG7 . For example, there are many scenes in a video, including daytime, nighttime, indoors, outdoors, sports, stillness, people, animals, etc. In order to make a single HDR model adapt to video frame information in as many different scenes as possible, a weighted network is used to fully utilize the information of the current video frame and perform parameter information correction on the basic network.
[0124] It should be noted that the HDR model architecture shown in FIG7 is merely an example. In the embodiments of the present disclosure, the HDR model can adopt the architecture of any neural network model and is not limited to the model architecture shown in FIG7 , and the embodiments of the present disclosure do not impose any restrictions on this.
[0125] FIG8 is a schematic block diagram of another video processing network (HDR model) provided by at least one embodiment of the present disclosure.
[0126] For example, in at least one embodiment of the present disclosure, as shown in FIG8 , in addition to the base network adopting a UNET network structure, the weights in the HDR model also adopt a UNET network structure, thereby achieving information correction at different scales. For example, in the method provided in at least one embodiment of the present disclosure, the weight network includes at least one feature correction network, and the corresponding input images of the at least one feature correction network have different sizes.
[0127] For example, in at least one embodiment of the present disclosure, as shown in FIG8 , the weight network includes a first feature correction network, a second feature correction network, and a third feature correction network. The input frame is output to the first feature correction network to obtain a first feature parameter matrix; the first feature parameter matrix is input to the third information adjustment node; the first feature parameter matrix and the input frame are subjected to feature channel rearrangement and then input to the second feature correction network to obtain a second feature parameter matrix; the second feature parameter matrix is input to the second information adjustment node and the fourth information adjustment node; the second feature parameter matrix and the input frame are subjected to feature channel rearrangement and then input to the third feature correction network to obtain a third feature parameter matrix; the third feature parameter matrix is input to the first information adjustment node and the fifth information adjustment node at the same time. Similar to FIG7 , in the example shown in FIG8 , the node where the weight network and the basic network are combined This is the information adjustment node mentioned above, which represents the point-to-point multiplication of the feature matrix. The other node Represents the rearrangement and combination of feature channels, that is, the connection layer.
[0128] For example, in the HDR model shown in Figure 8, the input frame is input to three correction networks (the first feature correction network, the second feature correction network, and the third feature correction network) after being downsampled once by 4 times, downsampled once by 2 times, and not performing any sampling operation. The sizes of the corresponding input images of the three correction networks are different from each other, so that the first feature correction network, the second feature correction network, and the third feature correction network can respectively provide information correction of different sizes to the basic network. It should be noted that in the example structures shown in Figures 7 and 8, upsampling and downsampling respectively represent 2x upsampling and 2x downsampling.
[0129] For example, in at least one embodiment of the present disclosure, as shown in FIG8 , the size of the input frame is 64×64. On the right branch (base network), the image size output by the first extraction subnetwork from top to bottom is 64×64. After the first 2x downsampling, the image size output by the second extraction subnetwork from top to bottom is 32×32. After the second 2x downsampling, the image size output by the third extraction subnetwork from top to bottom is 16×16. After the first 2x upsampling, the image size output by the fourth extraction subnetwork from top to bottom is 32×32. After the second 2x upsampling, the image size output by the fifth extraction subnetwork from top to bottom is restored to the same size as the input frame, i.e., 64×64. On the left branch (weight network), the input frame of size 64×64 is downsampled 4x to obtain an image size of 16×16. Therefore, the first correction network from top to bottom shown in FIG8 can provide a correction of size 16×16. After downsampling a 64×64 input frame by a factor of 2, the resulting image size is 32×32. Therefore, the second rectification network shown in Figure 8, from top to bottom, can provide a rectification of size 32×32. The third rectification network shown in Figure 8, from top to bottom, can provide a rectification of size 64×64. For example, as shown in Figure 8, the information rectifications of different sizes output by the feature rectification network are respectively provided to intermediate results of the same size in the feature extraction network. For example, in the example shown in Figure 8, from top to bottom, the information rectification output of the first rectification network (16×16) is provided to the output of the third extraction sub-network (16×16), the information rectification output of the second rectification network (32×32) is provided to the outputs of the second and fourth extraction sub-networks (32×32), and the information rectification output of the third rectification network (64×64) is provided to the outputs of the first and fifth extraction sub-networks (64×64). In this way, the weight network can provide information rectification of different sizes (e.g., 16×16, 32×32, or 64×64) to the base network.
[0130] For example, in at least one embodiment of the present disclosure, a weighted network is used in the video processing network (HDR model) shown in FIG8. For example, there are many scenes in a video, including daytime, nighttime, indoors, outdoors, sports, stillness, people, animals, etc. In order to make a single HDR model adapt to video frame information in as many different scenes as possible, a weighted network is used to fully utilize the information of the current video frame and perform parameter information correction on the basic network.
[0131] It should be noted that the HDR model architecture shown in FIG8 is merely an example. In the embodiments of the present disclosure, the HDR model can adopt the architecture of any neural network model and is not limited to the model architecture shown in FIG8 , and the embodiments of the present disclosure do not impose any restrictions on this.
[0132] Figure 9A is a schematic diagram of the structure of an extraction subnetwork provided by at least one embodiment of the present disclosure, and Figure 9B is a schematic diagram of the structure of a residual network ResNet provided by at least one embodiment of the present disclosure.
[0133] For example, in at least one embodiment of the present disclosure, as shown in FIG9A , an extraction subnetwork includes a convolutional layer Conv, an activation layer ReLU, multiple residual networks ResNet, etc. It should be noted that the feature extraction network shown in FIG9A is merely an example. In the embodiments of the present disclosure, the extraction subnetwork can adopt any reasonable architecture and is not limited to the model architecture shown in FIG9A . The embodiments of the present disclosure do not impose any restrictions on this and can be set according to actual conditions.
[0134] For example, in at least one embodiment of the present disclosure, the structure of the residual network ResNet is shown in Figure 9B. For example, the residual network ResNet includes a superposition of a convolutional layer Conv, an activation function ReLU, and a convolutional layer Conv. It should be noted that the residual network shown in Figure 9B is only an example. In the embodiments of the present disclosure, the residual network can adopt any reasonable architecture and is not limited to the model architecture shown in Figure 9B. The embodiments of the present disclosure are not limited to this and can be set according to actual conditions.
[0135] For example, in at least one embodiment of the present disclosure, the weight network includes at least one feature correction network, which includes at least one attention module. The attention module uses a dual-channel feature extraction method to extract features from input information, including: extracting local features from the input frame using a first channel to obtain a first feature; extracting global features from the input frame using a second channel to obtain a second feature; and fusing the first and second features to obtain output information.
[0136] FIG10A is a schematic diagram of the structure of a feature correction network provided by at least one embodiment of the present disclosure, and FIG10B is a schematic diagram of the structure of an attention module provided by at least one embodiment of the present disclosure.
[0137] For example, in at least one embodiment of the present disclosure, as shown in FIG10A , the feature correction network includes a convolutional layer Conv, an activation layer ReLU, and at least one attention (CSA) module. It should be noted that the feature correction network shown in FIG10A is only an example. In the embodiments of the present disclosure, the feature correction network can adopt any reasonable architecture and is not limited to the model architecture shown in FIG10A . The embodiments of the present disclosure are not limited to this and can be set according to actual conditions.
[0138] For example, in at least one embodiment of the present disclosure, as shown in FIG10B , the attention (CSA) module includes two branches (e.g., a first channel and a second channel), one branch (the first channel) includes a class variance (cstd) module, a convolution layer Conv, a pooling layer Pooling, an activation layer ReLU, a bilinear function (Bilinear), and a Sigmoid function, which can perform local feature extraction on the input frame to obtain the first feature. The other branch (the second channel) includes multiple real column regularization layers InsNorm, a convolution layer Conv, and an activation layer ReLU, which can perform global feature extraction on the input frame to obtain the second feature. Through the nodes shown in FIG10B The first feature and the second feature are integrated to obtain output information.
[0139] It should be noted that the attention CSA module shown in FIG10B is merely an example. In the embodiments of the present disclosure, the CSA module can adopt any reasonable architecture and is not limited to the model architecture shown in FIG10B. The embodiments of the present disclosure do not impose any restrictions on this and can be configured according to actual circumstances.
[0140] For example, in at least one embodiment of the present disclosure, in the example structures shown in Figures 9A, 9B, 10A, and 10B, the convolution layer Conv that appears adopts Conv(k3f64s1), k3f64s1 represents the convolution kernel k=3, the number of output channels f=64, and the step size s=1. For example, the upsampling shown in Figures 7 and 8 can be implemented as a deconvolution layer DConv, for example, the deconvolution layer DConv is DConv(k3f64s2), k3f64s2 represents the convolution kernel k=3, the number of output channels f=64, and the step size s=2, or can be implemented as an interpolation algorithm, such as Bilinear / Bicubic (upsampling by 2 times), to achieve 2x upsampling. For example, the downsampling shown in Figures 7 and 8 can be implemented as pooling, Bilinear / Bicubic function (downsampling by 2 times), or convolution layer Conv(k3f64s2), where k3f64s1 represents convolution kernel k=3, number of output channels f=64, and step size s=2, to achieve 2x downsampling. It should be noted that in the embodiments of the present disclosure, the network structures described in Figures 7 to 10B are all exemplary, and the embodiments of the present disclosure are not limited thereto and can be adjusted according to actual conditions.
[0141] It should be noted that the embodiments of the present disclosure do not limit the specific implementation methods of performing "upsampling" or "downsampling", as long as "upsampling" or "downsampling" can be achieved. It should also be noted that the embodiments of the present disclosure do not limit the specific multiples of upsampling and downsampling, and can be set according to actual needs.
[0142] For example, in at least one embodiment of the present disclosure, as shown in FIG10B , a class variance cstd module is used in the attention CSA module, which can effectively utilize information such as the mean and variance of the current video frame, thereby achieving more effective information correction.
[0143] For example, in at least one embodiment of the present disclosure, the class variance cstd module provides correction based on the value of each pixel in the current video frame and the size of the current video frame. In this way, the feature correction network can effectively utilize information such as the mean and variance of the current video frame.
[0144] For example, in at least one embodiment of the present disclosure, the class variance cstd module calculates the output using the following equation (3):
[0145]
[0146]
[0147] In the above equation (3), x represents the current video frame, u(x) represents the average value of the current video frame, M represents the width of the current video frame, N represents the height of the current video frame, and x represents the current video frame. i,j represents the pixel with coordinates (i, j) in the current video frame, Cstd(x) represents the correlation of the current video frame, O x Represents the output frame corresponding to the current video frame.
[0148] For example, at least one embodiment of the present disclosure provides a preprocessing model mechanism that dynamically adjusts the video frames in the initial video, so that a single HDR model can process more video scenes, effectively improving the quality and efficiency of generating HDR videos. For example, at least one embodiment of the present disclosure also provides an HDR model that adopts a variance-cstd-like module, so that the feature correction network of the HDR model can effectively utilize the mean, variance and other information of the current video frame. For another example, at least one embodiment of the present disclosure also provides an HDR model that adopts a UNET network structure as a whole, so that the feature correction network of the HDR model can provide information correction at different sizes.
[0149] It should be noted that, in various embodiments of the present disclosure, the execution order of the various steps of the video processing method 10 is not limited. Although the execution process of each step is described above in a specific order, this does not constitute a limitation on the embodiments of the present disclosure. The various steps in the video processing method 10 can be executed serially or in parallel, which can be determined according to actual needs. For example, the video processing method 10 can also include more or fewer steps, and the embodiments of the present disclosure are not limited in this regard.
[0150] FIG11 is a schematic block diagram of a video processing device according to at least one embodiment of the present disclosure.
[0151] For example, in at least one embodiment of the present disclosure, as shown in FIG. 11 , the video processing device 40 includes a dividing module 401 , an acquiring module 402 , and a processing module 403 .
[0152] For example, in at least one embodiment of the present disclosure, the division module 401 is configured to divide the multiple video frames included in the initial video into multiple video segments, each video segment includes one or more video frames, and the multiple video frames are continuous. For example, the division module 401 can implement step S101, and its specific implementation method can refer to the relevant description of step S101, which will not be repeated here. The acquisition module 402 is configured to determine the display parameter set of the video segment to which it belongs based on any one of the one or more video frames; adjust the other frames in the video segment to which it belongs according to the display parameter set to obtain an intermediate video segment. For example, the acquisition module 402 can implement steps S102 and S103, and its specific implementation method can refer to the relevant description of steps S102 and S103, which will not be repeated here. The processing module 403 is configured to perform high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; and generate a high dynamic range video based on the high dynamic range video segment. For example, the processing module 403 may implement steps S104 and S105. For specific implementation methods, reference may be made to the relevant descriptions of steps S104 and S105, which will not be repeated here.
[0153] It should be noted that these division modules 401, acquisition modules 402 and processing modules 403 can be implemented through software, hardware, firmware or any combination thereof. For example, they can be implemented as division circuit 401, acquisition circuit 402 and processing circuit 403 respectively. The embodiments of this disclosure do not limit their specific implementation methods.
[0154] It should be understood that the video processing device 40 provided in at least one embodiment of the present disclosure can implement the aforementioned video processing method 10, and can also achieve technical effects similar to those of the aforementioned video processing method 10. For example, the video processing device 40 provided in at least one embodiment of the present disclosure pre-processes the initial video and dynamically adjusts the video frames in the initial video, so that a single HDR model can process more video scenes, effectively improving the quality and efficiency of generating HDR videos. For example, in the video processing device 40 provided in at least one embodiment of the present disclosure, the HDR model adopts a variance-like cstd module, so that the feature correction network of the HDR model can effectively utilize the mean, variance and other information of the current video frame. For another example, in the video processing device 40 provided in at least one embodiment of the present disclosure, the HDR model as a whole adopts a UNET network structure, so that the feature correction network of the HDR model can provide information correction at different sizes.
[0155] It should be noted that in the embodiments of the present disclosure, the video processing device 40 may include more or fewer circuits or units, and the connection relationship between the various circuits or units is not limited and can be determined according to actual needs. The specific configuration of each circuit is not limited and can be composed of analog devices, digital chips, or other applicable methods based on circuit principles.
[0156] FIG12 is a schematic block diagram of another video processing device provided by at least one embodiment of the present disclosure.
[0157] At least one embodiment of the present disclosure further provides a video processing device 90. As shown in FIG12 , the video processing device 90 includes a processor 910 and a memory 920. The memory 920 includes one or more computer program modules 921. The one or more computer program modules 921 are stored in the memory 920 and are configured to be executed by the processor 910. The one or more computer program modules 921 include instructions for executing the video processing method 10 provided by at least one embodiment of the present disclosure. When executed by the processor 910, the one or more steps in the video processing method 10 provided by at least one embodiment of the present disclosure can be performed. The memory 920 and the processor 910 can be interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0158] For example, the processor 910 may be a central processing unit (CPU), a digital signal processor (DSP), or other processing units with data processing capabilities and / or program execution capabilities, such as a field programmable gate array (FPGA). For example, the central processing unit (CPU) may be an X86 or ARM architecture. The processor 910 may be a general-purpose processor or a dedicated processor, and may control other components in the video processing device 90 to perform desired functions.
[0159] For example, the memory 920 may include any combination of one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), a hard disk, an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, a flash memory, etc. One or more computer program modules 921 may be stored on the computer-readable storage medium, and the processor 910 may execute one or more computer program modules 921 to implement the various functions of the video processing device 90. The computer-readable storage medium may also store various applications and various data, as well as various data used and / or generated by the applications. The specific functions and technical effects of the video processing device 90 can be referred to the above description of the video processing method 10 and will not be repeated here.
[0160] FIG13 is a schematic block diagram of another video processing device provided by at least one embodiment of the present disclosure.
[0161] The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The video processing device 600 shown in FIG13 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0162] For example, as shown in FIG13 , in some examples, a video processing device 600 includes a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the computer system are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0163] For example, the following components may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; a storage device 608 including, for example, a magnetic tape, hard disk, etc.; and a communication device 609 including, for example, a network interface card, such as a LAN card, modem, etc. The communication device 609 may allow the video processing device 600 to communicate with other devices wirelessly or wired to exchange data, performing communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. Removable media 611, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in the drive 610 as needed, so that computer programs read therefrom can be installed into the storage device 608 as needed. Although FIG. 13 shows the video processing device 600 including various devices, it should be understood that implementation or inclusion of all of the devices shown is not required. More or fewer devices may alternatively be implemented or included.
[0164] For example, the video processing device 600 may further include a peripheral interface (not shown in the figure), etc. The peripheral interface may be various types of interfaces, such as a USB interface, a lightning interface, etc. The communication device 609 may communicate with a network and other devices through wireless communication, such as the Internet, an intranet, and / or a wireless network such as a cellular telephone network, a wireless local area network (LAN), and / or a metropolitan area network (MAN). Wireless communications may use any of a variety of communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Wi-Fi (e.g., based on IEEE 802.11a, IEEE 802.11b, IEEE 802.11g, and / or IEEE 802.11n standards), Voice over Internet Protocol (VoIP), Wi-MAX, protocols for email, instant messaging, and / or Short Message Service (SMS), or any other suitable communication protocol.
[0165] For example, the video processing device 600 can be any device such as a mobile phone, tablet computer, laptop computer, e-book, game console, television, digital photo frame, navigator, etc., or it can be any combination of data processing devices and hardware. The embodiments of the present disclosure do not limit this.
[0166] For example, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the video processing method 10 disclosed in the embodiment of the present disclosure is executed.
[0167] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0168] The computer-readable medium may be included in the video processing device 600 , or may exist independently without being incorporated into the video processing device 600 .
[0169] FIG14 is a schematic block diagram of a non-transitory readable storage medium provided by at least one embodiment of the present disclosure.
[0170] Embodiments of the present disclosure also provide a non-transitory readable storage medium. Figure 14 is a schematic block diagram of a non-transitory readable storage medium according to at least one embodiment of the present disclosure. As shown in Figure 14, non-transitory readable storage medium 70 stores computer instructions 111. When executed by a processor, these computer instructions 111 perform one or more steps of the video processing method 10 described above.
[0171] For example, the non-transitory readable storage medium 70 can be any combination of one or more computer-readable storage media. For example, one computer-readable storage medium contains computer-readable program code for dividing a plurality of video frames included in an initial video into a plurality of video segments, each video segment including one or more video frames. Another computer-readable storage medium contains computer-readable program code for determining, based on any one of the one or more video frames, a display parameter set for the video segment to which it belongs; adjusting other frames in the video segment based on the display parameter set to obtain an intermediate video segment; and yet another computer-readable storage medium contains computer-readable program code for performing high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; and generating a high dynamic range video based on the high dynamic range video segment. Of course, the aforementioned program codes can also be stored in the same computer-readable medium, and the embodiments of the present disclosure are not limited in this regard.
[0172] For example, when the program code is read by a computer, the computer may execute the program code stored in the computer storage medium, and execute, for example, the video processing method 10 provided in any embodiment of the present disclosure.
[0173] For example, the storage medium may include a memory card of a smartphone, a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a flash memory, or any combination thereof, or other suitable storage media. For example, the readable storage medium may also be the memory 920 in FIG. 12 , and the related description may refer to the above content and will not be repeated here.
[0174] Embodiments of the present disclosure also provide an electronic device. Figure 15 is a schematic block diagram of an electronic device according to at least one embodiment of the present disclosure. As shown in Figure 15 , the electronic device 120 may include the video processing apparatus 40 / 90 / 600 described above. For example, the electronic device 120 may implement the video processing method 10 provided in any embodiment of the present disclosure.
[0175] In the present disclosure, the term "plurality" refers to two or more than two, unless clearly defined otherwise.
[0176] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the disclosure herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0177] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A video processing method, comprising: Dividing a plurality of video frames included in an initial video into a plurality of video segments, each of the video segments including one or more video frames, wherein the plurality of video frames are continuous; Determining, according to any one of the one or more video frames, a display parameter set of a video segment to which the frame belongs; Adjusting other frames in the video segment according to the display parameter set to obtain an intermediate video segment; Performing high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; A high dynamic range video is generated according to the high dynamic range video clip.
2. The method according to claim 1, wherein The display parameter set includes a first display parameter, a second display parameter, and a third display parameter. The first display parameter and the third display parameter are used to adjust the brightness of the video frame, and the second display parameter is used to adjust the contrast of the video frame.
3. The method according to claim 2, wherein: The first display parameter is used to adjust the overall brightness level of the video frame, and the third display parameter is used to partially adjust the brightness level of the video frame.
4. The method according to any one of claims 1 to 3, wherein Divide the multiple video frames included in the initial video into multiple video segments, including: Calculating the similarity between each video frame and the previous video frame in sequence according to the playback order of the multiple video frames included in the initial video; Based on the calculated similarity between every two adjacent video frames, the initial video is divided into a plurality of video segments.
5. The method according to claim 4, wherein Before sequentially calculating the similarity between each video frame and the previous video frame according to the playback order of the multiple video frames included in the initial video, the method further includes: Performing dimensionality reduction processing on each initial video frame in the initial video to obtain the multiple video frames.
6. The method according to claim 4 or 5, wherein: The step of sequentially calculating the similarity between each video frame and the previous video frame includes: For each of the plurality of video frames, determining a structural similarity between the video frame and the previous video frame based on a mean of image data of the video frame and a mean of image data of a previous video frame, a standard deviation of image data of the video frame and a standard deviation of image data of the previous video frame, and a covariance of image data of the video frame and image data of the previous video frame; Based on the structural similarity between the video frame and the previous video frame, the similarity between the video frame and the previous video frame is determined.
7. The method according to any one of claims 1 to 6, wherein Determining, according to any one of the one or more video frames, a display parameter set of a video segment to which the frame belongs, includes: Performing parameter analysis on the initial video frame using an image processing network to obtain the display parameter set; The image processing network includes a first image analysis module and a second image analysis module; The first image analysis module is used to extract features from the initial video frame to obtain a first intermediate video frame; The second image analysis module is used to perform feature extraction and scale transformation on the first intermediate video frame to output the display parameter set.
8. The method according to claim 7, wherein: The first image analysis module includes a first convolution layer, an average pooling layer, an activation layer and a real column regularization normalization layer; the second image analysis module includes a second convolution layer and a global average pooling layer.
9. The method according to claim 7 or 8, wherein The image processing network includes a plurality of the first image analysis modules.
10. The method according to any one of claims 1 to 9, wherein Adjusting other frames in the video segment according to the display parameter set to obtain an intermediate video segment includes: All video frame data in each video clip is adjusted according to the display parameter set corresponding to each video frame according to the following equation: where X in represents the input frame, X out represents the output frame, w1, w2, and w3 are the first display parameter, the second display parameter, and the third display parameter, respectively.
11. The method according to any one of claims 1 to 10, wherein Performing high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment includes: performing high dynamic range conversion on the intermediate video segment using a video processing network; The video processing network includes a basic network and a weight network; The basic network is used to extract and reconstruct features from the input frame to obtain a high dynamic range output frame; The weight network is used to extract features from the input frame to obtain feature matrix parameters, and to perform information correction on the basic network according to the feature matrix parameters.
12. The method according to claim 11, wherein The basic network includes at least one information adjustment node, and the information adjustment node is used to integrate the feature extraction information of the input frame by the basic network and the feature matrix parameter information of the weight network.
13. The method according to claim 12, wherein: The basic network includes a first information regulation node, a second information regulation node, a third information regulation node, a fourth information regulation node and a fifth information regulation node.
14. The method according to any one of claims 11 to 13, wherein The weight network includes at least one feature correction network, and the feature correction network includes at least one attention module; The attention module uses a dual-channel approach to extract features from input information, including: Using the first channel to perform local feature extraction on the input frame to obtain a first feature; Performing global feature extraction on the input frame using the second channel to obtain a second feature; The first feature and the second feature are integrated to obtain output information.
15. The method according to any one of claims 11 to 14, wherein The weight network includes a first feature correction network, a second feature correction network, and a third feature correction network, and the method includes: Inputting the input frame into a first feature correction network to obtain a first feature parameter matrix; inputting the first characteristic parameter matrix into a third information adjustment node; Rearranging the feature channels of the first feature parameter matrix and the input frame and inputting the resultant into the second feature correction network to obtain a second feature parameter matrix; inputting the second characteristic parameter matrix into a second information adjustment node and a fourth information adjustment node; Rearranging the feature channels of the second feature parameter matrix and the input frame and then inputting the resultant into the third feature correction network to obtain a third feature parameter matrix; The third characteristic parameter matrix is input into the first information adjustment node and the fifth information adjustment node.
16. The method according to any one of claims 7 to 9, wherein: The method further comprises: Acquire first sample data, wherein the first sample data includes a first version SDR image and a first version HDR image; and use the first version HDR image corresponding to the first version SDR image as a first version true value image; Inputting the first version of the SDR image into a video processing network to obtain a first version of the predicted HDR image corresponding to the first version of the SDR image; Inputting the first version predicted HDR image and the first version true value image into a first loss function to obtain a first loss function value; and Adjusting the model parameters of the video processing network according to the first loss function value; Acquire second sample data, wherein the second sample data includes a second version SDR image and a second version HDR image; and use the second version HDR image corresponding to the second version SDR image as a second version true value image; Inputting the second version of the SDR image into the image processing network and the trained video processing network to obtain a second version of the predicted HDR image corresponding to the second version of the SDR image; Fixing parameters of the video processing network; Inputting the second version predicted HDR image and the second version true value image into a second loss function to obtain a second loss function value; and Adjust the model parameters of the image processing network according to the second loss function value.
17. The method according to any one of claims 7 to 9 and 16, further comprising Get third sample data, where The third sample data includes a third version SDR image and a third version HDR image; the third version HDR image corresponding to the third version SDR image is used as the third version true value image; Inputting the third version of the SDR image into the image processing network and the video processing network to obtain a third version of the predicted HDR image corresponding to the third version of the SDR image; Inputting the third version predicted HDR image and the third version true value image into a third loss function to obtain a third loss function value; and According to the third loss function value, the model parameters of the image processing network and the video processing network are adjusted.
18. A video processing device, comprising: a dividing module configured to divide a plurality of video frames included in an initial video into a plurality of video segments, each of the video segments including one or more video frames, wherein the plurality of video frames are continuous; an acquisition module configured to determine, based on any one of the one or more video frames, a display parameter set of a video segment to which the frame belongs; and adjust other frames in the video segment according to the display parameter set to obtain an intermediate video segment; The processing module is configured to perform high dynamic range conversion on the intermediate video segment to obtain a high dynamic range video segment; and generate a high dynamic range video according to the high dynamic range video segment.
19. A video processing device, comprising: processor; a memory comprising one or more computer program modules; The one or more computer program modules are stored in the memory and configured to be executed by the processor, and the one or more computer program modules include instructions for executing the video processing method according to any one of claims 1 to 17.
20. A non-transitory readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the video processing method according to any one of claims 1 to 17 is performed.
