Patent Description:
An unmanned aerial vehicle-based intelligent following function is roughly divided into two parts, namely, target detection and following control.

Generally, the target detection on a unmanned aerial vehicle is realized by a gimbal-mounted camera equipped on the unmanned aerial vehicle. For the target detection part, a target to be followed is found in an image obtained by the camera, and is marked with a rectangular frame (or other forms). The following control part is to enable the unmanned aerial vehicle to follow the target while certain requirements are met (for example, the distance between the target and the unmanned aerial vehicle is kept unchanged). The easiest way to implement following control is to follow the target according to the three-dimensional spatial location of the target. However, because the gimbal-mounted camera is a monocular camera, the three-dimensional spatial location of the target to be followed cannot be directly obtained from the camera.

At present, to solve this problem, one method is to calculate the distance between the target and the unmanned aerial vehicle according to a height above ground level obtained by the unmanned aerial vehicle. This method relies on the accuracy of the height, but the height data is unstable, which tends to cause an increasingly larger deviation in the calculated distance. In addition, this method is based on a strong assumption that the ground is level all the time. However, in fact, there are ups and downs on the ground, which will directly void this method.

Another method is to estimate the location of the target by triangulation. This method requires the unmanned aerial vehicle to have a displacement. If the unmanned aerial vehicle is hovering, the distance between the target and the unmanned aerial vehicle cannot be estimated.

Conventional device is known from Gottleben Emil: "Master of Science Thesis in Automatic Control Vision based control of an autonomous UAV", XP055878849.

A technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a method and device for estimating a distance to a target, and a unmanned aerial vehicle.

A technical solution adopted in the present invention to solve the technical problem is to devise a method for estimating a distance to a target, applicable to a unmanned aerial vehicle including a photographing device, the method including:.

In an embodiment, the acquiring an angle formed by the line connecting the highest point of the smallest circumscribed rectangle and the photographing device and an optical axis of the photographing device includes:.

In an embodiment, the acquiring an angle β formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and an optical axis of the photographing device includes:.

In an embodiment, the acquiring an angle δ formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and a vertical direction according to the pitch angle θ of the photographing device includes:
calculating the angle δ using the following formula: <MAT>.

In an embodiment, the acquiring the distance d between the target and the unmanned aerial vehicle according to the angle φ and the angle δ includes:.

In an embodiment, the length L<NUM> of the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device is calculated using the following formula: <MAT> <MAT> where L<NUM> is a length of the line connecting the highest point of the smallest circumscribed rectangle and the photographing device, and L is the height of the target.

In an embodiment, the photographing device includes a monocular camera.

The present invention further provides a device for estimating a distance to a target, applicable to a unmanned aerial vehicle, the device including:.

In an embodiment, the distance determining unit is further configured to:.

In an embodiment, the distance determining unit is further configured to: calculate the angle α using the following formula: <MAT> where vmin is the ordinate of the highest point of the smallest circumscribed rectangle, cy is an ordinate of an optical center of the photographing device, and fy is a focal length of the photographing device in a y-axis direction.

In an embodiment, the distance determining unit is further configured to:
calculate the angle δ using the following formula: <MAT>.

The present invention further provides a unmanned aerial vehicle, including:.

In an embodiment, the vision chip is further configured to:.

In an embodiment, the vision chip is further configured to:
calculate the angle δ using the following formula: <MAT>.

The following beneficial effects are achieved by the present invention: each frame of image of the target is obtained using an image acquisition device, each frame of image is processed using a preset method to obtain motion information of the target at a moment corresponding to each frame, and computation is performed according to the motion information and equipment information of the image acquisition device at this time to finally obtain real-time spatial location information of the target in each frame, and the unmanned aerial vehicle is controlled according to the real-time spatial location information of the target in each frame, to track the target. The method of the present invention can accurately calculate the spatial location information of the target, is not based on a strong assumption, requires a small amount of calculation, can estimate the spatial location information of the target in real time, and has high accuracy.

The present invention is further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:.

To solve the problem in the prior art that limited by conditions of a method used, three-dimensional spatial location information of the target that is estimated by a unmanned aerial vehicle may become invalid or the unmanned aerial vehicle cannot estimate or cannot accurately estimate the three-dimensional spatial information of the target, the embodiments of the present invention provide a method for estimating a distance to a target. This method can accurately estimate the distance between the target and the unmanned aerial vehicle, does not rely on the assumption that the ground is level, is not based on a strong assumption, requires a small amount of calculation, and can estimate the three-dimensional spatial location information of the target in real time with high accuracy, thereby ensuring that the unmanned aerial vehicle can achieve accurate tracking according to the estimated three-dimensional spatial location information, or ensuring that the unmanned aerial vehicle can achieve autonomous obstacle avoidance control according to the estimated three-dimensional spatial location information.

Referring to <FIG>, an embodiment of the present invention provides a method for estimating a distance to a target. This method may be used by a unmanned aerial vehicle to acquire a distance between the target and the unmanned aerial vehicle in real time, and implement real-time tracking of the target according to the acquired distance. The target may be a moving target or a stationary target, and in the real-time tracking process, the motion status (moving or stationary) of the target does not affect the accuracy of the calculation result. In addition, obstacle avoidance may also be performed according to the acquired distance between the target and the unmanned aerial vehicle.

<FIG> is a schematic flowchart of a method for estimating a distance to a target according to an embodiment of the present invention. The method for estimating a distance to a target may be applicable to a unmanned aerial vehicle including a photographing device. The method may specifically include the following steps:
Step S10: Acquire a current frame of image of the target captured by the photographing device.

In an embodiment of the present invention, the photographing device may be a gimbal equipped on the unmanned aerial vehicle and a camera mounted on the gimbal. The camera includes, but is not limited to, a monocular camera.

Before the unmanned aerial vehicle starts to perform target tracking control or obstacle avoidance control, the photographing device is first used to perform real-time photographing to obtain an image sequence including the target, and send the obtained image sequence to the unmanned aerial vehicle in real time. The image sequence includes all frames of images captured by the photographing device.

Step S20: Acquire location information of the target according to the current frame of image.

The location information of the target includes a height of the target and two-dimensional pixel coordinates of the target in the current frame of image.

Step S30: Acquire attitude information of a photographing device.

The attitude information of the photographing device includes a pitch angle of the photographing device.

Step S40: Acquire a distance between the target and the unmanned aerial vehicle according to the location information of the target and the attitude information of the photographing device.

Specifically, as shown in <FIG>, the distance d between the target and the unmanned aerial vehicle may be obtained through the following steps:
In other words, in an embodiment of the present invention, step S40 includes:
Step S401: Acquire a smallest circumscribed rectangle of the target.

In an embodiment of the present invention, the smallest circumscribed rectangle of the target may be a smallest circumscribed rectangular area including the target.

The two-dimensional pixel coordinates of the target in the current frame of image are two-dimensional pixel coordinates of the smallest circumscribed rectangle in the image, and the two-dimensional pixel coordinates of the smallest circumscribed rectangle in the image include an ordinate vmin of a highest point of the smallest circumscribed rectangle and an ordinate vmax of a lowest point of the smallest circumscribed rectangle. Specifically, as shown in <FIG>:
Step S402: Acquire an angle φ formed by a line connecting the highest point of the smallest circumscribed rectangle and the photographing device and a line connecting the lowest point of the smallest circumscribed rectangle and the photographing device.

Specifically, in this step, first, an angle α formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and the optical axis of the photographing device is acquired; next, an angle β formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and the optical axis of the photographing device is acquired. Then, the angle φ formed by the line connecting the highest point of the smallest circumscribed rectangle and the photographing device and the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device is calculated according to the obtained angle α and angle β.

The angle φ may be calculated using the following formula: <MAT>.

In an embodiment of the present invention, the angle α may be calculated using the following formula: <MAT> where vmin is the ordinate of the highest point of the smallest circumscribed rectangle, cy is an ordinate of an optical center of the photographing device, and fy is a focal length of the photographing device in a y-axis direction.

In an embodiment of the present invention, the angle β may be calculated using the following formula: <MAT> where vmax is the ordinate of the lowest point of the smallest circumscribed rectangle, cx is an ordinate of an optical center of the photographing device, and fy is a focal length of the photographing device in the y-axis direction.

Step S403: Acquire a distance d between the target and the unmanned aerial vehicle according to the angle φ and a pitch angle θ of the photographing device.

In an embodiment of the present invention, step S403 may include the following steps:
Step S4031: Acquire an angle δ formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and a vertical direction according to the pitch angle θ of the photographing device.

In an embodiment of the present invention, the angle δ may be calculated using the following formula: <MAT>.

Step S4032: Acquire the distance d between the target and the unmanned aerial vehicle according to the angle φ and the angle δ.

In an embodiment of the present invention, the distance d between the target and the unmanned aerial vehicle may be calculated using the following formula: <MAT> where L<NUM> is a length of the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device. Refer to <FIG>.

Further, the length L<NUM> of the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device is calculated using the following formula: <MAT> <MAT> and
where L<NUM> is a length of the line connecting the highest point of the smallest circumscribed rectangle and the photographing device, and L is the height of the target. Refer to <FIG>.

Specifically, after the distance d between the target and the unmanned aerial vehicle is acquired in step S40, the unmanned aerial vehicle may be controlled to track the target according to the distance. Of course, it is understandable that in some other embodiments, autonomous obstacle avoidance control may also be performed according to the distance.

It should be noted herein that in the embodiments of the present invention, for each frame of image received, the distance between the target and the unmanned aerial vehicle in each frame is obtained by performing the above steps S10 to S40, and tracking control or obstacle avoidance control is performed according to the distance obtained for each frame, so that the unmanned aerial vehicle can implement the real-time acquisition of the location of the target, tracking of the target, autonomous obstacle avoidance control, and so on.

By implementing the method for estimating a distance to a target according to the present invention, the problem that it is difficult to acquire three-dimensional spatial location information of the target using a monocular camera is effectively solved. In addition, the present invention does not rely on the assumption that the ground is level, is not based on any other strong assumption, requires a small amount of calculation, and can estimate the three-dimensional spatial location information of the target in real time. Moreover, the motion status of the target and the displacement status of the unmanned aerial vehicle do not affect the implementation of the present invention. In other words, regardless of whether the target is in a moving or stationary state, the present invention can accurately estimate the three-dimensional spatial location information of the target; when the unmanned aerial vehicle has no displacement, i.e., when the unmanned aerial vehicle is hovering, the present invention can accurately estimate the distance between the target and the unmanned aerial vehicle, and therefore can accurately acquire the three-dimensional spatial location information of the target.

<FIG> is a functional block diagram of a device for estimating a distance to a target according to an embodiment of the present invention. The device for estimating a distance to a target can be configured to implement the above method for estimating a distance to a target. The device for estimating a distance to a target according to the embodiments of the present invention may be applicable to a unmanned aerial vehicle.

As shown in <FIG>, the device for estimating a distance to a target may include: an image acquisition unit <NUM>, a location information acquisition unit <NUM>, an attitude information acquisition unit <NUM>, and a distance determining unit <NUM>.

Specifically, the image acquisition unit <NUM> is configured to acquire a current frame of image of the target.

The location information acquisition unit <NUM> is configured to acquire location information of the target according to the current frame of image, where the location information includes a height of the target and two-dimensional pixel coordinates of the target in the image.

The attitude information acquisition unit <NUM> is configured to acquire attitude information of a photographing device, where the attitude information includes a pitch angle of the photographing device.

The distance determining unit <NUM> is configured to acquire a distance d between the target and the unmanned aerial vehicle according to the location information of the target and the attitude information of the photographing device.

Optionally, in an embodiment of the present invention, the distance determining unit <NUM> is further configured to:.

Optionally, the distance determining unit <NUM> is specifically configured to:.

The distance determining unit <NUM> may be further configured to: acquire an angle β formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and the optical axis of the photographing device. where the angle φ may be calculated using the following formula: <MAT>.

The angle β is calculated using the following formula: <MAT> where vmax is the ordinate of the lowest point of the smallest circumscribed rectangle, cx is an abscissa of an optical center of the photographing device, and f is a focal length of the photographing device.

The distance determining unit <NUM> may be further configured to: acquire a distance d between the target and the unmanned aerial vehicle according to the angle φ and a pitch angle θ of the photographing device.

Optionally, in an embodiment of the present invention, the distance determining unit <NUM> is further configured to:
acquire an angle δ formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and a vertical direction according to the pitch angle θ of the photographing device.

The distance determining unit <NUM> may be further configured to: acquire the distance d between the target and the unmanned aerial vehicle according to the angle φ and the angle δ.

In an embodiment of the present invention, the distance d between the target and the unmanned aerial vehicle is calculated using the following formula: <MAT> where L<NUM> is a length of the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device.

Further, the length L<NUM> of the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device is calculated using the following formula: <MAT> <MAT> where L<NUM> is a length of the line connecting the highest point of the smallest circumscribed rectangle and the photographing device, and L is the height of the target.

In an embodiment of the present invention, the image acquisition unit <NUM> may be a photographing device equipped on a unmanned aerial vehicle, where the photographing device may include a gimbal and a camera mounted on the gimbal. The camera includes, but is not limited to, a monocular camera. The location information acquisition unit <NUM> and the distance determining unit <NUM> may be a vision chip of the unmanned aerial vehicle. The attitude information acquisition unit <NUM> may be an inertial measurement unit (IMU) mounted on the gimbal of the unmanned aerial vehicle.

The present invention also provides a unmanned aerial vehicle. The unmanned aerial vehicle can be configured to implement the above method for estimating a distance to a target, can estimate the distance between the target and the unmanned aerial vehicle in real time, and can also track or avoid the target according to the distance between the target and the unmanned aerial vehicle that is estimated in real time.

As shown in <FIG>, the unmanned aerial vehicle provided in an implementation of the present invention includes a body <NUM>, an arm <NUM> connected to the body <NUM>, a power device <NUM> disposed on the arm <NUM>, a photographing device <NUM> disposed on the body <NUM>, a vision chip <NUM>, and an inertial measurement unit <NUM> disposed on the photographing device <NUM>. The vision chip <NUM> is electrically connected to the inertial measurement unit <NUM>.

In an embodiment of the present invention, the power device <NUM> is configured to supply power for flight of the unmanned aerial vehicle. Optionally, the power device <NUM> may include a motor disposed on the arm <NUM> and a propeller connected to the motor, and the motor is configured to drive the propeller to rotate at a high speed to provide the power required for the flight of the unmanned aerial vehicle.

In an embodiment of the present invention, the photographing device <NUM> is configured to acquire a current frame of image of the target. Optionally, the photographing device <NUM> may be a gimbal-mounted camera equipped on the unmanned aerial vehicle. Specifically, the photographing device <NUM> may include a gimbal connected to the body <NUM> of the unmanned aerial vehicle and a camera connected to the gimbal. The camera includes, but is not limited to, a monocular camera.

In an embodiment of the present invention, the inertial measurement unit <NUM> is configured to acquire attitude information of the photographing device <NUM>, where the attitude information includes a pitch angle of the photographing device <NUM>. Specifically, the inertial measurement unit <NUM> is disposed on the gimbal.

In an embodiment of the present invention, the vision chip <NUM> is configured to perform the following actions:.

Further, the vision chip <NUM> may specifically be configured to perform the following actions:.

Further, the vision chip <NUM> may specifically be further configured to:.

Further, the vision chip <NUM> may specifically be further configured to:
calculate the angle δ using the following formula: <MAT>.

Claim 1:
A method for estimating a distance to a target, applicable to an unmanned aerial vehicle comprising a photographing device, characterized by comprising:
acquiring (S10) a current frame of image of the target captured by the photographing device;
acquiring (S20) location information of the target according to the current frame of image, wherein the location information comprises a height of the target and two-dimensional pixel coordinates of the target in the image;
acquiring (S30) attitude information of the photographing device, wherein the attitude information comprises a pitch angle of the photographing device;
acquiring (S401) a smallest circumscribed rectangle of the target, where the two-dimensional pixel coordinates of the target in the image are two-dimensional pixel coordinates of the smallest circumscribed rectangle in the image, and the two-dimensional pixel coordinates of the smallest circumscribed rectangle in the image comprise an ordinate vmin of a highest point of the smallest circumscribed rectangle and an ordinate vmax of a lowest point of the smallest circumscribed rectangle;
acquiring (S402) an angle φ formed by a line connecting the highest point of the smallest circumscribed rectangle and the photographing device and a line connecting the lowest point of the smallest circumscribed rectangle and the photographing device;
acquiring (S402) an angle δ formed by the line connecting the lowest point of the smallest circumscribed rectangle and the photographing device and a vertical direction according to the pitch angle θ of the photographing device; and
acquiring (S403) the distance d between the target and the unmanned aerial vehicle according to the angle φ and the angle δ.