Water bayonet detection method and system based on unmanned aerial vehicle

By combining images from PTZ cameras and fixed cameras, and using target recognition models for identification and tracking, the problem of incomplete information acquisition caused by a single UAV detection method is solved, achieving more comprehensive water bayonet detection and improving information reliability and detection results.

CN118537760BActive Publication Date: 2024-10-11ZHEJIANG WHYIS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411014235.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-11
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

The existing drone detection method is single and cannot fully obtain relevant information about the ship, leading to the problem of incomplete information acquisition.

Method used

By combining the images collected by PTZ cameras and fixed cameras, the target recognition model is used for identification and tracking, the target frame is converted, and more comprehensive information is obtained through the matching algorithm.

Benefits of technology

It improves the reliability and comprehensiveness of information, reduces visual blind spots, saves costs, and achieves more accurate water bayonet detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537760B_ABST
    Figure CN118537760B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method and system for detecting a water bayonet based on a drone, wherein the method comprises: obtaining a first image to be identified collected by a pan-tilt camera and a second image to be identified collected by a fixed camera at the current moment; using a target recognition model to respectively identify the first image to be identified and the second image to be identified, and obtaining a first identified target and a second identified target; converting a first target frame of the first identified target to a coordinate system to which the second identified target belongs, and obtaining a converted target frame; matching the converted target frame with the second target frame; performing target tracking based on the first identified target and the third identified target at the previous moment, and performing target tracking based on the second identified target and the fourth identified target at the previous moment, and assigning a unique target ID to the same identified target; performing information recognition on the first target frame and the second target frame of the same target ID, and obtaining target-related information. The reliability of information is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target monitoring, and in particular to an aquatic bayonet detection method and system based on an unmanned aerial vehicle. Background Art

[0002] Channel inspection is usually done manually, and manual inspection requires patrol boats. Due to the limited height of patrol boats, cargo ships are usually higher than patrol boats, and sometimes it is difficult to see the cargo loading situation in the cargo ship and the situation of the plywood on the other side. Drones can fly to a certain height to inspect ships, and their blind spots are small at high altitudes, thus solving the problem of insufficient information collection during manual inspections.

[0003] However, the existing technology uses a single method of drone detection, which cannot fully obtain relevant information of the ship. There is currently no effective solution to the above problems in the existing technology. Summary of the invention

[0004] To solve the above problems, the present invention provides a method and system for detecting water bayonet points based on drones. By fusing the images collected by the pan-tilt camera and the images collected by the fixed camera, more comprehensive and effective information of the ship is obtained, so as to solve the problems of single drone detection method and incomplete information acquisition in the prior art.

[0005] To achieve the above-mentioned purpose, the present invention provides a method for detecting a water bayonet based on an unmanned aerial vehicle, comprising: obtaining a first image to be identified collected by a gimbal camera at the current moment and a second image to be identified collected by a fixed camera; using a target recognition model to identify the first image to be identified to obtain a first identified target; using the target recognition model to identify the second image to be identified to obtain a second identified target; converting the first target frame of the first identified target to the coordinate system to which the second identified target belongs to obtain a converted target frame; calculating a first similarity between each converted target frame and the second target frames of all second identified targets, and obtaining a second target frame corresponding to the first target frame by using a matching algorithm based on the first similarity and a preset similarity threshold; performing target tracking based on the first identified target and the third identified target corresponding to the gimbal camera at the previous moment, and performing target tracking based on the second identified target and the fourth identified target corresponding to the fixed camera at the previous moment, and assigning a unique target ID to the same identified target; performing information recognition on the first target frame and the second target frame of the same target ID to obtain target-related information.

[0006] Further optionally, the converting of the first target frame of the first identified target to the coordinate system to which the second identified target belongs includes: determining a first rotation matrix based on the lateral angle of the gimbal camera relative to the fixed camera; determining a second rotation matrix based on the longitudinal angle of the gimbal camera relative to the fixed camera; defining a translation vector based on the position of the gimbal camera and the position of the fixed camera; and for any point in the first target frame, obtaining the corresponding point of the point in the coordinate system to which the second identified target belongs based on the first rotation matrix, the second rotation matrix and the translation vector.

[0007] Further optionally, the first rotation matrix is ​​determined according to the lateral angle of the gimbal camera relative to the fixed camera, and is calculated by the following formula:

[0008] ;

[0009] in, θx is the horizontal angle;

[0010] The second rotation matrix is ​​determined according to the longitudinal angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula:

[0011] ;

[0012] in, θy is the longitudinal angle;

[0013] For any point in the first target frame, the corresponding point of the point in the coordinate system of the second identified target is obtained according to the first rotation matrix, the second rotation matrix and the translation vector, and is calculated by the following formula:

[0014] ;

[0015] in, , is a point in the first target box, for The corresponding point in the coordinate system of the second recognition target, is the translation vector.

[0016] Further optionally, the target tracking according to the first recognized target and the third recognized target corresponding to the gimbal camera at the previous moment includes: predicting a first predicted target frame of the third recognized target at the current moment; calculating a second similarity between each first target frame and all first predicted target frames, and obtaining a first predicted target frame corresponding to the first target frame by using a matching algorithm according to the second similarity and a preset threshold;

[0017] The target tracking is performed based on the second recognized target and the fourth recognized target corresponding to the fixed camera at the previous moment, including: predicting the second predicted target frame of the fourth recognized target at the current moment; calculating the third similarity between each second target frame and all second predicted target frames, and using a matching algorithm based on the third similarity and a preset threshold to obtain the second predicted target frame corresponding to the second target frame.

[0018] Further optionally, the information of the first target frame and the second target frame of the same target ID is identified to obtain target related information, including: using a preset life jacket recognition model to respectively identify the first target frame and the second target frame of the same target ID, and fusing the recognition results to obtain target life jacket information; using a preset ship license plate recognition model to respectively identify the first target frame and the second target frame of the same target ID, and fusing the recognition results to obtain target ship license plate information.

[0019] On the other hand, the present invention also provides an above-water bayonet detection system based on an unmanned aerial vehicle, comprising: an image acquisition module, used to acquire a first image to be identified acquired by a pan-tilt camera at the current moment and a second image to be identified acquired by a fixed camera; a target recognition module, used to recognize the first image to be identified by using a target recognition model to obtain a first identified target; and to recognize the second image to be identified by using the target recognition model to obtain a second identified target; a conversion module, used to convert a first target frame of the first identified target into a coordinate system to which the second identified target belongs, to obtain a converted target frame; a matching module, used to calculate a first similarity between each converted target frame and the second target frames of all second identified targets, and to obtain a second target frame corresponding to the first target frame by using a matching algorithm according to the first similarity and a preset similarity threshold; a target tracking module, used to perform target tracking according to the first identified target and the third identified target corresponding to the pan-tilt camera at the previous moment, and to perform target tracking according to the second identified target and the fourth identified target corresponding to the fixed camera at the previous moment, and to assign a unique target ID to the same identified target; an information recognition module, used to perform information recognition on the first target frame and the second target frame of the same target ID to obtain target related information.

[0020] Further optionally, the conversion module includes: a first rotation matrix calculation submodule, used to determine the first rotation matrix according to the lateral angle of the gimbal camera relative to the fixed camera; a second rotation matrix calculation submodule, used to determine the second rotation matrix according to the longitudinal angle of the gimbal camera relative to the fixed camera; a translation vector determination submodule, used to define the translation vector according to the position of the gimbal camera and the position of the fixed camera; and a conversion submodule, used to obtain, for any point in the first target frame, the corresponding point of the point in the coordinate system to which the second identified target belongs according to the first rotation matrix, the second rotation matrix and the translation vector.

[0021] Further optionally, the first rotation matrix is ​​determined according to the lateral angle of the gimbal camera relative to the fixed camera, and is calculated by the following formula:

[0022] ;

[0023] in, θx is the horizontal angle;

[0024] The second rotation matrix is ​​determined according to the longitudinal angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula:

[0025] ;

[0026] in, θy is the longitudinal angle;

[0027] For any point in the first target frame, the corresponding point of the point in the coordinate system of the second identified target is obtained according to the first rotation matrix, the second rotation matrix and the translation vector, and is calculated by the following formula:

[0028] ;

[0029] in, , is a point in the first target box, for The corresponding point in the coordinate system of the second recognition target, is the translation vector.

[0030] Further optionally, the target tracking module includes: a first prediction submodule, used to predict the first predicted target frame of the third recognized target at the current moment; a first matching submodule, used to calculate the second similarity between each first target frame and all first predicted target frames, and use a matching algorithm based on the second similarity and a preset threshold to obtain the first predicted target frame corresponding to the first target frame; a second prediction submodule, used to predict the second predicted target frame of the fourth recognized target at the current moment; and a second matching submodule, used to calculate the third similarity between each second target frame and all second predicted target frames, and use a matching algorithm based on the third similarity and a preset threshold to obtain the second predicted target frame corresponding to the second target frame.

[0031] Further optionally, the information identification module includes: a life jacket information identification submodule, which is used to use a preset life jacket recognition model to respectively identify the first target frame and the second target frame of the same target ID, and fuse the recognition results to obtain the target life jacket information; a ship license plate information identification submodule, which is used to use a preset ship license plate recognition model to respectively identify the first target frame and the second target frame of the same target ID, and fuse the recognition results to obtain the target ship license plate information.

[0032] The above technical solution has the following beneficial effects: using drone inspections instead of manual inspections saves costs, reduces visual blind spots, and improves the reliability of collected information; by matching the images of the pan-tilt camera with the images of the fixed camera, images of the same target from different perspectives are created, and these images are identified to avoid unreliable information caused by visual blind spots, thereby improving the comprehensiveness of image acquisition and improving the effectiveness and reliability of the identified information. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 is a flow chart of a method for detecting water checkpoints based on a drone provided by an embodiment of the present invention;

[0035] Figure 2 is a flow chart of a coordinate conversion method provided by an embodiment of the present invention;

[0036] Figure 3 is a flow chart of a target tracking method provided by an embodiment of the present invention;

[0037] Figure 4 is a flow chart of a method for identifying relevant information provided by an embodiment of the present invention;

[0038] Figure 5 It is a structural schematic diagram of a water bayonet detection system based on a drone provided by an embodiment of the present invention;

[0039] Figure 6 is a schematic diagram of the structure of a conversion module provided by an embodiment of the present invention;

[0040] Figure 7 is a schematic diagram of the structure of a target tracking module provided by an embodiment of the present invention;

[0041] Figure 8It is a structural diagram of an information identification module provided by an embodiment of the present invention.

[0042] Figure markings: 100-image acquisition module; 200-target recognition module; 300-conversion module; 3001-first rotation matrix calculation submodule; 3002-second rotation matrix calculation submodule; 3003-translation vector determination submodule; 3004-conversion submodule; 400-matching module; 500-target tracking module; 5001-first prediction submodule; 5002-first matching submodule; 5003-second prediction submodule; 5004-second matching submodule; 600-information recognition module; 6001-life jacket information recognition submodule; 6002-ship license plate information recognition submodule. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] In order to solve the problem that the information obtained by using drones for data collection in the prior art is incomplete, the embodiment of the present invention provides a water bayonet detection method based on drones. Figure 1 FIG. 1 is a flow chart of a method for detecting water checkpoints based on a drone according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0045] S1, obtaining a first image to be recognized captured by the pan-tilt camera and a second image to be recognized captured by the fixed camera at the current moment;

[0046] Plan the route for the drone in advance. The preset route should cover as much area as possible and ensure that there are no obstructions or obstacles within the preset route. The program controls the drone to take off and enter the preset route to start data collection.

[0047] The latitude and longitude information of the drone's location is used to determine the location of the river, and the drone's flight attitude is adjusted according to the location of the river, so that the shooting frame of the gimbal camera is as perpendicular to the river as possible, so as to reduce subsequent data collection errors and ensure that clear, no-blind-angle image data can be obtained during navigation.

[0048] During the flight of the drone, the gimbal camera is installed on a rotatable gimbal, which can flexibly adjust the angle to shoot images at different angles. The fixed camera shoots at a fixed angle, and both cameras shoot continuously. At a certain moment, the gimbal camera will acquire a frame of image, and the fixed camera will also acquire a frame of image. According to the timestamp, the first image to be identified and the second image to be identified collected at the same time can be obtained.

[0049] The first image to be identified captured by the PTZ camera and the second image to be identified captured by the fixed camera can be preprocessed to improve image quality. As an optional implementation, the preprocessing method includes denoising, contrast enhancement, distortion correction, etc.

[0050] S2, using the target recognition model to recognize the first image to be recognized, and obtaining a first recognition target; using the target recognition model to recognize the second image to be recognized, and obtaining a second recognition target;

[0051] Pre-train the target recognition model. For the target recognition model, some images can be collected by drones in advance, and the images can be annotated as a labeled training set. The labeled training set is used to train a neural network for image target detection, that is, the target recognition model.

[0052] The target recognition model is used to perform target recognition on the first image to be recognized to obtain a first recognized target. There may be one or more first recognized targets in the first image to be recognized.

[0053] The target recognition model is used to perform target recognition on the second image to be recognized to obtain a second recognized target. There may be one or more second recognized targets in the second image to be recognized.

[0054] If there is no target in the first image to be identified or the second image to be identified, no subsequent operation is performed.

[0055] As an optional implementation, the first image to be recognized and the second image to be recognized may be recognized respectively by two threads, thereby improving data processing efficiency.

[0056] S3, converting the first target frame of the first recognized target into the coordinate system to which the second recognized target belongs to obtain a converted target frame;

[0057] Each identified target is a data set within a target frame. For the first target frame corresponding to the first identified target, there are several points in the first target frame, and each point has coordinates and is located in the coordinate system to which the first target frame belongs. Similarly, the second identified target belongs to another coordinate system. The relationship between the two coordinate systems can be established by measuring the relative positions of the two cameras in advance to establish a conversion relationship.

[0058] All points in the first target frame are mapped to the coordinate system of the second recognition target with reference to the conversion relationship to obtain a conversion target frame. This conversion needs to be performed on all first recognition targets in the first image to be recognized.

[0059] S4, calculating the first similarity between each converted target frame and the second target frames of all second recognized targets, and obtaining the second target frame corresponding to the first target frame by using a matching algorithm according to the first similarity and a preset similarity threshold;

[0060] For each conversion target frame, the first similarity between it and the second target frames corresponding to all the second recognition targets is calculated. As an optional implementation, for each conversion target frame, the IOU value between it and all the second target frames is calculated as the similarity.

[0061] Afterwards, a global match is performed based on the similarity using the Hungarian algorithm, and the two target frames whose similarity is greater than a preset similarity threshold (80% in this embodiment) are regarded as successfully matched target frames. The conversion target frame successfully matches the second target frame, that is, the first target frame corresponding to the conversion target frame successfully matches the second target frame, and the targets in the matched first target frame and the corresponding second target frame are the same target.

[0062] S5, performing target tracking based on the first identified target and the third identified target corresponding to the PTZ camera at the previous moment, performing target tracking based on the second identified target and the fourth identified target corresponding to the fixed camera at the previous moment, and assigning a unique target ID to the same identified target;

[0063] For the third recognized target captured by the PTZ camera at the previous moment, the Hungarian algorithm is used to match the first recognized target at the current moment to track the target frame.

[0064] For the fourth recognized target captured by the fixed camera at the previous moment, the Hungarian algorithm is used to match the second recognized target at the current moment to track the target frame.

[0065] For the first target frame that successfully matches at the current moment and the identified target in the corresponding second target frame, the identified targets in the two target frames are considered to be the same target. For the third identified target that completes target tracking and the corresponding first identified target, they are considered to be the same target. For the fourth identified target that completes target tracking and the corresponding second identified target, they are considered to be the same target. Assign a unique target ID to the same target to ensure that the same target in different cameras and at different times has the same identification, which is convenient for subsequent reporting and verification.

[0066] S6. Perform information recognition on the first target frame and the second target frame of the same target ID to obtain target related information.

[0067] For the first target frame and the second target frame of the same target ID, a pre-trained model is used to perform information recognition to collect the data required for monitoring. The target related information includes: life jacket information, ship license information, ship height information, load information, etc.

[0068] As an optional implementation, Figure 2 is a flow chart of a coordinate conversion method provided by an embodiment of the present invention. Figure 2 As shown, converting the first target frame of the first recognized target to the coordinate system to which the second recognized target belongs includes:

[0069] S301, determining a first rotation matrix according to the lateral angle of the pan / tilt camera relative to the fixed camera;

[0070] Since the pan-tilt camera and the fixed camera are set at different positions, the coordinate systems of the images collected by the two are different, so the coordinate conversion relationship needs to be determined.

[0071] Predetermine the lateral angle of the pan-tilt camera relative to the fixed camera θx , the lateral angle θx is the horizontal rotation angle, and the first rotation matrix of the coordinate transformation is determined according to the horizontal rotation angle Rx .

[0072] S302, determining a second rotation matrix according to the longitudinal angle of the pan / tilt camera relative to the fixed camera;

[0073] Predetermine the vertical angle of the PTZ camera relative to the fixed camera θy , the longitudinal angle θy is the vertical or pitch rotation angle, and the second rotation matrix of the coordinate transformation is determined according to the vertical or pitch rotation angle R .

[0074] S303, defining a translation vector according to the position of the pan / tilt camera and the position of the fixed camera;

[0075] Define a translation vector by the coordinates of the gimbal camera and the fixed camera , the translation vector is the translation of the gimbal camera relative to the fixed camera.

[0076] S304. For any point in the first target frame, obtain the corresponding point of the point in the coordinate system to which the second recognized target belongs according to the first rotation matrix, the second rotation matrix and the translation vector.

[0077] For each first target frame, each point therein is rotated according to the first rotation matrix and the second rotation matrix and then translated according to the translation vector to obtain the corresponding point of each point in the second identified target coordinate system. When all points in the first target frame are transformed, the transformed target frame is obtained.

[0078] As an optional implementation, the first rotation matrix is ​​determined according to the lateral angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula:

[0079] ;

[0080] in, θx is the horizontal angle;

[0081] The second rotation matrix is ​​determined according to the longitudinal angle of the gimbal camera relative to the fixed camera and is calculated by the following formula:

[0082] ;

[0083] in, θy is the longitudinal angle;

[0084] For any point in the first target frame, the corresponding point of the point in the coordinate system of the second recognition target is obtained according to the first rotation matrix, the second rotation matrix and the translation vector, and is calculated by the following formula:

[0085]

[0086] in, , is a point in the first target box, for The corresponding point in the coordinate system of the second recognition target, is the translation vector.

[0087] As an optional implementation, Figure 3 is a flow chart of a target tracking method provided by an embodiment of the present invention. Figure 3 As shown, target tracking is performed according to the first recognized target and the third recognized target corresponding to the PTZ camera at the previous moment, including:

[0088] S501, predicting a first predicted target frame of a third recognized target at the current moment;

[0089] The state of the third recognized target at the previous moment is predicted according to its motion state at the previous moment to obtain a first predicted target frame.

[0090] Specifically, the target frame corresponding to the third recognized target may be predicted according to the state transfer equation to obtain a first predicted target frame.

[0091] S502, calculating the second similarity between each first target frame and all first predicted target frames, and obtaining the first predicted target frame corresponding to the first target frame by using a matching algorithm according to the second similarity and a preset threshold;

[0092] For each first target frame, calculate its second similarity (for example, IOU value) with all first predicted target frames, and perform global matching using the Hungarian matching algorithm based on the second similarity and a preset threshold to obtain the first predicted target frame corresponding to the first target frame. The identified targets corresponding to the two target frames are the same identified targets and can share the same target ID.

[0093] Tracking the target according to the second recognized target and the fourth recognized target corresponding to the fixed camera at the previous moment includes:

[0094] S503, predicting a second predicted target frame of the fourth recognized target at the current moment;

[0095] The state of the fourth recognized target at the previous moment is predicted based on its state to obtain a second predicted target frame.

[0096] Specifically, the target frame corresponding to the fourth recognized target may be predicted according to the state transfer equation to obtain a second predicted target frame.

[0097] S504: Calculate the third similarity between each second target frame and all second predicted target frames, and use a matching algorithm according to the third similarity and a preset threshold to obtain a second predicted target frame corresponding to the second target frame.

[0098] For each second target frame, calculate its third similarity (for example, IOU value) with all second predicted target frames, and perform global matching using the Hungarian matching algorithm based on the third similarity and a preset threshold to obtain the second predicted target frame corresponding to the second target frame. The identified targets corresponding to the two target frames are the same identified targets and can share the same target ID.

[0099] The above is the case of successful matching. For target frames that are not successfully matched, the number of frames that are not successfully matched can be accumulated. If a certain number is reached, it is considered that the target corresponding to the target frame has left the detection range.

[0100] In addition, after completing target tracking at each moment, the target status (such as position, speed, direction, etc.) needs to be updated to prepare for the matching of the next frame.

[0101] As an optional implementation, Figure 4 is a flow chart of a method for identifying relevant information provided by an embodiment of the present invention. Figure 4 As shown, information recognition is performed on the first target frame and the second target frame of the same target ID to obtain target related information, including:

[0102] S601, using a preset life jacket recognition model to respectively recognize the first target frame and the second target frame of the same target ID, and fusing the recognition results to obtain target life jacket information;

[0103] S602: Use a preset license plate recognition model to respectively recognize the first target frame and the second target frame of the same target ID, and merge the recognition results to obtain the target license plate information.

[0104] The life jacket recognition model and the ship license plate recognition model are pre-trained. Both models can be obtained by training the neural network through the collected annotated images.

[0105] By using the life jacket recognition model to recognize the image, we can get information such as whether there are people on the ship who are not wearing life jackets, or the number of people wearing life jackets. By using the ship license plate recognition model to recognize the image, we can get the ship license plate information of the ship.

[0106] The life jacket recognition model is used to perform image recognition on the first target frame and the second target frame that are matched successfully, and the recognition results of the first target frame and the second target frame are obtained. The recognition results of the two are fused to obtain the target life jacket information. The ship license plate recognition model is used to perform image recognition on the first target frame and the second target frame that are matched successfully, and the recognition results of the first target frame and the second target frame are obtained. The recognition results of the two are fused to obtain the target ship license plate information.

[0107] During the fusion process, the two results may be the same or different. If the results are the same, the common result will be used as the target ship license result. If the two recognition results are different, a selection needs to be made. There are many ways to make the selection: for example, adding a confidence mechanism during the model training process, each target box recognition result has a corresponding confidence level, and during the fusion, the recognition result with a larger confidence level is selected as the final recognition result; or, the selection is made through manual intervention.

[0108] In addition, during the target tracking process, each frame can be identified and the most reliable result can be selected as the final result; the identification result of one of the frames can also be selected as the final result, for example, the corresponding identification result of the middle frame of the relevant frames of a certain target can be selected as the final result.

[0109] The target-related information and related images are sent to the front end for display through a private protocol to complete target detection.

[0110] The embodiment of the present invention also provides a water bayonet detection system based on a drone. Figure 5 FIG. 1 is a schematic diagram of a water bayonet detection system based on a drone according to an embodiment of the present invention. Figure 5As shown, the system includes:

[0111] The image acquisition module 100 is used to acquire a first image to be recognized captured by the pan-tilt camera and a second image to be recognized captured by the fixed camera at the current moment;

[0112] Plan the route for the drone in advance. The preset route should cover as much area as possible and ensure that there are no obstructions or obstacles within the preset route. The program controls the drone to take off and enter the preset route to start data collection.

[0113] The latitude and longitude information of the drone's location is used to determine the location of the river, and the drone's flight attitude is adjusted according to the location of the river, so that the shooting frame of the gimbal camera is as perpendicular to the river as possible, so as to reduce subsequent data collection errors and ensure that clear, no-blind-angle image data can be obtained during navigation.

[0114] During the flight of the drone, the gimbal camera is installed on a rotatable gimbal, which can flexibly adjust the angle to shoot images at different angles. The fixed camera shoots at a fixed angle, and both cameras shoot continuously. At a certain moment, the gimbal camera will acquire a frame of image, and the fixed camera will also acquire a frame of image. According to the timestamp, the first image to be identified and the second image to be identified collected at the same time can be obtained.

[0115] The first image to be identified captured by the PTZ camera and the second image to be identified captured by the fixed camera can be preprocessed to improve image quality. As an optional implementation, the preprocessing method includes denoising, contrast enhancement, distortion correction, etc.

[0116] The target recognition module 200 is used to recognize the first image to be recognized by using the target recognition model to obtain a first recognized target; and recognize the second image to be recognized by using the target recognition model to obtain a second recognized target;

[0117] Pre-train the target recognition model. For the target recognition model, some images can be collected by drones in advance, and the images can be annotated as a labeled training set. The labeled training set is used to train a neural network for image target detection, that is, the target recognition model.

[0118] The target recognition model is used to perform target recognition on the first image to be recognized to obtain a first recognized target. There may be one or more first recognized targets in the first image to be recognized.

[0119] The target recognition model is used to perform target recognition on the second image to be recognized to obtain a second recognized target. There may be one or more second recognized targets in the second image to be recognized.

[0120] If there is no target in the first image to be identified or the second image to be identified, no subsequent operation is performed.

[0121] As an optional implementation, the first image to be recognized and the second image to be recognized may be recognized respectively by two threads, thereby improving data processing efficiency.

[0122] A conversion module 300 is used to convert a first target frame of a first recognized target into a coordinate system to which a second recognized target belongs, to obtain a converted target frame;

[0123] Each identified target is a data set within a target frame. For the first target frame corresponding to the first identified target, there are several points in the first target frame, and each point has coordinates and is located in the coordinate system to which the first target frame belongs. Similarly, the second identified target belongs to another coordinate system. The relationship between the two coordinate systems can be established by measuring the relative positions of the two cameras in advance to establish a conversion relationship.

[0124] All points in the first target frame are mapped to the coordinate system of the second recognition target with reference to the conversion relationship to obtain a conversion target frame. This conversion needs to be performed on all first recognition targets in the first image to be recognized.

[0125] A matching module 400 is used to calculate a first similarity between each conversion target frame and the second target frames of all second recognition targets, and obtain a second target frame corresponding to the first target frame by using a matching algorithm according to the first similarity and a preset similarity threshold;

[0126] For each conversion target frame, the first similarity between it and the second target frames corresponding to all the second recognition targets is calculated. As an optional implementation, for each conversion target frame, the IOU value between it and all the second target frames is calculated as the similarity.

[0127] Afterwards, a global match is performed based on the similarity using the Hungarian algorithm, and the two target frames whose similarity is greater than a preset similarity threshold (80% in this embodiment) are regarded as successfully matched target frames. The conversion target frame successfully matches the second target frame, that is, the first target frame corresponding to the conversion target frame successfully matches the second target frame, and the targets in the matched first target frame and the corresponding second target frame are the same target.

[0128] The target tracking module 500 is used to track the target according to the first identified target and the third identified target corresponding to the PTZ camera at the previous moment, and to track the target according to the second identified target and the fourth identified target corresponding to the fixed camera at the previous moment, and to assign a unique target ID to the same identified target;

[0129] For the third recognized target captured by the PTZ camera at the previous moment, the Hungarian algorithm is used to match the first recognized target at the current moment to track the target frame.

[0130] For the fourth recognized target captured by the fixed camera at the previous moment, the Hungarian algorithm is used to match the second recognized target at the current moment to track the target frame.

[0131] For the first target frame that successfully matches at the current moment and the identified target in the corresponding second target frame, the identified targets in the two target frames are considered to be the same target. For the third identified target that completes target tracking and the corresponding first identified target, they are considered to be the same target. For the fourth identified target that completes target tracking and the corresponding second identified target, they are considered to be the same target. Assign a unique target ID to the same target to ensure that the same target in different cameras and at different times has the same identification, which is convenient for subsequent reporting and verification.

[0132] The information identification module 600 is used to perform information identification on the first target frame and the second target frame of the same target ID to obtain target related information.

[0133] For the first target frame and the second target frame of the same target ID, a pre-trained model is used to perform information recognition to collect the data required for monitoring. The target related information includes: life jacket information, ship license information, ship height information, load information, etc.

[0134] As an optional implementation, Figure 6 is a schematic diagram of the structure of the conversion module provided by an embodiment of the present invention, such as Figure 6 As shown, the conversion module 300 includes:

[0135] The first rotation matrix calculation submodule 3001 is used to determine a first rotation matrix according to the lateral angle of the pan / tilt camera relative to the fixed camera;

[0136] Since the pan-tilt camera and the fixed camera are set at different positions, the coordinate systems of the images collected by the two are different, so the coordinate conversion relationship needs to be determined.

[0137] Predetermine the lateral angle of the pan-tilt camera relative to the fixed camera θx , the lateral angle θx is the horizontal rotation angle, and the first rotation matrix of the coordinate transformation is determined according to the horizontal rotation angle Rx .

[0138] The second rotation matrix calculation submodule 3002 is used to determine the second rotation matrix according to the longitudinal angle of the pan / tilt camera relative to the fixed camera;

[0139] Predetermine the vertical angle of the PTZ camera relative to the fixed camera θy , the longitudinal angle θy is the vertical or pitch rotation angle, and the second rotation matrix of the coordinate transformation is determined according to the vertical or pitch rotation angle R .

[0140] A translation vector determination submodule 3003 is used to define a translation vector according to the position of the pan / tilt camera and the position of the fixed camera;

[0141] Define a translation vector by the coordinates of the gimbal camera and the fixed camera , the translation vector is the translation of the gimbal camera relative to the fixed camera.

[0142] The conversion submodule 3004 is used to obtain, for any point in the first target frame, a corresponding point of the point in the coordinate system to which the second recognition target belongs according to the first rotation matrix, the second rotation matrix and the translation vector.

[0143] For each first target frame, each point therein is rotated according to the first rotation matrix and the second rotation matrix and then translated according to the translation vector to obtain the corresponding point of each point in the second identified target coordinate system. When all points in the first target frame are transformed, the transformed target frame is obtained.

[0144] As an optional implementation, the first rotation matrix is ​​determined according to the lateral angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula:

[0145] ;

[0146] in, θx is the horizontal angle;

[0147] The second rotation matrix is ​​determined according to the longitudinal angle of the gimbal camera relative to the fixed camera and is calculated by the following formula:

[0148] ;

[0149] in, θy is the longitudinal angle;

[0150] For any point in the first target frame, the corresponding point of the point in the coordinate system of the second recognition target is obtained according to the first rotation matrix, the second rotation matrix and the translation vector, and is calculated by the following formula:

[0151] ;

[0152] in, , is a point in the first target box, for The corresponding point in the coordinate system of the second recognition target, is the translation vector.

[0153] As an optional implementation, Figure 7 is a schematic diagram of the structure of the target tracking module provided by an embodiment of the present invention, such as Figure 7 As shown, the target tracking module 500 includes:

[0154] The first prediction submodule 5001 is used to predict the first predicted target frame of the third recognition target at the current moment;

[0155] The state of the third recognized target at the previous moment is predicted according to its motion state at the previous moment to obtain a first predicted target frame.

[0156] Specifically, the target frame corresponding to the third recognized target may be predicted according to the state transfer equation to obtain a first predicted target frame.

[0157] The first matching submodule 5002 is used to calculate the second similarity between each first target frame and all first predicted target frames, and obtain the first predicted target frame corresponding to the first target frame by using a matching algorithm according to the second similarity and a preset threshold;

[0158] For each first target frame, calculate its second similarity (for example, IOU value) with all first predicted target frames, and perform global matching using the Hungarian matching algorithm based on the second similarity and a preset threshold to obtain the first predicted target frame corresponding to the first target frame. The identified targets corresponding to the two target frames are the same identified targets and can share the same target ID.

[0159] The second prediction submodule 5003 is used to predict a second predicted target frame of the fourth recognized target at the current moment;

[0160] The state of the fourth recognized target at the previous moment is predicted based on its state to obtain a second predicted target frame.

[0161] Specifically, the target frame corresponding to the fourth recognized target may be predicted according to the state transfer equation to obtain a second predicted target frame.

[0162] The second matching submodule 5004 is used to calculate the third similarity between each second target frame and all second predicted target frames, and obtain the second predicted target frame corresponding to the second target frame by using a matching algorithm according to the third similarity and a preset threshold.

[0163] For each second target frame, calculate its third similarity (for example, IOU value) with all second predicted target frames, and perform global matching using the Hungarian matching algorithm based on the third similarity and a preset threshold to obtain the second predicted target frame corresponding to the second target frame. The identified targets corresponding to the two target frames are the same identified targets and can share the same target ID.

[0164] The above is the case of successful matching. For target frames that are not successfully matched, the number of frames that are not successfully matched can be accumulated. If a certain number is reached, it is considered that the target corresponding to the target frame has left the detection range.

[0165] In addition, after completing target tracking at each moment, the target status (such as position, speed, direction, etc.) needs to be updated to prepare for the matching of the next frame.

[0166] As an optional implementation, Figure 8 is a schematic diagram of the structure of the information identification module provided by an embodiment of the present invention, such as Figure 8 As shown, the information identification module 600 includes:

[0167] The life jacket information recognition submodule 6001 is used to respectively recognize the first target frame and the second target frame of the same target ID using a preset life jacket recognition model, and fuse the recognition results to obtain the target life jacket information;

[0168] The license plate information recognition submodule 6002 is used to use a preset license plate recognition model to respectively recognize the first target frame and the second target frame of the same target ID, and fuse the recognition results to obtain the target license plate information.

[0169] The life jacket recognition model and the ship license plate recognition model are pre-trained. Both models can be obtained by training the neural network through the collected annotated images.

[0170] By using the life jacket recognition model to recognize the image, we can get information such as whether there are people on the ship who are not wearing life jackets, or the number of people wearing life jackets. By using the ship license plate recognition model to recognize the image, we can get the ship license plate information of the ship.

[0171] The life jacket recognition model is used to perform image recognition on the first target frame and the second target frame that are matched successfully, and the recognition results of the first target frame and the second target frame are obtained. The recognition results of the two are fused to obtain the target life jacket information. The ship license plate recognition model is used to perform image recognition on the first target frame and the second target frame that are matched successfully, and the recognition results of the first target frame and the second target frame are obtained. The recognition results of the two are fused to obtain the target ship license plate information.

[0172] During the fusion process, the two results may be the same or different. If the results are the same, the common result will be used as the target ship license result. If the two recognition results are different, a selection needs to be made. There are many ways to make the selection: for example, adding a confidence mechanism during the model training process, each target box recognition result has a corresponding confidence level, and during the fusion, the recognition result with a larger confidence level is selected as the final recognition result; or, the selection is made through manual intervention.

[0173] In addition, during the target tracking process, each frame can be identified and the most reliable result can be selected as the final result; the identification result of one of the frames can also be selected as the final result, for example, the corresponding identification result of the middle frame of the relevant frames of a certain target can be selected as the final result.

[0174] The target-related information and related images are sent to the front end for display through a private protocol to complete target detection.

[0175] The above technical solution has the following beneficial effects: using drone inspections instead of manual inspections saves costs, reduces visual blind spots, and improves the reliability of collected information; by matching the images of the pan-tilt camera with the images of the fixed camera, images of the same target from different perspectives are created, and these images are identified to avoid unreliable information caused by visual blind spots, thereby improving the comprehensiveness of image acquisition and improving the effectiveness and reliability of the identified information.

[0176] The specific implementation methods of the above invention further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above content is only the specific implementation methods of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A water bayonet detection method based on drone, characterized in that: include: Obtain the first image to be identified captured by the pan / tilt camera and the second image to be identified captured by the fixed camera at the current moment; Using the target recognition model to recognize the first image to be recognized, to obtain a first recognized target; using the target recognition model to recognize the second image to be recognized, to obtain a second recognized target; Converting a first target frame of the first recognized target to a coordinate system to which the second recognized target belongs to obtain a converted target frame; The converting the first target frame of the first identified target to the coordinate system of the second identified target includes: determining a first rotation matrix according to the lateral angle of the pan-tilt camera relative to the fixed camera, and calculating by the following formula: Wherein, θx is the lateral angle; the second rotation matrix is ​​determined according to the longitudinal angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula: Wherein, θy is the longitudinal angle; the translation vector is defined according to the position of the pan-tilt camera and the position of the fixed camera; for any point in the first target frame, the corresponding point of the point in the coordinate system of the second identified target is obtained according to the first rotation matrix, the second rotation matrix and the translation vector, and is calculated by the following formula: Where R = R x R y , is a point in the first target box, for The corresponding point in the coordinate system of the second recognition target, is the translation vector; Calculating a first similarity between each converted target frame and the second target frames of all second recognized targets, and obtaining a second target frame corresponding to the first target frame by using a matching algorithm according to the first similarity and a preset similarity threshold; Tracking the target based on the first identified target and the third identified target corresponding to the PTZ camera at the previous moment, tracking the target based on the second identified target and the fourth identified target corresponding to the fixed camera at the previous moment, and assigning a unique target ID to the same identified target; The first target frame and the second target frame of the same target ID are identified to obtain target related information.

2. The method for detecting water bayonet based on drone according to claim 1, characterized in that: The target tracking according to the first recognized target and the third recognized target corresponding to the pan / tilt camera at the previous moment includes: Predicting a first predicted target frame of the third recognized target at the current moment; Calculating a second similarity between each first target frame and all first predicted target frames, and obtaining a first predicted target frame corresponding to the first target frame by using a matching algorithm according to the second similarity and a preset threshold; The target tracking according to the second recognized target and the fourth recognized target corresponding to the fixed camera at the previous moment includes: Predicting a second predicted target frame of the fourth recognized target at the current moment; A third similarity between each second target frame and all second predicted target frames is calculated, and a matching algorithm is used according to the third similarity and a preset threshold to obtain a second predicted target frame corresponding to the second target frame.

3. The method for detecting water bayonet based on drone according to claim 1, characterized in that: The information identification of the first target frame and the second target frame of the same target ID to obtain target related information includes: The preset life jacket recognition model is used to respectively recognize the first target frame and the second target frame of the same target ID, and the recognition results are fused to obtain the target life jacket information; The preset license plate recognition model is used to recognize the first target frame and the second target frame of the same target ID respectively, and the recognition results are fused to obtain the target license plate information.

4. A water bayonet detection system based on drone, characterized in that: include: An image acquisition module, used to acquire a first image to be recognized captured by the pan-tilt camera and a second image to be recognized captured by the fixed camera at the current moment; A target recognition module, configured to recognize the first image to be recognized by using a target recognition model to obtain a first recognized target; and recognize the second image to be recognized by using the target recognition model to obtain a second recognized target; A conversion module, used for converting the first target frame of the first recognized target into the coordinate system to which the second recognized target belongs, to obtain a converted target frame; The conversion module includes: a first rotation matrix calculation submodule, which is used to determine the first rotation matrix according to the lateral angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula: Wherein, θx is the lateral angle; the second rotation matrix calculation submodule is used to determine the second rotation matrix according to the longitudinal angle of the pan-tilt camera relative to the fixed camera, and is calculated by the following formula: Wherein, θy is the longitudinal angle; the translation vector determination submodule is used to define the translation vector according to the position of the pan / tilt camera and the position of the fixed camera; the conversion submodule is used to obtain the corresponding point of any point in the first target frame in the coordinate system to which the second recognition target belongs according to the first rotation matrix, the second rotation matrix and the translation vector, and calculate it by the following formula: Where R = R x R y , is a point in the first target box, for The corresponding point in the coordinate system of the second recognition target, is the translation vector; A matching module, used to calculate a first similarity between each conversion target frame and the second target frames of all second recognition targets, and to obtain a second target frame corresponding to the first target frame by using a matching algorithm according to the first similarity and a preset similarity threshold; A target tracking module is used to track a target based on the first identified target and a third identified target corresponding to the PTZ camera at the previous moment, and to track a target based on the second identified target and a fourth identified target corresponding to the fixed camera at the previous moment, and to assign a unique target ID to the same identified target; The information identification module is used to perform information identification on the first target frame and the second target frame of the same target ID to obtain target related information.

5. The water bayonet detection system based on drone according to claim 4 is characterized in that: The target tracking module comprises: A first prediction submodule, used to predict a first predicted target frame of the third recognized target at a current moment; A first matching submodule is used to calculate a second similarity between each first target frame and all first predicted target frames, and to obtain a first predicted target frame corresponding to the first target frame by using a matching algorithm according to the second similarity and a preset threshold; A second prediction submodule, used to predict a second predicted target frame of the fourth recognized target at the current moment; The second matching submodule is used to calculate the third similarity between each second target frame and all second predicted target frames, and to obtain the second predicted target frame corresponding to the second target frame by using a matching algorithm according to the third similarity and a preset threshold.

6. The water bayonet detection system based on drone according to claim 4 is characterized in that: The information identification module comprises: The life jacket information recognition submodule is used to respectively recognize the first target frame and the second target frame of the same target ID using a preset life jacket recognition model, and fuse the recognition results to obtain the target life jacket information; The license plate information recognition submodule is used to use a preset license plate recognition model to respectively recognize the first target frame and the second target frame of the same target ID, and fuse the recognition results to obtain the target license plate information.