Method, device, electronic device and readable storage medium for identifying approaching peripheral vessels
By acquiring multiple images of peripheral ships, determining the motion trajectory and identifying the target area, the problem of infrared sensors and radars being susceptible to interference is solved, and accurate judgment of the proximity of peripheral ships and illegal personnel detection are achieved.
Patent Information
- Application Number
- CN202411046993.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-08-01
AI Technical Summary
In the prior art, infrared sensors and radars are susceptible to interference when detecting whether two ships are approaching unexpectedly, resulting in inaccurate detection results.
By obtaining multiple images of peripheral ships, the motion trajectory of peripheral ships is determined, and the target area is identified. Geometric fitting and linear fitting are used to determine whether the peripheral ship is approaching the target ship, and based on the detection of the edge of the deck, whether there are outsiders entering.
It achieves an accurate judgment on whether the peripheral ship is approaching the target ship, and can promptly identify illegal personnel entering, improving safety and accuracy.
Smart Images

Figure CN119006520B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to a method, device, electronic device and readable storage medium for identifying the approach of peripheral ships. Background Art
[0002] In the vast ocean environment, ships face various safety threats, and many safety incidents involve two ships approaching each other unexpectedly in the early stage. If the unexpected approach of two ships can be detected in a timely and accurate manner, early intervention and prevention can be carried out to lift the safety threat in time.
[0003] The prior art usually uses infrared sensors, radars, etc. to detect whether two ships approach each other unexpectedly. However, infrared sensors and radars are easily interfered with, resulting in inaccurate detection results. For example, infrared sensors are easily interfered with by other heat sources, and radars are easily interfered with by other electronic devices. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device, electronic device and readable storage medium for identifying the approach of peripheral ships, which can accurately determine whether a peripheral ship approaches a target ship.
[0005] Embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, the present invention provides a method for identifying the approach of peripheral ships, the method comprising:
[0007] Obtain multiple images of peripheral ships, where the multiple images of peripheral ships are images including a target ship and peripheral ships within a preset sea area range of the target ship taken at multiple different moments within a preset time period, and the target ship is in the same position in the multiple images of peripheral ships;
[0008] Determine the movement trajectory of the peripheral ships according to the multiple images of peripheral ships;
[0009] Identify the target area of the target ship in any one of the images of peripheral ships;
[0010] Judge whether the peripheral ships approach the target ship according to the movement trajectory and the target area.
[0011] In an optional implementation manner, the step of determining the movement trajectory of the peripheral ships according to the multiple images of peripheral ships includes:
[0012] Identify the peripheral ships in each of the images of peripheral ships to obtain the image positions of the peripheral ships in each of the images of peripheral ships;
[0013] Perform geometric fitting on all the image positions to obtain the motion trajectory of the peripheral ship.
[0014] In an alternative embodiment, the step of identifying the peripheral ship in each peripheral ship image to obtain the image position of the peripheral ship in each peripheral ship image includes:
[0015] Identify the peripheral ship in each peripheral ship image and determine the rectangular area where the peripheral ship is located in each peripheral ship image;
[0016] Take the center point coordinates of the rectangular area in each peripheral ship image as the image position of the peripheral ship in each peripheral ship image.
[0017] In an alternative embodiment, there are multiple preset points on the edge of the target ship, and the step of identifying the target area of the target ship in any one of the peripheral ship images includes:
[0018] Determine the pixel points corresponding to each preset point in any one of the peripheral ship images;
[0019] Connect the multiple pixel points in sequence to obtain multiple reference lines, and the multiple reference lines are connected end to end in sequence to form a target frame, and the area enclosed by the target frame is the target area.
[0020] In an alternative embodiment, the motion trajectory is a straight line, and the target area is the area enclosed by a target frame formed by connecting multiple reference lines end to end in sequence. The step of determining whether the peripheral ship approaches the target ship according to the motion trajectory and the target area includes:
[0021] If the angle between the motion trajectory and any one of the reference lines is within a preset angle range, it is determined that the peripheral ship approaches the target ship; otherwise, it is determined that the peripheral ship does not approach the target ship.
[0022] In an alternative embodiment, the method further includes:
[0023] If the peripheral ship approaches the target ship, detect whether there are foreign personnel crossing the deck edge of the target ship;
[0024] If there are foreign personnel crossing the deck edge of the target ship, it is determined that there are illegal personnel entering the target ship.
[0025] In an alternative embodiment, the step of detecting whether there are foreign personnel crossing the deck edge of the target ship includes:
[0026] Obtain a pedestrian image captured by a pedestrian on the deck of the target ship, where the pedestrian image includes a deck area;
[0027] Identify the pedestrian image to obtain a pedestrian area where the pedestrian is located in the pedestrian image;
[0028] If the central coordinates of the pedestrian area are within the deck area, it is determined that the pedestrian has crossed the deck edge of the target ship;
[0029] When it is determined that the pedestrian has crossed the deck edge of the target ship, extract features from the pedestrian area to obtain pedestrian features;
[0030] If the pedestrian features do not match the preset crew features, it is determined that an outsider has crossed the deck edge of the target ship.
[0031] In a second aspect, the present invention provides a peripheral ship approaching recognition device, and the device includes:
[0032] An acquisition module, configured to acquire multiple peripheral ship images, where the multiple peripheral ship images are images including the target ship and peripheral ships within a preset sea area range of the target ship captured at multiple different times within a preset time period, and the target ship is in the same position in the multiple peripheral ship images;
[0033] A determination module, configured to determine the movement trajectory of the peripheral ship according to the multiple peripheral ship images;
[0034] An identification module, configured to identify a target area of the target ship in any one of the peripheral ship images;
[0035] A judgment module, configured to judge whether the peripheral ship is approaching the target ship according to the movement trajectory and the target area.
[0036] In a third aspect, the present invention provides an electronic device, including a processor and a memory, where the memory is used to store a program, and the processor is configured to implement the peripheral ship approaching recognition method according to any one of the foregoing embodiments when executing the program.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the peripheral ship approaching recognition method according to any one of the foregoing embodiments is implemented.
[0038] The present invention first takes multiple images including a target ship and peripheral ships within a preset sea area range of the target ship at multiple different moments within a preset time period. The target ship is in the same position in multiple images of the peripheral ships. Then, it determines the movement trajectories of the peripheral ships based on the multiple images of the peripheral ships, identifies the target area of the target ship in any image of the peripheral ships, and finally determines whether the peripheral ships are approaching the target ship according to the movement trajectories and the target area. By determining the movement trajectories of the peripheral ships and the target area of the target ship in the images of the peripheral ships through multiple images, it can accurately determine whether the peripheral ships are approaching the target ship. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative efforts.
[0040] Figure 1 It is an example diagram of the application scenario provided in this embodiment.
[0041] Figure 2 It is a flowchart example diagram of the method for identifying the approach of peripheral ships provided in this embodiment.
[0042] Figure 3 It is an example diagram of the image position of the peripheral ships provided in this embodiment.
[0043] Figure 4 It is an example diagram of the change in the image position of the peripheral ships provided in this embodiment.
[0044] Figure 5 It is an example diagram of the movement trajectory of the peripheral ships provided in this embodiment.
[0045] Figure 6 It is an example diagram of the included angle between the movement trajectory and the reference line provided in this embodiment.
[0046] Figure 7 It is a block diagram example diagram of the device for identifying the approach of peripheral ships provided in this embodiment.
[0047] Figure 8 It is a block diagram example diagram of the electronic device provided in this embodiment.
[0048] Icons: 10 - Electronic device; 11 - Processor; 12 - Memory; 13 - Bus; 100 - Device for identifying the approach of peripheral ships; 110 - Acquisition module; 120 - Determination module; 130 - Identification module; 140 - Judgment module. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Components of the embodiments of the present invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0051] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0052] In the description of the present invention, it should be noted that if terms such as "upper", "lower", "inner", "outer", etc. are used to indicate the orientation or positional relationship, it is based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of the present invention is usually placed during use. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention.
[0053] In addition, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0054] It should be noted that, without conflict, the features in the embodiments of the present invention can be combined with each other.
[0055] Please refer to Figure 1 , Figure 1 which is an example diagram of the application scenario provided for this embodiment. Figure 1 In it, a camera device is installed at a fixed position of the target ship, that is, the relative position of the camera device and the target ship is fixed, and the position of the target ship in the picture taken by the camera device is fixed. By performing real-time detection on the ships in the pictures taken by the camera device, the peripheral ships within the preset sea area of the target ship can be identified. By tracking the peripheral ships in the images taken at multiple different times within a preset time period, the movement trajectories of the peripheral ships can be identified. Further, based on the movement trajectories of the peripheral ships and the position of the target ship in the pictures taken by the camera device, it can be determined whether the peripheral ships are approaching the target ship.
[0056] In this embodiment, the current application scenario can be further expanded based on the result of whether the peripheral ship approaches the target ship. For example, when it is detected that the peripheral ship approaches the target ship, pedestrians are further detected in real time, the detected pedestrians are tracked, and the movement trajectories of the pedestrians are analyzed. Whether the pedestrians cross the edge area of the deck of the target ship is judged according to the movement trajectories of the pedestrians. When it is determined that the pedestrians cross the deck of the target ship, the appearance features of the pedestrians crossing the deck are analyzed. If their appearance features do not match the work uniform features of the crew members of the target ship, it is determined that the pedestrians are outsiders. When the peripheral ship approaches the target ship, there are pedestrians crossing the edge area of the deck of the target ship, and the pedestrians are outsiders, it can be determined that there are illegal persons entering the target ship, and there is a safety risk for the target ship.
[0057] It should be noted that the peripheral ship approaching recognition method provided by the embodiment of the present invention and its extension to the recognition method can be applied not only to scenarios such as detecting illegal persons on large ships such as commercial cargo ships and cruise ships, but also extended to fields such as offshore oil platforms and port security monitoring.
[0058] Next, the peripheral ship approaching recognition method will be introduced in detail as a starting point.
[0059] Please refer to Figure 2 , Figure 2 which is a flowchart example of the peripheral ship approaching recognition method provided by this embodiment. The method includes the following steps:
[0060] Step S101, obtain multiple peripheral ship images. The multiple peripheral ship images are images including the target ship and peripheral ships within the preset sea area range of the target ship taken at multiple different moments within a preset time period, and the target ship is in the same position in the multiple peripheral ship images.
[0061] In this embodiment, multiple peripheral ship images can be captured at preset intervals within a preset time period when peripheral ships are detected within a preset sea area range. The preset interval can be set according to the needs of the actual scenario. For example, the preset interval can be set according to the traveling speed of the peripheral ships or the speed of change in the relative position between the peripheral ships and the target ship. When the traveling speed of the peripheral ships is relatively fast or the speed of change in the relative position is relatively fast, the preset interval can be set shorter to timely detect changes in the movement trajectories of the peripheral ships. Otherwise, the preset interval can be set longer to reduce the number of images that need to be analyzed. For example, after detecting a peripheral ship at 10:00, the preset interval is set to 5 minutes, that is, a peripheral ship image is captured every 5 minutes. As another implementation manner, the number of peripheral ship images can also be preset according to actual needs, and based on the preset number, multiple shooting times within the preset time period are determined. For example, the preset number is 20, and the preset time period is 40 minutes. After detecting a peripheral ship at 10:00, one image is captured every 2 minutes, and a total of 20 images are captured in 40 minutes.
[0062] In this embodiment, detecting whether there are peripheral ships within the preset sea area range can be achieved by using a target recognition algorithm to identify in real time whether there are peripheral ships in the peripheral ship images. The target recognition algorithm includes, but is not limited to, the YOLO (You Only Look Once) algorithm, the DETR (Detection Transformer) algorithm, etc.
[0063] Step S102: Determine the movement trajectory of the peripheral ship according to multiple peripheral ship images.
[0064] In this embodiment, since the peripheral ships are constantly moving, the positions of the peripheral ships in each peripheral ship image are also constantly changing, and their change trajectories can reflect the movement trajectories of the peripheral ships. Therefore, the movement trajectories of the peripheral ships can be determined according to the position changes of the peripheral ships in the peripheral ship images.
[0065] It should be noted that in the actual application scenario, there may be a situation where multiple peripheral ships approach the target ship simultaneously. At this time, it is necessary to track each identified peripheral ship, and the same identifier can be set for the same identified peripheral ship. Each peripheral ship is identified in multiple peripheral ship images, and then the movement trajectory of each peripheral ship is determined according to the position changes of each peripheral ship in the multiple peripheral ship images. Tracking the peripheral ships can be achieved by using a tracking algorithm. The tracking algorithm includes, but is not limited to, the deepSORT (deep Simple Online and Realtime Tracking) algorithm, the StrongSORT algorithm, the CenterTrack algorithm, etc.
[0066] Step S103: Identify the target area of the target ship in any of the peripheral ship images.
[0067] In this embodiment, since the position of the target ship is the same in multiple peripheral ship images, any peripheral ship image can be selected to identify the target ship and obtain the target area of the target ship. As an implementation method, peripheral ship images with higher clarity can also be selected, or peripheral ship images with clearer edges of the target ship in the peripheral ship images can be selected, and then the target area of the target ship therein can be identified to improve the accuracy of target area identification.
[0068] Step S104: Determine whether the peripheral ship is approaching the target ship according to the movement trajectory and the target area.
[0069] In this embodiment, the movement trajectory and the target area can be geometrically abstracted respectively, and according to the change in the relative position of the two abstracted geometric shapes, the change in the relative position between the movement trajectory and the target area can be determined to judge whether the peripheral ship is approaching the target ship.
[0070] The above method provided in this embodiment determines the movement trajectory of the peripheral ship and the target area of the target ship in the peripheral ship image through multiple peripheral ship images, and it can accurately judge whether the peripheral ship is approaching the target ship.
[0071] In this embodiment, the movement trajectory of the peripheral ship can be determined by the image position of the peripheral ship in all peripheral ship images. One implementation method is as follows:
[0072] First, identify the peripheral ship in each peripheral ship image to obtain the image position of the peripheral ship in each peripheral ship image.
[0073] In this embodiment, the image position of the peripheral ship in each peripheral ship image can be represented by the position of the rectangular area where the peripheral ship is located in each peripheral ship image. Please refer to Figure 3 , Figure 3 which is an example diagram of the image position of the peripheral ship provided in this embodiment. Figure 3 In, there are two peripheral ships: Ship 1 and Ship 2, and the rectangular areas where they are located are Area 1 and Area 2. The positions of Area 1 and Area 2 are represented by the coordinates of their upper left corner and lower right corner respectively. The position of Area 1 is represented as {(x11, y11), (x12, y12)}, and the position of Area 2 is represented as {(x21, y21), (x22, y22)}.
[0074] As Ship 1 and Ship 2 move, their image positions in each peripheral ship image will also change. Please refer to Figure 4 ,Figure 4 This is an example diagram of the image position change of the peripheral ship provided in this embodiment. Figure 4 In it, the image positions of the peripheral ship at time t1 are {(x11, y11), (x12, y12)}, the image positions at time t2 are {(x21, y21), (x22, y22)}, and the image positions at time t3 are {(x31, y31), (x32, y32)}.
[0075] In this embodiment, in addition to representing the image position of the peripheral ship in each peripheral ship image with the vertex coordinates of the rectangular area, the image position in each peripheral ship image can also be represented by the center point coordinates of the rectangular area. This embodiment provides an implementation method for obtaining the image position of the peripheral ship in each peripheral ship image taking the center point coordinates as an example:
[0076] Identify the peripheral ship in each peripheral ship image, and determine the rectangular area where the peripheral ship is located in each peripheral ship image; use the center point coordinates of the rectangular area in each peripheral ship image as the image position of the peripheral ship in each peripheral ship image.
[0077] In this embodiment, a method for determining the center point coordinates of the rectangular area is: calculate the center point coordinates of the rectangular area using the vertex coordinates of the rectangular area. For example, if the coordinates of the upper left corner and the lower right corner of the rectangular area are (x11, y11) and (x12, y12) respectively, then the corresponding center point coordinates are (x0, y0), where x0 = (x11 + x12) / 2 and y0 = (y11 + y12) / 2.
[0078] Secondly, perform geometric fitting on all image positions to obtain the motion trajectory of the peripheral ship.
[0079] In this embodiment, the geometric fitting can be linear fitting, that is, use the image positions for linear fitting to obtain that the motion trajectory is a straight line, and the linear fitting can be implemented using a linear regression algorithm. Please refer to Figure 5 , Figure 5 This is an example diagram of the running trajectory of the peripheral ship provided in this embodiment. Figure 5 In it, the center point coordinates of the rectangular frames where the peripheral ship is located in the three images are: (x10, y10), (x20, y20), (x30, y30). Perform linear fitting on these three center point coordinates, and the obtained motion trajectory is a straight line, as shown by the dotted line in Figure 5 .
[0080] It should be noted that in addition to linear fitting, other methods of geometric fitting can also be used, such as piecewise fitting, where each segment corresponds to a straight line or an arc, etc.
[0081] In an alternative embodiment, in order to identify the target area of the target ship in any peripheral ship image, it is identified by a plurality of preset points on the edge of the target ship. The specific identification method is as follows:
[0082] First, determine the pixel points corresponding to each preset point in any peripheral ship image;
[0083] In this embodiment, the preset point can be a point located on the edge of the target ship and where two edges meet in a straight line.
[0084] Secondly, connect the multiple pixel points in sequence to obtain multiple reference straight lines. The multiple reference straight lines are connected end to end in sequence to form a target box, and the area enclosed by the target box is the target area.
[0085] When the target area is the area enclosed by the target box formed by connecting the multiple reference straight lines end to end in sequence and the movement trajectory is a straight line, a method for determining whether the peripheral ship approaches the target ship according to the movement trajectory and the target area is as follows:
[0086] If the angle between the movement trajectory and any reference straight line is within a preset angle range, it is determined that the peripheral ship approaches the target ship; otherwise, it is determined that the peripheral ship does not approach the target ship.
[0087] In this embodiment, the preset angle range can be set according to actual needs. For example, the preset angle range is (75°, 90°). When the angle between the movement trajectory and any reference straight line is within this preset angle range, it means that the angle between the peripheral ship and the target ship gradually approaches 90°, and then it is determined that the peripheral ship approaches the target ship; otherwise, it is determined that the peripheral ship does not approach the target ship. Please refer to Figure 6 , Figure 6 which is an example diagram of the angle between the movement trajectory and the reference straight line provided in this embodiment. Figure 6 In the reference straight lines include four straight lines AB, BC, CD, and DA. If the angle between the movement trajectory and the reference straight line AB is within the preset angle range, it is determined that the peripheral ship approaches the target ship.
[0088] Based on the recognition result that the peripheral ship approaches the target ship, this embodiment also provides an extended solution to determine whether there are illegal personnel entering the target ship. The implementation method is as follows:
[0089] First, if the peripheral ship approaches the target ship, detect whether there are foreign personnel crossing the deck edge of the target ship;
[0090] In this embodiment, an outsider is a person who logs in to the target ship without permission. It may be a passenger on the target ship or a person on a peripheral ship who illegally logs in to the target ship without permission. As an implementation method, it is possible to first detect whether there is a pedestrian crossing the deck edge of the target ship. When a pedestrian crosses the deck edge of the target ship, it is further determined whether the pedestrian is a staff member of the target ship. If not, it is determined that an illegal person has entered the target ship. Otherwise, it is a normal behavior of the staff member of the target ship. The specific implementation method is as follows:
[0091] (1) Obtain a pedestrian image of a pedestrian taken on the deck of the target ship. The pedestrian image includes the deck area;
[0092] In this embodiment, multiple shooting devices can be preset to shoot pedestrians on the deck from different angles. The shooting device for shooting pedestrians can be the same as or different from the shooting device for shooting peripheral ships. The determination method of the deck area is similar to the determination method of the target area of the target ship. It can be a target box formed by sequentially connecting the pixel points corresponding to multiple preset points on the deck edge of the target ship in the pedestrian image, and the area enclosed by the target box.
[0093] In this embodiment, the pedestrian image can also be multiple images taken at multiple different times, and each pedestrian image can include one or more pedestrians.
[0094] (2) Identify the pedestrian image to obtain the pedestrian area where the pedestrian is located in the pedestrian image;
[0095] (3) If the center coordinates of the pedestrian area are within the deck area, it is determined that the pedestrian has crossed the deck edge of the target ship;
[0096] In this embodiment, pedestrian detection is performed on the pedestrian image, and target tracking is performed on the detected pedestrians to obtain the coordinates of the pedestrians in the pedestrian images taken at each moment. The pedestrian detection can also use a target detection algorithm, and the target detection algorithm includes, but is not limited to, YOLO, DETR, etc. The algorithms used for target tracking include, but are not limited to, deepSORT algorithm, StrongSORT algorithm, CenterTrack algorithm, etc.
[0097] In this embodiment, the pedestrian area can also be a rectangular box where the pedestrian is located, and the center coordinates of the pedestrian area can also be the center point coordinates of the rectangular box.
[0098] It should be noted that there can also be multiple pedestrian images. Pedestrian detection is performed on multiple pedestrian images, and then target tracking is performed on the detected pedestrians to obtain the coordinates of the pedestrians in the pedestrian images captured at each moment. When any of the coordinates at all moments is within the deck area, it is determined that the pedestrian has crossed the deck edge of the target ship. In addition, it can also be determined that the pedestrian has crossed the deck edge of the target ship when the coordinates of the pedestrian are detected to change from outside the deck area to inside the deck area.
[0099] It should also be noted that multiple pedestrians can also be included in the pedestrian image. In this case, each pedestrian needs to be identified and tracked, and for each pedestrian, it is determined whether it has crossed the deck edge of the target ship.
[0100] (4) When it is determined that a pedestrian has crossed the deck edge of the target ship, feature extraction is performed on the pedestrian area to obtain pedestrian features;
[0101] In this embodiment, the pedestrian features can be extracted using a pre-trained pedestrian feature extraction model. The pedestrian features can be represented by a feature vector. As an implementation, the feature vector of the pedestrian features can be a 2048-dimensional vector Vector = [v0, v1, v2,......, v2047], where each element is a floating-point number of type float32. The vector Vector can be used as the unique identifier of the pedestrian area of each pedestrian.
[0102] The pedestrian feature extraction model can be trained by using pre-annotated sample pedestrian pictures as the training set through the method of metric learning. The pedestrian feature extraction model can be a model including a multi-layer convolutional neural network.
[0103] To further ensure the accuracy of the identified pedestrian features, the pedestrian area in the pedestrian image can be cropped first, and then the pedestrian feature extraction model is used to perform feature extraction on the pedestrian area to obtain the pedestrian features.
[0104] (5) If the pedestrian features do not match the preset crew features, it is determined that an outsider has crossed the deck edge of the target ship.
[0105] In this embodiment, the preset crew features can be the features of the crew members wearing the preset work uniforms extracted in advance. As an implementation, the preset crew features of all crew members wearing the preset work uniforms can be stored in the feature database, and the pedestrian features are compared one by one with the preset crew features in the feature database. If all do not match, it means that the pedestrian features do not match the preset crew features, and it is determined that an outsider has crossed the deck edge of the target ship.
[0106] In this embodiment, the preset crew characteristics can be obtained by first taking a full-body photo of a crew member wearing a preset work uniform, and then using a pedestrian feature extraction model to extract features from the full-body photo to obtain the preset crew characteristics.
[0107] As an implementation method, the method for comparing the pedestrian features with the preset crew characteristics is as follows: Calculate the similarity between the feature vectors of the pedestrian features and the preset crew characteristics. If the similarity is greater than the preset threshold, it is considered that the two match. For example, the feature vector of the pedestrian features is V = [v0, v1, v2,......, v2047], and the feature vector of the preset crew characteristics is M = [m0, m1, m2,......, m2047]. Calculate the Euclidean distance d between V and M, and the calculation formula is: where vi represents the i-th element in V, and mi represents the i-th element in M. The preset threshold can be set according to actual needs. When a higher accuracy is required, the preset threshold can be set larger. For example, the preset threshold is 0.75.
[0108] Secondly, if an outsider crosses the deck edge of the target ship, it is determined that an illegal person has entered the target ship.
[0109] To execute the corresponding steps in the above embodiment and each possible implementation method, an implementation method of the peripheral ship approaching recognition device 100 is given below. Please refer to Figure 7 , Figure 7 which is a schematic block diagram of the peripheral ship approaching recognition device provided in this embodiment. It should be noted that for the peripheral ship approaching recognition device 100 provided by the present invention, its basic principle and the generated technical effects are the same as those of the corresponding above embodiment. For the sake of brief description, some parts of this embodiment are not mentioned.
[0110] The peripheral ship approaching recognition device 100 includes an acquisition module 110, a determination module 120, an identification module 130, and a judgment module 140.
[0111] The acquisition module 110 is used to acquire multiple peripheral ship images. The multiple peripheral ship images are images containing the target ship and the peripheral ships within the preset sea area range of the target ship taken at multiple different times within a preset time period, and the target ship is in the same position in the multiple peripheral ship images;
[0112] The determination module 120 is used to determine the movement trajectory of the peripheral ship according to the multiple peripheral ship images;
[0113] The identification module 130 is used to identify the target area of the target ship in any one of the peripheral ship images;
[0114] A judgment module 140, configured to judge whether a peripheral ship approaches a target ship according to a motion trajectory and a target area.
[0115] In an optional implementation manner, the determination module 120 is specifically configured to:
[0116] Identify the peripheral ships in each peripheral ship image to obtain the image positions of the peripheral ships in each peripheral ship image;
[0117] Perform geometric fitting on all the image positions to obtain the motion trajectory of the peripheral ships.
[0118] In an optional implementation manner, when the determination module 120 is used to identify the peripheral ships in each peripheral ship image to obtain the image positions of the peripheral ships in each peripheral ship image, it is used to:
[0119] Identify the peripheral ships in each peripheral ship image to determine the rectangular areas where the peripheral ships are located in each peripheral ship image;
[0120] Take the center point coordinates of the rectangular areas in each peripheral ship image as the image positions of the peripheral ships in each peripheral ship image.
[0121] In an optional implementation manner, the recognition module 130 is specifically configured to:
[0122] Determine the pixel points corresponding to each preset point in any peripheral ship image;
[0123] Connect the multiple pixel points in sequence to obtain multiple reference straight lines. The multiple reference straight lines are connected end to end in sequence to form a target frame, and the area enclosed by the target frame is the target area.
[0124] In an optional implementation manner, the motion trajectory is a straight line, and the target area is the area enclosed by a target frame formed by connecting multiple reference straight lines end to end in sequence. The judgment module 140 is specifically configured to:
[0125] If the included angle between the motion trajectory and any reference straight line is within a preset angle range, it is determined that the peripheral ship approaches the target ship; otherwise, it is determined that the peripheral ship does not approach the target ship.
[0126] In an optional implementation manner, the judgment module 140 is further used to:
[0127] If the peripheral ship approaches the target ship, detect whether there are foreign personnel crossing the deck edge of the target ship;
[0128] If there are foreign personnel crossing the deck edge of the target ship, it is determined that there are illegal personnel entering the target ship.
[0129] In an alternative embodiment, when the determination module 140 is used to detect whether an outsider crosses the deck edge of the target ship, it is specifically configured to:
[0130] Obtain a pedestrian image captured for pedestrians on the deck of the target ship, where the pedestrian image includes a deck area;
[0131] Identify the pedestrian image to obtain a pedestrian area where the pedestrians are located in the pedestrian image;
[0132] If the central coordinates of the pedestrian area are within the deck area, it is determined that the pedestrian has crossed the deck edge of the target ship;
[0133] When it is determined that a pedestrian has crossed the deck edge of the target ship, extract features from the pedestrian area to obtain pedestrian features;
[0134] If the pedestrian features do not match the preset crew features, it is determined that an outsider has crossed the deck edge of the target ship.
[0135] An embodiment of the present invention also provides a block diagram of the electronic device 10. For the electronic device 10 to implement the peripheral ship approach recognition method in the foregoing embodiment, please refer to Figure 8 , Figure 8 This is the block diagram of the electronic device 10 provided in this embodiment. The electronic device 10 includes a processor 11, a memory 12, and a bus 13. The processor 11 and the memory 12 are connected through the bus 13.
[0136] The processor 11 may be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the peripheral ship approach recognition method in the foregoing embodiment may be completed by the integrated logic circuit in the hardware of the processor 11 or instructions in software form. The foregoing processor 11 may be a general-purpose processor, including a CPU (Central Processing Unit), an NP (Network Processor), etc.; it may also be a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Logic Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. [[ID=2,7]]
[0137] The memory 12 is used to store a program for implementing a method for identifying an approaching peripheral vessel. The program may be a software function module stored in the memory 12 in the form of software or firmware or solidified in the OS (Operating System) of the electronic device 10 .
[0138] After receiving the execution instruction, the processor 11 executes the program to implement the peripheral vessel approach recognition method of the aforementioned embodiment.
[0139] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for identifying an approaching peripheral vessel as described in any one of the aforementioned embodiments is implemented.
[0140] In summary, an embodiment of the present invention provides a method, device, electronic device and readable storage medium for identifying the approach of a peripheral ship. The method includes: acquiring multiple peripheral ship images, where the multiple peripheral ship images are images taken at multiple different times within a preset time period and include a target ship and peripheral ships within a preset sea area of the target ship, and the target ship is in the same position in the multiple peripheral ship images; determining the motion trajectory of the peripheral ship based on the multiple peripheral ship images; identifying the target area of the target ship in any peripheral ship image; and judging whether the peripheral ship is approaching the target ship based on the motion trajectory and the target area. Compared with the prior art, this embodiment has at least the following advantages: (1) by determining the motion trajectory of the peripheral ship and the target area of the target ship in the peripheral ship image through multiple peripheral ship images, it can accurately judge whether the peripheral ship is approaching the target ship; (2) the image position of the peripheral ship in the peripheral ship image is represented by the coordinates of the center point of the rectangular area where the peripheral ship is located, which can more accurately represent the motion trajectory of the peripheral ship; (3) by using whether the angle between the motion trajectory and any reference straight line is within a preset angle range, the accuracy of whether the peripheral ship is approaching the target ship is improved; (4) based on the recognition result of the peripheral ship approaching the target ship, by detecting whether there are outsiders crossing the deck edge of the target ship, it is possible to timely detect whether there are illegal personnel entering the target ship, timely identify the risks existing in the target ship, and reduce the losses caused by illegal personnel entering the target ship.
[0141] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for identifying the approach of a peripheral ship, characterized in that The method includes: Obtaining multiple peripheral ship images, where the multiple peripheral ship images are images including a target ship and peripheral ships within a preset sea area range of the target ship taken at multiple different moments within a preset time period, the target ship is in the same position in the multiple peripheral ship images, and there are multiple preset points on the edge of the target ship; Determining the movement trajectory of the peripheral ships according to the multiple peripheral ship images, where the movement trajectory is a straight line; Determining pixel points corresponding to each preset point in any one of the peripheral ship images; Sequentially connecting the multiple pixel points to obtain multiple reference straight lines, and sequentially connecting the heads and tails of the multiple reference straight lines to form a target frame, and the area enclosed by the target frame is the target area; If the included angle between the movement trajectory and any one of the reference straight lines is within a preset angle range, it is determined that the peripheral ship is approaching the target ship, otherwise it is determined that the peripheral ship is not approaching the target ship.
2. The method for identifying the approach of a peripheral ship according to claim 1, characterized in that, The step of determining the movement trajectory of the peripheral ships according to the multiple peripheral ship images includes: Identifying the peripheral ships in each of the peripheral ship images to obtain the image positions of the peripheral ships in each of the peripheral ship images; Performing geometric fitting on all the image positions to obtain the movement trajectory of the peripheral ships.
3. The peripheral ship proximity recognition method according to claim 2, characterized in that, The step of identifying the peripheral ships in each of the peripheral ship images to obtain the image positions of the peripheral ships in each of the peripheral ship images includes: Identifying the peripheral ships in each of the peripheral ship images to determine the rectangular area where the peripheral ships are located in each of the peripheral ship images; Taking the center point coordinates of the rectangular area in each of the peripheral ship images as the image positions of the peripheral ships in each of the peripheral ship images.
4. The peripheral ship proximity recognition method according to claim 1, wherein, The method further includes: If the peripheral ship is approaching the target ship, detecting whether there are foreign personnel crossing the deck edge of the target ship; If there are foreign personnel crossing the deck edge of the target ship, it is determined that there are illegal personnel entering the target ship.
5. The peripheral ship proximity recognition method according to claim 4, wherein The step of detecting whether there are foreign personnel crossing the deck edge of the target ship includes: Obtaining a pedestrian image taken of pedestrians on the deck of the target ship, where the pedestrian image includes a deck area; Identifying the pedestrian image to obtain the pedestrian area where the pedestrians are located in the pedestrian image; If the center coordinates of the pedestrian area are within the deck area, it is determined that the pedestrians cross the deck edge of the target ship; When it is determined that the pedestrians cross the deck edge of the target ship, extracting features of the pedestrian area to obtain pedestrian features; If the pedestrian features do not match the preset crew features, it is determined that there are foreign personnel crossing the deck edge of the target ship.
6. An identification device for approaching peripheral ships, characterized in that, The device includes: An acquisition module, configured to acquire multiple peripheral ship images, where the multiple peripheral ship images are images including a target ship and peripheral ships within a preset sea area range of the target ship, taken at multiple different times within a preset time period, the target ship is in the same position in the multiple peripheral ship images, and there are multiple preset points on the edge of the target ship; A determination module, configured to determine the movement trajectory of the peripheral ships according to the multiple peripheral ship images, and the movement trajectory is a straight line; An identification module, configured to determine the pixel points corresponding to each of the preset points in any one of the peripheral ship images; connect the multiple pixel points in sequence to obtain multiple reference straight lines, and the multiple reference straight lines are connected end to end in sequence to form a target frame, and the area enclosed by the target frame is the target area; A judgment module, configured to determine that the peripheral ship is approaching the target ship if the included angle between the movement trajectory and any one of the reference straight lines is within a preset angle range, otherwise determine that the peripheral ship is not approaching the target ship.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory is used to store a program, and the processor is used to implement the peripheral ship approach recognition method according to any one of claims 1-5 when executing the program.
8. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and when the computer program is executed by a processor, it implements the peripheral ship approach recognition method according to any one of claims 1-5.
Citation Information
Patent Citations
Access personnel management method and computer readable storage medium
CN112991585A
Vehicle risk avoidance method and system, vehicle and storage medium
CN116872921A
Intelligent ship collision avoidance control method and device, electronic equipment and storage medium
CN117912303A
Offshore ship situation distribution prediction method
CN118941111A