## 4 Engineering Application Case
### Program Verification
#### 4.3.2 Second Phase  
Four other methods, M.1, M.2, M.3, and M.4, were applied to the same video image to detect the vessels in the port area. M.1 is an effective motion object detection method using optical flow estimation under a moving camera [57]. M.2 is a motion detection method for moving camera videos that uses background modeling and FlowNet [58]. M.3 is a three-frame difference algorithm to detect moving objects [59]. M.4 is an approach to ship target detection based on a combined optimization model of dehazing and detection [60]. M.1 inserts a third frame between the first two to acquire the horizontal and vertical flows. The horizontal and vertical flows are then optimized through the use of the gradient function and threshold approach, respectively. Following the filling of the region, the entire motion object boundary might be optimized using the Gaussian filtering technique to provide the final detection results. For M.2, a fusing technique for dense optical flow and a background modeling method are implemented to enhance the image detection outcomes. In the process, deep learning-based dense optical flow is applied along with an adaptive threshold and some post-processing techniques; this not only extracts the moving pixels but also increases the computational cost. Regarding M.3, a three-frame difference algorithm that combines edge information is proposed to enhance moving target detection. The program uses the expansion and corrosion of mathematical morphology to eliminate  
Figure 18: Significance comparison chart.  
noise from images. M.4 uses a self-adaptive image dehazing module integrated with a lightweight improved object detection deep learning model to detect ships in foggy images.  
We aimed to assess and compare the performance of the proposed approach (IMSM) with that of the other four methods. We assessed the accuracy, recall, and F-measure of the detected vessels to determine the quality of each method. Matching the identified lines with the sea-truth lines was the first step. Let \(Y=f(x,y)\) be an image. A matching bipartite image is a set of selected edges, with no two edges sharing the same vertices. We aimed to identify a matching image such that, for every set of sea-truth lines \((S_{i})\), there was no more than one detected line \((P_{i})\), and vice versa. In this study, we determined the true positive (TP), false positive (FP), and false negative (FN) rates in accordance with the matching images of p and s. A TP is defined as predicted lines \((P_{1},P_{2})\) linked with sea-truth lines \((S_{1},S_{2})\). An FP is a predicted line \((P_{3})\) that does not match any sea-truth line \((S_{3})\), while an FN is a sea-truth line that does not match any predicted line. The formulas for determining the accuracy, recall, and F-measure are as follows:  
\[A=\frac{TP}{TP+FP},\ \ \ R=\frac{TP}{TP+FN},\ \ \ F=\frac{2 PR}{P+R} \tag{30}\]  
Multiple thresholds (\(\tau\) = 0.01, 0.02, \(\ldots\), 0.99) were applied to the sea-truth and prediction pairs. As a result, we obtained a number of F-measure, accuracy, and recall scores. The performances of each method were assessed based on the results obtained from these metrics.  
The processing results after applying each of these methods are shown in Table 3 and Figure 19.  
The M.1, M.2, and IMSM methods output remarkable results. However, when these three suitable approaches were compared in depth, IMSM had the best processing time (1.23 s), F-measure (0.821), and accuracy (0.94) among the three methods. In addition, its false detection rate (0.04) was the lowest. These results prove the effectiveness and reliability of the proposed approach for the detection of vessels around a surveillance area. In addition, it is evident from the results in Table 3 that edge-guided refinement, irrespective of the dataset, successfully improved the detection outcomes.