# Recognizing and Recovering Ball Motion Based on Low-Frame-Rate Monocular Camera
## 3 Method
### Acquiring Contours
#### 3.2.2 Candidate Block Detection  
Sphere motion projection detection is a dynamic object detection problem that aims to distinguish the fixed background and the streak in an input image. As a standard method  
Figure 3: Fitting the intensity values along the profile using a semi-ellipsoid. in dynamic object detection research, an interframe difference method is used to obtain moving target contours by differencing two frames. However, in the process of sphere detection, the interframe difference method faces two problems: (1) how to select ideal background frames and (2) how to distinguish the streak blocks from the noise blocks. To resolve the first problem, we improve the interframe difference method with a selection criterion for background. This criterion denies frames containing streak-like blocks and excessive noises. To resolve the second problem, we design a filter method to gradually filter out candidate blocks based on internal pixel intensity features and shape features. Figure 4 shows the overall process of our candidate block detection method. We first focus on the selection of the ideal background. The interframe difference algorithm can figure out inconsistent pixel blocks between the input background frame and the current frame. However, when facing the output pixel blocks, we cannot tell from which input frame they come. In other words, if streak blocks are contained in the selected background frame but not in the current frame, the output result of the interframe difference algorithm also contains these blocks even if the current frame contains nothing. Similarly, noise blocks in the background frame will also appear in the result of the interframe difference algorithm. This problem leads to useless work and consumes a lot of computing resources. The idea of this part is to select frames that contain less noise as background frames, and we observed that a frame close to the current frame usually has less noise in terms of interframe difference method. Therefore, based on this observation, we propose to improve the interframe difference method by using the nearest frame with less noise as background. When detecting streaks in frame \(f_{t}\), the nearest frame \(f_{n}\) that does not contain streaks and has less noise influence is used as the background. In the candidate block detection method, an image that does not contain any blocks with a similar shape ratio to streaks can be selected as a background frame for the following detections. Therefore, the difference \(D_{t}\) is  
\[D_{t}(x,y)=|f_{t}(x,y)-f_{n}(x,y)| \tag{6}\]  
To distinguish backgrounds from streaks in image \(D_{t}\), a threshold \(T\) is used. When the difference \(D_{t}(x,y)\) is greater than \(T\), this pixel point is considered as part of the streak, otherwise is classified as the background:  
\[R_{t}(x,y)=\left\{ \begin{array}{ll}255,&D_{t}(x,y)>T\\ 0,&else\end{array} \right. \tag{7}\]  
Using the improved interframe difference method, we solved the background frame selection problem, thus significantly reducing the noise pollution between frames. The improved interframe difference method ensures the independence of each frame but still cannot distinguish streak blocks from noise blocks in the foreground. When recognizing high-speed moving spheres, the camera position is kept fixed. As shown in Figure 5, Figure 5a is an original image containing a trajectory projection, and Figure 5b is  
Figure 4: The overall process of our candidate block detection method. a binarized image after using our proposed interframe difference method (the black area belongs to the background, and the white area belongs to the foreground). A foreground may contain three parts: streaks, images of a moving human body, and changes in ambient light. The improved interframe difference method cannot exclude the noise caused by the above moving human body and light changes. However, noise blocks and streak blocks have different characteristics, such as the external shape and the internal pixel intensity.