An automatic ship tracking method based on a deep learning network and a mean shift, comprising the following steps:
- step 1:
- collecting surveillance video data, wherein the surveillance video data comprises coastal region surveillance video data under visible light;
- and extracting a video image from the surveillance video data;
- step 2:
- performing a preprocessing based on the video image obtained in the step 1 to extract a positive sample and a negative sample of a first ship target;
- step 3:
- inputting the positive sample and the negative sample of the first ship target in the video image into a neural network to train a model by a region-based convolutional neural network method;
- step 4:
- extracting initial frame data of the video image, and performing a ship detection and a probability density calculation on the initial frame data according to the model obtained in the step 3, wherein the probability density calculation is realized by dividing a gray color space of a target region to obtain a gray histogram formed by multiple equal histogram intervals, and calculating the probability density according to one histogram interval of the multiple equal histogram intervals, a gray value of a pixel in the target region belongs to the one histogram interval;
- and
- step 5:
- determining a ship tracking result at a current moment by a calculation result of a previous moment, wherein the step 5 further comprises the following processing:
- step A:
- taking ξ ship positions tracked at a moment t−1 as initial positions, respectively taking a center coordinate f0 of each of the ξ ship positions as an initial target position of a ship tracked at a moment t, taking the f0 as a center of a search window to obtain a center position coordinate f of a corresponding candidate ship, calculating a region histogram of a candidate position, and further realizing the probability density calculation;
- step B:
- describing a degree of similarity between a ship model and the corresponding candidate ship by a Bhattacharyya coefficient, calculating a mean shift iteration equation in a center of the target region, so that the ship model moves continuously towards a direction with a maximum color change until last two moving distances are less than a corresponding preset threshold, finding a ship position obtained by a mean shift result at the moment t, setting that multiple ship positions Boxmt are obtained, and expressing an idth ship position as Boxmidt;
- step C:
- by the region-based convolutional neural network method, performing the ship detection on the video image at the moment t, and obtaining the numth detection coordinate Boxdnumt of multiple ships in the video image at the moment t, calculating a degree of overlap between the Boxdnumt and the Boxmidt, recording a value of degree of overlap Omax between each Boxmidt and the corresponding Boxdnumt with a maximum degree of overlap, and if the Omax is less than a corresponding threshold θ1, considering the ship position as false-alarm and deleting the Boxmidt;
- and
- step D:
- updating a second ship target appeared at the moment t by a neural network detection result of the step C, wherein the step D further comprises calculating a maximum value of the degrees of overlap obtained respectively between each Boxdnumt and all the Boxmidt, if the Omax′ is less than a corresponding threshold θ2, considering the second ship target as the ship appeared at the moment t, and adding the second ship target into a tracking result of the moment t to obtain a complete tracking result set.