## 3 Motion Dynamics Input Search Algorithm
### Search Model Creation  
The MDIS model was designed with the described pixel movements in mind. The model creation starts by segmenting the image into nine equal regions. This is achieved by partitioning both the vertical and horizontal axes into three equal segments, resulting in a 3x3 grid. The next step is determining which diamond locations should be searched in each of the nine segments. We developed a few search model versions which varied in several parameters. For example, in one version of MDIS, the diamond shape is extended so that it also includes corner locations (Figure 9). Different versions also varied in parameters such as the weight in the weighted probability function, or the probability threshold, described later on. The general model design process will be described through the forward motion model. The search model for left-right motion is created analogously. Figure 10 shows the forward motion search model in MDIS. The whole box represents a single image, which is segmented into nine segments, as explained earlier. In each segment, a modified diamond shape is drawn, where locations marked with 'X' represent locations that should be searched, and locations marked with '0' represent locations that should be skipped. In other words, depending on the block location in the image, some search locations will be included and some will be excluded. For example, in the forward motion search model shown in Figure 10, blocks that belong in the center grid segment are searched for the most similar block in all possible directions. Similarly, blocks in the upper-left grid segment are only searched in the right and bottom directions. In this particular case, the diagonal search locations are also shown, which can be excluded in some search models. Figure 8: Visual representation of pixel trajectories during a drone’s right yaw rotation. Figure 9: Search locations in Diamond Search (**left**) and potential search locations in Motion Dynamics Input Search (**right**). We call this model the Discrete search model (DSM). While MDIS could be implemented following DSM, we decided to improve it by creating the so-called Continuous Search Model (CSM). Instead of simply deciding whether a certain location should be searched depending on the block location, the CSM calculates the search probability for each search location. The search probability is calculated based on the block coordinates, and each search location uses a different function, inspired by the DSM. All the functions for each search location in a forward motion are displayed in Figure 11. Every function was crafted to emulate the DSM location-filtering approach, with an additional goal of functions having minimal computational complexity. The variable \(x\) denotes the x-coordinate of the upper left corner of the current block, while \(y\) denotes the y-coordinate of the same corner. \(w\) stands for the picture width, and \(h\) represents the picture height. Each grid segment refers to one search location. The small grayscale images inside each grid segment represent the 2D probability functions--the brighter the area, the higher the probability. These grayscale images correspond to images themselves, in terms of resolution. Let us look at the upper left search location for an example--the closer the block is to the bottom right corner of the image, the higher the probability that the upper left search location will be searched. This can be seen from the small grayscale image in the upper left grid segment--the closer the block is to the bottom right corner, the brighter it is. Search probabilities are calculated for each block independently. At the start of the MDIS algorithm, the probability threshold is defined (0.5 for instance), and each search location that has a search probability higher than the probability threshold will be searched. Figure 11: Set of probability functions determining search locations in forward motion, based on block position within the image.