# Recognizing and Recovering Ball Motion Based on Low-Frame-Rate Monocular Camera
## 3 Method
### Acquiring Contours
#### 3.2.2 Candidate Block Detection
Therefore, filtering the blocks step-by-step, with each step focusing on a specific characteristic, can exclude a large amount of noise. Based on this observation, we filter the foreground blocks in four steps based on the characteristics of the spherical motion projection to obtain candidate blocks. We first extract blocks with suitable sizes. The area value _Area_ of a streak in a captured image should be moderate, so large blocks should be excluded. Similarly, widely distributed small blocks should also be excluded. Thus, two boundary thresholds could be set:  
\[\left\{ \begin{array}{l}Area\leq T_{max\_area},\\ Area\geq T_{min\_area},\end{array} \right. \tag{8}\]  
The second filter condition limits the ratios of the area to the perimeter of a block and the area to the span. We define the span L of a block as the distance between the two furthest points on the contour. The contour can be simplified to a set \(P_{corners}\) that contains four corner points. Each corner point is closest to the image boundary. \[P_{corners}=\left\{P_{x\_min},P_{y\_min},P_{x\_max},P_{y\_max}\right\} \tag{9}\]  
\[L=\max\left(\|P_{i}-P_{j}\|_{2}\right)\quad\forall P_{i},P_{j}\in P_{corners} \tag{10}\]  
Since the block is a narrow strip, the ratio of Area to \(L^{2}\) should be relatively small. A threshold \(T_{ratio\_area}\) is used to filter this ratio value. \[\frac{Area}{L^{2}}\leq T_{ratio\_area} \tag{11}\]  
Similarly, the block is a narrow strip, and the ratio of perimeter _Peri_ to \(L\) should also be relatively small. However, perimeters obtained by Canny are usually larger than the actual values. This is because the boundaries of blocks obtained by Canny may be too tortuous in a local area, resulting in error corner points and false edges [17; 18]. Therefore, to obtain perimeters with higher precision, the overly dense corner points should be simplified as one point. We transform the corner points obtained by Canny with size _Poly_ into optimized corner points with size _rePoly_. Then, based on the deviation of the two size values, we  
Figure 5: Detecting candidate blocks from an original image: (**a**) input an actual photograph; (**b**) binarize the image with our proposed interframe difference method. (**c**) extract candidate blocks (wrapped in blue curves) with filters. define a correction term \((Ploy-rePloy)*10\) to calibrate \(Peri\). The ratio of the calibrated perimeter to the span should not exceed the threshold value \(T_{Peri}\). \[\frac{Peri-(Ploy-rePloy)*10}{L}\leq T_{Peri} \tag{12}\]  
The third filtering condition is the pixel intensity feature inside a block. According to the profile fitting model in Section 3.2.1, the pixel intensity values on the profile can be fitted. Thus, the goodness of fit is taken as a criterion for judgment. The goodness of fit (\(Rsq\)) for each profile is defined as  
\[Rsq=1-\frac{\sum(y_{i}-\widehat{y}_{i})^{2}}{\sum(y_{i}-\overline{y})^{2}} \tag{13}\]  
We set a threshold \(T_{Rsq}\) for \(Rsq\). When \(Rsq\) of this profile fit is greater than \(T_{Rsq}\), the semi-ellipse fit is regarded as a valid fit, and the profile is valid. An ideal streak block is a family of valid profiles. Thus, the ratio of valid profiles in a valid block is greater than threshold \(T_{\textit{streak}}\). The last filtering condition ensures image borders do not trim any block. An accurate sphere motion reconstruction is based on a sufficiently complete streak, so the edges of the blocks should not intersect with the picture borders \(P_{\textit{border\_points}}\). \[P_{\textit{border\_points}}\cap P_{\textit{corners}}=\varnothing \tag{14}\]  
After the above four filter steps, most noises could be filtered out, and the remains are regarded as candidate blocks. By these means, the number of candidate blocks can be reduced substantially. Figure 5c shows the blue contour of the candidate blocks after filtering. Compared with Figure 5b, most of the interferences of moving body and light changes are removed.