Multi-target ship model motion trail measuring method
By using the YOLO object detection algorithm and multi-feature fusion method in ship model test, we can identify and associate the trajectory data of the multi-objective ship model, and solve the problem of false intersection points in the multi-objective ship model motion trajectory measurement, achieving high-precision and real-time measurement results.
Patent Information
- Application Number
- CN202510205532.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art has the problem of false junction points in the measurement of multi-target ship model motion trajectory, especially when the number of ship models is large, the false junction points increase exponentially, affecting the accuracy and real-timeness of the measurement results.
The YOLO object detection algorithm combined with the multi-feature fusion method is used to capture the motion picture of the ship model through the camera, identify and associate the trajectory data of each ship model, and generate the motion trajectory of each ship model.
The identification accuracy and real-timeness of the measurement results of multi-objective ship model motion trajectory measurement are improved, and the problem of multi-objective classification matching is solved.
Smart Images

Figure BDA0005284401980000031 
Figure BDA0005284401980000032 
Figure BDA0005284401980000033
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of ship model testing, and in particular to a method for measuring motion trajectories of multi-target ship models. Background Art
[0002] Ship model test is a key test for analyzing the seaworthiness of waterway engineering and navigable buildings. During the test, the motion trajectory of the ship model needs to be measured in real time. There are currently two methods to measure the motion trajectory of the ship model, one is the laser angle measurement cross positioning method, and the other is the image recognition tracking measurement method. The laser angle measurement cross positioning method has high measurement accuracy and good real-time performance. It is currently generally used for single ship model trajectory measurement. In the trajectory measurement of multi-target ship models, the problem of false intersection points needs to be solved. Especially when the number of ship models is large, the false intersection points increase exponentially, and the classification and matching of multiple ship models will become extremely difficult. The image recognition tracking measurement method is currently also mainly used for single ship model trajectory measurement. In this measurement method, the YOLO (Robot Vision Tool) target detection method is used to realize real-time tracking and detection of the ship model. YOLO (Robot Vision Tool) is one of the fastest computer vision tools, developed by Joseph Redmon and Ali Farhadi in 2016, specifically for real-time image detection. It uses a neural network to divide the image into grids and then predicts each grid at the same time to improve recognition efficiency.
[0003] Although this YOLO-based target detection method can identify multiple ship model targets at the same time, it is inevitably affected by factors such as water surface reflection, complex background environment, and foreign object occlusion. Misidentification will inevitably occur during the recognition process, affecting the accuracy of ship model association matching. Therefore, the measurement of the motion trajectory of multi-target ship models is a difficult problem in current ship model tests. How to better realize the motion trajectory detection of multi-target ship models and improve the recognition accuracy of each target has become a problem that technicians in this field need to consider and solve. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a multi-target ship model motion trajectory measurement method based on the YOLO target detection algorithm, which can effectively improve the multi-target recognition accuracy and the accuracy and real-time performance of the measurement results by improving the data processing mechanism.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A multi-target ship model motion trajectory measurement method is used. The ship model motion picture is captured by a camera, and all ship model targets are identified using the YOLO target detection algorithm. The method is characterized in that the trajectory data of each ship model is correlated and matched through multi-feature fusion, so as to distinguish and generate the motion trajectory of each ship model.
[0007] In this way, the YOLO target detection algorithm has a fast detection speed and can realize real-time detection of ship models (frequency can reach 30Hz). During detection, this method is based on the association matching of the trajectory data of each ship model, which can better distinguish each ship model and generate the motion trajectory of each ship model, thereby improving the accuracy and real-time performance of the measurement results.
[0008] Furthermore, the method comprises the following steps:
[0009] Step 1, obtaining video data, arranging multiple cameras above the test area to ensure that the motion range of all ship models is covered; the camera collects the motion picture of the ship model and transmits it to the processing system;
[0010] Step 2: Use the YOLO target detection algorithm to process the captured images and identify each ship model; the YOLO detection algorithm extracts image features through a convolutional neural network and outputs the center point coordinates, width, height, and rotation angle of the ship model detection frame;
[0011] Suppose there are N ship models (the ship model numbers are i=1, 2, ... N), the recognition result of the j-th frame image and a certain ship model is: (xc i,j , yc i,j , w i,j ,h i,j ,θ i,j ), where xc i,j , yc i,j is the center point coordinate of the ship model detection frame, w i,j is the width of the ship model detection frame, h i,j is the height of the ship model detection frame, θ i,j is the deflection angle of the ship model detection frame; the recognition result of a ship model in the j-1th frame image is: (xc k,j-1 , yc k,j-1 , w k,j-1 ,h k,j-1 ,θ k,j-1 ), ship model number k = 1, 2, ... N;
[0012] Since the numbering of YOLO target detection is random, the detection result of the previous frame image (xc k,j-1 , yc k,j-1 , w k,j-1 ,h k,j-1 ,θ k,j-1 ) and the current frame image detection result (xc i,j , yc i,j , w i,j ,h i,j ,θ i,j ), even when k=i, it does not mean the same ship model, but may actually represent different ship models, and the two need to be associated and matched through an algorithm;
[0013] Step 3: Eliminate the wrong recognition results; delete the data whose deflection angle of the detection frame is too large and the distance from the center of the detection frame is too far;
[0014] Step 3 specifically includes the following process:
[0015] 1): Delete the ship model with too large deflection angle in the detection frame;
[0016] The deflection angle set of the ship model detected in the previous frame (j-1 frame) is {θ k,j -1}, the deflection angle set of the ship model detected by the current frame (j frame) is {θ i,j}, take the starting frame of the ship model as the reliable one and calculate backwards in sequence, and calculate the minimum value of the deviation angle difference between the current frame and the previous frame:
[0017] M θi,j =min|θ i,j -θ k,j-1 |, k = 1, 2, ..., N
[0018] The detection result of the previous frame is processed and reliable, and the detection result of the current frame may be wrong and needs to be judged; Judgment criterion: When M θi,j >θ0, then θ i,j It is an erroneous detection result and needs to be eliminated. According to the experience of ship model test, θ0 is taken as 5°;
[0019] 2) Delete the ship models that are too far from the center of the detection frame;
[0020] The center coordinate set of the ship model detected in the previous frame (j-1 frame) is {(xc k,j-1 , yc k,j-1 )}, the center coordinate set of the ship model detected in the current frame (j frame) image is {(xc i,j , yc i,j )}, take the starting frame of the ship model as the reliable one and calculate it in sequence; calculate the difference between the center distance of the current frame and the previous frame:
[0021]
[0022] The detection result of the previous frame has been processed and is reliable. The detection result of the current frame may have errors and needs to be judged. Judgment criteria: When (xc i,j , yc i,j ) is an erroneous detection result and needs to be removed. According to the experience of ship model tests, d0 is generally taken as a distance of 20 pixels.
[0023] This is because the YOLO target detection results may be missed, wrongly detected, or have large errors due to the influence of foreign objects, water surface reflection, and complex scene conditions. If not processed, it will affect the subsequent association matching of each ship model data. To address this problem, the detection results need to be judged and the wrong detection results need to be eliminated. There are two principles for error judgment. If any one of them is met, it can be considered as wrong data and needs to be eliminated.
[0024] Step 4, perform multi-target association matching, calculate the matching degree between the current frame and the previous frame for the four feature parameters of the center point coordinates, width, height and deflection angle of the detection frame, and associate them; when associating, perform multi-feature fusion based on the Hadamard product of the four feature parameter matrices, and perform trajectory association to obtain the motion trajectory of each target ship model.
[0025] Further, step 4 includes the following steps:
[0026] (1) Calculate the angle matching degree of the detection frame;
[0027] Since the movement of the ship model is continuous, the angle of the ship model detection frame will not change significantly between two adjacent frames. If the angle change of the ship model detection frame between the two frames is the smallest, it is the best match. Therefore, a calculation matrix that characterizes the matching degree of the detection frame angle is proposed;
[0028] First, calculate the normal form matrix of the angles:
[0029]
[0030] Then, find the maximum value of each row of matrix A1 and construct vector a=(a1, a2, ..., a N ), where a1 represents the maximum value of the first row of matrix A1, a2 represents the maximum value of the second row of matrix A1, and so on;
[0031] Finally, the calculation matrix A2 representing the angle matching of the detection frame is calculated:
[0032]
[0033] Among them, A 1i represents the i-th row vector of A1. Each row of data in A1 is divided by the maximum value of each row. A2 is an N×N matrix. Any data in it, such as A 2i,j , represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the ship model deflection, A 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0034] (2) Calculate the matching degree of the center point of the detection frame;
[0035] Similarly, since the movement of the ship model is continuous, the center point position of the ship model will not change significantly between two adjacent frames. If the coordinate change of the center point of the detection frame of the ship model is the smallest, it is the best match. Therefore, a calculation matrix that characterizes the matching degree of the center point of the ship model is proposed.
[0036] First, calculate the second normal matrix of the center point distance
[0037]
[0038] In the formula
[0039] Then, find the maximum value of each row of matrix B1 and construct vector b=(b1, b2, ..., b N ), where b1 represents the maximum value of the first row of matrix B1, b2 represents the maximum value of the second row of matrix B1, and so on;
[0040] Finally, the calculation matrix B2 representing the matching degree of the center point of the ship model is calculated:
[0041]
[0042] B 1i represents the i-th row vector of B1. Each row of data in B1 is divided by the maximum value of each row. B2 is an N×N matrix. Any data in it, such as B 2i,j , represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the center point of the ship model, B 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0043] (3) Calculate the matching degree of the detection frame width;
[0044] Similarly, since the motion of the ship model is continuous, the width of the detection frame changes little between two adjacent frames. Referring to the detection frame angle matching calculation method, the calculation matrix C2 representing the detection frame width matching is calculated;
[0045] First, calculate the width of the normal form matrix:
[0046]
[0047] Then, find the maximum value of each row of matrix C1 and construct vector c=(c1, c2, ..., c N ), where c1 represents the maximum value of the first row of matrix C1, c2 represents the maximum value of the second row of matrix C1, and so on;
[0048] Finally, the calculation matrix C2 representing the matching degree of the detection box width is calculated:
[0049]
[0050] C 1i represents the i-th row vector of C1. Each row of data in C1 is divided by the maximum value of each row. C2 is an N×N matrix. Any data in it, such as C 2i,j , which represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame in terms of the width of the ship model, C 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0051] (4) Calculate the matching degree of the detection frame height;
[0052] Similarly, due to the continuity of the ship model motion, the height change of the detection frame between two adjacent frames is small. Referring to the detection frame angle matching calculation method, the calculation matrix D2 representing the detection frame height matching is calculated.
[0053] First, calculate the height of the first normal form matrix:
[0054]
[0055] Then, find the maximum value of each row of matrix D1 to form a vector d=(d1, d2, ..., d N ), where d1 represents the maximum value of the first row of matrix D1, d2 represents the maximum value of the second row of matrix D1, and so on;
[0056] Finally, the calculation matrix D2 representing the height matching degree of the detection box is calculated:
[0057]
[0058] D 1i represents the i-th row vector of D1. Each row of data in D1 is divided by the maximum value of each row. D2 is an N×N matrix. Any data in it, such as D 2i,j , which represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the ship model height, D 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0059] (5) Perform feature fusion and trajectory association;
[0060] Due to the similarity of the motion of multiple target ship models, the single feature parameters of different ship models may be similar. Therefore, a multi-feature fusion method is proposed to achieve the association matching of ship models.
[0061] Calculate the Hadamard product of the above four feature parameter matrices and combine the four features:
[0062]
[0063] The matrix F is the element-wise product of the four matrices A2, B2, C2, and D2. F is an N×N matrix, and any element F i,j =A 2i,j ×B 2i,j ×C 2i,j ×D 2i,j , as described in (1) to (4), A 2i,j , B 2i,j , C 2i,j , D 2i,j They represent the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the rotation angle, center coordinates, width, and height of the detection frame. The value range of each parameter is [0,1]. The closer to 1, the more similar they are. If the i-th ship model in the current frame is the same as the j-th ship model in the previous frame, then these four parameters are very close to 1, and F i,j is also very close to 1. If it is not the same ship model, one or more of these four parameters are close to 0, then F i,j It is also very close to 0; thereby realizing the associated matching of the ship model; in this way, since multiple characteristic parameters are used, the mutual interference problem among different multi-target ship models can be eliminated.
[0064] The ith row in the matrix F has N elements. The Hadamard products of the ith ship model in the current frame and the ship models in the previous frame are calculated in sequence. The largest value indicates that the ship models are most similar. Thus, for each row of the matrix F, the maximum value is found, such as F i,l represents the maximum value of the i-th row, then the i-th ship model in the current frame should actually be the l-th ship model in the previous frame; in this way, the detected ship model is associated with the corresponding trajectory, and the trajectory information is updated.
[0065] Furthermore, during the recognition process of YOLO target detection, due to complex environmental conditions, the YOLO detection frame inevitably jitters, affecting the measurement accuracy. Therefore, during implementation, the trajectory data can be further corrected by methods such as Kalman filtering to improve the measurement accuracy.
[0066] The present invention has the following beneficial effects. 1. Multi-target support: It can simultaneously measure the motion trajectories of multiple ship models, and solve the problem of multi-target classification and matching through multi-feature fusion association. 2. Real-time performance: By adopting the YOLO algorithm, the real-time performance of ship model detection is achieved.
[0067] In summary, the present invention realizes the classification and matching of multiple targets by integrating and calculating the similarity of multiple features of the ship model detection frame; it provides an efficient and accurate method for measuring the motion trajectory of multiple targets of ship models, solves the problems existing in the prior art, and has broad application prospects. DETAILED DESCRIPTION
[0068] The present invention is further described in detail below in conjunction with specific implementation modes.
[0069] Specific implementation example: A method for measuring the motion trajectory of a multi-target ship model, which uses a camera to capture the motion picture of the ship model and uses the YOLO target detection algorithm to identify all ship model targets. Its characteristic is that the trajectory data of each ship model is correlated and matched through multi-feature fusion, so as to distinguish and generate the motion trajectory of each ship model.
[0070] In this way, the YOLO target detection algorithm has a fast detection speed and can realize real-time detection of ship models (frequency can reach 30Hz). During detection, this method is based on the association matching of the trajectory data of each ship model, which can better distinguish each ship model and generate the motion trajectory of each ship model, thereby improving the accuracy and real-time performance of the measurement results.
[0071] Specifically, the method comprises the following steps:
[0072] Step 1, obtaining video data, arranging multiple cameras above the test area to ensure that the motion range of all ship models is covered; the camera collects the motion picture of the ship model and transmits it to the processing system;
[0073] Step 2: Use the YOLO target detection algorithm to process the captured images and identify each ship model; the YOLO detection algorithm extracts image features through a convolutional neural network and outputs the center point coordinates, width, height, and rotation angle of the ship model detection frame;
[0074] Suppose there are N ship models (the ship model numbers are i=1, 2, ... N), the recognition result of the j-th frame image and a certain ship model is: (xc i,j , yc i,j , w i,j ,h i,j ,θ i,j ), where xc i,j , yc i,j is the center point coordinate of the ship model detection frame, w i,j is the width of the ship model detection frame, h i,j is the height of the ship model detection frame, θ i,j is the deflection angle of the ship model detection frame; the recognition result of a ship model in the j-1th frame image is: (xc k,j-1 , yc k,j-1 , w k,j-1 ,h k,j-1 ,θ k,j-1 ), ship model number k = 1, 2, ... N;
[0075] Since the numbering of YOLO target detection is random, the detection result of the previous frame image (xc k,j-1 , yck,j-1 , w k,j-1 ,h k,j-1 ,θ k,j-1 ) and the current frame image detection result (xc i,j , yc i,j , w i,j ,h i,j ,θ i,j ), even when k=i, it does not mean the same ship model, but may actually represent different ship models, and the two need to be associated and matched through an algorithm;
[0076] Step 3: Eliminate the wrong recognition results; delete the data whose deflection angle of the detection frame is too large and the distance from the center of the detection frame is too far;
[0077] When implemented, step 3 specifically includes the following process:
[0078] 1): Delete the ship model with too large deflection angle in the detection frame;
[0079] The deflection angle set of the ship model detected in the previous frame (j-1 frame) is {θ k,j-1}, the deflection angle set of the ship model detected by the current frame (j frame) image is {θ i,j}, take the starting frame of the ship model as the reliable one and calculate backwards in sequence, and calculate the minimum value of the deviation angle difference between the current frame and the previous frame:
[0080] M θi,j =min|θ i,j -θ k,j-1 |, k = 1, 2, ..., N
[0081] The detection result of the previous frame is processed and reliable, and the detection result of the current frame may be wrong and needs to be judged; Judgment criterion: When M θi,j >θ0, then θ i,j It is an erroneous detection result and needs to be eliminated. According to the experience of ship model test, θ0 is taken as 5°;
[0082] 2) Delete the ship models that are too far from the center of the detection frame;
[0083] The center coordinate set of the ship model detected in the previous frame (j-1 frame) is {(xc k,j-1 , yc k,j-1 )}, the center coordinate set of the ship model detected in the current frame (j frame) image is {(xc i,j , yc i,j )}, take the starting frame of the ship model as the reliable one and calculate it in sequence; calculate the difference between the center distance of the current frame and the previous frame:
[0084]
[0085] The detection result of the previous frame is processed and reliable. The detection result of the current frame may have errors and needs to be judged. Judgment criterion: When M xyi,j >d0, then it is considered that (xc i,j , yc i,j ) is an erroneous detection result and needs to be removed. According to the experience of ship model tests, d0 is generally taken as a distance of 20 pixels.
[0086] This is because the YOL0 target detection results may be missed, wrongly detected, or have large errors due to the influence of foreign objects, water surface reflection, and complex scene conditions. If not processed, it will affect the subsequent association matching of each ship model data. To address this problem, the detection results need to be judged and the wrong detection results need to be eliminated. There are two principles for error judgment. If any one of them is met, it can be considered as wrong data and needs to be eliminated.
[0087] Step 4: Perform multi-target association matching. Based on the center point coordinates, width, height, and deflection angle of the detection frame, calculate the matching degree between the current frame and the previous frame, and associate them. Perform multi-feature fusion based on the Hadamard product of the four feature parameter matrices, and perform trajectory association to obtain the motion trajectory of each target ship model.
[0088] When implemented, step 4 specifically includes the following process:
[0089] (1) Calculate the angle matching degree of the detection frame;
[0090] Since the movement of the ship model is continuous, the angle of the ship model detection frame will not change significantly between two adjacent frames. If the angle change of the ship model detection frame between the two frames is the smallest, it is the best match. Therefore, a calculation matrix that characterizes the matching degree of the detection frame angle is proposed;
[0091] First, calculate the normal form matrix of the angles:
[0092]
[0093] Then, find the maximum value of each row of matrix A1 and construct vector a=(a1, a2, ..., a N ), where a1 represents the maximum value of the first row of matrix A1, a2 represents the maximum value of the second row of matrix A1, and so on.
[0094] Finally, the calculation matrix A2 representing the angle matching of the detection frame is calculated:
[0095]
[0096] A 1irepresents the i-th row vector of A1. Each row of data in A1 is divided by the maximum value of each row. A2 is an N×N matrix. Any data in it, such as A 2i,j , represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the ship model deflection, A 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0097] (2) Calculate the matching degree of the center point of the detection frame;
[0098] Similarly, since the movement of the ship model is continuous, the center point position of the ship model will not change significantly between two adjacent frames. If the coordinate change of the center point of the detection frame of the ship model is the smallest, it is the best match. Therefore, a calculation matrix that characterizes the matching degree of the center point of the ship model is proposed.
[0099] First, calculate the second normal matrix of the center point distance
[0100]
[0101] In the formula
[0102] Then, find the maximum value of each row of matrix B1 and construct vector b=(b1, b2, ..., b N ), where b1 represents the maximum value of the first row of matrix B1, b2 represents the maximum value of the second row of matrix B1, and so on.
[0103] Finally, the calculation matrix B2 representing the matching degree of the center point of the ship model is calculated:
[0104]
[0105] B 1i represents the i-th row vector of B1. Each row of data in B1 is divided by the maximum value of each row. B2 is an N×N matrix. Any data in it, such as B 2i,j , represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the center point of the ship model, B 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0106] (3) Calculate the matching degree of the detection frame width;
[0107] Similarly, due to the continuity of the ship model motion, the width of the detection frame changes slightly between two adjacent frames. Referring to the detection frame angle matching calculation method, the calculation matrix C2 representing the detection frame width matching is calculated.
[0108] First, calculate the width of the normal form matrix:
[0109]
[0110] Then, find the maximum value of each row of matrix C1 and construct vector c=(c1, c2, ..., c N ), where c1 represents the maximum value of the first row of matrix C1, c2 represents the maximum value of the second row of matrix C1, and so on.
[0111] Finally, the calculation matrix C2 representing the matching degree of the detection box width is calculated:
[0112]
[0113] C 1i represents the i-th row vector of C1. Each row of data in C1 is divided by the maximum value of each row. C2 is an N×N matrix. Any data in it, such as C 2i,j , which represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame in terms of the width of the ship model, C 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0114] (4) Calculate the matching degree of the detection frame height;
[0115] Similarly, due to the continuity of the ship model motion, the height change of the detection frame between two adjacent frames is small. Referring to the detection frame angle matching calculation method, the calculation matrix D2 representing the detection frame height matching is calculated.
[0116] First, calculate the height of the first normal form matrix:
[0117]
[0118] Then, find the maximum value of each row of matrix D1 to form a vector d=(d1, d2, ..., d N ), where d1 represents the maximum value of the first row of matrix D1, d2 represents the maximum value of the second row of matrix D1, and so on.
[0119] Finally, the calculation matrix D2 representing the height matching degree of the detection box is calculated:
[0120]
[0121] D 1i represents the i-th row vector of D1. Each row of data in D1 is divided by the maximum value of each row. D2 is an N×N matrix. Any data in it, such as D 2i,j , which represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the ship model height, D 2i,j The value range of is [0, 1], the closer to 1, the more similar;
[0122] (5) Feature fusion and trajectory association;
[0123] Due to the similarity of the motion of multiple target ship models, the individual feature parameters of different ship models may be similar. Therefore, a multi-feature fusion method is proposed to achieve the association matching of ship models. The Hadamard product of the above four feature parameter matrices is calculated to fuse the four features:
[0124]
[0125] The matrix F is the element-wise product of the four matrices A2, B2, C2, and D2. F is an N×N matrix, and any element F i,j =A 2i,j ×B 2i,j ×C 2i,j ×D 2i,j , as described in (1) to (4), A 2i,j , B 2i,j , C 2i,j , D 2i,j They represent the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the rotation angle, center coordinates, width, and height of the detection frame. The value range of each parameter is [0, 1]. The closer to 1, the more similar they are. If the i-th ship model in the current frame is the same as the j-th ship model in the previous frame, then these four parameters are very close to 1, and F i,j is also very close to 1. If it is not the same ship model, one or more of these four parameters are close to 0, then F i,j is also very close to 0. Based on this, the ship models can be associated and matched. And because multiple characteristic parameters are used, the mutual interference problem among different multi-target ship models can be eliminated.
[0126] The ith row in the matrix F has N elements, and the Hadamard products of the ith ship model in the current frame and each ship model in the previous frame are calculated in sequence. The largest value indicates that the ship models are most similar. To this end, for each row of the matrix F, find the maximum value, such as F i,l If represents the maximum value of the i-th row, the i-th ship model in the current frame should actually be the l-th ship model in the previous frame. Based on this, the detected ship model is associated with the corresponding trajectory, and the trajectory information is updated.
[0127] In addition, during the recognition process of YOLO target detection, due to complex environmental conditions, the YOLO detection frame will inevitably jitter, affecting the measurement accuracy. Therefore, during implementation, the trajectory data can be further corrected through methods such as Kalman filtering to improve the measurement accuracy.
[0128] The present invention has the following beneficial effects. 1. Multi-target support: It can simultaneously measure the motion trajectories of multiple ship models, and solve the problem of multi-target classification and matching through multi-feature fusion association. 2. Real-time performance: By adopting the YOLO algorithm, the real-time performance of ship model detection is achieved.
Claims
1. A multi-target ship model motion trajectory measurement method, which uses a camera to shoot the ship model motion picture and uses the YOLO target detection algorithm to identify all ship model targets, characterized in that: The trajectory data of each ship model are correlated and matched through multi-feature fusion, so as to distinguish and generate the motion trajectory of each ship model.
2. The multi-target ship model motion trajectory measurement method according to claim 1, characterized in that: The method comprises the following steps: Step 1, obtaining video data, arranging multiple cameras above the test area to ensure that the motion range of all ship models is covered; the camera collects the motion picture of the ship model and transmits it to the processing system; Step 2: Use the YOLO target detection algorithm to process the captured images and identify each ship model; the YOLO detection algorithm extracts image features through a convolutional neural network and outputs the center point coordinates, width, height, and rotation angle of the ship model detection frame; Suppose there are N ship models (the ship model numbers are i=1, 2, ... N), the recognition result of the j-th frame image and a certain ship model is: (xc i,j , yc i,j , w i,j ,h i,j ,θ i,j ), where xc i,j , yc i,j is the center point coordinate of the ship model detection frame, w i,j is the width of the ship model detection frame, h i,j is the height of the ship model detection frame, θ i,j is the deflection angle of the ship model detection frame; the recognition result of a ship model in the j-1th frame image is: xc k,j-1 , yc k,j-1 , w k,j-1 ,h k,j-1 ,θ k,j-1 ), ship model number k = 1, 2, ... N; Step 3: Eliminate the wrong recognition results; delete the data whose deflection angle of the detection frame is too large and the distance from the center of the detection frame is too far; Step 4, perform multi-target association matching, calculate the matching degree between the current frame and the previous frame for the four feature parameters of the center point coordinates, width, height and deflection angle of the detection frame, and associate them; when associating, perform multi-feature fusion based on the Hadamard product of the four feature parameter matrices, and perform trajectory association to obtain the motion trajectory of each target ship model.
3. The multi-target ship model motion trajectory measurement method according to claim 2, characterized in that: Step 3 specifically includes the following process: 1): Delete the ship model with too large deflection angle in the detection frame; The deflection angle set of the ship model detected in the previous frame (j-1 frame) is {θ k,j-1 }, the deflection angle set of the ship model detected by the current frame (j frame) image is {θ i,j }, take the starting frame of the ship model as the reliable one and calculate backwards in sequence to calculate the minimum value of the deviation angle difference between the current frame and the previous frame: M θi,j =min|θ i,j -θ k,j-1 |,k=1,2,...,N The detection result of the previous frame is processed and reliable, and the detection result of the current frame may be wrong and needs to be judged; Judgment criterion: When M θi,j >θ0, then θ i,j It is an erroneous detection result and needs to be eliminated. According to the experience of ship model test, θ0 is taken as 5°; 2) Delete the ship models that are too far from the center of the detection frame; The center coordinate set of the ship model detected in the previous frame (j-1 frame) is {(xc k,j-1 , yc k,j-1 )}, the center coordinate set of the ship model detected in the current frame (j frame) image is {(xc i,j , yc i,j )}, take the starting frame of the ship model as the reliable one and calculate it in sequence; calculate the difference between the center distance of the current frame and the previous frame: The detection result of the previous frame is processed and reliable. The detection result of the current frame may have errors and needs to be judged. Judgment criterion: When M xyi,j >d0, then it is considered that (xc i,j , yc i,j ) is an erroneous detection result and needs to be removed. According to the experience of ship model tests, d0 is generally taken as a distance of 20 pixels.
4. The multi-target ship model motion trajectory measurement method according to claim 2, characterized in that: Step 4 includes the following steps: (1) Calculate the angle matching degree of the detection frame; First, calculate the first normal form matrix of the angles: Then, find the maximum value of each row of matrix A1 and construct vector a=(a1, a2, ..., a N ), where a1 represents the maximum value of the first row of matrix A1, a2 represents the maximum value of the second row of matrix A1, and so on; Finally, the calculation matrix A2 representing the angle matching of the detection frame is calculated: Among them, A 1i represents the i-th row vector of A1. Each row of data in A1 is divided by the maximum value of each row. A2 is an N×N matrix. Any data in it, such as A 2i,j , represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the ship model deflection, A 2i,j The value range of is [0,1], the closer to 1, the more similar; (2) Calculate the matching degree of the center point of the detection frame; First, calculate the second normal matrix of the center point distance In the formula Then, find the maximum value of each row of matrix B1 and construct vector b=(b1, b2, ..., b N ), where b1 represents the maximum value of the first row of matrix B1, b2 represents the maximum value of the second row of matrix B1, and so on; Finally, the calculation matrix B2 representing the matching degree of the center point of the ship model is calculated: B 1i represents the i-th row vector of B1. Each row of data in B1 is divided by the maximum value of each row. B2 is an N×N matrix. Any data in it, such as B 2i,j , represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the center point of the ship model, B 2i,j The value range of is [0,1], the closer to 1, the more similar; (3) Calculate the matching degree of the detection frame width; First, calculate the width of the normal form matrix: Then, find the maximum value of each row of matrix C1 and construct vector c=(c1, c2, ..., c N ), where c1 represents the maximum value of the first row of matrix C1, c2 represents the maximum value of the second row of matrix C1, and so on; Finally, the calculation matrix C2 representing the matching degree of the detection box width is calculated: C 1i represents the i-th row vector of C1. Each row of data in C1 is divided by the maximum value of each row. C2 is an N×N matrix. Any data in it, such as C 2i,j , which represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame in terms of the width of the ship model, C 2i,j The value range of is [0,1], the closer to 1, the more similar; (4) Calculate the matching degree of the detection frame height; First, calculate the height of the first normal form matrix: Then, find the maximum value of each row of matrix D1 to form a vector d=(d1, d2, ..., d N ), where d1 represents the maximum value of the first row of matrix D1, d2 represents the maximum value of the second row of matrix D1, and so on; Finally, the calculation matrix D2 representing the height matching degree of the detection box is calculated: D 1i represents the i-th row vector of D1. Each row of data in D1 is divided by the maximum value of each row. D2 is an N×N matrix. Any data in it, such as D 2i,j , which represents the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the ship model height, D 2i,j The value range of is [0,1], the closer to 1, the more similar; (5) Perform feature fusion and trajectory association; Calculate the Hadamard product of the above four feature parameter matrices and combine the four features: The matrix F is the element-wise product of the four matrices A2, B2, C2, and D2. F is an N×N matrix, and any element F i,j =A 2i,j ×B 2i,j ×C 2i,j ×D 2i,j , A 2i,j , B 2i,j , C 2i,j , D 2i,j Respectively represent the similarity between the i-th ship model in the current frame and the j-th ship model in the previous frame from the perspective of the rotation angle, center coordinates, width, and height of the detection frame. The value range of each parameter is [0,1], and the closer to 1, the more similar; If the i-th ship model in the current frame is the same as the j-th ship model in the previous frame, then these four parameters are very close to 1, and F i,j is also very close to 1. If it is not the same ship model, one or more of these four parameters are close to 0, then F i,j is also very close to 0; thus, the association matching of the ship models is realized; specifically, the i-th row in the matrix F has N elements, and the Hadamard product of the i-th ship model in the current frame and each ship model in the previous frame is calculated in turn. The largest value indicates that the ship models are most similar; thus, for each row of the matrix F, the maximum value is found, such as F i,l represents the maximum value of the i-th row, then the i-th ship model in the current frame should actually be the l-th ship model in the previous frame; in this way, the detected ship model is associated with the corresponding trajectory, and the trajectory information is updated.