# US 2017/0293796 A1 · Flight device and flight control method

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

- Number: US 2017/0293796 A1
- Document ID: US20170293796A1
- Status: Published application
- Kind: A1
- Application number: 15/630,613
- Filed: 2017-06-22
- Published: 2017-10-12
- Earliest claimed: 2015-11-13
- Assignees: Autel Robotics Co., Ltd.
- Applicants: Autel Robotics Co., Ltd.
- Inventors: Zuoguang LI
- Web page: https://patentgrep.com/patent/US20170293796A1

## CPC

- G06T 7/246: using feature-based methods, e.g. the tracking of corners or segments
- G01C 21/10: by using measurements of speed or acceleration (G01C21/24, G01C21/26 take precedence)
- G06T 5/40: using histogram techniques
- G06V 10/751: {Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching}
- G06V 10/758: {Involving statistics of pixels or of feature values, e.g. histogram matching}
- G06V 20/13: Satellite images
- G06V 20/17: taken from planes or by drones
- B64U 2101/30: for imaging, photography or videography
- G06T 2207/10032: Satellite or aerial image; Remote sensing
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G01C: MEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY (measuring liquid level G01F; radio navigation, determining distance or velocity by use of propagation effects, e.g. Doppler effects, propagation time, of radio waves, analogous arrangements using other waves G01S)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- B64U: UNMANNED AERIAL VEHICLES [UAV]; EQUIPMENT THEREFOR

## Abstract

A flight device and a flight control method are disclosed. The method includes: acquiring an image and a height of the flight device; determining a scene in which the flight device is currently located; calculating an image X-offset and an image Y-offset of a second image frame of two adjacent image frames relative to a first image frame of the two adjacent image frames; compensating for the image X-offset and the image Y-offset according to the acceleration and the angular velocity of the flight device to obtain image correction offsets comprising a corrected image X-offset and a corrected image Y-offset; calculating an X-offset and a Y-offset in world coordinates corresponding to the image correction offsets; and deriving a velocity of the flight device.

## Claims

### Claim 1

A flight device, comprising
a processor; and
a memory communicably connected with the processor, the memory storing instructions, wherein when execution of the instructions by the processor causes the processor to:
acquire an image captured by a camera module of the flight device;
acquire a height of the flight device sensed by a distance sensor of the flight device;
determine a scene in which the flight device is currently located;
according to two adjacent image frames captured by the camera module and the scene in which the flight device is currently located, calculate an image X-offset and an image Y-offset of a second image frame of the two adjacent image frames relative to a first image frame of the two adjacent image frames;
acquire acceleration and angular velocity of the flight device in three dimensions that are detected by an acceleration sensor of the flight device;
compensate for the image X-offset and the image Y-offset according to the acceleration and the angular velocity of the flight device to obtain image correction offsets comprising a corrected image X-offset and a corrected image Y-offset;
calculate an X-offset and a Y-offset in world coordinates corresponding to the image correction offsets according to a lens focal length of the camera module, a height of the flight device and the image correction offsets; and
derive a velocity of the flight device according to a time interval between time points at which the two adjacent image frames are captured and according to the X-offset and the Y-offset in world coordinates.

### Claim 2 (depends on 1)

The flight device according to claim 1, wherein the execution of the instructions by the processor further causes the processor to:
perform positioning and/or hovering control on the flight device at least based on the velocity of the flight device.

### Claim 3 (depends on 1)

The flight device according to claim 1, wherein the execution of the instructions by the processor further causes the processor to:
determine a scene in which the flight device is located according to at least one parameter of the image captured by the camera module; and
analyze changes in the parameters of the two adjacent image frames according to the algorithm corresponding to the scene in which the flight device is located so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 4 (depends on 3)

The flight device according to claim 3, wherein the at least one parameter comprises texture, the execution of the instructions by the processor further causes the processor to:
process the image by use of the sobel gradient algorithm to obtain a gradient matrix;
count the number of pixels of which the gradient is greater than a predetermined first threshold in the gradient matrix;
determine that the current scene is a richly textured scene if the number as counted is greater than a second threshold;
determine that the texture is relatively poor and that the current scene is a relatively poorly textured scene if the number as counted is smaller than or equal to the second threshold;
adopt the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames; and
adopt the algorithm of sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 5 (depends on 3)

The flight device according to claim 3, wherein the at least one parameter further comprises reflections, the execution of the instructions by the processor further causes the processor to:
perform shadow statistics according to continuous multi-frame images;
determine whether there are reflections so as to determine whether the scene is a scene with reflections or a scene without reflections;
when the scene in which the flight device is currently located is a scene with reflection:
remove the shadows in the image;
after the shadows are removed, determine whether the scene is a richly-textured scene;
adopt the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames; and
adopt the algorithm of sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 6 (depends on 3)

The flight device according to claim 3, wherein the at least one parameter further comprises grayscale, the execution of the instructions by the processor further causes the processor to:
convert the image into a gray scale histogram according to the gray scale value of the image;
performs statistics to get a statistical value;
compare the statistical value with corresponding threshold, thereby determine whether the scene is a dark, normal, or bright scene;
when the scene in which the flight device is currently located is a bright or a dark scene:
perform histogram equalization on the image to make the brightness of the image uniform;
determine whether the scene is a richly-textured scene;
adopts the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames; and
adopt the algorithm of sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 7 (depends on 3)

The flight device according to claim 3, wherein the at least one parameter further comprises lines, the execution of the instructions by the processor further causes the processor to:
perform gradient detection on the image;
perform binary processing on the image;
use the hough straight-line detection, to determine whether there are straight lines;
if it is determined that there is at least one straight line and the length of the straight line is at least ½ of the width of the image, the scene is determined as a richly-lined scene;
when the scene in which the flight device is currently located is a richly-lined scene:
divide the straight lines into straight lines in the horizontal direction and straight lines in the vertical direction;
find a straight line from the previous frame image, wherein the angular difference between the straight lien and a straight line in the horizontal direction detected in the current image is the smallest, calculate the distance between these two straight lines to get a first distance and set the first distance to 0 if the first distance is not within the range [−R, R], wherein R is a set moving range; and
find a straight line from the previous frame image, wherein the angular difference between the straight line and a straight line in the vertical direction detected in the current image is the smallest, calculate the distance between these two straight lines to get a second distance and set the second distance to 0 if the second distance is not within the range [−R, R]; and thus
the first distance and the second distance obtained through straight line positioning are the image X-offset and the image Y-offset of the two adjacent image frames.

### Claim 8 (depends on 4)

The flight device according to claim 4, the execution of the instructions by the processor further causes the processor to:
set the width and the height of the current image be W and H respectively;
set the size of a template image T be Mx×My, wherein Mx=W−8, My=H−8, and the template image T is obtained from the location of the current frame image [4, 4];
set the size of a matching image S be Nx×Ny, wherein Nx=W, Ny=H, and the matching image S is obtained from the previous frame image;
during the matching, stack the template image on the matching image and translate the template image, wherein the searched sub-image in the reference image covered by the template image is S(i, j), wherein i, j is the locations of the upper-left corner image point of the sub-image in the matching image S, values of i and j are within the range [−4, 4], and S (0, 0) corresponding to the location [4, 4] of A; and
during the matching, to find a searched sub-image as similar as possible to the template image and the coordinate locations i and j thereof, calculate the correlation function SAD, wherein the location where the SAD value of T and S(i, j) is minimum is the image X-offset and the image Y-offset of the two adjacent image frames and wherein SAD refers to the process of calculating the sum of absolute values of the differences between pixels corresponding to each location of the two images.

### Claim 9 (depends on 4)

The flight device according to claim 4, the execution of the instructions by the processor further causes the processor to:
perform edge detection through Sobel algorithm and calculate by use of a two-dimensional template, wherein the two-dimensional template comprises a horizontal template used for difference operation in the horizontal direction and a vertical template used for difference operation in the vertical direction;
use the horizontal and vertical templates to perform plane convolution operation so as to calculate the convolution fx in horizontal-direction and the convolution fy in vertical-direction respectively and calculate the gradient value G, which is the square root of the sum of squares of fx and fy, and then perform the gradient operation on the two adjacent images respectively to obtain the gradient matrix A and the gradient matrix B, wherein A is the Sobel gradient matrix of the previous frame image, and B is the Sobel gradient matrix of the current frame image;
set the size of the template image T be Mx×My, wherein Mx=W−8, My=H−8, and the template image T is obtained from the location [4, 4] of B;
set the size of the matching image S be Nx×Ny, wherein Nx=W, Ny=H, and the matching image S is obtained from A;
during the matching, stack the template image on the matching image and translate the template image, wherein the searched sub-image in the reference image covered by the template image is S(i, j), wherein i, j is the location of the upper-left corner image point of the sub-image in the matching image S, values of i and j are within the range [−4, 4], and S (0, 0) corresponding to the location [4, 4] of A;
perform difference operation on the gradient matrix T and S (i, j) to obtain a difference matrix C; and
calculate the sum of absolute values of each element in the matrix C that satisfies Conditions 1 and 2 to obtain the sum SS (i, j), wherein Condition 1 is A[r, c]>T and Condition 2 is B[r, c]>T;
wherein A[r, c] is the gradient value at the location r, c in the gradient matrix A, and B[r, c] is the gradient value at the location r, c in the gradient matrix B, wherein r>=0 and r<My, c>=0 and c<Mx, and T is gradient threshold, and wherein the location (i, j) where the value of SS(i, j) is minimum is the image X-offset and the image Y-offset of the two adjacent image frames.

### Claim 10 (depends on 1)

The flight device according to claim 1, wherein the execution of the instructions by the processor further causes the processor to:
calculate the X-offset in world coordinates according to Formula 1: x1/X1=f/H, and calculates the Y-offset in world coordinates according to Formula 2: y1/Y1=f/H, wherein x1 is a corrected image X-offset, y1 is a corrected image Y-offset, f is lens focal length, H is height of the flight device, X1 is the X-offset in world coordinates, and Y1 is the Y-offset in world coordinates; and
calculate a rate of the flight device in the X direction and a rate of the flight device in the Y direction according to the time interval between time points at which the two adjacent image frames are captured by the camera module and according to the X-offset and the Y-offset in world coordinates.

### Claim 11

A flight control method for controlling a flight device, wherein the flight control method comprises:
acquiring an image captured by a camera module of the flight device;
acquiring a height of the flight device sensed by a distance sensor of the flight device;
determining a scene in which the flight device is currently located;
calculating, according to two adjacent image frames captured by the camera module and the scene in which the flight device is currently located, an image X-offset and an image Y-offset of a second image frame of the two adjacent image frames relative to a first image frame of the two adjacent image frames;
acquiring an acceleration and an angular velocity of the flight device in three dimensions that are detected by an acceleration sensor of the flight device;
compensating for the image X-offset and the image Y-offset according to the acceleration and the angular velocity of the flight device to obtain image correction offsets comprising a corrected image X-offset and a corrected image Y-offset;
calculating an X-offset and a Y-offset in world coordinates corresponding to the image correction offsets according to a lens focal length of the camera module, a height of the flight device and the image correction offsets; and
deriving a velocity of the flight device according to a time interval between time points at which the two adjacent image frames are captured and according to the X-offset and the Y-offset in world coordinates.

### Claim 12 (depends on 11)

The flight control method according to claim 11, wherein the determining a scene in which the flight device is currently located comprises:
determining a scene in which the flight device is located according to at least one parameter in the image captured by the camera module.

### Claim 13 (depends on 12)

The flight control method according to claim 12, wherein the calculating, according to two adjacent image frames captured by the camera module and the scene in which the flight device is currently located, an image X-offset and an image Y-offset of a second image frame of the two adjacent image frames relative to a first image frame of the two adjacent image frames comprises:
choosing a corresponding algorithm according to the scene in which the flight device is currently located; and
analyzing changes in the parameters of the two adjacent image frames according to the algorithm so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frame.

### Claim 14 (depends on 13)

The flight control method according to claim 13, wherein the at least one parameter comprises texture;
the determining a scene in which the flight device is located according to at least one parameter in the image captured by the camera module comprises:
processing the image by use of the Sobel gradient algorithm to obtain a gradient matrix;
counting the number of pixels of which the gradient is greater than a predetermined first threshold in the gradient matrix;
determining that the current scene is a richly textured scene if the number of pixels as counted is greater than a second threshold; and
determining that the current scene is a relatively poorly textured scene if the number of pixels as counted is smaller than or equal to the second threshold; and that
the choosing a corresponding algorithm according to the scene in which the flight device is currently located; and analyzing changes in the parameters of the two adjacent image frames according to the algorithm so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frame comprises:
adopting the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames; and
adopting the algorithm of Sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 15 (depends on 14)

The flight control method according to claim 14, wherein the at least one parameter further comprises reflections;
the determining a scene in which the flight device is located according to at least one parameter in the image captured by the camera module comprises:
performing shadow statistics according to continuous multi-frame images; and
determining whether there are reflections so as to determine whether the scene is a scene with reflections or a scene without reflections; and that
the choosing a corresponding algorithm according to the scene in which the flight device is currently located; and analyzing changes in the parameters of the two adjacent image frames according to the algorithm so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frame comprises:
when the scene in which the flight device is currently located is a scene with reflection:
removing the shadows in the image;
after the shadows are removed, determining whether the scene is a richly-textured scene;
adopting the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames; and
adopting the algorithm of sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 16 (depends on 14)

The flight control method according to claim 14, wherein the at least one parameter further comprises grayscale;
the determining a scene in which the flight device is located according to at least one parameter in the image captured by the camera module comprises:
converting the image into a gray scale histogram according to the gray scale value of the image;
performing statistics to get a statistical value; and
comparing the statistical value with corresponding threshold, thereby determining whether the scene is a dark, normal, or bright scene; and that
the choosing a corresponding algorithm according to the scene in which the flight device is currently located; and analyzing changes in the parameters of the two adjacent image frames according to the algorithm so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frame comprises:
when the scene in which the flight device is currently located is a bright or a dark scene:
performing histogram equalization on the image to make the brightness of the image uniform;
determining whether the scene is a richly-textured scene;
adopting the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames; and
adopting the algorithm of sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames.

### Claim 17 (depends on 14)

The flight control method according to claim 14, wherein the at least one parameter further comprises lines;
the determining a scene in which the flight device is located according to at least one parameter in the image captured by the camera module comprises:
performing gradient detection on the image;
performing binary processing on the image;
using the Hough straight-line detection, to determine whether there are straight lines; and
if it is determined that there is at least one straight line and the length of the straight line is at least ½ of the width of the image, the scene is determined as a richly-lined scene; and that
the choosing a corresponding algorithm according to the scene in which the flight device is currently located; and analyzing changes in the parameters of the two adjacent image frames according to the algorithm so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frame comprises:
when the scene in which the flight device is currently located is a richly-lined scene:
dividing the straight lines into straight lines in the horizontal direction and straight lines in the vertical direction;
finding a straight line from the previous frame image, wherein the angular difference between the straight line and a straight line in the horizontal direction detected in the current image is the smallest, calculating the distance between these two straight lines to obtain a first distance, and setting the first distance to 0 if the first distance is not within the range [−R, R], wherein R is a set moving range; and
finding a straight line from the previous frame image, wherein the angular difference between the straight line and a straight line in the vertical direction detected in the current image is the smallest, calculating the distance between these two straight lines to obtain a second distance, and setting the second distance to 0 if the second distance is not within the range [−R, R]; and thus
the first distance and the second distance obtained through straight line positioning are the image X-offset and the image Y-offset of the two adjacent image frames.

### Claim 18 (depends on 14)

The flight control method according to claim 14, wherein the adopting the algorithm of gray template matching when the current scene is a richly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames comprises:
setting the width and the height of the current image be W and H respectively, the size of a template image T be Mx×My, wherein Mx=W−8, My=H−8, and the template image T is obtained from the location of the current frame image [4, 4];
setting the size of a matching image S be Nx×Ny, wherein Nx=W, Ny=H, and the matching image S is obtained from the previous frame image; and during the matching, stacking the template image on the matching image and translating the template image, wherein the searched sub-image in the reference image covered by the template image is S(i, j), wherein i, j is the location of the upper-left corner image point of the sub-image in the matching image S, values of i and j are within the range [−4, 4], and S (0, 0) corresponding to the location [4, 4] of A; and
during the matching, to find a searched sub-image similar to the template image and the coordinate locations i and j thereof, calculating the correlation function SAD, wherein the minimum SAD value of T and S(i, j) is the image X-offset and the image Y-offset of the two adjacent image frames, and wherein SAD refers to the process of calculating the sum of absolute values of the differences between pixels corresponding to each location of the two images.

### Claim 19 (depends on 14)

The flight control method according to claim 14, wherein the adopting the algorithm of Sobel gradient template matching when the current scene is a relative poorly textured scene, to analyze changes in the parameters of the two adjacent image frames, so as to calculate the image X-offset and the image Y-offset of the second image frame of the two adjacent image frames relative to the first image frame of the two adjacent image frames comprises:
performing edge detection through Sobel algorithm and calculating by use of a two-dimensional template, wherein the two-dimensional template comprises a horizontal template used for difference operation in the horizontal direction and a vertical template used for difference operation in the vertical direction;
using the horizontal and vertical templates to perform plane convolution operation so as to calculate the convolution fx in horizontal-direction and the convolution fy in vertical-direction respectively, and calculate the gradient value G, which is the square root of the sum of squares of fx and fy, and then performing the gradient operation on the two adjacent images respectively to obtain the gradient matrix A and the gradient matrix B, wherein A is the Sobel gradient matrix of the previous frame image, and B is the Sobel gradient matrix of the current frame image;
setting the size of the template image T be Mx×My, wherein Mx=W−8, My=H−8, and the template image T is obtained from the location [4, 4] of B;
setting the size of the matching image S be Nx×Ny, wherein Nx=W, Ny=H, and the matching image S is obtained from A;
during the matching, stacking the template image on the matching image and translating the template image, wherein the searched sub-image in the reference image covered by the template image is S(i, j), wherein i, j is the location of the upper-left corner image point of the sub-image in the matching image S, values of i and j are within the range [−4, 4], and S (0, 0) corresponding to the location [4, 4] of A;
performing difference operation on the gradient matrix T and S (i, j) to obtain a difference matrix C; and
calculating the sum of absolute values of each element in the matrix C that satisfies Conditions 1 and 2 to obtain the sum SS (i, j), wherein Condition 1 is A[r, c]>T and Condition 2 is B[r, c]>T;
wherein A[r, c] is the gradient value at the location r, c in the gradient matrix A, and B[r, c] is the gradient value at the location r, c in the gradient matrix B, wherein r>=0 and r<My, c>=0 and c<Mx, and T is gradient threshold, and wherein the location (i, j) where the value of SS(i, j) is minimum is the image X-offset and the image Y-offset of the two adjacent image frames.

### Claim 20 (depends on 11)

A non-volatile computer storage medium storing computer executable instructions, wherein when the computer executable instructions are executed by a processor causes the processor to perform the flight control method of claim 11.
