# US 11,120,269 B2 · Method and apparatus for determining target rotation direction, computer readable medium and electronic device

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

- Number: US 11,120,269 B2
- Document ID: US11120269B2
- Status: Granted
- Kind: B2
- Application number: 16/492,984
- Filed: 2018-03-29
- Published: 2020-03-26
- Granted: 2021-09-14
- Earliest claimed: 2017-06-16
- Assignees: Beijing Jingdong Shangke Information Technology Co., Ltd.; Beijing Jingdong Century Trading Co., Ltd.
- Applicants: Beijing Jingdong Shangke Information Technology Co., Ltd.; Beijing Jingdong Century Trading Co., Ltd.
- Inventors: Guangfu Che; Shan An; Xiaozhen Ma; Yu Chen
- Web page: https://patentgrep.com/patent/US11120269B2

## CPC

- G06T 7/20: Analysis of motion (motion estimation for coding, decoding, compressing or decompressing digital video signals H04N19/43, H04N19/51)
- G06T 7/11: Region-based segmentation
- G06T 7/194: involving foreground-background segmentation
- G06T 7/251: {involving models}
- G06T 7/269: using gradient-based methods
- G06V 10/242: {by image rotation, e.g. by 90 degrees}
- G06V 10/28: Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
- 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 40/20: Movements or behaviour, e.g. gesture recognition (recognition of facial expressions G06V40/16)
- G06T 2207/10016: Video; Image sequence
- G06V 2201/07: Target detection
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

The present disclosure relates to a method and apparatus for determining a target rotation direction. Said method for determining the target rotation direction comprises: inputting successive video frames which comprise a rotation target; establishing a background model for the first image frame in said video frames; performing foreground detection on the video frames other than the first frame by means of said background model so as to determine the rotation axis of said rotation target; obtaining the distribution of optical flow points within a preset region of said rotation axis; determining the direction of rotation of said rotation target according to the distribution of optical flow points within said preset region. By means of the present disclosure, it is possible to simply and efficiently determine the clock direction of a rotation target in a video.

## Claims

### Claim 1

A method for determining a rotation direction of a target, comprising:
inputting continuous video frames comprising a rotation target;
establishing a background model according to a first frame image in the video frames;
performing a foreground detection on each video frame other than the first frame by using the background model, and determining a rotation axis center of the rotation target;
tracking and recording optical flow points on the rotation target using the optical flow method;
screening the optical flow points within a preset area of the rotation axis center according to coordinate information of each optical flow point;
performing a statistics on numbers of optical flow points in a first direction and a second direction within the preset area of the rotation axis center respectively; and
determining a rotation direction of the rotation target according to the numbers of the optical flow points in the first direction and the second direction.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the performing the foreground detection on each video frame other than the first frame by using the background model, and determining the rotation axis center of the rotation target comprises:
storing a sample set for each background point in the first frame image by the background model, so as to generate a background sample set;
locating foreground points in each video frame other than the first frame according to the background sample set;
performing a statistical analysis on the foreground points in each video frame other than the first frame and determining a foreground image area of the rotation target; and
taking a center point of the foreground image area as the rotation axis center of the rotation target.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the performing the statistical analysis on the foreground points in each video frame other than the first frame and determining the foreground image area of the rotation target comprises:
when determining that a foreground range within a preset frame reaches a maximum according to the foreground points in each video frame other than the first frame, taking the foreground in the corresponding video frame when the foreground range reaches the maximum as the foreground image area.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the screening the optical flow points within the preset area of the rotation axis center according to coordinate information of each optical flow point comprises:
calculating an absolute value of a difference between an x coordinate of the rotation axis center and an x coordinate of each optical flow point; and
when the absolute value is less than a preset threshold, selecting a corresponding optical flow point to be within the preset area of the rotation axis center.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
determining whether input video frames are color images; and
when the video frames are the color images, converting the color images into grayscale images.

### Claim 6

A non-transitory computer-readable medium having stored thereon a computer program, the program being executed by a processor to:
input continuous video frames comprising a rotation target;
establish a background model according to a first frame image in the video frames;
perform a foreground detection on each video frame other than the first frame by using the background model, and determining a rotation axis center of the rotation target;
tracking and recording optical flow points on the rotation target using the optical flow method;
screening the optical flow points within a preset area of the rotation axis center according to coordinate information of each optical flow point;
performing a statistics on numbers of optical flow points in a first direction and a second direction within the preset area of the rotation axis center respectively; and
determining a rotation direction of the rotation target according to the numbers of the optical flow points in the first direction and the second direction.

### Claim 7

An electronic device, comprising:
one or more processors; and
a storage device for storing one or more programs;
wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to:
input continuous video frames comprising a rotation target;
establish a background model according to a first frame image in the video frames;
perform a foreground detection on each video frame other than the first frame by using the background model, and determining a rotation axis center of the rotation target;
track and record optical flow points on the rotation target using the optical flow method;
screen the optical flow points within a preset area of the rotation axis center according to coordinate information of each optical flow point;
perform a statistics on numbers of optical flow points in a first direction and a second direction within the preset area of the rotation axis center respectively; and
determine a rotation direction of the rotation target according to the numbers of the optical flow points in the first direction and the second direction.

### Claim 8 (depends on 7)

The electronic device according to claim 7, wherein the one or more processors are further configured to:
store a sample set for each background point in the first frame image by the background model, so as to generate a background sample set;
locate foreground points in each video frame other than the first frame according to the background sample set;
perform a statistical analysis on the foreground points in each video frame other than the first frame and determining a foreground image area of the rotation target; and
take a center point of the foreground image area as the rotation axis center of the rotation target.

### Claim 9 (depends on 8)

The electronic device according to claim 8, wherein the one or more processors are further configured to:
when determining that a foreground range within a preset frame reaches a maximum according to the foreground points in each video frame other than the first frame, take the foreground in the corresponding video frame when the foreground range reaches the maximum as the foreground image area.

### Claim 10 (depends on 7)

The electronic device according to claim 7, wherein the one or more processors are further configured to:
calculate an absolute value of a difference between an x coordinate of the rotation axis center and an x coordinate of each optical flow point; and
when the absolute value is less than a preset threshold, select a corresponding optical flow point to be within the preset area of the rotation axis center.

### Claim 11 (depends on 7)

The electronic device according to claim 7, wherein the one or more processors are further configured to:
determine whether input video frames are color images; and
when the video frames are the color images, convert the color images into grayscale images.
