Ship draft intelligent measurement method and system based on marker template matching
By creating standardized virtual draft gauge digital templates and feature matching, and combining them with SAM2 models for interactive segmentation, the robustness and accuracy issues of ship draft measurement in existing technologies have been resolved. This has enabled high-precision, robust, automated measurement, thereby improving port operation efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN RES INST FOR WATER TRANSPORT ENG M O T
- Filing Date
- 2026-06-03
- Publication Date
- 2026-07-03
Smart Images

Figure CN122335948A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of draft measurement technology, and in particular to an intelligent method and system for measuring ship draft based on marker template matching. Background Technology
[0002] With the continuous growth of shipping trade and the deepening of port intelligent transformation and upgrading, accurate and efficient measurement of ship draft has become a key link in improving port operation efficiency, ensuring ship navigation safety, and realizing digital maritime supervision. Ship draft directly reflects the ship's cargo capacity and is the core basis for draft surveying; its measurement accuracy is related to the fairness of bulk cargo trade settlement. In recent years, the rapid development of computer vision and artificial intelligence technologies has provided a solid technical foundation for replacing traditional manual operations with non-contact and automated methods. Vision-based automatic ship draft measurement technology has become one of the important research directions in port intelligent construction, showing broad application prospects.
[0003] However, existing visual methods for measuring ship draft still face numerous technical challenges in practical applications. Specifically, traditional image processing-based methods heavily rely on manually designed features, such as edge detection and Hough transform. When faced with complex and variable port environments, including water waves, light reflection, hull fouling, and draft gauge tilt, their robustness significantly decreases, making it difficult to guarantee measurement accuracy. While deep learning-based object detection or segmentation methods improve adaptability to some extent, they require collecting and labeling massive amounts of high-quality, diverse scene data for training models, tailored to different ports and ship types. This is time-consuming, labor-intensive, and costly. Furthermore, the generalization ability of the trained models is limited, making it difficult to effectively handle novel draft gauge patterns or extreme conditions not present in the training dataset, leading to severe performance degradation in unfamiliar scenarios. In addition, the commonly used methods of directly detecting physical draft gauge markings or waterlines suffer from high requirements for the physical integrity of the draft gauge and difficulty in establishing stable and high-precision geometric mapping relationships, resulting in insufficient measurement consistency and reliability.
[0004] Therefore, there is an urgent need for a new intelligent method for measuring ship draft that can combine high precision, strong robustness, low scenario dependence, and easy deployment. Summary of the Invention
[0005] To address these issues, this invention provides a smart method and system for measuring ship draft based on marker template matching, which overcomes the problems of poor robustness and low measurement accuracy in complex environments, strong scenario dependence and insufficient generalization ability of deep learning methods, and difficulty in establishing stable and high-precision geometric mapping relationships in existing technologies.
[0006] To achieve the above objectives, the present invention provides an intelligent method for measuring ship draft based on marker template matching, comprising: S1. Create a standardized virtual water gauge digital template, which includes preset feature control points and defines the calibration relationship between the scale lines and the physical depth. S2, acquire a target image containing the actual ship draft, perform feature matching between the target image and the virtual draft digital template, and establish a coordinate mapping relationship between the virtual draft digital template and the actual draft area in the target image; S3, receive the prompt points marked on the target image, call the preset image segmentation model, segment the ship's waterline according to the prompt points, and obtain the waterline pixel coordinates; S4. Based on the coordinate mapping relationship, the draft pixel coordinates are mapped to the coordinate system of the virtual draft gauge digital template, and the ship's draft depth is calculated in combination with the calibration relationship.
[0007] Furthermore, the creation of the virtual water level gauge digital template includes adopting an n-row × 2-column feature control point selection strategy, symmetrically selecting a total of 2n feature control points on the left and right sides of the virtual water level gauge digital template, with each pair of horizontally aligned scale lines forming a row, and selecting the endpoints or center points as a pair of control points.
[0008] Furthermore, the step of performing feature matching between the target image and the virtual water gauge digital template to establish a coordinate mapping relationship between the virtual water gauge digital template and the actual water gauge region in the target image includes using a scale-invariant feature transformation algorithm to detect and match feature control points in the target image and the virtual water gauge digital template, and calculating and generating a homography matrix to establish a perspective transformation relationship between the virtual water gauge digital template and the actual water gauge region in the target image.
[0009] Furthermore, in S3, the cue points include foreground and background points; receiving the cue points marked on the target image and calling a preset image segmentation model to segment the ship's waterline based on the cue points includes: Receive foreground points marked by users at the waterline position, and background points marked at the hull position outside the waterline; The foreground and background points are used as prompts to input into the image segmentation model, which then performs segmentation based on the prompts and outputs the contour pixel coordinates of the waterline.
[0010] Furthermore, the image segmentation model is the SAM2 model, which is used to interactively segment the waterline of the ship in the target image and output the contour pixel coordinates of the waterline.
[0011] Furthermore, the step of mapping the draft pixel coordinates to the coordinate system of the virtual draft gauge digital template based on the coordinate mapping relationship, and calculating the ship's draft depth value in conjunction with the calibration relationship, includes: Take the average ordinate of the waterline pixel coordinates, and map the average ordinate to the virtual ordinate in the virtual water gauge digital template coordinate system through the coordinate mapping relationship. The draft of the vessel is calculated based on the calibration relationship between the virtual ordinate and the physical depth in the virtual draft gauge digital template.
[0012] Furthermore, after acquiring the target image containing the actual ship's draft gauge, the process also includes at least one preprocessing operation among denoising, contrast enhancement, and geometric correction of the target image.
[0013] This invention also provides an intelligent ship draft measurement system based on marker template matching, comprising: The virtual water gauge generation module is used to create a standardized virtual water gauge digital template. The virtual water gauge digital template includes preset feature control points and defines the calibration relationship between the scale lines and the physical depth. The feature matching module, connected to the virtual draft gauge generation module, is used to acquire a target image containing the actual ship draft gauge, perform feature matching between the target image and the virtual draft gauge digital template, and establish a coordinate mapping relationship between the virtual draft gauge digital template and the actual draft gauge area in the target image. The image segmentation module, connected to the feature matching module, is used to receive the cue points marked on the target image, call the preset image segmentation model, segment the ship's waterline according to the cue points, and obtain the waterline pixel coordinates. The draft depth calculation module, connected to the image segmentation module, is used to map the draft line pixel coordinates to the coordinate system of the virtual draft gauge digital template based on the coordinate mapping relationship, and calculate the ship's draft depth value in combination with the calibration relationship.
[0014] Furthermore, the system also includes a database management module for storing and managing different ships and their corresponding virtual draft gauge digital template data; The human-computer interaction module provides a graphical user interface to enable interactive annotation, intelligent measurement result visualization, and historical data query and export functions.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: Firstly, the invention creates a standardized virtual water gauge digital template and predefines the calibration relationship between the scale lines and the physical depth using an n-row × 2-column feature control point selection strategy. Then, it uses a scale-invariant feature transformation algorithm to perform feature matching between the virtual water gauge digital template and the actual water gauge in the target image, establishing a perspective transformation coordinate mapping relationship. This solves the problem in the prior art where it is difficult to establish a stable and high-precision geometric benchmark due to factors such as physical water gauge contamination, blurred scales, and tilted shooting angles. It achieves accurate registration between the virtual measurement benchmark and the physical water gauge, improving the accuracy and robustness of draft depth measurement from the source. Secondly, this invention introduces the SAM2 model as the basic model for image segmentation and uses interactive foreground and background point annotations as prompts to perform guided segmentation of the ship's waterline. This solves the problem that the existing fully automatic segmentation methods are prone to missegmentation and omissions under conditions such as complex water and air boundaries, water surface reflection, and wave interference, thus improving the accuracy and reliability of waterline segmentation. Thirdly, this invention organically combines four steps—virtual draft gauge digital template generation, feature matching mapping, interactive draft line segmentation, and coordinate conversion—to construct a complete human-machine collaborative intelligent measurement scheme. This overcomes the shortcomings of traditional methods in existing technologies, such as poor robustness and strong scenario dependence and insufficient generalization ability of deep learning methods. It achieves high-precision, robust, and low-scenario-dependent automated measurement of ship draft, thereby improving the efficiency and digitalization level of port draft gauge operations. Attached Figure Description
[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 A flowchart of the intelligent measurement method for ship draft based on marker template matching provided in this embodiment of the invention; Figure 2 The structural block diagram of the intelligent ship draft measurement system based on marker template matching provided in the embodiments of the present invention is shown. Detailed Implementation
[0018] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0019] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0020] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0021] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0022] Example 1 like Figure 1 As shown, this invention provides an intelligent method for measuring ship draft based on marker template matching, comprising: S1. Create a standardized virtual water gauge digital template, which includes preset feature control points and defines the calibration relationship between the scale lines and the physical depth. The creation of the virtual water level gauge digital template includes adopting an n-row × 2-column feature control point selection strategy, symmetrically selecting a total of 2n feature control points on the left and right sides of the virtual water level gauge digital template, with each pair of horizontally aligned scale lines forming a row, and selecting the endpoints or center points as a pair of control points.
[0023] In one possible implementation, the operator activates the virtual water level gauge generation module through a human-computer interaction interface, inputting basic parameters of the virtual water level gauge, including: measuring range (e.g., 10.0m to 11.0m), graduation interval (0.2m), template image resolution (width 400 pixels, height 800 pixels). Based on these parameters, a high-resolution digital image of the virtual water level gauge is automatically generated, clearly displaying the horizontal graduation lines and their corresponding numerical markings. The template is saved in PNG format as a standard reference for subsequent matching and calculation.
[0024] Simultaneously, an n-row × 2-column feature control point selection strategy is adopted to automatically determine the feature control points in the template and record their pixel coordinates. In this embodiment, n is set to 5, meaning 10 feature control points (5 rows × 2 columns) are selected. Specifically, on the left and right sides of the virtual water gauge digital template, the endpoints of the scale lines 10.0m, 10.2m, 10.4m, 10.6m, and 10.8m are selected as feature control points, respectively. The pixel coordinates of the five control points on the left are (xL1, y1) to (xL5, y5), and the pixel coordinates of the five control points on the right are (xR1, y1) to (xR5, y5). The vertical coordinates of each pair of left and right control points are the same, and they are located on the same horizontal scale line. The coordinate data of these 10 control points are recorded together with the corresponding scale values.
[0025] Furthermore, the calibration relationship between the scale lines of the virtual water level gauge digital template and the physical depth is established and stored. In this embodiment, the total pixel height of the virtual water level gauge digital template is 800 pixels, corresponding to a physical depth of 1.0m, and the physical depth range is from 10.0m to 11.0m, thereby determining the scaling factor to be 0.00125m / pixel.
[0026] This invention creates a standardized virtual water gauge digital template and employs an n-row × 2-column feature control point selection strategy, symmetrically selecting a total of 2n feature control points on both sides of the template. It predefines the calibration relationship between the scale lines and the physical depth, solving the problems of feature recognition difficulties and missing geometric benchmarks caused by water gauge damage, tilting, blurred scales, or inconsistent styles when relying on physical water gauges for visual measurement in the prior art. This improves the identifiability of water gauge features and the uniformity of measurement benchmarks, thereby enhancing the accuracy and robustness of calculations from the source.
[0027] S2, acquire a target image containing the actual ship draft, perform feature matching between the target image and the virtual draft digital template, and establish a coordinate mapping relationship between the virtual draft digital template and the actual draft area in the target image; Feature matching is performed on the target image and the virtual water gauge digital template to establish a coordinate mapping relationship between the virtual water gauge digital template and the actual water gauge region in the target image. This includes using a scale-invariant feature transformation algorithm to detect and match feature control points in the target image and the virtual water gauge digital template, and calculating and generating a homography matrix to establish a perspective transformation relationship between the virtual water gauge digital template and the actual water gauge region in the target image.
[0028] After acquiring the target image containing the actual ship's draft, the process also includes at least one preprocessing operation among denoising, contrast enhancement, and geometric correction on the target image.
[0029] In one possible implementation, after the virtual draft gauge digital template is created, a target image containing the actual ship's draft gauge is acquired using a high-definition camera deployed at the dock. To improve matching accuracy, the target image is first preprocessed, including Gaussian filtering for noise reduction and histogram equalization for contrast enhancement, to reduce the impact of environmental factors such as water surface reflection and water mist on image quality.
[0030] The feature matching module retrieves the virtual draft gauge digital template corresponding to the current vessel from the database, obtaining the preset 2n feature control points and their pixel coordinates from the template. A scale-invariant feature transform (SIFT) algorithm is used for feature matching. Specifically, SIFT feature point detection is performed on the target image to extract key points and their corresponding local feature descriptors. Simultaneously, the preset feature control points from the virtual draft gauge digital template are used as the set of points to be matched, and their SIFT feature descriptors are calculated. Feature matching is performed based on the Euclidean distance between the two sets of feature descriptors, and the closest valid matching point pairs that meet a preset threshold are selected. In this embodiment, 8 valid matching point pairs are successfully matched between the feature points detected from the target image and the 10 preset control points of the template.
[0031] Based on valid matching point pairs, a random sampling consensus algorithm is used to eliminate mismatched points, and a 3×3 homography matrix H is generated using at least four correct matching point pairs. The homography matrix H describes the perspective transformation relationship between the virtual water gauge digital template and the actual water gauge region in the target image, establishing a coordinate mapping relationship between the two planes. Through this coordinate mapping, the pixel coordinates of any point on the virtual water gauge digital template can be transformed to the corresponding position of the actual water gauge in the target image, providing a geometric reference for accurate superposition of the virtual and physical water gauges and subsequent draft calculations. After matching is complete, the virtual water gauge is transformed according to the homography matrix H and superimposed on the target image, allowing for a visual verification of the matching effect.
[0032] This invention acquires a target image containing the actual ship's draft gauge and uses a scale-invariant feature transformation algorithm to detect and match feature control points between the target image and a virtual draft gauge digital template. It then calculates and generates a homography matrix to establish a perspective transformation relationship between the two. This solves the problem in the prior art where it is difficult to establish a stable and accurate geometric mapping relationship between the physical draft gauge and the measurement benchmark due to tilted shooting angle, draft gauge deformation, and environmental interference, thus improving the accuracy and stability of coordinate mapping.
[0033] S3, receive the prompt points marked on the target image, call the preset image segmentation model, segment the ship's waterline according to the prompt points, and obtain the waterline pixel coordinates; In S3, the cue points include foreground and background points; receiving the cue points marked on the target image and calling a preset image segmentation model to segment the ship's waterline based on the cue points includes: Receive foreground points marked by users at the waterline position, and background points marked at the hull position outside the waterline; The foreground and background points are used as prompts to input into the image segmentation model, which then performs segmentation based on the prompts and outputs the contour pixel coordinates of the waterline.
[0034] The image segmentation model is the SAM2 model, which is used to interactively segment the waterline of a ship in a target image and output the contour pixel coordinates of the waterline.
[0035] In one possible implementation, the location where the ship's hull meets the water surface in an image is observed, and points are marked on the image using the mouse. Specifically, at the hull-water interface, i.e., the waterline, several points are clicked to mark as foreground points; for example, seven points are clicked at intervals along the suspected waterline. Simultaneously, several points are clicked in the rippled area of the water surface or in locations clearly belonging to the ship's hull above the waterline to mark as background points; for example, two points are clicked in the water surface area. These two types of marked points are displayed with different colors, such as green foreground points and red for background points, making it easy to visually confirm the marked area.
[0036] The pixel coordinates of the aforementioned marked points are received in real time, and the coordinates of the foreground and background points are used as prompts and input into a preset image segmentation model. In this embodiment, the image segmentation model adopts the SAM2 model. After receiving the target image and prompt point information, the SAM2 model uses its internal feature encoder to extract multi-scale features from the target image, while encoding the foreground points as positive prompts and the background points as negative prompts, generating prompt embedding features through the prompt encoder. The model fuses and decodes the image features and prompt embedding features to generate a segmentation mask for the ship's waterline. Subsequently, contour extraction processing is performed on the segmentation mask, and the contour pixel coordinate sequence of the waterline is obtained by tracing along the mask boundary. The contour pixel coordinates are output as the segmentation result for subsequent use by the draft depth calculation module. The segmentation results can be viewed in real time on the interface. If a deviation is found between the segmentation contour and the actual waterline, the marked points can be added, deleted, or adjusted. The model will re-segment based on the updated prompts until satisfactory segmentation accuracy is obtained.
[0037] This invention receives foreground and background points marked by the user on the target image as prompts, and calls the SAM2 model to perform interactive segmentation of the ship's waterline based on the prompts, outputting the outline pixel coordinates of the waterline. This solves the problem of missegmentation and omission in existing fully automatic segmentation methods under conditions such as complex water vapor boundaries, water surface reflection, and wave interference, and effectively improves the accuracy and reliability of waterline segmentation.
[0038] S4, based on the coordinate mapping relationship, map the draft pixel coordinates to the coordinate system of the virtual draft gauge digital template, and calculate the ship's draft depth value in conjunction with the calibration relationship, including: Take the average ordinate of the waterline pixel coordinates, and map the average ordinate to the virtual ordinate in the virtual water gauge digital template coordinate system through the coordinate mapping relationship. The draft of the vessel is calculated based on the calibration relationship between the virtual ordinate and the physical depth in the virtual draft gauge digital template.
[0039] In one possible implementation, since the waterline is typically presented as a curve or broken line segment extending horizontally, the ordinates of all pixels on the contour are first statistically analyzed. After removing outliers with large dispersion, the average ordinate of the remaining pixels is calculated to obtain the pixel ordinate value representing the overall position of the waterline. Subsequently, the homography matrix H, which has been calculated and stored in S2, is called. Matrix H describes the perspective transformation relationship between the target image coordinate system and the virtual water gauge digital template coordinate system. By substituting the waterline pixel coordinates into the transformation formula, its corresponding coordinates in the virtual water gauge digital template coordinate system are calculated. The mapped virtual ordinates represent the vertical pixel position of the waterline in the virtual water gauge digital template image.
[0040] The calibration parameters corresponding to the virtual draft gauge digital template are retrieved from the database. In this embodiment, the physical range of the virtual draft gauge digital template is 10.0m to 11.0m, and the total height of the corresponding template image is 800 pixels. That is, for every 1 pixel increase in the vertical coordinate in the virtual coordinate system, the physical depth increases by 0.00125m. The calibration relationship can be expressed as: final physical value of ship draft = 10.0 + virtual vertical coordinate × 0.00125; Substituting the virtual vertical coordinate obtained in the previous step into the formula, the final physical value of the ship draft is calculated, in meters. The calculation result, along with the timestamp, ship identification information, and the corresponding processed image, is stored in the database and displayed in a prominent position on the human-computer interaction interface.
[0041] This invention uses a coordinate mapping relationship based on the homography matrix to accurately convert the waterline pixel coordinates to the coordinate system of a virtual water gauge digital template. It also directly calculates the draft depth value by combining the pre-calibrated virtual ordinate and physical depth correspondence of the template. This solves the problem in the prior art that the physical depth cannot be accurately converted from image pixels due to image perspective distortion, blurred or missing water gauge scales. This improves the accuracy and automation of draft depth calculation and ensures the consistency and traceability of measurement results.
[0042] Example 2 like Figure 2 As shown, the present invention provides an intelligent ship draft measurement system based on marker template matching. The system is used to implement the intelligent ship draft measurement method based on marker template matching described in any one of Embodiment 1. The system includes: The virtual water gauge generation module is used to create a standardized virtual water gauge digital template. The virtual water gauge digital template includes preset feature control points and defines the calibration relationship between the scale lines and the physical depth. The feature matching module, connected to the virtual draft gauge generation module, is used to acquire a target image containing the actual ship draft gauge, perform feature matching between the target image and the virtual draft gauge digital template, and establish a coordinate mapping relationship between the virtual draft gauge digital template and the actual draft gauge area in the target image. The image segmentation module, connected to the feature matching module, is used to receive the cue points marked on the target image, call the preset image segmentation model, segment the ship's waterline according to the cue points, and obtain the waterline pixel coordinates. The draft depth calculation module, connected to the image segmentation module, is used to map the draft line pixel coordinates to the coordinate system of the virtual draft gauge digital template based on the coordinate mapping relationship, and calculate the ship's draft depth value in combination with the calibration relationship.
[0043] The system also includes a database management module for storing and managing data on different ships and their corresponding virtual draft gauge digital templates; The human-computer interaction module provides a graphical user interface to enable interactive annotation, intelligent measurement result visualization, and historical data query and export functions.
[0044] In one possible implementation, after an operator creates a new virtual draft gauge template using the virtual draft gauge generation module, the database management module receives and persistently stores the template's relevant data. The stored information includes: a unique template identifier, template name, associated vessel type or name, template image file, feature control point coordinate set, and calibration parameters. Specifically, the calibration parameters include the physical depth corresponding to the starting and ending values of the measurement range in the virtual coordinate system, the total pixel height of the template image, and the physical depth ratio coefficient calculated per unit pixel. Operators can retrieve, view, modify, and delete stored templates through the human-computer interaction module. When a measurement of a vessel is required, the system automatically matches and retrieves the corresponding virtual draft gauge template data from the database based on the vessel information for use by the feature matching module.
[0045] After each measurement, the draft calculation module submits the complete data of that measurement to the database management module for storage. The stored measurement record information includes: measurement number, measurement timestamp, vessel identification information, the identifier of the virtual draft gauge digital template used, the original target image, the resulting image with the virtual draft gauge and draft superimposed, the calculated draft value, and the operator's identification. The database management module supports conditional retrieval of measurement records. Operators can quickly query historical measurement records by time range, vessel identification, and other criteria, and can export the query results as spreadsheets or reports to meet the needs of data archiving and business traceability.
[0046] The main interface of the human-computer interaction module is divided into an image display area, a control panel area, and a results display area. The image display area displays the target image in real time, as well as the processed image overlaid with the virtual waterline template and waterline segmentation contour. It supports basic operations such as image zooming and panning. The control panel area integrates various function buttons and parameter input controls, including: starting image acquisition, selecting or creating a virtual waterline template, triggering feature matching, annotating prompt points, controlling the segmentation model's operation, and viewing and exporting historical records.
[0047] The foreground point is marked with a green dot, and the background point is marked with a red cross. Marked points can be dragged and repositioned at any time or deleted by right-clicking. After marking, the operator clicks the segmentation button in the control panel area to send the marked points to the image segmentation module for processing. After the image segmentation module returns the waterline contour coordinates, the human-computer interaction module displays the segmentation result as a highlighted line overlay in the image display area, and simultaneously displays the calculated draft depth value in the results display area.
[0048] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for intelligent measurement of the draft of a ship based on marker template matching, characterized in that, include: S1. Create a standardized virtual water gauge digital template, which includes preset feature control points and defines the calibration relationship between the scale lines and the physical depth. S2, acquire a target image containing the actual ship draft, perform feature matching between the target image and the virtual draft digital template, and establish a coordinate mapping relationship between the virtual draft digital template and the actual draft area in the target image; S3, receive the prompt points marked on the target image, call the preset image segmentation model, segment the ship's waterline according to the prompt points, and obtain the waterline pixel coordinates; S4. Based on the coordinate mapping relationship, the draft pixel coordinates are mapped to the coordinate system of the virtual draft gauge digital template, and the ship's draft depth is calculated in combination with the calibration relationship.
2. The method for intelligent measurement of ship draft based on marker template matching according to claim 1, characterized in that, The creation of the virtual water level gauge digital template includes adopting an n-row × 2-column feature control point selection strategy, symmetrically selecting a total of 2n feature control points on the left and right sides of the virtual water level gauge digital template, with each pair of horizontally aligned scale lines forming a row, and selecting the endpoints or center points as a pair of control points.
3. The method for intelligent measurement of ship draft based on marker template matching according to claim 1, characterized in that, The step of performing feature matching between the target image and the virtual water gauge digital template to establish a coordinate mapping relationship between the virtual water gauge digital template and the actual water gauge region in the target image includes using a scale-invariant feature transformation algorithm to detect and match feature control points in the target image and the virtual water gauge digital template, and calculating and generating a homography matrix to establish a perspective transformation relationship between the virtual water gauge digital template and the actual water gauge region in the target image.
4. The method for intelligent measurement of ship draft based on marker template matching according to claim 1, characterized in that, In S3, the cue point includes a foreground point and a background point; The step of receiving the cue points marked on the target image, calling the preset image segmentation model, and segmenting the ship's waterline according to the cue points includes: Receive foreground points marked by users at the waterline position, and background points marked at the hull position outside the waterline; The foreground and background points are used as prompts to input into the image segmentation model, which then performs segmentation based on the prompts and outputs the contour pixel coordinates of the waterline.
5. The method for intelligent measurement of ship draft based on marker template matching according to claim 4, characterized in that, The image segmentation model is the SAM2 model, which is used to interactively segment the waterline of a ship in a target image and output the contour pixel coordinates of the waterline.
6. The method for intelligent measurement of ship draft based on marker template matching according to claim 1, characterized in that, The process of mapping the draft pixel coordinates to the coordinate system of the virtual draft gauge digital template based on the coordinate mapping relationship, and calculating the ship's draft depth value in conjunction with the calibration relationship, includes: Take the average ordinate of the waterline pixel coordinates, and map the average ordinate to the virtual ordinate in the virtual water gauge digital template coordinate system through the coordinate mapping relationship. The draft of the vessel is calculated based on the calibration relationship between the virtual ordinate and the physical depth in the virtual draft gauge digital template.
7. The method for intelligent measurement of ship draft based on marker template matching according to claim 1, characterized in that, After acquiring the target image containing the actual ship's draft, the process also includes at least one preprocessing operation among denoising, contrast enhancement, and geometric correction on the target image.
8. A ship draft intelligent measuring system based on marker template matching, characterized in that, The system is used to implement the intelligent ship draft measurement method based on marker template matching as described in any one of claims 1 to 7, and the system includes: The virtual water gauge generation module is used to create a standardized virtual water gauge digital template. The virtual water gauge digital template includes preset feature control points and defines the calibration relationship between the scale lines and the physical depth. The feature matching module, connected to the virtual draft gauge generation module, is used to acquire a target image containing the actual ship draft gauge, perform feature matching between the target image and the virtual draft gauge digital template, and establish a coordinate mapping relationship between the virtual draft gauge digital template and the actual draft gauge area in the target image. The image segmentation module, connected to the feature matching module, is used to receive the cue points marked on the target image, call the preset image segmentation model, segment the ship's waterline according to the cue points, and obtain the waterline pixel coordinates. The draft depth calculation module, connected to the image segmentation module, is used to map the draft line pixel coordinates to the coordinate system of the virtual draft gauge digital template based on the coordinate mapping relationship, and calculate the ship's draft depth value in combination with the calibration relationship.
9. The system for intelligent measurement of the draft of a ship based on marker template matching according to claim 8, characterized in that, The system also includes a database management module for storing and managing data on different ships and their corresponding virtual draft gauge digital templates; The human-computer interaction module provides a graphical user interface to enable interactive annotation, intelligent measurement result visualization, and historical data query and export functions.