# An Improved Optical Flow Algorithm Based on Mask-R-CNN and K-Means for Velocity Calculation
## 1 Introduction  
The unmanned combat platform is a developing war mode in future wars, where a micro-unmanned aerial vehicle (UAV) occupies a significant position. An UAV is mission-centered design, which breaks away from the constraints of human safety, human physiology and psychology. It has a series of advantages, such as small size and light weight, strong mobility, good stealth, long idle time, large combat radius and large payload. Because of its relatively small size and good concealment, micro-UAVs can be widely used in future wars, which is conducive to effectively attack without the enemy's preparedness. The biggest advantage of the UAV is that it does not require the human to be co-located with the aircraft. Thus, it is free from human physiological limitations and health damage. When performing some dangerous tasks, it does not need to worry about casualties. Therefore, it is suitable for performing dull, dirty and dangerous missions, which is in the so-called \"3D\" environment. However, the premise of the UAV consummate flight during the execution of the mission is precision navigation. Precise aircraft navigation information such as velocity is the basis of the stability control of the UAV [1; 2; 3; 4; 5]. The most commonly techniques used to obtain vehicle velocity include the inertial navigation system (INS) [6; 7; 8], global position system (GPS) [9; 10], geomagneticnavigation and a GPS/INS [11; 12; 13] integrated navigation system. However, the methods mentioned above have problems such as integral and cumulative error, signal loss and the possibility to be interfered by continuously changing electromagnetic signal. With the advantages of low cost, rich navigation information, and strong anti-electromagnetic interference capability, vision navigation has undergone a great development in recent years and can be a good alternative to the common navigation system [14; 15]. To obtain precise vehicle velocity, optical flow algorithm is an important method used in vision navigation. The so-called optical flow is a series of information of an object in changing images formed on the retina of a human or insect when they observe the moving object. In flight, birds and insects are inspired by optical flow to control the velocity of flight, avoid obstacles, land and take off autonomously [16]. The concept of optical flow was first proposed by [PERSON] [17]. Later, [PERSON] and [PERSON] presented an approach to compute the motion of each pixel in an image [18], which can be considered a rough flow method. The first practical optical flow model was established by the classical work of [PERSON] (HS) [19]. It assumes that the brightness of a pixel keeps constant during a short time interval, which is known as the brightness constancy assumption (BCA) [20]. Optical flow not only provides important information about the unknown environment, but also helps to determine the direction and the velocity of the aircraft. Due to this characteristic, optical flow is one of the primary techniques for UAV navigation. Optical flow can be widely used for obstacle detection and collision avoidance. Meanwhile it can help to calculate the velocity of global movement. Nowadays, the mainstream optical flow calculation techniques include the frame differential method [21], pyramid Lucas Kanade (LK) algorithm and convolution network-based optical flow algorithms [22]. Aiming at a nonlinear controller for a vertical take-off and landing of UAV, the measurement of the average optical flow is exploited to enable hover and landing control on a moving platform. The average optical flow is obtained from a textured target plane. An embedded inertial measurement unit provides additional information for derotation of the flow and to have precise output based on pyramid LK algorithm [23]. To calculate dense optical flow, rich descriptors are integrated into the variational optical flow [24]. A dense optical flow field, which almost has the same high accuracy as variational optical flow, can be estimated.