# US 2021/0081671 A1 · Video processing method and device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0081671 A1
- Document ID: US20210081671A1
- Status: Published application
- Kind: A1
- Application number: 16/693,376
- Filed: 2019-11-25
- Published: 2021-03-18
- Earliest claimed: 2019-09-12
- Assignees: Beijing Xiaomi Mobile Software Co., Ltd.
- Applicants: Beijing Xiaomi Mobile Software Co., Ltd.
- Inventors: Jiagao HU; Fei WANG
- Web page: https://patentgrep.com/patent/US20210081671A1

## CPC

- G06V 20/38: {Outdoor scenes}
- G06F 16/75: Clustering; Classification
- G06F 18/24: Classification techniques
- G06V 20/41: {Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items (segmenting video sequences G06V20/49)}
- G06V 20/49: {Segmenting video sequences, i.e. computational techniques such as parsing or cutting the sequence, low-level clustering or determining units such as shots or scenes}
- G06V 20/70: Labelling scene content, e.g. deriving syntactic or semantic representations
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A video processing method includes: collecting a plurality of video frames sequentially from a to-be-processed video; classifying an image corresponding to each of the plurality of video frames to obtain a classification result; for each video frame, performing a temporal smoothing processing on the classification result for the image corresponding to the video frame, to determine at least one category associated with the video frame; and grouping the adjacent video frames of a same category into a video segment, to obtain a plurality of video segments.

## Claims

### Claim 1

A video processing method, comprising:
collecting a plurality of video frames sequentially from a to-be-processed video;
for each of the plurality of video frames, classifying an image corresponding to the video frame to obtain a classification result;
performing a temporal smoothing processing on the classification results for the images corresponding to all of the video frames, to determine at least one category associated with each of the video frames; and
grouping the adjacent video frames of a same category into a video segment, to obtain a plurality of video segments,
wherein in a case that a same video frame belongs to different categories, the video frame is categorized into different video segments of the categories corresponding to the video frame.

### Claim 2 (depends on 1)

The video processing method of claim 1, wherein for each of the plurality of video frames, the classifying an image corresponding to each of the plurality of video frames to obtain a classification result comprises:
calling an image classifier, with an input of the image classifier being the image, and an output of the image classifier being confidences corresponding to a plurality of categories, and
the grouping the adjacent video frames of a same category into a video segment, to obtain a plurality of video segments comprises:
determining the adjacent video frames of the same category according to at least one category of the image corresponding to each video frame and a confidence corresponding to the at least one category, to categorize the plurality of video frames into the plurality of video segments.

### Claim 3 (depends on 2)

The video processing method of claim 2, wherein the performing a temporal smoothing processing on the classification results for the images corresponding to all of the video frames, to determine at least one category associated with each of the video frames comprises:
constructing a frame classification confidence matrix of the plurality of collected video frames according to the confidences corresponding to the plurality of categories outputted by the image classifier for each video frame;
performing a temporal smoothing processing based on the frame classification confidence matrix, to output a smooth tag sequence, with the smooth tag sequence being a multi-dimensional vector, a value of each component in the multi-dimensional vector representing a category tag outputted for the video frame in the temporal smoothing processing;
repeating the performing the temporal smoothing processing until a predetermined number of smooth tag sequences are determined; and
determining the at least one category associated with each video frame from the plurality of categories by using the confidences in the predetermined number of smooth tag sequences.

### Claim 4 (depends on 3)

The video processing method of claim 3, wherein the performing a temporal smoothing processing based on the frame classification confidence matrix to output a smooth tag sequence comprises:
constructing a linear chain Conditional Random Field (CRF) model; and
determining, by using the linear chain CRF model, a smooth tag sequence that satisfies a maximum probability condition.

### Claim 5 (depends on 4)

The video processing method of claim 4, wherein the determining, by using the linear chain CRF model, a smooth tag sequence that satisfies a maximum probability condition comprises:
performing normalization processing based on the frame classification confidence matrix and a predetermined state transition matrix,
wherein the predetermined state transition matrix has a predetermined multiple relationship with a unit matrix, and the predetermined multiple is determined according to a smoothing degree.

### Claim 6 (depends on 3)

The video processing method of claim 3, wherein the performing a temporal smoothing processing based on the frame classification confidence matrix to output a smooth tag sequence comprises:
constructing a fully-connected Conditional Random Field (CRF) model; and
determining, by using the fully-connected CRF model, a smooth tag sequence based on a minimized energy function.

### Claim 7 (depends on 3)

The video processing method of claim 3, wherein after the determining the at least one category associated with each video frame from the plurality of categories by using the confidences in the predetermined number of smooth tag sequences, the method further comprises:
taking a mean value of the adjacent confidences, corresponding to a same category, in the predetermined number of smooth tag sequences as a confidence corresponding to the category of the images corresponding to the adjacent video frames of the same category.

### Claim 8 (depends on 2)

The video processing method of claim 2, wherein after the grouping the adjacent video frames of a same category into a video segment, the method further comprises:
determining a confidence corresponding to each of the video segments obtained by the categorizing; and
taking the video segment corresponding to the confidence greater than a predetermined threshold as a final video segment.

### Claim 9 (depends on 2)

The video processing method of claim 2, wherein the determining the adjacent video frames of the same category according to at least one category of the image corresponding to each video frame and a confidence corresponding to the at least one category, to categorize the plurality of video frames into the plurality of video segments comprises:
constructing a frame classification confidence matrix of the plurality of collected video frames according to the confidences corresponding to the plurality of categories outputted by the image classifier for each video frame;
constructing a grayscale image based on the frame classification confidence matrix, with the grayscale image comprising a horizontal axis coordinate and a longitudinal axis coordinate, wherein the horizontal axis coordinate represents confidences corresponding to the categories, and the longitudinal axis coordinate represents a sequence of the video frames;
detecting a longitudinal straight line of the grayscale image by using a line segment detection method; and
categorizing the plurality of video frames into the video segments according to the longitudinal straight line, wherein starting and ending coordinates in a longitudinal axis of the longitudinal straight line correspond to starting and ending frames of the video segment, and a coordinate in a horizontal axis of the longitudinal straight line corresponds to a category of the video segment.

### Claim 10

A video processing device, comprising:
a processor;
a memory configured to store an instruction executable by the processor; and
a processor is configured to:
collect a plurality of video frames sequentially from a to-be-processed video;
for each of the plurality of video frames, classify an image corresponding to the video frame to obtain a classification result;
perform a temporal smoothing processing on the classification results for the images corresponding to all of the video frames, to determine at least one category associated with each of the video frames; and
group the adjacent video frames of a same category into a video segment, to obtain a plurality of video segments,
wherein if a same video frame belongs to different categories, the video frame is categorized into different video segments of the categories corresponding to the video frame.

### Claim 11 (depends on 10)

The video processing device of claim 10, wherein the processor is further configured to:
call an image classifier, with an input of the image classifier being the image, and an output of the image classifier being confidences corresponding to a plurality of categories; and
determine the adjacent video frames of the same category according to at least one category of the image corresponding to each video frame and a confidence corresponding to the at least one category, to categorize the plurality of video frames into the plurality of video segments.

### Claim 12 (depends on 11)

The video processing device of claim 11, wherein the processor is further configured to:
construct a frame classification confidence matrix of the plurality of collected video frames according to the confidences corresponding to the plurality of categories outputted by the image classifier for each video frame;
perform a temporal smoothing processing based on the frame classification confidence matrix, to output a smooth tag sequence, with the smooth tag sequence being a multi-dimensional vector, a value of each component in the multi-dimensional vector representing a category tag outputted for the video frame in the temporal smoothing processing;
repeat the performing a temporal smoothing processing until a predetermined number of smooth tag sequences are determined; and
determine the at least one category associated with each video frame from the plurality of categories by using the confidences in the predetermined number of smooth tag sequences.

### Claim 13 (depends on 12)

The video processing device of claim 12, wherein the processor is further configured to:
construct a linear chain Conditional Random Field (CRF) model; and
determine, by using the linear chain CRF model, a smooth tag sequence that satisfies a maximum probability condition.

### Claim 14 (depends on 13)

The video processing device of claim 13, wherein the processor is further configured to:
perform normalization processing based on the frame classification confidence matrix and a predetermined state transition matrix,
wherein the predetermined state transition matrix has a predetermined multiple relationship with a unit matrix, and the predetermined multiple is determined according to a smoothing degree.

### Claim 15 (depends on 12)

The video processing device of claim 12, wherein the processor is further configured to:
construct a fully-connected Conditional Random Field (CRF) model; and
determine, by using the fully-connected CRF model, a smooth tag sequence based on a minimized energy function.

### Claim 16 (depends on 12)

The video processing device of claim 12, wherein the processor is further configured to:
take a mean value of the adjacent confidences, corresponding to a same category, in the predetermined number of smooth tag sequences as a confidence corresponding to the category of the images corresponding to the adjacent video frames of the same category.

### Claim 17 (depends on 11)

The video processing device of claim 11, wherein after the adjacent video frames of a same category are grouped into a video segment, the processor is further configured to:
determine a confidence corresponding to each of the video segments obtained by the categorizing; and
take the video segment corresponding to the confidence greater than a predetermined threshold as a final video segment.

### Claim 18 (depends on 11)

The video processing device of claim 11, wherein the processor is further configured to:
construct a frame classification confidence matrix of the plurality of collected video frames according to the confidences corresponding to the plurality of categories outputted by the image classifier for each video frame;
construct a grayscale image based on the frame classification confidence matrix, with the grayscale image comprising a horizontal axis coordinate and a longitudinal axis coordinate, wherein the horizontal axis coordinate represents confidences corresponding to the categories, and the longitudinal axis coordinate represents a sequence of the video frames;
detect a longitudinal straight line of the grayscale image by using a line segment detection method; and
categorize the plurality of video frames into the video segments according to the longitudinal straight line, wherein starting and ending coordinates in a longitudinal axis of the longitudinal straight line correspond to starting and ending frames of the video segment, and a coordinate in a horizontal axis of the longitudinal straight line corresponds to a category of the video segment.

### Claim 19

A non-transitory computer-readable storage medium having computer executable instructions stored thereon for execution by a processor to enable the processor to implement a video processing method, the method comprising:
collecting a plurality of video frames sequentially from a to-be-processed video;
for each of the plurality of video frames, classifying an image corresponding to the video frame to obtain a classification result;
performing a temporal smoothing processing on the classification result for the image corresponding to the video frame, to determine at least one category associated with the video frame; and
grouping the adjacent video frames of a same category into a video segment, to obtain a plurality of video segments,
wherein if a same video frame belongs to different categories, the video frame is categorized into different video segments of the categories corresponding to the video frame.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein the classifying an image corresponding to each of the plurality of video frames to obtain a classification result comprises:
calling an image classifier, with an input of the image classifier being the image, and an output of the image classifier being confidences corresponding to a plurality of categories, and
the grouping the adjacent video frames of a same category into a video segment, to obtain a plurality of video segments comprises:
determining the adjacent video frames of the same category according to at least one category of the image corresponding to each video frame and a confidence corresponding to the at least one category, to categorize the plurality of video frames into the plurality of video segments.
