# US 2021/0287009 A1 · Video processing method, video processing 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/0287009 A1
- Document ID: US20210287009A1
- Status: Published application
- Kind: A1
- Application number: 16/984,527
- Filed: 2020-08-04
- Published: 2021-09-16
- Earliest claimed: 2020-03-11
- Assignees: Beijing Xiaomi Pinecone Electronics Co., Ltd.
- Applicants: Beijing Xiaomi Pinecone Electronics Co., Ltd.
- Inventors: Jiagao HU; Changxin LIU; Fei WANG; Pengfei YU
- Web page: https://patentgrep.com/patent/US20210287009A1

## CPC

- G06V 20/46: {Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames}
- G11B 27/031: Electronic editing of digitised analogue information signals, e.g. audio or video signals
- 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}
- H04N 21/44008: {involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream (arrangements characterised by components specially adapted for monitoring, identification or recognition of video in broadcast systems H04H60/59)}
- H04N 21/440272: {for performing aspect ratio conversion}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G11B: INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER (recording measured values in a way that does not require playback through a transducer G01D9/00; recording or playback apparatus using mechanically marked tape, e.g. punched paper tape, or using unit records, e.g. punched or magnetically marked cards G06K; transferring data from one type of record carrier to another G06K1/18; circuits for coupling output of reproducer to radio receiver H04B1/20; gramophone pick-ups or like acoustic electromechanical transducers or circuits therefor H04R)
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A video processing method includes: extracting a plurality of video frames from a source video with a first aspect ratio; clipping each of the plurality of video frames multiple times to generate a plurality of candidate clipping boxes with a second aspect ratio; respectively determining scores of the plurality of candidate clipping boxes of each of the plurality of video frames, the scores representing playing effects of the video frames in response to that each of the candidate clipping boxes is taken as a clipping range; selecting a clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores; and clipping each of the video frames by using the selected clipping box, and generating a target video with the second aspect ratio.

## Claims

### Claim 1

A video processing method, comprising:
extracting a plurality of video frames from a source video with a first aspect ratio;
clipping each of the plurality of video frames multiple times to generate a plurality of candidate clipping boxes with a second aspect ratio;
respectively determining scores of the plurality of candidate clipping boxes of each of the plurality of video frames, the scores representing playing effects of the video frames in response to that each of the candidate clipping boxes is taken as a clipping range;
selecting a clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores; and
clipping each of the video frames by using the selected clipping box, and generating a target video with the second aspect ratio.

### Claim 2 (depends on 1)

The video processing method of claim 1, wherein determining the scores of the candidate clipping boxes comprises:
aesthetically scoring image contents in the candidate clipping boxes to obtain the scores of the candidate clipping boxes.

### Claim 3 (depends on 1)

The video processing method of claim 1, wherein determining the scores of the candidate clipping boxes comprises:
performing salient target detection for each of pixels in the candidate clipping boxes, and determining a pixel score of each of the pixels based on a salient target detection result; and
determining the scores of the candidate clipping boxes according to the pixel score of each of the pixels in the candidate clipping boxes.

### Claim 4 (depends on 1)

The video processing method of claim 1, wherein selecting the clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores comprises:
constructing a state transition matrix based on a position between every two candidate clipping boxes for each of the plurality of video frames, the state transition matrix being configured to smoothly control a jitter between adjacent frames for the selected candidate clipping box of each of the video frames; and
determining a clipping box sequence which meets a maximum clipping box score by using the state transition matrix and the score of each of the candidate clipping boxes based on a maximum target function, the clipping box sequence comprising the selected candidate clipping box of each of the video frames.

### Claim 5 (depends on 4)

The video processing method of claim 4, wherein constructing the state transition matrix based on the position between every two candidate clipping boxes comprises:
constructing the state transition matrix based on an intersection over union (IoU) between every two candidate clipping boxes and a coefficient multiplier, the coefficient multiplier being configured to control a degree of smoothing.

### Claim 6 (depends on 4)

The video processing method of claim 4, wherein constructing the state transition matrix based on the position between every two candidate clipping boxes comprises:
constructing the state transition matrix based on a Euclidean distance between center positions of every two adjacent candidate clipping boxes, areas of the candidate clipping boxes, and a coefficient multiplier, the coefficient multiplier being configured to control a degree of smoothing.

### Claim 7 (depends on 4)

The video processing method of claim 4, wherein after the clipping box of each of the video frames is selected, further comprising:
dividing the source video into a plurality of video segments with an unchanged position and size of the selected clipping box between adjacent frames;
determining a speed for a clipping box moving in two adjacent video segments based on a middle time point of the two adjacent video segments and a distance between the clipping boxes in the two adjacent video segments; and
adjusting positions of the clipping boxes in the two adjacent video segments based on the speed and playing time.

### Claim 8 (depends on 7)

The video processing method of claim 7, wherein a total number of the plurality of video segments is K, and K is a positive integer greater than 1;
wherein adjusting the positions of the clipping boxes in the two adjacent video segments based on the speed and the playing time comprises:
for a first video segment, in response to that the playing time is less than a middle time point of the first video segment, keeping a position of the clipping box in the first video segment unchanged;
for a kth video segment and a (k+1)th video segment, in response to that the playing time is greater than or equal to a middle time point of the kth video segment and less than a middle time point of the (k+1)th video segment, adjusting the clipping box in the kth video segment to move a first distance, the first distance being a product of a first speed and a first time, the first speed being a speed at which the clipping box moves from the kth video segment to the (k+1)th video segment, the first time being a difference between a current time and the middle time point of the kth video segment, and k is a positive integer and 1<k<K−1; and
for a Kth video segment, in response to that the playing time is greater than a middle time point of the Kth video segment, keeping a position of the clipping box in the Kth video segment unchanged.

### Claim 9

A video processing device, comprising:
a processor; and
a memory for storing instructions executable by the processor;
wherein the processor is configured to:
extract a plurality of video frames from a source video with a first aspect ratio;
clip each of the plurality of video frames multiple times to generate a plurality of candidate clipping boxes with a second aspect ratio;
respectively determine scores of the plurality of candidate clipping boxes of each of the plurality of video frames; the scores representing playing effects of the video frames in response to that each of the candidate clipping boxes is taken as a clipping range;
select a clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores; and
clip each of the video frames by using the selected clipping box, and generate a target video with the second aspect ratio.

### Claim 10 (depends on 9)

The video processing device of claim 9, wherein in determining the scores of the candidate clipping boxes, the processor is further configured to:
aesthetically score image contents in the candidate clipping boxes to obtain the scores of the candidate clipping boxes.

### Claim 11 (depends on 9)

The video processing device of claim 9, wherein in determining the scores of the candidate clipping boxes, the processor is further configured to:
perform salient target detection for each of pixels in the candidate clipping boxes, and determine a pixel score of each of the pixels based on a salient target detection result; and
determine the scores of the candidate clipping boxes according to the pixel score of each of the pixels in the candidate clipping boxes.

### Claim 12 (depends on 9)

The video processing device of claim 9, wherein in selecting the clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores, the processor is further configured to:
construct a state transition matrix based on a position between every two candidate clipping boxes for each of the plurality of video frames, the state transition matrix being configured to smoothly control a jitter between adjacent frames for the selected candidate clipping box of each of the video frames; and
determine a clipping box sequence which meets a maximum clipping box score by using the state transition matrix and the score of each of the candidate clipping boxes based on a maximum target function, the clipping box sequence comprising the selected candidate clipping box of each of the video frames.

### Claim 13 (depends on 12)

The video processing device of claim 12, wherein in constructing the state transition matrix based on the position between every two candidate clipping boxes, the processor is further configured to:
construct the state transition matrix based on an intersection over union (IoU) between every two candidate clipping boxes and a coefficient multiplier, the coefficient multiplier being configured to control a degree of smoothing.

### Claim 14 (depends on 12)

The video processing device of claim 12, wherein in constructing the state transition matrix based on the position between every two candidate clipping boxes, the processor is further configured to:
construct the state transition matrix based on a Euclidean distance between center positions of every two adjacent candidate clipping boxes, areas of the candidate clipping boxes, and a coefficient multiplier, the coefficient multiplier being configured to control a degree of smoothing.

### Claim 15 (depends on 12)

The video processing device of claim 12, wherein the processor is further configured to:
divide the source video into a plurality of video segments with an unchanged position and size of the selected clipping box between adjacent frames after the clipping box of each of the video frames is selected;
determine a speed for a clipping box moving in two adjacent video segments based on a middle time point of the two adjacent video segments and a distance between the clipping boxes in the two adjacent video segments; and
adjust positions of the clipping boxes in the two adjacent video segments based on the speed and playing time.

### Claim 16 (depends on 15)

The video processing device of claim 15, wherein a total number of the plurality of video segments is K, and K is a positive integer greater than 1;
wherein in adjusting the positions of the clipping boxes in the two adjacent video segments based on the speed and the playing time, the processor is further configured to:
for a first video segment, in response to that the playing time is less than a middle time point of the first video segment, keep a position of the clipping box in the first video segment unchanged;
for a kth video segment and a (k+1)th video segment, in response to that the playing time is greater than or equal to a middle time point of the kth video segment and less than a middle time point of the (k+1)th video segment, adjust the clipping box in the kth video segment to move a first distance, the first distance being a product of a first speed and a first time, the first speed being a speed at which the clipping box moves from the kth video segment to the (k+1)th video segment, the first time being a difference between a current time and the middle time point of the kth video segment, and k is a positive integer and 1<k<K−1; and
for a Kth video segment, in response to that the playing time is greater than a middle time point of the Kth video segment, keep a position of the clipping box in the Kth video segment unchanged.

### Claim 17

A non-transitory computer-readable storage medium having stored therein instructions that, when executed by a processor of a mobile terminal, causes the mobile terminal to perform a video processing method comprising:
extracting a plurality of video frames from a source video with a first aspect ratio;
clipping each of the plurality of video frames multiple times to generate a plurality of candidate clipping boxes with a second aspect ratio;
respectively determining scores of the plurality of candidate clipping boxes of each of the plurality of video frames, the scores representing playing effects of the video frames in response to that each of the candidate clipping boxes is taken as a clipping range;
selecting a clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores; and
clipping each of the video frames by using the selected clipping box, and generating a target video with the second aspect ratio.

### Claim 18 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein determining the scores of the candidate clipping boxes comprises:
aesthetically scoring image contents in the candidate clipping boxes to obtain the scores of the candidate clipping boxes.

### Claim 19 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein determining the scores of the candidate clipping boxes comprises:
performing salient target detection for each of pixels in the candidate clipping boxes, and determining a pixel score of each of the pixels based on a salient target detection result; and
determining the scores of the candidate clipping boxes according to the pixel score of each of the pixels in the candidate clipping boxes.

### Claim 20 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein selecting the clipping box of each of the video frames from the plurality of candidate clipping boxes based on the scores comprises:
constructing a state transition matrix based on a position between every two candidate clipping boxes for each of the plurality of video frames, the state transition matrix being configured to smoothly control a jitter between adjacent frames for the selected candidate clipping box of each of the video frames; and
determining a clipping box sequence which meets a maximum clipping box score by using the state transition matrix and the score of each of the candidate clipping boxes based on a maximum target function, the clipping box sequence comprising the selected candidate clipping box of each of the video frames.
