Ship draught load line identification method based on machine vision

Through machine vision-based identification methods, the ship draft load line is accurately identified, and the problem of inaccurate measurement in the prior art is solved, high-accuracy identification and overload judgment are achieved, and the channel safety and ship stability are ensured.

CN119445502APending Publication Date: 2025-02-14南京畅淼科技有限责任公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411474576.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art is difficult to accurately measure the ship's draft load line, resulting in inaccurate cargo weight calculations, affecting the safety of the waterway and ship stability.

Method used

Using machine vision-based recognition methods, the ship image is acquired, pre-processing, water ruler character recognition, key point detection and line fitting are carried out to accurately identify the ship's draft load line and judge the overload condition.

Benefits of technology

The accurate identification of the draft load lines at the front, middle and rear positions of the ship is achieved, with an identification accuracy rate of more than 95%, providing precise data to the regulatory authorities and ensuring channel safety and ship stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445502A_ABST
    Figure CN119445502A_ABST
Patent Text Reader

Abstract

The invention provides a ship draught load line identification method based on machine vision, which comprises the following steps of: (1) acquiring a ship shot image, (2) preprocessing the obtained images of a prow, a midship and a stern water gauge areas, expanding the midship water gauge areas, and obtaining the position of a load line through preprocessing and Hough circle detection; (3) carrying out water gauge character recognition on the pre-processed water gauge area image; (4) inputting the ship image into a key point detection model to detect ship waterline key points; (5) based on the ship waterline key points, performing line fitting by adopting a least square method to obtain a ship waterline; (6) respectively comparing ship waterlines of the bow, the middle and the stern with ship load identification positions, if the ship waterlines are higher than the ship load identification, judging that the ship is overloaded, and if the ship waterlines are lower than the load line, judging that the ship is not overloaded; (7) if it is judged that the ship is overloaded, draught values of a prow water gauge, a midship water gauge and a stern water gauge of the overloaded ship are calculated respectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of ship draft line recognition, and in particular relates to a ship draft load line recognition method based on machine vision. Background Art

[0002] Accurately measuring the ship's draft load line can not only improve the accuracy and objectivity of cargo weighing, but also help the maritime administration to effectively supervise the safe navigation of ships, obtain effective evidence of overloading and over-draft of ships, and then facilitate the punishment of ships that undermine the safety of waterways, effectively protect waterway resources, ensure waterway safety and maintain waterway interests. In addition, the driver can also calculate the draft difference between the bow and stern, the draft difference between the port and starboard, the ship's stability and the swing period according to the accurate six-sided draft data, and adjust the ship's navigation attitude in time to effectively ensure the safe navigation of the ship. Therefore, it is urgent to propose a reliable, efficient and scientific method for measuring the ship's draft load line to achieve accurate measurement of the weight of the ship's cargo, which is crucial to the development of ship weight weighing and the ship's bulk cargo transportation industry.

[0003] In order to overcome the inaccurate draft gauge readings, more and more researchers have studied a series of methods, such as laser method, sensor method, etc., and achieved good results. However, this project uses computer vision and recognition analysis technology to accurately measure the ship's draft and load line, and obtains accurate draft gauge readings. Image processing is a research hotspot in many industries. The computer vision system can not only avoid subjective factors such as manual observation and reading deviation, but also record data in a timely manner during the observation process. The positioning of the ship's waterline image area, water traces, and complex external interference factors can all be well solved using computer vision technology. The measurement of draft readings is crucial to the determination of cargo weight. Accurate identification of the draft line is an important prerequisite for draft gauge weighing. In recent years, image processing technology has been introduced into various fields by many scholars, which provides reference value for its application in ship draft gauge measurement. Summary of the invention

[0004] Purpose of the invention: The present invention proposes a method for identifying ship draft and load lines based on machine vision. According to the method of the present invention, whether the bow, midship and stern are overloaded can be accurately calculated, and the specific draft value can be calculated.

[0005] Technical solution, in order to achieve the above purpose, the present invention proposes a ship draft load line recognition method based on machine vision, the method steps are as follows:

[0006] (1) Obtaining a ship image, which includes the water gauge and waterline information of the bow, midship and stern of the ship;

[0007] (2) Preprocessing the images of the bow, midship, and stern water gauge areas, using a single-scale retinal color correction method, expanding and detecting the bow, midship, and stern water gauge areas to obtain the load line position;

[0008] (3) performing water ruler character recognition on the preprocessed water ruler area image;

[0009] (4) inputting the ship image into a key point detection model to detect the key points of the ship waterline, wherein the key point detection model is trained with the ship image as input and the marked key points of the ship waterline as output to obtain the key point detection model;

[0010] (5) Based on the key points of the ship's waterline, the least squares method is used to perform line fitting to obtain the ship's waterline;

[0011] (6) Compare the ship's waterline at the bow, midship and stern with the position of the ship's load mark. If the ship's waterline is higher than the ship's load mark, it is judged to be overloaded; if it is lower than the load line, it is judged to be not overloaded;

[0012] (7) According to step (6), whether the bow, midship and stern of the ship are overloaded is determined. If it is determined to be overloaded, the draft values ​​of the bow water gauge, the midship water gauge and the stern water gauge of the overloaded ship are calculated.

[0013] Furthermore, the method of step (2) is as follows:

[0014] Set the original water gauge image to I(x,y), perform Gaussian filtering on the original water gauge image, set the filtering parameter to c, and get the filtering result L(x,y). According to the formula R(x,y)=log(I(x,y))-log(L(x,y)), we can get 9R(x,y)). Quantize R(x,y) to pixel values ​​in the range of 0 to 255. The specific calculation is as follows Among them, min is the minimum value of R(x,y), and max is the maximum value of R(x,y);

[0015] Assuming the image width of the midship draft gauge area is W pixels, the midship draft gauge area is expanded to the right with an expansion width of 2W to the area containing the load line to obtain the draft gauge load line area image; the draft gauge load line area image is grayed out, and the image edge is detected. The potential circular contour is found through the Hough circle detection method to obtain the load mark position.

[0016] Furthermore, the grayscale is converted using the weighted average method. The color component values ​​of the three RGB channels of the pixel in the original water gauge image I(x, y) are r, g, and b respectively. The grayscale value of the pixel is g = 0.299 × r + 0.587 × g + 0.114 × b. The grayscale image H(x, y) is obtained based on the calculated grayscale value.

[0017] Based on the grayscale image H(x,y), the Sobel operator is used for edge detection and horizontal gradient calculation

[0018]

[0019] Vertical gradient

[0020]

[0021] Edge value, i.e. gradient value After calculating the edge value of each pixel, an edge graph B(x,y) is formed;

[0022] The gradient direction is

[0023] Traverse all non-zero pixel points in the edge graph B(x,y), draw lines along the gradient direction, each point is an accumulator, if the line drawn along the gradient direction passes through the point, the accumulator is increased by 1, all accumulators are sorted in descending order, and the first 5 points are selected as candidate circle centers;

[0024] Calculate the distance d from all non-zero pixels in the edge map to the center of the candidate circle, and obtain a set of distance vectors d{d1, d2, …, d n}

[0025] , after removing the circle centers whose distance is less than the radius threshold D, we get the distance vector d'{d'1,d'2,…,d' m},d' i ≥D,i∈[1,m], m is the number of remaining distance vectors. The center of the circle with the largest accumulator value is selected from the remaining candidate centers as the center of the final detection, and the distance that appears most times in d' is used as the radius to obtain the circular contour detection result, which is the load line position.

[0026] Furthermore, the calculation method of the draft value in step (7) is as follows:

[0027] Assume that the distance between the ship's waterline and the bottom edge of the image is y p The pixel width of the water gauge reading character closest to the ship's waterline is N p , the distance between the lower edge of the water gauge reading character closest to the ship's waterline and the lower edge of the image is y t , the result of the character and number recognition of the water gauge reading is M t , the distance represented by each pixel is Draft value W = M t -(t t -y p )·D p , unit is meter.

[0028] In addition, the present invention proposes a ship draft and load line recognition system based on machine vision, which includes the following system:

[0029] An image acquisition module acquires images taken by a ship. The images taken by the ship contain the water gauge and waterline information of the ship at the bow, midship and stern. The images of the ship are automatically numbered and named according to the order of the front, middle and back of the ship.

[0030] The load line calculation module pre-processes the images of the bow, midship and stern water gauge areas, uses a single-scale retinal color correction method for the bow, midship and stern water gauge images, expands the midship water gauge area, and obtains the load line position through pre-processing and Hough circle detection;

[0031] A water gauge character recognition module performs water gauge character recognition on the preprocessed water gauge area image;

[0032] A key point detection module inputs the ship image into a key point detection model to detect the key points of the ship waterline. The key point detection model takes the ship image as input and the marked key points of the ship waterline as output, and is trained to obtain the key point detection model;

[0033] The ship line fitting module uses the least squares method to fit the ship's waterline based on the key points of the ship's waterline;

[0034] The overload judgment module compares the ship's waterline at the bow, midship and stern with the position of the ship's load mark. If the ship's waterline is higher than the ship's load mark, it is judged to be overloaded; if it is lower than the load line, it is judged to be not overloaded;

[0035] The draft value calculation module determines whether the bow, midship and stern of the ship are overloaded. If it is determined to be overloaded, the draft values ​​of the bow water gauge, midship water gauge and stern water gauge of the overloaded ship are calculated respectively.

[0036] Furthermore, the functions of the load line calculation module are as follows:

[0037] Set the original water gauge image to I(x,y), perform Gaussian filtering on the original water gauge image, set the filtering parameter to c, and get the filtering result L(x,y). According to the formula R(x,y)=log(I(x,y))-log(L(x,y)), calculate (R(x,y)), and quantize R(x,y) to pixel values ​​in the range of 0 to 255. The specific calculation is as follows Among them, min is the minimum value of R(x,y), and max is the maximum value of R(x,y);

[0038] Assuming the image width of the midship draft gauge area is W pixels, the midship draft gauge area is expanded to the right with an expansion width of 2W to the area containing the load line to obtain the draft gauge load line area image; the draft gauge load line area image is grayed out, and the image edge is detected. The potential circular contour is found through the Hough circle detection method to obtain the load mark position.

[0039] Furthermore, the grayscale is converted using the weighted average method. The color component values ​​of the three RGB channels of the pixel in the original water gauge image I(x, y) are r, g, and b respectively. The grayscale value of the pixel is g = 0.299 × r + 0.587 × g + 0.114 × b. The grayscale image H(x, y) is obtained based on the calculated grayscale value.

[0040] Based on the grayscale image H(x,y), the Sobel operator is used for edge detection and horizontal gradient calculation

[0041]

[0042] Vertical gradient

[0043]

[0044] Edge value, i.e. gradient value After calculating the edge value of each pixel, an edge graph B(x,y) is formed;

[0045] The gradient direction is

[0046] Traverse all non-zero pixel points in the edge graph B(x,y), draw lines along the gradient direction, each point is an accumulator, if the line drawn along the gradient direction passes through the point, the accumulator is increased by 1, all accumulators are sorted in descending order, and the first 5 points are selected as candidate circle centers;

[0047] Calculate the distance d between all non-zero pixels in the edge map and the center of the candidate circle, and obtain a set of distance vectors d{d1, d2, …, d n}

[0048] , after removing the circle centers whose distance is less than the radius threshold D, we get the distance vector d'{d'1,d'2,…,d' m},d' i ≥D,i∈[1,m], m is the number of remaining distance vectors. The center of the circle with the largest accumulator value is selected from the remaining candidate centers as the center of the final detection, and the distance that appears most times in d' is used as the radius to obtain the circular contour detection result, which is the load line position.

[0049] Furthermore, the draft value is calculated as follows:

[0050] Assume that the distance between the ship's waterline and the bottom edge of the image is y p The pixel width of the water gauge reading character closest to the ship's waterline is N p , the distance between the lower edge of the water gauge reading character closest to the ship's waterline and the lower edge of the image is y t , the result of the character and number recognition of the water gauge reading is M t , the distance coefficient represented by each pixel is Draft value W = M t -(y t -y p )·D p , unit is meter.

[0051] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:

[0052] The technical solution of the present invention is different from the existing technology. The present invention can accurately identify the draft and load lines at the front, middle and rear of the ship, with an identification accuracy rate of more than 95%. In some scenarios, if monitoring and camera equipment is installed on both sides of the river, the six draft and load lines of the ship can be identified, providing more detailed data to the regulatory authorities. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 is a flow chart of the method of the present invention;

[0054] Figure 2 It is a scene schematic diagram of the present invention;

[0055] Figure 3 It is a model framework diagram of the present invention;

[0056] Figure 4 This is the CoordConv structure diagram. DETAILED DESCRIPTION

[0057] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0058] like Figure 1 As shown, the present invention proposes a method for identifying a ship's draft and load line based on machine vision, and the steps of the method are as follows:

[0059] (1) Input several sets of ship images. The images are taken from the side of the ship. The images contain information such as the water gauge and waterline of the ship at the bow, midship and stern. The ship images are automatically numbered and named according to the order of the front, middle and back of the ship. For example, if there are 10 images in total, sequence number 01 is the bow and sequence number 10 is the stern.

[0060] (2) Preprocessing the obtained bow, midship, and stern water gauge images, applying a single-scale retinal color correction method to the bow, midship, and stern water gauge images, expanding the midship water gauge area, and obtaining the load line position through preprocessing and Hough circle detection;

[0061] Set the original water gauge image to I(x,y), perform Gaussian filtering on the original water gauge image, set the filtering parameter to c, and get the filtering result L(x,y). According to the formula R(x,y)=log(I(x,y))-log(L(x,y)), calculate (R(x,y)), and quantize R(x,y) to pixel values ​​in the range of 0 to 255. The specific calculation is as follows Among them, min is the minimum value of R(x,y), and max is the maximum value of R(x,y);

[0062] Assuming the image width of the midship draft gauge area is W pixels, the midship draft gauge area is expanded to the right with an expansion width of 2W to the area containing the load line to obtain the draft gauge load line area image; the draft gauge load line area image is grayed out, and the image edge is detected. The potential circular contour is found through the Hough circle detection method to obtain the load mark position.

[0063] Grayscale is converted using the weighted average method. The color component values ​​of the three RGB channels of the pixel in the original water gauge image I(x, y) are r, g, and b respectively. The grayscale value of the pixel is g = 0.299×r+0.587×g+0.114×b. The grayscale image H(x, y) is obtained based on the calculated grayscale value.

[0064] Based on the grayscale image H(x,y), the Sobel operator is used for edge detection and horizontal gradient calculation

[0065]

[0066] Vertical gradient

[0067]

[0068] Edge value, i.e. gradient value After calculating the edge value of each pixel, an edge graph B(x,y) is formed;

[0069] The gradient direction is

[0070] Traverse all non-zero pixel points in the edge graph B(x,y), draw lines along the gradient direction, each point is an accumulator, if the line drawn along the gradient direction passes through the point, the accumulator is increased by 1, all accumulators are sorted in descending order, and the first 5 points are selected as candidate circle centers;

[0071] Calculate the distance d between all non-zero pixels in the edge map and the center of the candidate circle, and obtain a set of distance vectors d{d1, d2, …, d n}, the distance vector d'{d'1,d'2,…,d' m},d' i ≥D,i∈[1,m], m is the number of remaining distance vectors. The center of the circle with the largest accumulator value is selected from the remaining candidate centers as the center of the final detection, and the distance that appears most times in d' is used as the radius to obtain the circular contour detection result, which is the load line position.

[0072] (3) Perform water gauge character recognition on the preprocessed water gauge area image using the FOTS text detection and recognition framework;

[0073] (4) Based on the input high-definition snapshot image of the ship, the key points of the ship's waterline are detected, and a YOLOv8n-Pose key point detection model based on the SimAM attention mechanism and the CoordConv convolution improved network is adopted to obtain a set of key points of the ship's waterline; the key point detection model takes the high-definition snapshot image of the ship as input and the marked key points of the ship's waterline as output, and is trained to obtain the key point detection model.

[0074] The YOLOv8n-Pose key point detection model based on the SimAM attention mechanism and CoordConv convolution improved network includes two parts: the backbone network and the key point detection head.

[0075] The first layer of the backbone network is a conv layer, followed by four consecutive conv and C2f layers, followed by an attention mechanism layer SimAM, and finally an SPPF layer. The SimAM attention module added in this patent is embedded between C2f and SPPF to observe important neurons in the entire backbone network, enhance important features, and suppress other neurons, thereby focusing on feature representations that are more conducive to waterline key point detection.

[0076] The key point detection head is a mesh structure. The features are extracted from the 2nd and 3rd C2f layers and SPPF layers of the backbone network, and the key point output layer is obtained by combining the C2f, conv, up, and concat modules horizontally and vertically. In the key point detection head, a CoordConv convolution layer with a convolution kernel size of 1×1 is introduced after the 2nd C2f, and then connected to C2f. A CoordConv convolution layer with a convolution kernel size of 1×1 is introduced after the 3rd C2f, and then connected to Concat, aiming to enhance the network's perception of the target space coordinates, thereby improving the performance of target detection and key point detection.

[0077] The SimAM attention mechanism mines the importance of neurons by constructing an optimized energy function to calculate the attention weight. Formula (1) is the energy function e t :

[0078]

[0079] Where t is the target neuron of the input feature; λ is the regularization coefficient; i is the spatial dimension index; x i are other neurons; M is the number of all neurons on the channel; y is the label value, which is used to determine whether the neuron is an important neuron; w t is the weight; b t is the bias. According to formula (1), the minimum energy function is derived as formula (2):

[0080]

[0081] Where t is the target neuron of the input feature; λ is the regularization coefficient, is the mean of the input feature t, is the variance of the input feature t.

[0082] From formula (2), we can see that the lower the energy, the greater the difference between the feature-related neuron t and the surrounding neurons, and the higher the importance, so the neuron importance is

[0083] CoordConv convolution aims to improve the neural network's perception of coordinate information. Figure 4 The CoordConv structure introduces two additional channels in the channel dimension through a concatenation operation in the traditional convolutional neural network. These two channels contain the information of the x-coordinate (j) and the y-coordinate (i) respectively. CoordConv significantly improves the model's ability to understand the spatial layout, allowing the network to more effectively handle tasks with clear spatial relationships.

[0084] (5) Based on the key points of the ship's waterline, the least squares method is used to perform line fitting to obtain the ship's waterline;

[0085] (6) Compare the waterline of the ship at the bow, midship and stern with the position of the ship's load mark. If the waterline is higher than the load mark, it is judged to be overloaded; if it is lower than the load line, it is judged to be not overloaded;

[0086] (7) According to step (6), determine whether the bow, midship and stern of the ship are overloaded. If it is determined to be overloaded, calculate the draft values ​​of the bow water gauge, midship water gauge and stern water gauge of the overloaded ship respectively.

[0087] According to the regulations of water gauge characters, the height of numbers and letters in the metric common water gauge mark is 0.1m, and the distance between characters is 0.1m. The specific method of draft calculation is: count the number of pixels occupied by the height of numbers or letters, and accurately calculate the actual distance represented by the unit pixel in this image. After obtaining the distance represented by the unit pixel, the draft value of the water gauge image can be determined through relative position.

[0088] Assume that the distance between the ship's waterline and the bottom edge of the image is y p The pixel width of the water gauge reading character closest to the ship's waterline is N p , the distance between the lower edge of the water gauge reading character closest to the ship's waterline and the lower edge of the image is y t , the result of the character and number recognition of the water gauge reading is M t , the distance represented by each pixel is Draft value W = M t -(y t -y p )·D p , unit is meter.

[0089] In addition, the present invention proposes a ship draft and load line recognition system based on machine vision, which includes the following system:

[0090] An image acquisition module acquires images taken by a ship. The images taken by the ship contain the water gauge and waterline information of the ship at the bow, midship and stern. The images of the ship are automatically numbered and named according to the order of the front, middle and back of the ship.

[0091] The load line calculation module pre-processes the images of the bow, midship and stern water gauge areas, uses a single-scale retinal color correction method for the bow, midship and stern water gauge images, expands the midship water gauge area, and obtains the load line position through pre-processing and Hough circle detection;

[0092] A water gauge character recognition module performs water gauge character recognition on the preprocessed water gauge area image;

[0093] A key point detection module inputs the ship image into a key point detection model to detect the key points of the ship waterline. The key point detection model takes the ship image as input and the marked key points of the ship waterline as output, and is trained to obtain the key point detection model;

[0094] The ship line fitting module uses the least squares method to fit the ship's waterline based on the key points of the ship's waterline;

[0095] The overload judgment module compares the ship's waterline at the bow, midship and stern with the position of the ship's load mark. If the ship's waterline is higher than the ship's load mark, it is judged to be overloaded; if it is lower than the load line, it is judged to be not overloaded;

[0096] The draft value calculation module determines whether the bow, midship and stern of the ship are overloaded. If it is determined to be overloaded, the draft values ​​of the bow water gauge, midship water gauge and stern water gauge of the overloaded ship are calculated respectively.

[0097] Furthermore, the functions of the load line calculation module are as follows:

[0098] Set the original water gauge image to I(x,y), perform Gaussian filtering on the original water gauge image, set the filtering parameter to c, and get the filtering result L(x,y). According to the formula R(x,y)=log(I(x,y))-log(L(x,y)), calculate (R(x,y)), and quantize R(x,y) to pixel values ​​in the range of 0 to 255. The specific calculation is as follows Among them, min is the minimum value of R(x,y), and max is the maximum value of R(x,y);

[0099] Assuming the image width of the midship draft gauge area is W pixels, the midship draft gauge area is expanded to the right with an expansion width of 2W to the area containing the load line to obtain the draft gauge load line area image; the draft gauge load line area image is grayed out, and the image edge is detected. The potential circular contour is found through the Hough circle detection method to obtain the load mark position.

[0100] Furthermore, the grayscale is converted using the weighted average method. The color component values ​​of the three RGB channels of the pixel in the original water gauge image I(x, y) are r, g, and b respectively. The grayscale value of the pixel is g = 0.299 × r + 0.587 × g + 0.114 × b. The grayscale image H(x, y) is obtained based on the calculated grayscale value.

[0101] Based on the grayscale image H(x,y), the Sobel operator is used for edge detection and horizontal gradient calculation

[0102]

[0103] Vertical gradient

[0104]

[0105] Edge value, i.e. gradient value After calculating the edge value of each pixel, an edge graph B(x,y) is formed;

[0106] The gradient direction is

[0107] Traverse all non-zero pixel points in the edge graph B(x,y), draw lines along the gradient direction, each point is an accumulator, if the line drawn along the gradient direction passes through the point, the accumulator is increased by 1, all accumulators are sorted in descending order, and the first 5 points are selected as candidate circle centers;

[0108] Calculate the distance d from all non-zero pixels in the edge map to the center of the candidate circle, and obtain a set of distance vectors d{d1, d2, …, d n}

[0109] , after removing the circle centers whose distance is less than the radius threshold D, we get the distance vector d'{d'1,d'2,…,d' m},d' i ≥D,i∈[1,m], m is the number of remaining distance vectors. The center of the circle with the largest accumulator value is selected from the remaining candidate centers as the center of the final detection, and the distance that appears most times in d' is used as the radius to obtain the circular contour detection result, which is the load line position.

[0110] Furthermore, the draft value is calculated as follows:

[0111] Assume that the distance between the ship's waterline and the bottom edge of the image is y p The pixel width of the water gauge reading character closest to the ship's waterline is N p , the distance between the lower edge of the water gauge reading character closest to the ship's waterline and the lower edge of the image is y t , the result of the character and number recognition of the water gauge reading is M t , the distance coefficient represented by each pixel is Draft value W = M t -(y t -y p )·D p , unit is meter.

[0112] It should be noted that the above content only illustrates the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.

Claims

1. A method for identifying ship draft and load line based on machine vision, characterized in that: The steps of this method are as follows: (1) Obtaining a ship image, which includes the water gauge and waterline information of the bow, midship and stern of the ship; (2) Preprocessing the images of the bow, midship, and stern water gauge areas, using a single-scale retinal color correction method, expanding and detecting the bow, midship, and stern water gauge areas to obtain the load line position; (3) performing water ruler character recognition on the preprocessed water ruler area image; (4) inputting the ship image into a key point detection model to detect the key points of the ship waterline, wherein the key point detection model is trained with the ship image as input and the marked key points of the ship waterline as output to obtain the key point detection model; (5) Based on the key points of the ship's waterline, the least squares method is used to perform line fitting to obtain the ship's waterline; (6) Compare the ship's waterline at the bow, midship and stern with the position of the ship's load mark. If the ship's waterline is higher than the ship's load mark, it is judged to be overloaded; if it is lower than the load line, it is judged to be not overloaded; (7) According to step (6), whether the bow, midship and stern of the ship are overloaded is determined. If it is determined to be overloaded, the draft values ​​of the bow water gauge, the midship water gauge and the stern water gauge of the overloaded ship are calculated.

2. The method for identifying a ship's draft and load line based on machine vision according to claim 1, characterized in that: The method of step (2) is as follows: Set the original water gauge image to I(x,y), perform Gaussian filtering on the original water gauge image, set the filtering parameter to c, and obtain the filtering result L(x,y). According to the formula R(x,y)=log(I(x,y))-log(L(x,y)), calculate R(x,y), and quantize R(x,y) to pixel values ​​in the range of 0 to 255. The calculation is as follows: Among them, min is the minimum value of R(x,y), and max is the maximum value of R(x,y); Assume that the width of the water gauge area image is W pixels, expand the water gauge area to the right with an expansion width of 2W, and expand it to the area containing the load line to obtain the water gauge load line area image; grayscale the water gauge load line area image, detect the image edge, and find the potential circular contour through the Hough circle detection method to obtain the load mark position.

3. The method for identifying a ship's draft and load line based on machine vision according to claim 2, characterized in that: Grayscale is converted using the weighted average method. The color component values ​​of the three RGB channels of the pixel in the original water gauge image I(x, y) are r, g, and b respectively. The grayscale value of the pixel is g = 0.299×r+0.587×g+0.114×b. The grayscale image H(x, y) is obtained based on the calculated grayscale value. Based on the grayscale image H(x,y), the Sobel operator is used for edge detection, and the horizontal gradient is calculated as follows: Vertical gradient: Calculate the edge value, that is, the gradient value After calculating the edge value of each pixel, an edge graph B(x,y) is formed; The gradient direction is Traverse all non-zero pixel points in the edge graph B(x,y), draw lines along the gradient direction, and use each point as an accumulator. If the line drawn along the gradient direction passes through a non-zero pixel point, the accumulator is increased by 1. All accumulators are sorted in descending order, and the first 5 points are selected as candidate circle centers. Calculate the distance d between all non-zero pixels in the edge map and the center of the candidate circle, and obtain a set of distance vectors d{d1, d2, …, d n }, n is the number of distances, and the distance vector d'{d'1,d'2,…,d' m },d' i ≥D,i∈[1,m], m is the number of remaining distances. The center of the circle with the largest accumulator value is selected from the remaining candidate centers as the center of the final detection. The distance that appears most times in d' is used as the radius to obtain the circular contour detection result, which is the load line position.

4. The method for identifying a ship's draft and load line based on machine vision according to claim 1, characterized in that: The calculation method of the draft value in step (7) is as follows: Assume that the distance between the ship's waterline and the bottom edge of the image is y p The pixel width of the water gauge reading character closest to the ship's waterline is N p , the distance between the lower edge of the water gauge reading character closest to the ship's waterline and the lower edge of the image is y t , the result of the character and number recognition of the water gauge reading is M t , the distance represented by each pixel is Draft value W = M t -(y t -y p )·D p , unit is meter.

5. A ship draft and load line recognition system based on machine vision, characterized in that: The system includes the following systems: An image acquisition module acquires images taken by a ship. The images taken by the ship contain the water gauge and waterline information of the ship at the bow, midship and stern. The images of the ship are automatically numbered and named according to the order of the front, middle and back of the ship. The load line calculation module pre-processes the images of the bow, midship and stern water gauge areas, uses a single-scale retinal color correction method for the bow, midship and stern water gauge images, expands the midship water gauge area, and obtains the load line position through pre-processing and Hough circle detection; A water gauge character recognition module performs water gauge character recognition on the preprocessed water gauge area image; A key point detection module inputs the ship image into a key point detection model to detect the key points of the ship waterline. The key point detection model takes the ship image as input and the marked key points of the ship waterline as output, and is trained to obtain the key point detection model; The ship line fitting module uses the least squares method to fit the ship's waterline based on the key points of the ship's waterline; The overload judgment module compares the ship's waterline at the bow, midship and stern with the position of the ship's load mark. If the ship's waterline is higher than the ship's load mark, it is judged to be overloaded; if it is lower than the load line, it is judged to be not overloaded; The draft value calculation module determines whether the bow, midship and stern of the ship are overloaded. If it is determined to be overloaded, the draft values ​​of the bow water gauge, midship water gauge and stern water gauge of the overloaded ship are calculated respectively.

6. A ship draft and load line identification system based on machine vision according to claim 5, characterized in that: The functions of the load line calculation module are as follows: Set the original water gauge image to I(x,y), perform Gaussian filtering on the original water gauge image, set the filtering parameter to c, and get the filtering result L(x,y). According to the formula R(x,y)=log(I(x,y))-log(L(x,y)), calculate (R(x,y)), and quantize R(x,y) to pixel values ​​in the range of 0 to 255. The specific calculation is as follows Among them, min is the minimum value of R(x,y), and max is the maximum value of R(x,y); Assuming the image width of the midship draft gauge area is W pixels, the midship draft gauge area is expanded to the right with an expansion width of 2W to the area containing the load line to obtain the draft gauge load line area image; the draft gauge load line area image is grayed out, and the image edge is detected. The potential circular contour is found through the Hough circle detection method to obtain the load mark position.

7. A ship draft and load line identification system based on machine vision according to claim 6, characterized in that: Grayscale is converted using the weighted average method. The color component values ​​of the three RGB channels of the pixel in the original water gauge image I(x, y) are r, g, and b respectively. The grayscale value of the pixel is g = 0.299×r+0.587×g+0.114×b. The grayscale image H(x, y) is obtained based on the calculated grayscale value. Based on the grayscale image H(x,y), the Sobel operator is used for edge detection and horizontal gradient calculation Vertical gradient Edge value, i.e. gradient value After calculating the edge value of each pixel, an edge graph B(x,y) is formed; The gradient direction is Traverse all non-zero pixel points in the edge graph B(x,y), draw lines along the gradient direction, each point is an accumulator, if the line drawn along the gradient direction passes through the point, the accumulator is increased by 1, all accumulators are sorted in descending order, and the first 5 points are selected as candidate circle centers; Calculate the distance d between all non-zero pixels in the edge map and the center of the candidate circle, and obtain a set of distance vectors d{d1, d2, …, d n }, the distance vector d'{d'1,d'2,…,d' m },d' i ≥D,i∈[1,m], m is the number of remaining distance vectors. The center of the circle with the largest accumulator value is selected from the remaining candidate centers as the center of the final detection, and the distance that appears most times in d' is used as the radius to obtain the circular contour detection result, which is the load line position.

8. A ship draft and load line identification system based on machine vision according to claim 7, characterized in that: The draft value is calculated as follows: Assume that the distance between the ship's waterline and the bottom edge of the image is y p The pixel width of the water gauge reading character closest to the ship's waterline is N p , the distance between the lower edge of the water gauge reading character closest to the ship's waterline and the lower edge of the image is y t , the result value of the water gauge reading character and digital recognition is M t , the distance coefficient represented by each pixel is Draft value W = M t -(y t -y p )·D p , unit is meter.

Citation Information

Cited By

  • Method for identifying ship behaviors based on images of overwater electronic checkpoint

    CN120580889A