Video processing methods, apparatus, equipment and storage media
By performing multi-layer scaling and color feature extraction on video image frames, flicker detection is automated, solving the problem of low efficiency in manual review and achieving efficient and accurate video flicker detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-09-06
- Publication Date
- 2026-05-26
AI Technical Summary
Current video review technology mainly relies on manual labor, which is inefficient and prone to false positives, and cannot effectively detect flickering phenomena.
By acquiring multiple image frames from the video to be processed, scaling the images to generate multi-layer images, extracting color feature information layer by layer, and performing flicker detection at different feature scales, flicker in the video is automatically detected.
It achieves automated video inspection, reduces reliance on manual review, improves inspection efficiency and accuracy, reduces computational load and cost, and supports lightweight terminal deployment.
Smart Images

Figure CN117710989B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computers, and more particularly to a video processing method, apparatus, device, and storage medium. Background Technology
[0002] With the rise of self-media and short video platforms, content creators can publish or share their original videos. However, videos usually need to undergo review before being published or shared.
[0003] In related technologies, video review mainly relies on manual review, which not only has low video detection efficiency but is also prone to false detections. Summary of the Invention
[0004] This disclosure provides a video processing method, apparatus, device, and storage medium to solve at least one technical problem in the prior art.
[0005] On the one hand, this disclosure provides a video processing method, including:
[0006] Acquire a video to be processed, which includes multiple consecutive image frames;
[0007] Determine the multi-layer image corresponding to each of the plurality of image frames; each layer of the multi-layer image is obtained by scaling the corresponding image frame, and the pixel size of each layer of the multi-layer image decreases layer by layer;
[0008] Color features are extracted from the multi-layer image corresponding to each image frame to obtain color feature information corresponding to each image frame; the color feature information is used to characterize the flicker-related features of each image frame at multiple different feature scales.
[0009] For any two adjacent image frames among the plurality of image frames, flicker detection is performed on the two image frames at at least one of the feature scales based on the color feature information corresponding to the two image frames respectively.
[0010] On the other hand, a video processing apparatus is also provided, the apparatus comprising:
[0011] An acquisition module is used to acquire a video to be processed, which includes multiple consecutive image frames;
[0012] The determining module is used to determine the multi-layer image corresponding to each image frame in the plurality of image frames; each layer of the multi-layer image is obtained by scaling the corresponding image frame, and the pixel size of each layer of the multi-layer image decreases layer by layer;
[0013] The feature extraction module is used to extract color features from the multi-layer image corresponding to each image frame to obtain color feature information corresponding to each image frame; the color feature information is used to indicate the flicker-related features of each image frame at multiple different feature scales.
[0014] The detection module is used to perform flicker detection on any two adjacent image frames among the plurality of image frames at at least one of the feature scales, based on the color feature information corresponding to the two image frames respectively.
[0015] On the other hand, an electronic device is also provided, the electronic device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement any of the methods described above.
[0016] On the other hand, a computer-readable storage medium is also provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement any of the methods described above.
[0017] On the other hand, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described above.
[0018] The video processing method, apparatus, device, and storage medium disclosed herein have the following technical advantages:
[0019] This embodiment of the disclosure acquires a video to be processed, which includes multiple consecutive image frames; determines a multi-layer image corresponding to each image frame in the multiple image frames; each layer of the multi-layer image is obtained by scaling the corresponding image frame, and the pixel size of each layer of the multi-layer image decreases layer by layer; extracts color features from the multi-layer image corresponding to each image frame to obtain color feature information corresponding to each image frame; the color feature information is used to characterize the flicker-related features of each image frame at multiple different feature scales; for any two adjacent image frames in the multiple image frames, flicker detection is performed on the two image frames at at least one feature scale based on the color feature information corresponding to the two image frames, thereby realizing automatic detection of the video to be processed, reducing the reliance on manual review and improving video detection efficiency. Meanwhile, by extracting color features from the multi-layered images after image scaling at multiple different feature scales, and based on the extracted color feature information, flicker detection is performed on two image frames at at least one feature scale, taking into account both local and global features in the image frames, thus improving the accuracy and reliability of video detection results. In addition, there is no need to extract features from the original image frames with massive pixels, nor is there a need to perform flicker detection on all feature scales. The entire video processing process has low computational load and supports parallel processing, which not only enables lightweight deployment on the terminal, but also has high video processing efficiency. Attached Figure Description
[0020] To more clearly illustrate the technical solutions and advantages in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the application environment of a video processing method provided in an embodiment of this disclosure;
[0022] Figure 2 This is a schematic flowchart of a video processing method provided in an embodiment of this disclosure;
[0023] Figure 3 This is a flowchart illustrating a step for obtaining color feature information according to an embodiment of this disclosure;
[0024] Figure 4 This is a flowchart illustrating a step for obtaining color features according to an embodiment of this disclosure;
[0025] Figure 5 This is a schematic flowchart of a flicker detection step provided in an embodiment of this disclosure;
[0026] Figure 6 This is a flowchart illustrating another video processing method provided in an embodiment of this disclosure;
[0027] Figure 7 This is a flowchart illustrating an anomaly elimination process provided in an embodiment of this disclosure;
[0028] Figure 8 This is a structural block diagram of a video processing apparatus provided in an embodiment of this disclosure;
[0029] Figure 9 This is a structural block diagram of another video processing apparatus provided in an embodiment of this disclosure;
[0030] Figure 10 This is a schematic diagram of the hardware structure of a device for implementing the method provided in the embodiments of this disclosure. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.
[0032] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.
[0033] To facilitate understanding of the technical solutions described above and their resulting technical effects in the embodiments of this disclosure, the terms used in the embodiments of this disclosure are briefly introduced as follows:
[0034] Computer Vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0035] Flicker: refers to a rapid and drastic fluctuation in the intensity of the light signal received by the human eye. In other words, flicker is the continuous flickering of an image as perceived by the human eye. One cause of flicker is the flickering of the displayed image; this type of flicker can easily induce harmful effects such as epilepsy.
[0036] RGB: It is an industry color standard that uses variations in the three color channels (red, green, and blue) and their superposition to obtain a variety of colors. RGB represents the colors of the red, green, and blue channels.
[0037] HSL: is a representation of points in the RGB color model in a cylindrical coordinate system.
[0038] Chroma (H): This is the fundamental attribute of color, essentially the color name, such as red or yellow. Chroma is composed of primary, secondary, and tertiary colors. Chroma is the primary characteristic of color and the most accurate standard for distinguishing different colors.
[0039] Brightness (L): This refers to the lightness or darkness of a color, primarily determined by the intensity of light. Colors with the same hue may appear to have different levels of brightness. Generally, the stronger the light, the brighter the color appears; the weaker the light, the darker the color appears.
[0040] The solutions provided in this disclosure relate to technologies such as computer vision and machine learning in artificial intelligence, and are specifically illustrated through the following embodiments:
[0041] The video processing method disclosed herein can be applied to, for example... Figure 1 The application environment shown. For example... Figure 1 As shown, the hardware environment may include at least a terminal 110 and a server 120.
[0042] The aforementioned terminals 110 include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.
[0043] The aforementioned server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal and server can be connected directly or indirectly via wired or wireless communication, and this disclosure does not impose any limitations. It should be noted that the aforementioned server 120 can be implemented as a cloud server in the cloud.
[0044] In some embodiments, the server 120 can also be implemented as a node in a blockchain system. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0045] It should be noted that, in practical applications, the video processing method provided in this disclosure can be implemented in a terminal, in a server, or jointly by a terminal and a server.
[0046] Of course, the methods provided in this disclosure are not limited to... Figure 1 The hardware environment shown can also be used in other possible hardware environments, and this disclosure does not limit the scope of the embodiments. Figure 1 The functions that each device in the hardware environment shown can perform will be described in subsequent method embodiments, and will not be elaborated on here.
[0047] With the rise of self-media and short video platforms, content creators may be unaware of the potential dangers of flickering videos, leading to the widespread dissemination of flickering content on online platforms and causing negative consequences. In related technologies, before content creators share or publish their original videos, they often rely on manual review for anomalies. This manual review method is not only inefficient but also prone to false positives. To address this technical problem, this disclosure provides a video processing method.
[0048] Figure 2 This is a flowchart illustrating a video processing method provided in an embodiment of this disclosure. This disclosure provides the operational steps of the method described in the embodiments or flowchart, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many steps and does not represent a unique execution order. The executing entity of this video processing method can be the video processing device provided in the embodiments of this disclosure, or a server integrating the video processing device, wherein the video processing device can be implemented in hardware or software. Taking the executing entity as described above... Figure 1 Taking the terminal in the example of this, for example... Figure 2 As shown, the method may include:
[0049] S201: Obtain the video to be processed, which includes multiple consecutive image frames.
[0050] The term "video to be processed" refers to video resources that require review and processing, such as video resources that are currently playing and awaiting review. For example, the video resource may include, but is not limited to, at least one of short videos, live streams, and films / television works.
[0051] Optionally, the video to be processed includes multiple consecutive image frames, the order of each image frame in the multiple image frames corresponds to the frame order in the video to be processed, and the frame interval between two adjacent image frames in the multiple image frames satisfies a preset condition, which is used to indicate the condition for detecting whether there is flicker in the video to be processed.
[0052] The multiple image frames can refer to image frames corresponding to a specific video segment in the video to be processed. For example, the multiple image frames can be image frames corresponding to a video segment in the currently playing video to be processed that has not yet been played. For instance, if the nth video segment in the video to be processed is playing, then the multiple image frames can be image frames corresponding to the (n+m)th video segment in the video to be processed, where n and m are both positive integers. Alternatively, the multiple image frames can also be image frames extracted from the video to be processed. For example, the multiple image frames can be image frames extracted from a video segment in the currently playing video to be processed that has not yet been played, at a preset interval. This preset interval refers to the frame interval used to detect whether there is flickering in the video to be processed, and this frame interval can be a natural number.
[0053] S202: Determine the multi-layer image corresponding to each image frame in multiple image frames.
[0054] In this multi-layer image, each layer is obtained by scaling the corresponding image frame, and the pixel size of each layer decreases progressively.
[0055] Optionally, by performing layer-by-layer image scaling on each of the multiple image frames, a multi-layer image corresponding to each image frame is obtained. The resolution of each layer in the multi-layer image is lower than the resolution of the corresponding image frame, and the pixel size of each layer decreases layer by layer.
[0056] For example, for image frame a, image frame a is scaled layer by layer to obtain a multi-layered image. Taking three layers as an example, the multi-layered image can be, in sequence, a first layer image a1, a second layer image a2, and a third layer image a3. The resolution of each of these three layers is lower than the resolution of the corresponding image frame a. The pixel size of each layer in the multi-layered image decreases layer by layer, that is, the pixel size of the first layer image a1 is smaller than that of image frame a, and the pixel sizes of the first layer image a1, the second layer image a2, and the third layer image a3 decrease in sequence. As an optional example, the pixel size (e.g., length and width) of the first layer image a1 can be 1 / m of the pixel size of image frame a, the pixel size (e.g., length and width) of the second layer image a2 can be 1 / n of the pixel size of the first layer image a1, and the pixel size (e.g., length and width) of the third layer image a3 can be 1 / r of the pixel size of the second layer image a2, where m, n, and r are positive integers, and m, n, and r can be the same value or at least partially different values.
[0057] S203: Extract color features from the multi-layer image corresponding to each image frame to obtain the color feature information corresponding to each image frame.
[0058] Among them, color feature information is used to characterize the flicker-related features of each image frame at multiple different feature scales.
[0059] Optionally, the color feature information corresponding to each image frame may include multiple color features at different feature scales. For example, for N different feature scales, the color feature information corresponding to each image frame may include N color features. Each feature scale corresponds to one color feature, and each color feature can be represented in the form of a one-dimensional vector or a two-dimensional matrix. Correspondingly, the color feature information can be represented in the form of a two-dimensional matrix or a three-dimensional matrix, where N is an integer greater than 1.
[0060] Optionally, in a flicker detection task, the flicker-related feature refers to a flicker-related color feature. For example, the color feature can be at least one of a luminance feature and a chromaticity feature.
[0061] In one optional implementation, the terminal uses an adapted color feature extraction algorithm to extract color features from the multi-layer image corresponding to each of the multiple image frames, obtaining color features for each image frame at multiple different feature scales. These extracted color features are those related to flicker. Then, by aggregating the color features of each image frame at its respective feature scale, color feature information corresponding to each image frame is obtained. The color feature information corresponding to each image frame includes the extracted color features.
[0062] In another alternative implementation, such as Figure 3As shown, Figure 3 This is a flowchart illustrating a step for obtaining color feature information according to an embodiment of this disclosure. The step involves extracting color features from multiple layers of the image corresponding to each image frame to obtain color feature information for each image frame, including:
[0063] S301: Extract color features from the multi-layer images corresponding to each image frame to obtain the multi-layer feature map corresponding to each image frame.
[0064] Among them, the feature scale and the number of feature blocks corresponding to different levels of feature maps in multi-layer feature maps are different.
[0065] Optionally, if two adjacent image frames to be detected are denoted as I1 and I2, they can be preprocessed before feature extraction, resulting in preprocessed image frames I1′ and I2′. Taking size adjustment as an example, the image frames can be resized by padding pixels with zeros. The adjusted image frames have the same length and width; for example, the adjusted image size is 512×512, meaning each image frame has a length and width of 512 pixels. Next, color features are extracted from the multi-layer images corresponding to each preprocessed image frame, resulting in feature maps for each layer. This leads to multi-layer feature maps for each image frame. The feature scale and number of feature blocks differ between different levels of the multi-layer feature maps. The number of levels in the multi-layer feature maps is the same as the number of levels in the multi-layer images.
[0066] For example, taking a three-layer feature map, the feature scales corresponding to each layer are 64*64, 32*32, and 16*16, respectively. 64*64 corresponds to the feature scale of the first layer, 32*32 to the second layer, and 16*16 to the third layer. The lower the feature layer, the more local the extracted features; the higher the feature layer, the more global the extracted features. For instance, compared to the second layer, the first layer is more focused on local color features; while compared to the second layer, the third layer is more focused on global color features.
[0067] S302: Based on the multi-layer feature map corresponding to each image frame, obtain the color features corresponding to each feature block in each layer feature map corresponding to each image frame.
[0068] In an alternative implementation, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating a step for obtaining color features according to an embodiment of the present disclosure. Based on the multi-layer feature map corresponding to each image frame, the color features corresponding to each feature block in each layer feature map corresponding to each image frame are obtained, including:
[0069] S401: Based on the multi-layer feature map corresponding to each image frame, determine the initial color features of each pixel in each layer of the multi-layer feature map;
[0070] S402: Determine the first color component features and the second color component features of the initial color features in the target color space; the first color component features are used to indicate the features of the pixel in the chromaticity dimension; the second color component features are used to indicate the features of the pixel in the luminance dimension;
[0071] S403: For each feature block, determine the first color sub-feature of the feature block based on the first color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block;
[0072] S404: For each feature block, determine the second color sub-feature of the feature block based on the second color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block;
[0073] S405: Based on the first color sub-feature and the corresponding second color sub-feature, determine the color features corresponding to each feature block in each layer feature map corresponding to each image frame.
[0074] Optionally, the terminal determines the initial color features of each pixel in each layer of the multi-layer feature map based on the multi-layer feature map corresponding to each image frame. These initial color features refer to the features corresponding to the RGB color space. Next, based on the correspondence between the target color space and the RGB color space, the initial color features are converted in the target color space. The target color space can be the HSL color space, which includes chroma (H), saturation (S), and lightness (L). Then, the converted color features are used to determine the first and second color component features in the target color space. The first color component feature indicates the pixel's features in the chroma dimension, i.e., the chroma component feature; the second color component feature indicates the pixel's features in the lightness dimension, i.e., the lightness component feature.
[0075] Next, for each feature block in the multi-layer feature map, the total number of pixels contained in the feature block is determined. Based on the first color component features corresponding to each pixel and the total number of pixels contained in the feature block, the first color sub-feature of the feature block is determined. Taking the first color sub-feature being the mean of the corresponding feature block as an example, the first color sub-feature is calculated. The calculation formula can be expressed as:
[0076]
[0077] Where v represents the currently accessed pixel, HSL() represents the RGB-HSL color space conversion function, .H refers to the component in the chromaticity dimension, Count represents the number of pixels in the current region, Feat_n represents the image frame to which its feature belongs, k represents its layer index, and i represents the index of its feature block in the current feature layer.
[0078] Next, for each feature block in the multi-layer feature map, based on the second color component features corresponding to each pixel and the total number of pixels contained in the feature block, the second color sub-feature of that feature block is determined. Taking the first color sub-feature being the mean of the corresponding feature block as an example, the second color sub-feature is calculated. The calculation formula can be expressed as:
[0079]
[0080] Where v represents the currently accessed pixel, HSL() represents the RGB-HSL color space conversion function, .L refers to the component in the luminance dimension, Count represents the number of pixels in the current region, Feat_n represents the image frame to which its feature belongs, k represents its layer index, and i represents the index of its feature block in the current feature layer.
[0081] Next, after determining the first color sub-feature and the corresponding second color sub-feature, the first color sub-feature and the corresponding second color sub-feature of the same feature block can be combined to obtain the color features of each feature block in each layer feature map corresponding to each image frame.
[0082] The above embodiments first perform color space conversion and separate the relevant color component features, and then use each color component feature and the corresponding total number of pixels to determine the color sub-features corresponding to each feature block, so as to obtain the color features corresponding to each feature block. This comprehensively considers the various sub-features related to color changes, making the determined color features more representative of the relevant characteristics of the feature block, improving the accuracy of the color features of each feature block, and thus helping to improve the reliability of the video results.
[0083] In one optional implementation, the terminal can first convert the multi-layer feature map corresponding to each image frame into a multi-layer target feature map corresponding to the target color space, such as a multi-layer target feature map corresponding to the HSL color space. Then, based on the multi-layer target feature map, the color features corresponding to each feature block of each image frame are determined.
[0084] S303: Determine the color feature information corresponding to each image frame based on the color features corresponding to each image frame.
[0085] Optionally, by summarizing the color features of each image frame at each feature scale, the color feature information corresponding to each image frame is obtained. The color feature information corresponding to each image frame includes multiple defined color features, which simultaneously contain the first color sub-feature and the corresponding second color sub-feature of each feature block. The color feature information can be represented in the form of a two-dimensional matrix or a three-dimensional matrix.
[0086] The above embodiment obtains the color features corresponding to each feature block in each layer of feature maps corresponding to each image frame by using multi-layer feature maps, thereby obtaining the corresponding color feature information. By considering multi-layer feature maps and the color features of the feature blocks corresponding to each layer, the computational load is reduced, and the efficiency of video detection is improved.
[0087] S204: For any two adjacent image frames in a plurality of image frames, perform flicker detection on the two image frames at at least one feature scale based on the color feature information corresponding to the two image frames respectively.
[0088] In one optional implementation, the color feature information includes chromaticity feature information for characterizing the chromaticity dimension and luminance feature information for characterizing the luminance dimension. In this case, flicker detection is performed on the two image frames at at least one feature scale based on the color feature information corresponding to the two image frames, including:
[0089] Based on the chromaticity feature information corresponding to the two image frames at the same feature scale, the chromaticity difference information between the corresponding feature blocks of the two image frames at the same feature scale is determined.
[0090] Based on the brightness feature information corresponding to the same feature scale of two image frames, the brightness difference information between corresponding feature blocks of the two image frames at the same feature scale is determined.
[0091] Based on chromaticity difference information and luminance difference information, flicker detection is performed on two image frames at at least one feature scale.
[0092] Optionally, the terminal can determine the chromaticity difference information between corresponding feature blocks of two image frames at the same feature scale based on the chromaticity feature information corresponding to the two image frames at the same feature scale. For example, for adjacent image frame 1 and image frame 2, this chromaticity difference information can be represented as... in It is the first color sub-feature corresponding to image frame 1. It is the first color sub-feature corresponding to image frame 2, and abs() is the function to calculate the absolute value.
[0093] Similarly, the terminal can determine the brightness difference information between corresponding feature blocks of two image frames at the same feature scale based on the brightness feature information corresponding to the two image frames at the same feature scale. For example, for adjacent image frames 1 and 2, this chromaticity difference information can be represented as... in It is the second color sub-feature corresponding to image frame 1. This is the second color sub-feature corresponding to image frame 2, and abs() is a function for calculating the absolute value. Next, based on the chromaticity difference information and the brightness difference information, flicker detection is performed on the two image frames at at least one feature scale to obtain the flicker detection result. This flicker detection result characterizes whether the detected image frame has flicker.
[0094] In an alternative implementation, such as Figure 5 As shown, Figure 5 This is a flowchart illustrating a flicker detection step provided in an embodiment of this disclosure. Based on chromaticity difference information and luminance difference information, flicker detection is performed on two image frames at at least one feature scale, including:
[0095] S501: Use the largest feature scale among multiple different feature scales as the current feature scale;
[0096] S502: Compare the color difference value corresponding to the color difference information of each corresponding feature block at the current feature scale with the size of the corresponding color threshold;
[0097] S503: If the comparison result indicates that flicker exists at the current feature scale, determine that the detected image frame has flicker;
[0098] S504: If the comparison result indicates that there is no flicker at the current feature scale, the next feature scale among multiple different feature scales shall be taken as the current feature scale;
[0099] S505: Continue to compare the color difference value corresponding to the color difference information of each feature block at the current feature scale, the size of the corresponding color threshold, and subsequent related steps until the detection termination condition is met.
[0100] Optionally, the terminal uses the largest feature scale among multiple different feature scales (e.g., the feature scale corresponding to the first layer feature map) as the current feature scale, and compares the color difference value corresponding to the color difference information of each corresponding feature block at the current feature scale with the corresponding color threshold. If the comparison result indicates that flicker exists at the current feature scale, it is determined that flicker exists in the detected image frame, and the flicker detection process is exited. For example, flicker can include chromatic flicker and luminance flicker, where chromatic flicker refers to a rapid change in chromaticity, such as rapid alternation of red and green, and luminance flicker refers to a rapid change in the brightness of the image.
[0101] If the comparison result indicates that there is no flicker at the current feature scale, the next feature scale among multiple different feature scales (e.g., the feature scale corresponding to the second layer feature map) is taken as the current feature scale, and steps S502-S504 above are continued. This process continues until, if flicker is determined to exist at the feature scale corresponding to the second layer feature map, the detected image frame is confirmed to have flicker, and the anomaly detection process exits. Otherwise, the next feature scale corresponding to the second layer feature map (e.g., the feature scale corresponding to the third layer feature map) is taken as the current feature scale, and steps S502-S504 above are continued. If an anomaly is detected, the process exits; otherwise, it continues until the detection termination condition is met. This termination condition can be that all feature scales have been traversed, or that the smallest feature scale among multiple different feature scales has been traversed.
[0102] During the detection process, if no flicker is detected at any feature scale, it is determined that the detected image frame does not flicker; otherwise, if an abnormal detection result corresponding to a feature scale indicates flicker, it is determined that the detected image frame does flicker.
[0103] The above embodiments perform anomaly detection layer by layer, starting from the largest feature scale. If flicker is detected at a feature scale corresponding to a certain layer, there is no need to perform anomaly detection on other feature scales in the remaining layers, achieving fast real-time anomaly detection, reducing anomaly detection time, and improving video processing efficiency.
[0104] In an optional implementation, if the comparison result indicates the presence of flicker at the current feature scale, before the step of determining that the detected image frame has flicker, the method further includes:
[0105] At the current feature scale, determine the current cumulative amount that satisfies the preset detection conditions for the comparison results;
[0106] If the current cumulative amount is greater than or equal to the preset threshold corresponding to the current feature scale, the comparison result indicates that flicker exists at the current feature scale;
[0107] If the current cumulative amount is less than the preset threshold corresponding to the current feature scale, the comparison result indicates that there is no flicker at the current feature scale.
[0108] The preset threshold is related to the number of feature blocks corresponding to the current feature scale. The preset detection condition can refer to the color difference value exceeding the corresponding color threshold, specifically, the chromaticity difference value exceeding the corresponding chromaticity threshold (H_threshhold) or the luminance difference value exceeding the corresponding luminance threshold (L_threshhold).
[0109] Optionally, at the current feature scale, for each feature block, if either the chromaticity difference value or the luminance difference value corresponding to the feature block exceeds the corresponding color threshold, then the feature block is counted as 1. If neither the chromaticity difference value nor the luminance difference value corresponding to the feature block exceeds the corresponding color threshold, then the feature block is not counted, or the count is 0. After traversing all feature blocks at the current feature scale, the count corresponding to each feature block can be counted to obtain the current cumulative amount corresponding to the current feature scale. Then, the current cumulative amount is compared with the preset threshold corresponding to the current feature scale. If it is greater than or equal to the preset threshold, then the comparison result indicates that flicker exists at the current feature scale; otherwise, the comparison result indicates that flicker exists at the current feature scale.
[0110] The preset threshold is related to the number of feature blocks corresponding to the current feature scale. As an example, for a 16*16 feature scale, the total number of feature blocks is 256, and the corresponding preset threshold can be half of the total number of feature blocks, i.e., the preset threshold is 128.
[0111] The above embodiment determines whether flicker exists at the current feature scale by comparing the current cumulative amount with a preset threshold corresponding to the current feature scale, resulting in low computational complexity. Furthermore, the preset threshold is related to the number of feature blocks corresponding to the current feature scale, which improves the detection flexibility for each feature scale and further enhances video processing efficiency.
[0112] In one optional implementation, the comparison result includes a first comparison sub-result indicating chromaticity difference information and a second comparison sub-result indicating luminance difference information. At the current feature scale, determining the current cumulative amount by which the comparison result satisfies preset detection conditions includes:
[0113] At the current feature scale, determine the first cumulative amount that the first comparison result satisfies the preset detection conditions, and determine the second cumulative amount that the second comparison result satisfies the preset detection conditions;
[0114] The current cumulative amount is determined based on the first and second cumulative amounts.
[0115] Optionally, at the current feature scale, the terminal determines a first cumulative amount that satisfies the preset detection conditions for the first comparison sub-result, and a second cumulative amount that satisfies the preset detection conditions for the second comparison sub-result. The first and second cumulative amounts may carry the block identifiers of the corresponding feature blocks. Then, based on the block identifiers of the feature blocks, the first and second cumulative amounts are fused, i.e., the cumulative amounts corresponding to the same block identifier are removed to obtain the current cumulative amount. In the above embodiment, by detecting the luminance and chrominance dimensions separately, and obtaining the current cumulative amount based on the obtained first and second cumulative amounts respectively, the processing does not need to be performed in a predetermined order, reducing processing difficulty and improving video processing efficiency.
[0116] Optionally, if it is determined that the first cumulative amount or the second cumulative amount is greater than or equal to the corresponding preset threshold, then any cumulative amount that is greater than or equal to the corresponding preset threshold is taken as the current cumulative amount. For example, the first cumulative amount or the second cumulative amount is taken as the current cumulative amount, thereby further saving processing steps and time and improving video processing efficiency.
[0117] The above method involves acquiring a video to be processed, which includes multiple consecutive image frames; determining a multi-layer image corresponding to each image frame; each layer of the multi-layer image is obtained by scaling the corresponding image frame, with the pixel size of each layer decreasing progressively; extracting color features from the multi-layer image corresponding to each image frame to obtain color feature information for each image frame; this color feature information is used to characterize the flicker-related features of each image frame at multiple different feature scales; and for any two adjacent image frames, flicker detection is performed on the two image frames at at least one feature scale based on the color feature information corresponding to the two image frames, thus achieving automatic detection of the video to be processed, reducing reliance on manual review and improving video detection efficiency. Meanwhile, by extracting color features from the multi-layered images after image scaling at multiple different feature scales, and based on the extracted color feature information, flicker detection is performed on two image frames at at least one feature scale, taking into account both local and global features in the image frames, thus improving the accuracy and reliability of video detection results. In addition, there is no need to extract features from the original image frames with massive pixels, nor is there a need to perform flicker detection on all feature scales. The entire video processing process has low computational load and supports parallel processing, which not only enables lightweight deployment on the terminal, but also has high video processing efficiency.
[0118] Furthermore, compared to traditional video review methods that rely on manual review, which are not only costly but also require additional storage space after backend transcoding, the video processing method disclosed herein can be deployed on a terminal, such as integrated into a client with video playback capabilities. The entire video processing process can be executed on the client, enabling real-time flicker detection of playing videos without backend intervention, manual review, or backend transcoding, thus reducing both review and storage costs.
[0119] In an alternative implementation, such as Figure 6 As shown, Figure 6 This is a flowchart illustrating another video processing method provided in this disclosure embodiment, the method further comprising:
[0120] S601: If the flicker detection result indicates that the detected image frame has flicker, perform anomaly elimination processing on the detected image frame.
[0121] Optionally, if the flicker detection result indicates that flicker exists in the detected image frame, then flicker anomaly elimination processing is performed on the detected image frame in a timely manner. For example, this anomaly elimination processing may include, but is not limited to, image frame masking processing, image frame overlay processing, and image frame replacement processing.
[0122] The above embodiments, when the detected flicker detection result indicates that the detected image frame has flicker, quickly perform anomaly elimination processing on the detected image frame. This is suitable for real-time video processing in video playback scenarios, reducing the harm caused to users by flicker and ensuring the safety of real-time video playback.
[0123] In an alternative implementation, such as Figure 7 As shown, Figure 7 This is a flowchart illustrating an anomaly removal process provided in an embodiment of this disclosure. If the flicker detection result indicates that flicker exists in the detected image frame, anomaly removal processing is performed on the detected image frame, including:
[0124] S701: If the flicker detection result indicates that the detected image frame has flicker, perform grayscale processing on the detected image frame;
[0125] S702: Perform grayscale linear mapping on the detected image frame that has undergone grayscale processing to obtain the target image frame that has undergone anomaly elimination processing. The image contrast of the target image frame is less than the image contrast of the corresponding detected image frame.
[0126] Optionally, if flicker is detected in two image frames being detected, grayscale processing and grayscale linear mapping are performed. Specifically, grayscale processing is applied to the detected image frame to eliminate its chromatic flicker. Then, grayscale linear mapping is performed on the grayscale-processed detected image frame within the grayscale range to obtain the target image frame after anomaly removal processing, thus eliminating its luminance flicker. For example, the grayscale linear mapping range can be [0,255]->[20,230], that is, dynamic range compression of gray values with a compression value of 20. The image contrast of the processed target image frame is less than the image contrast of the corresponding detected image frame, thus eliminating its luminance flicker.
[0127] The above embodiments, by combining grayscale processing and gray linear mapping for anomaly elimination, can not only effectively eliminate flickering anomalies, but also eliminate anomalies quickly without the need for additional transcoding, minimizing the computational load of anomaly elimination and facilitating deployment on various terminals.
[0128] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.
[0129] Please refer to Figure 8 This diagram illustrates a structural block diagram of a video processing apparatus provided in an embodiment of this disclosure. The apparatus has the functions described in the method examples above; these functions can be implemented in hardware or by hardware executing corresponding software. The video processing apparatus may include:
[0130] The acquisition module 810 is used to acquire the video to be processed, which includes multiple consecutive image frames;
[0131] The determining module 820 is used to determine the multi-layer image corresponding to each image frame in the plurality of image frames; each layer of the multi-layer image is obtained by scaling the corresponding image frame, and the pixel size of each layer of the multi-layer image decreases layer by layer;
[0132] The feature extraction module 830 is used to extract color features from each of the plurality of image frames to obtain color feature information corresponding to each image frame; the color feature information is used to indicate the flicker-related features of each image frame at multiple different feature scales.
[0133] The detection module 840 is used to perform flicker detection on any two adjacent image frames among the plurality of image frames, based on the color feature information corresponding to the two image frames respectively, at at least one of the feature scales.
[0134] In an optional embodiment, the feature extraction module 830 includes:
[0135] The extraction submodule is used to extract color features from each of the multiple image frames to obtain a multi-layer feature map corresponding to each image frame; the feature scale and the number of feature blocks corresponding to different levels of the multi-layer feature map are different.
[0136] The feature determination submodule is used to obtain the color features corresponding to each feature block in each feature map of each layer corresponding to each image frame based on the multi-layer feature map corresponding to each image frame;
[0137] The information determination submodule is used to determine the color feature information corresponding to each image frame based on the color features corresponding to each image frame.
[0138] In an optional implementation, the extraction submodule includes:
[0139] An initial feature determination unit is used to determine the initial color features of each pixel in each layer of the multi-layer feature map based on the multi-layer feature map corresponding to each image frame.
[0140] A component feature determination unit is used to determine the first color component feature and the second color component feature of the initial color feature in the target color space; the first color component feature is used to indicate the feature of the pixel in the chromaticity dimension; the second color component feature is used to indicate the feature of the pixel in the luminance dimension.
[0141] The first sub-feature determination unit is used to determine the first color sub-feature of each feature block based on the first color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block.
[0142] The second sub-feature determination unit is used to determine the second color sub-feature of each feature block based on the second color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block.
[0143] The feature determination unit is used to determine the color features corresponding to each feature block in each layer feature map corresponding to each image frame, based on the first color sub-feature and the corresponding second color sub-feature.
[0144] In an optional embodiment, the color feature information includes chromaticity feature information for characterizing the chromaticity dimension and luminance feature information for characterizing the luminance dimension; the detection module 840 includes:
[0145] The first difference determination submodule is used to determine the chromaticity difference information between the two image frames at the same feature scale and their corresponding feature blocks based on the chromaticity feature information corresponding to the two image frames at the same feature scale.
[0146] The second difference determination submodule is used to determine the brightness difference information between corresponding feature blocks of the two image frames at the same feature scale based on the brightness feature information corresponding to the two image frames at the same feature scale.
[0147] The detection submodule is used to perform flicker detection on the two image frames at at least one of the feature scales based on the chromaticity difference information and the brightness difference information.
[0148] In an optional implementation, the detection submodule includes:
[0149] The first scale determination unit is used to take the largest feature scale among the multiple different feature scales as the current feature scale.
[0150] The comparison unit is used to compare the color difference value corresponding to the color difference information of each corresponding feature block under the current feature scale with the size of the corresponding color threshold.
[0151] The first detection unit is used to determine that the detected image frame has flicker if the comparison result indicates that flicker exists at the current feature scale.
[0152] The second scale determination unit is used to take the next feature scale among the plurality of different feature scales as the current feature scale if the comparison result indicates that there is no flicker at the current feature scale.
[0153] The second detection unit is used to continue to perform the comparison of the color difference value corresponding to the color difference information of each corresponding feature block at the current feature scale, the size of the corresponding color threshold, and subsequent related steps, until the detection end condition is met.
[0154] In an alternative embodiment, the device further includes:
[0155] The cumulative determination module is used to determine the current cumulative amount that satisfies the preset detection conditions under the current feature scale;
[0156] The first anomaly detection module is used to determine, if the current cumulative amount is greater than or equal to a preset threshold corresponding to the current feature scale, that the comparison result indicates that there is flickering at the current feature scale.
[0157] The second anomaly detection module is used to determine, if the current cumulative amount is less than the preset threshold corresponding to the current feature scale, that the comparison result indicates that there is no flicker at the current feature scale.
[0158] The preset threshold is related to the number of feature blocks corresponding to the current feature scale.
[0159] In an optional implementation, the comparison result includes a first comparison sub-result indicating chromaticity difference information and a second comparison sub-result indicating luminance difference information; the cumulative determination module is specifically used for:
[0160] At the current feature scale, a first cumulative amount is determined to satisfy the preset detection conditions for the first comparison sub-result, and a second cumulative amount is determined to satisfy the preset detection conditions for the second comparison sub-result;
[0161] The current cumulative amount is determined based on the first cumulative amount and the second cumulative amount.
[0162] In an alternative implementation, such as Figure 9 As shown, the device also includes:
[0163] The anomaly elimination module 850 is used to perform anomaly elimination processing on the detected image frame if the flicker detection result indicates that flicker exists in the detected image frame.
[0164] In an optional implementation, the anomaly elimination module 850 is specifically used for:
[0165] If the flicker detection result indicates that the detected image frame has flicker, the detected image frame is processed into grayscale;
[0166] The detected image frame, after grayscale processing, is linearly mapped to grayscale to obtain a target image frame after anomaly removal processing. The image contrast of the target image frame is less than that of the corresponding detected image frame.
[0167] The apparatus provided in the above embodiments can execute the corresponding methods in the embodiments of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the methods provided in any embodiment of this application.
[0168] This disclosure provides a computer device that may include a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method described in any of the above method embodiments.
[0169] This disclosure also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded by a processor and executed by any of the methods described in the above method embodiments.
[0170] This disclosure also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described in this embodiment.
[0171] Furthermore, Figure 10 A schematic diagram of a hardware structure for implementing the methods provided in the embodiments of this disclosure is shown. The device may be a computer terminal, a mobile terminal, or other device, and may also participate in or include the apparatus provided in the embodiments of this disclosure. Figure 10 As shown, the computer terminal 11 may include one or more processors 112 (shown as 112a, 112b, ..., 112n in the figure) 112 (processor 112 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 114 for storing data, and a transmission device 116 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 10 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 11 may also include... Figure 10 The more or fewer components shown, or having the same Figure 10 The different configurations shown.
[0172] It should be noted that the aforementioned one or more processors 112 and / or other data processing circuitry are generally referred to herein as "data processing circuitry". This data processing circuitry may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 11 (or mobile device). As per the embodiments of this disclosure, the data processing circuitry serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0173] The memory 114 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in this embodiment. The processor 112 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the aforementioned neural network processing method. The memory 114 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 114 may further include memory remotely located relative to the processor 112, and these remote memories can be connected to the computer terminal 11 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0174] The transmission device 116 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 11. In one example, the transmission device 116 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 116 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0175] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 11 (or mobile device).
[0176] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.
[0177] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0178] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0179] The above description is only a preferred embodiment of this disclosure and is not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.
Claims
1. A video processing method, characterized in that, include: Acquire a video to be processed, which includes multiple consecutive image frames; Determine the multi-layer image corresponding to each of the plurality of image frames; Each layer of the multi-layer image is obtained by scaling the corresponding image frame, and the pixel size of each layer of the multi-layer image decreases layer by layer. Color features are extracted from the multi-layer image corresponding to each image frame to obtain color feature information corresponding to each image frame; the color feature information is used to characterize the flicker-related features of each image frame at multiple different feature scales. For any two adjacent image frames among the plurality of image frames, based on the color feature information corresponding to the two image frames respectively, flicker detection is performed on the two image frames at at least one of the feature scales; The color feature information includes chromaticity feature information for characterizing the chromaticity dimension and luminance feature information for characterizing the luminance dimension. The step of performing flicker detection on the two image frames at at least one feature scale based on the color feature information corresponding to the two image frames respectively includes: Based on the chromaticity feature information corresponding to the two image frames at the same feature scale, the chromaticity difference information between the corresponding feature blocks of the two image frames at the same feature scale is determined. Based on the brightness feature information corresponding to the two image frames at the same feature scale, the brightness difference information between the corresponding feature blocks of the two image frames at the same feature scale is determined. Based on the chromaticity difference information and the luminance difference information, flicker detection is performed on the two image frames at at least one of the feature scales, including: taking the largest feature scale among the plurality of different feature scales as the current feature scale; comparing the color difference value corresponding to the color difference information of each corresponding feature block at the current feature scale with the size of the corresponding color threshold; if the comparison result indicates that flicker exists at the current feature scale, determining that the detected image frame has flicker; if the comparison result indicates that there is no flicker at the current feature scale, taking the next feature scale among the plurality of different feature scales as the current feature scale; continuing to execute the comparison of the color difference value corresponding to the color difference information of each corresponding feature block at the current feature scale with the size of the corresponding color threshold and subsequent related steps, until the detection termination condition is met.
2. The method according to claim 1, characterized in that, The step of extracting color features from the multi-layer images corresponding to each image frame to obtain color feature information corresponding to each image frame includes: Color features are extracted from the multi-layer image corresponding to each image frame to obtain a multi-layer feature map corresponding to each image frame; the feature scale and the number of feature blocks corresponding to the feature maps of different layers in the multi-layer feature map are different. Based on the multi-layer feature map corresponding to each image frame, the color features corresponding to each feature block in each layer feature map corresponding to each image frame are obtained; Based on the color features corresponding to each image frame, the color feature information corresponding to each image frame is determined.
3. The method according to claim 2, characterized in that, The step of obtaining the color features corresponding to each feature block in each feature map of each image frame based on the multi-layer feature map corresponding to each image frame includes: Based on the multi-layer feature map corresponding to each image frame, the initial color features of each pixel in each layer of the multi-layer feature map are determined. Determine the first color component features and the second color component features of the initial color features in the target color space; the first color component features are used to indicate the features of the pixel in the chromaticity dimension; the second color component features are used to indicate the features of the pixel in the luminance dimension. For each feature block, a first color sub-feature of the feature block is determined based on the first color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block; For each feature block, a second color sub-feature of the feature block is determined based on the second color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block; Based on the first color sub-feature and the corresponding second color sub-feature, the color features corresponding to each feature block in each layer feature map corresponding to each image frame are determined.
4. The method according to claim 1, characterized in that, Before the step of determining that the detected image frame has flicker if the comparison result indicates that flicker exists at the current feature scale, the method further includes: Under the current feature scale, determine the current cumulative amount that satisfies the preset detection conditions for the comparison results; If the current cumulative amount is greater than or equal to the preset threshold corresponding to the current feature scale, the comparison result indicates that flicker exists at the current feature scale. If the current cumulative amount is less than the preset threshold corresponding to the current feature scale, the comparison result indicates that there is no flicker at the current feature scale. The preset threshold is related to the number of feature blocks corresponding to the current feature scale.
5. The method according to claim 4, characterized in that, The comparison results include a first comparison sub-result for indicating chromaticity difference information and a second comparison sub-result for indicating luminance difference information; Determining the current cumulative amount that satisfies the preset detection conditions under the current feature scale includes: At the current feature scale, a first cumulative amount is determined to satisfy the preset detection conditions for the first comparison sub-result, and a second cumulative amount is determined to satisfy the preset detection conditions for the second comparison sub-result; The current cumulative amount is determined based on the first cumulative amount and the second cumulative amount.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: If the flicker detection result indicates that the detected image frame has flicker, the detected image frame is subjected to anomaly elimination processing.
7. The method according to claim 6, characterized in that, If the flicker detection result indicates that the detected image frame has flicker, the detected image frame is subjected to anomaly elimination processing, including: If the flicker detection result indicates that the detected image frame has flicker, the detected image frame is processed into grayscale; The detected image frame, after grayscale processing, is linearly mapped to grayscale to obtain a target image frame after anomaly removal processing. The image contrast of the target image frame is less than that of the corresponding detected image frame.
8. A video processing apparatus, characterized in that, The device includes: An acquisition module is used to acquire a video to be processed, which includes multiple consecutive image frames; The determining module is used to determine the multi-layer image corresponding to each image frame in the plurality of image frames; each layer of the multi-layer image is obtained by scaling the corresponding image frame, and the pixel size of each layer of the multi-layer image decreases layer by layer; The feature extraction module is used to extract color features from the multi-layer image corresponding to each image frame to obtain color feature information corresponding to each image frame; the color feature information is used to indicate the flicker-related features of each image frame at multiple different feature scales. The detection module is used to perform flicker detection on any two adjacent image frames in the plurality of image frames at at least one of the feature scales, based on the color feature information corresponding to the two image frames respectively. The color feature information includes chromaticity feature information for characterizing the chromaticity dimension and luminance feature information for characterizing the luminance dimension; the detection module includes: The first difference determination submodule is used to determine the chromaticity difference information between the two image frames at the same feature scale and their corresponding feature blocks based on the chromaticity feature information corresponding to the two image frames at the same feature scale. The second difference determination submodule is used to determine the brightness difference information between corresponding feature blocks of the two image frames at the same feature scale based on the brightness feature information corresponding to the two image frames at the same feature scale. The detection submodule is used to perform flicker detection on the two image frames at at least one of the feature scales based on the chromaticity difference information and the brightness difference information. The detection submodule includes: The first scale determination unit is used to take the largest feature scale among the multiple different feature scales as the current feature scale. The comparison unit is used to compare the color difference value corresponding to the color difference information of each corresponding feature block under the current feature scale with the size of the corresponding color threshold. The first detection unit is used to determine that the detected image frame has flicker if the comparison result indicates that flicker exists at the current feature scale. The second scale determination unit is used to take the next feature scale among the plurality of different feature scales as the current feature scale if the comparison result indicates that there is no flicker at the current feature scale. The second detection unit is used to continue to perform the comparison of the color difference value corresponding to the color difference information of each corresponding feature block at the current feature scale, the size of the corresponding color threshold, and subsequent related steps, until the detection end condition is met.
9. The apparatus according to claim 8, characterized in that, The feature extraction module includes: The extraction submodule is used to extract color features from each of the multiple image frames to obtain a multi-layer feature map corresponding to each image frame; the feature scale and the number of feature blocks corresponding to different levels of the multi-layer feature map are different. The feature determination submodule is used to obtain the color features corresponding to each feature block in each feature map of each layer corresponding to each image frame based on the multi-layer feature map corresponding to each image frame; The information determination submodule is used to determine the color feature information corresponding to each image frame based on the color features corresponding to each image frame.
10. The apparatus according to claim 9, characterized in that, The extraction submodule includes: An initial feature determination unit is used to determine the initial color features of each pixel in each layer of the multi-layer feature map based on the multi-layer feature map corresponding to each image frame. A component feature determination unit is used to determine the first color component feature and the second color component feature of the initial color feature in the target color space; the first color component feature is used to indicate the feature of the pixel in the chromaticity dimension; the second color component feature is used to indicate the feature of the pixel in the luminance dimension. The first sub-feature determination unit is used to determine the first color sub-feature of each feature block based on the first color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block. The second sub-feature determination unit is used to determine the second color sub-feature of each feature block based on the second color component features corresponding to each pixel in the feature block and the total number of pixels contained in the feature block. The feature determination unit is used to determine the color features corresponding to each feature block in each layer feature map corresponding to each image frame, based on the first color sub-feature and the corresponding second color sub-feature.
11. The apparatus according to claim 8, characterized in that, The device further includes: The cumulative determination module is used to determine the current cumulative amount that satisfies the preset detection conditions under the current feature scale; The first anomaly detection module is used to determine, if the current cumulative amount is greater than or equal to a preset threshold corresponding to the current feature scale, that the comparison result indicates that there is flickering at the current feature scale. The second anomaly detection module is used to determine, if the current cumulative amount is less than the preset threshold corresponding to the current feature scale, that the comparison result indicates that there is no flicker at the current feature scale. The preset threshold is related to the number of feature blocks corresponding to the current feature scale.
12. The apparatus according to claim 11, characterized in that, The comparison result includes a first comparison sub-result indicating chromaticity difference information and a second comparison sub-result indicating luminance difference information; the cumulative determination module is specifically used for: At the current feature scale, a first cumulative amount is determined to satisfy the preset detection conditions for the first comparison sub-result, and a second cumulative amount is determined to satisfy the preset detection conditions for the second comparison sub-result; The current cumulative amount is determined based on the first cumulative amount and the second cumulative amount.
13. The apparatus according to any one of claims 8-11, characterized in that, The device further includes: An anomaly elimination module is used to perform anomaly elimination processing on the detected image frame if the flicker detection result indicates that flicker exists in the detected image frame.
14. The apparatus according to claim 13, characterized in that, The anomaly elimination module is specifically used for: If the flicker detection result indicates that the detected image frame has flicker, the detected image frame is processed into grayscale; The detected image frame, after grayscale processing, is linearly mapped to grayscale to obtain a target image frame after anomaly removal processing. The image contrast of the target image frame is less than that of the corresponding detected image frame.
15. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the video processing method as described in any one of claims 1-7.
16. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the video processing method as described in any one of claims 1-7.
17. A computer program product, characterized in that, The computer program product includes at least one instruction or at least one program segment, which is loaded and executed by a processor to implement the video processing method as described in any one of claims 1-7.