A method for enlarging and enhancing a snapshot of a water gauge of a sailing ship
By training a YOLOv5 model and using high-resolution imaging technology, the problem of capturing ship draft marks at long distances or in low light conditions was solved, achieving precise positioning and magnified capture of the draft marks and improving the clarity of the captured images.
Patent Information
- Application Number
- CN202311505051.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-13
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-11-13
AI Technical Summary
Existing technologies struggle to accurately capture detailed features of a ship's draft gauge from a distance or in low light conditions, making it impossible to identify ships at sea and view draft gauge readings.
A ship draft survey model was trained using the YOLOV5 model. Through high-resolution imaging, optical zoom, and digital magnification techniques, combined with Mosaic data augmentation and the GIOU_Loss loss function, the precise positioning and magnified capture of the draft survey were achieved.
At long distances or in low light conditions, the clarity of water level gauge images is significantly improved, increasing from 20% to 95% during the day and from less than 10% to 90% at night, ensuring that water level gauge details are clearly visible.
Smart Images

Figure CN117560566B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for magnified and enhanced capture of draft gauge data of ships underway, belonging to the field of waterway ship detection and capture technology. Background Technology
[0002] Ship draft gauges are markers used on ships to measure their draft and load. Their accurate identification is crucial for safe navigation, port management, and maritime law enforcement. In recent years, ship detection and image capture technologies have become increasingly sophisticated, primarily focusing on the detection, capture, and identification of the ship itself and its name. Ship draft gauges are relatively small and contain many details, differing from typical ship image capture methods. Capturing ship draft gauge images is challenging, and currently, there is no specific method for capturing images of ship draft gauges.
[0003] The commonly used method for capturing ship images is to use radar / AIS for target detection. Once a ship is detected, the camera is triggered to capture the image. However, this method does not capture a high percentage of clear draft images. Most of the time, it cannot accurately capture the detailed features of the draft of a ship underway, and thus cannot achieve the purpose of identifying and viewing the draft reading of a ship underway. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method for enhancing the capture of waterline drafts on ships at sea, which allows the capturer to accurately locate and observe the target even at a great distance or in extremely low light conditions through high-resolution imaging and magnification.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] A method for enhanced image capture of draft gauges of ships underway includes the following steps:
[0007] Step 1: Obtain a ship draft image dataset, and use the ship draft image dataset to train the YOLOV5 model to obtain a ship draft positioning model.
[0008] Step 2: With the initial preset zoom Z0 of the capture camera, when a vessel is detected to be completely within the camera's field of view, the camera's zoom is adjusted for the first time based on the vessel's position within the field of view. The captured image of the vessel is then taken based on the adjusted zoom. The adjusted zoom is as follows:
[0009]
[0010] Where Z1 is the zoom after the first adjustment, n is the number of ship images captured after the first zoom adjustment, k is the correction parameter, x1 is the X-axis coordinate of the lower left corner of the ship rectangle detected by the detection camera, and x2 is the X-axis coordinate of the upper right corner of the ship rectangle detected by the detection camera.
[0011] Step 3: Based on the ship image captured after the first zoom adjustment, the ship draft positioning model trained in Step 1 is used to locate the draft of the ship underway. The zoom of the capture camera is adjusted a second time. Based on the zoom of the second adjustment and the draft positioning, the ship's draft area is captured, thus obtaining a magnified and enhanced image of the ship's draft. The zoom after the second adjustment is:
[0012]
[0013] Here, the time from sunrise to sunset for the latitude and longitude of the camera is defined as daytime, and all other times are defined as nighttime. Z is the zoom level after the second adjustment, and x = min{x1, x2, ..., x} n}, y = min{y1, y2, ..., y n},x1,x2,…,x n Let y1, y2, ..., yn represent the proportions of the waterline in the horizontal direction relative to the first, second, ..., nth images of the ship captured after the first zoom adjustment. n These represent the proportions of the water gauge in the vertical direction relative to the first, second, ..., nth images of the ship captured after the first zoom adjustment.
[0014] As a preferred embodiment of the present invention, the specific process of step 1 is as follows:
[0015] 1) Obtain a dataset of ship images containing draft gauges. The dataset should contain no fewer than 5,000 ship images, and the ship images should include draft gauges of different types of ships in different application scenarios. The application scenarios include daytime and nighttime, and the ship types include cargo ships, passenger ships, roll-on / roll-off ships, tugboats, container ships, and government vessels.
[0016] 2) Label the ship images in the ship image dataset obtained in 1), label the water gauge bounding box and provide corresponding category labels, including two categories: water gauge and not water gauge;
[0017] 3) The YOLOV5 model is trained using the labeled dataset, and the parameters of the model are optimized using the backpropagation algorithm to obtain the ship draft positioning model.
[0018] As a preferred embodiment of the present invention, the method for enhancing and capturing images of ship draft gauges in transit according to claim 2 is characterized in that the YOLOV5 model includes an input terminal, a backbone network, a Neck network, and an output terminal; the input terminal employs Mosaic data augmentation to randomly scale, crop, and arrange the ship image dataset containing draft gauges; the backbone network includes a Focus module and a CSP module, the Focus module being used to focus and compress the image after data augmentation at the input terminal, converting high-resolution images into low-resolution images; the output terminal employs the GIOU_Loss loss function, the formula of which is: Among them, IOU Loss Let GIOU_Loss be the loss, A be the true label, and B be the predicted label.
[0019] In a preferred embodiment of the present invention, in step 2, n is not less than 3 and k is 1.18.
[0020] A computer device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the steps of the in-ship drafts magnification and enhanced image capture method as described above.
[0021] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the in-ship draft gauge magnification and enhanced image capture method as described above.
[0022] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:
[0023] 1. This invention provides a water draft magnification and enhanced image capture technology applicable to ships underway. This technology solves the problem of unclear focus on details in water drafts of ships underway. Water draft photos captured using this technology have high-definition imaging and details that are discernible to the human eye. Through high-resolution imaging and magnification functions, operators can accurately locate and observe targets, even at great distances or in extremely low light conditions. Optical zoom, digital magnification, or other advanced imaging technologies are employed to ensure clear visibility of target details.
[0024] 2. Using the method of this invention, the daytime water level gauge clearing rate is increased from 20% to 95%, and the nighttime water level gauge clearing rate is increased from less than 10% to 90%. Attached Figure Description
[0025] Figure 1 This is a flowchart of a method for enhancing and capturing water level drafts of ships underway, according to the present invention.
[0026] Figure 2This is a diagram illustrating the ship's draft markings;
[0027] Figure 3 This is a magnified image of the water level gauge to enhance the snapshot effect;
[0028] Figure 4 This is a diagram of the YOLOv5 model structure;
[0029] Figure 5 This is a structural diagram of the Focus module in the YOLOv5 model. Detailed Implementation
[0030] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0031] like Figure 1 The diagram shows a flowchart of a method for enhancing and capturing water draft data of a ship underway, as proposed in this invention. The specific steps are as follows:
[0032] Step 1: Train the draft water level localization model to obtain the draft water level localization algorithm. (1) First, collect an image dataset containing draft water level figures. The dataset should contain no fewer than 5,000 images, including draft water level figures of different ships in various application scenarios. (2) Label the dataset, draw a bounding box for each draft water level figure and provide the corresponding category label, such as Figure 2 As shown. (3) The YOLOV5 model is used to train the water level gauge image. The training process involves inputting the image into the model and optimizing the model parameters through the backpropagation algorithm so that it can accurately detect and locate the water level gauge.
[0033] YOLOv5 network structure model, such as Figure 4 As shown, the model consists of four parts, mainly divided into the input end, the backbone network, the neck network, and the output end (Prediction).
[0034] Input: Mosaic data augmentation is used to randomly scale, crop, and rearrange the waterline dataset.
[0035] Select four different images: Choose four different images from the training dataset.
[0036] Randomly select a main image: Randomly select one of these four images as the main image.
[0037] Randomly select three auxiliary images: randomly select three from the remaining three images.
[0038] Adjusting image size and position: The auxiliary images are resized and randomly placed around the main image to create a composite Mosaic image. This simulates the diversity between different targets and backgrounds.
[0039] Generate labels: Generate labels for the composite image, which are usually objects in the main image and their corresponding location information.
[0040] The backbone network is mainly composed of Focus modules and CSP structures.
[0041] The main function of the Focus module is to focus and compress information from the input image, thereby reducing computational complexity and preserving important features. It is typically used to process high-resolution input images, transforming them into low-resolution feature maps suitable for further processing. The structure of the Focus module is as follows: Figure 5 As shown.
[0042] The original image was 640*640*3. After the Focus structure was applied, a slicing operation was used to transform it into a 320*320*12 feature map. After concatenation, a convolution operation was performed to finally transform it into a 320*320*64 feature map.
[0043] YoloV5 has two CSP structures: CSP1X in the backbone network and CSP2X in the Neck. For the backbone network, the convolutional kernels in the CSP modules are all 3x3 with a stride of 2. If the input image size is 608x608, its feature map changes as follows: 608x608 -> 304x304 -> 152x152 -> 76x76 -> 38x38 -> 19x19, ultimately resulting in a 19x19 feature map.
[0044] The output is mainly composed of the GIOU_Loss loss function.
[0045] The formula for the GIOU_Loss loss function is:
[0046]
[0047] During model training, 5000 images were labeled and divided into training, validation, and test sets in an 8:1:1 ratio. The final model achieved an accuracy of 95.57% and a recall of 96.7%.
[0048] Step 2: The camera resolution is 1920*1080, and the initial zoom is Z0. At zoom Z0=1, the detection model detects the position of the ship in the image (x1, x2, L1, y2). The zoom is then adjusted to Z1 for the first time.
[0049]
[0050] This ensures that the ship takes exactly n photos, where n = 3, 4, 5, ..., and k is a correction parameter, taken as 1.18.
[0051] Step 3: After locating the water level gauge in the image from Step 2, adjust the camera, where x is the minimum proportion of the water level gauge in the horizontal direction of all captured images, and y is the minimum proportion of the water level gauge in the vertical direction of all captured images. Adjust the zoom according to the following formula:
[0052] daytime:
[0053] at night:
[0054] Before using the water gauge positioning model, the daytime image clarity rate was only 20%, and less than 10% at night. After using the model, it increased to 95% during the day and 90% at night. The enlarged water gauge significantly improved the image capture effect. Figure 3 As shown.
[0055] Based on the same inventive concept, this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the aforementioned method for enhancing and capturing water level drafts of ships underway.
[0056] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned method for enhancing and capturing water level drafts of ships underway.
[0057] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0058] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0059] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0060] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0061] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A method for magnified and enhanced capture of draft cards of ships underway, characterized in that, Includes the following steps: Step 1: Obtain a ship draft image dataset, and use the ship draft image dataset to train the YOLOV5 model to obtain a ship draft positioning model. Step 2, set the initial zoom level for the capture camera. When a vessel is detected to be completely within the camera's field of view, the camera's zoom level is adjusted based on the vessel's position within the camera's view. The captured image is then taken based on this adjusted zoom level. The adjusted zoom level is as follows: , in, This is the first adjustment after the multiplication factor was adjusted. This refers to the number of ship images captured after the initial zoom adjustment. To correct the parameters, To detect the X-axis coordinate of the lower left corner of the rectangular frame of the ship detected by the camera, The X-axis coordinate of the upper right corner of the rectangular frame of the ship detected by the camera is used to determine the capture camera's resolution (1920*1080). Step 3: Based on the ship image captured after the first zoom adjustment, the ship draft positioning model trained in Step 1 is used to locate the draft of the ship underway. The zoom of the capture camera is adjusted a second time. Based on the zoom of the second adjustment and the draft positioning, the ship's draft area is captured, thus obtaining a magnified and enhanced image of the ship's draft. The zoom after the second adjustment is: , Specifically, the time from sunrise to sunset for the location of the camera is defined as daytime, and all other times are defined as nighttime. This is the second adjustment to the multiplication factor. , , These represent the proportions of the waterline in the horizontal direction relative to the first, second, ..., nth images of the ship captured after the first zoom adjustment. These represent the proportions of the water gauge in the vertical direction of the first, second, ..., nth images of the ship captured after the first adjustment and zoom.
2. The method for enhanced capture of draft gauge data of ships underway according to claim 1, characterized in that, The specific process of step 1 is as follows: 1) Obtain a dataset of ship images containing draft gauges. The dataset should contain no fewer than 5,000 ship images, and the ship images should include draft gauges of different types of ships in different application scenarios. The application scenarios include daytime and nighttime, and the ship types include cargo ships, passenger ships, roll-on / roll-off ships, tugboats, container ships, and government vessels. 2) Label the ship images in the ship image dataset obtained in 1), label the water gauge bounding box and provide corresponding category labels, including two categories: water gauge and not water gauge; 3) The YOLOV5 model is trained using the labeled dataset, and the parameters of the model are optimized using the backpropagation algorithm to obtain the ship draft positioning model.
3. The method for enhanced capture of draft gauge data of ships underway according to claim 2, characterized in that, The YOLOV5 model comprises an input, a backbone network, a Neck network, and an output. The input employs Mosaic data augmentation, randomly scaling, cropping, and rearranging the ship image dataset containing waterline drafts. The backbone network includes a Focus module and a CSP module. The Focus module focuses and compresses the augmented images from the input, converting high-resolution images into low-resolution images. The output uses the GIOU_Loss loss function, the formula of which is: , in, The loss is GIOU_Loss. For real labels, For predicted labels.
4. The method for enhanced capture of draft data of ships underway according to claim 1, characterized in that, In step 2, n is not less than 3, and k takes the value of 1.
18.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the in-ship draft gauge magnification and enhanced image capture method as described in any one of claims 1 to 4.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the in-ship draft gauge magnification and enhanced image capture method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Image processing model training method and device and medium
CN110827219A
Ship water gauge reading detection and identification method based on machine vision
CN117037132A
