A method and device for detecting the safety of a ship entering a lock
By setting anchor points and reference bars in front of the gate, combined with the cross-counting theorem, and using an image acquisition device to quickly measure the size of the ship, the problems of low efficiency and inaccurate measurement of ships in the prior art are solved, and efficient and accurate safety detection of ship entry into the gate are achieved.
Patent Information
- Application Number
- CN202310574151.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-05-22
AI Technical Summary
In the prior art, ships have low efficiency in passing through the locks, and ship tonnage measurement relies on manual observation and rough estimation, resulting in low efficiency, large data errors and omissions, and the measurement process is troublesome and inaccurate.
Four anchor points are set in the river channel in front of the gate to form a rectangle. Two reference benchmarks are on the water surface of the river bank. The image acquisition device is on the river bank on the other side of the benchmark. It uses the intersection theorem to determine the length, width and height of the ship from the image information, and judges the safety of the gate entry based on the gate limit parameters.
It realizes low-cost and efficient safety inspection of ship entry gates, simple scene construction, not easily affected by external factors such as weather, and high measurement accuracy and efficiency.
Smart Images

Figure CN116758781B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of measurement, and particularly to a method for measuring the size of a ship. Background Art
[0002] At present, the passing efficiency of domestic ships through locks is generally low. The key to ship tonnage measurement is the measurement of the geometric dimensions of the ship. Since the measurement of ship specifications relies on the statistical method of manual observation and rough estimation, the efficiency is low, the data error is large, and there are omissions. The measurement process is troublesome and inaccurate. Summary of the Invention
[0003] In order to solve the above problems, the present invention provides a detection scheme for the safety of ships entering the lock with low detection cost, high accuracy and high efficiency.
[0004] In order to achieve the above object, on the one hand, the present invention provides a method for detecting the safety of ships entering the lock, including the following steps:
[0005] S1: Set four anchor points in the river channel in front of the lock gate to form a rectangle;
[0006] S2: Set two reference poles on the water surface on the bank of the river channel, and the distance between the two reference poles is greater than the distance between two adjacent anchor points;
[0007] S3: Set an image acquisition device on the river bank on the other side of the reference pole, and the image acquisition device is arranged on the perpendicular bisector of the line connecting two adjacent anchor points;
[0008] S4: When the ship to be detected passes through the rectangle, the image acquisition device acquires the image information of the ship to be detected;
[0009] S5: Determine the length and width of the ship to be detected according to the image information and the cross-ratio theorem;
[0010] S6: Determine the height of the ship to be detected according to the image information and the cross-ratio theorem;
[0011] S7: Determine whether the ship to be detected is safe to enter the lock according to the comparison between the limit parameters of the lock gate and the length, width and height of the ship.
[0012] As a preferred technical solution, the length of the rectangle is 30% - 50% greater than the length of the largest ship that can pass through the lock gate.
[0013] As a preferred technical solution, the width of the rectangle is 30% - 50% greater than the width of the largest ship that can pass through the lock gate.
[0014] As a preferred technical solution, the reference pole is perpendicular to the water surface.
[0015] As a preferred technical solution, the anchor point is perpendicular to the water surface and the length exposed above the water surface is 20 to 50 cm.
[0016] As a preferred technical solution, the image collected by the image acquisition device includes four anchor points, the whole body of the ship to be detected, and a reference benchmark.
[0017] As a preferred technical solution, the step S5 further includes:
[0018] The extension line of the line segment XY where the length of the ship to be detected is located intersects the two sides of the rectangle at J and K;
[0019] According to the theorem of cross ratio , since is known, can be obtained;
[0020] Similarly, can be obtained;
[0021] The length of the ship is obtained;
[0022] Among them, represents the distance between two points, A, B, C, and D represent the positions of the four anchor points in the real space, X and Y represent the positions of the ship to be detected in the real space, J and K represent the intersection points of the extension line of the line segment where the ship to be detected is located and the sides of the rectangle formed by the four anchor points; the lowercase letters represent the positions of the respective points in the real space in the collected image, and m1 is the vanishing point where ab and cd intersect.
[0023] As a preferred technical solution, the step S6 further includes:
[0024] Plane a is perpendicular to plane b, and the reference benchmark HT and the height MN of the ship are perpendicular to plane a;
[0025] m1m2 is the vanishing line of plane a, vz is the vanishing point of the line ht, and vp is the vanishing point of the line hn;
[0026] Connect the point vp to m and intersect ht at r. Since the parallel lines in the real space will have the same vanishing point in the photo space, MN = HR in the real space;
[0027] Take the four points h, r, t, and vz, and by the theorem of cross ratio , determine the height of the ship ;
[0028] Among them, represents the distance between two points, and R represents the projection of the vertex of the ship's height on the reference benchmark.
[0029] On the other hand, the present invention also provides a ship lock-in safety detection device, including:
[0030] Four anchor points, which are arranged in a rectangle in the river channel in front of the lock gate;
[0031] Reference benchmarks, which are arranged on the water surface on the bank of the river channel, and the distance between the two reference benchmarks is greater than the distance between two adjacent anchor points;
[0032] An image acquisition device, which is arranged on the bank on the other side of the benchmark, and the image acquisition device is arranged on the perpendicular bisector of the connection line of two adjacent anchor points; when the ship to be detected passes through the rectangle, the image acquisition device acquires the image information of the ship to be detected;
[0033] A first determination unit, which is used to determine the length and width of the ship to be detected according to the image information and the cross-ratio theorem;
[0034] A second determination unit: determines the height of the ship to be detected according to the image information and the cross-ratio theorem;
[0035] A third determination unit: determines whether it is safe for the ship to be detected to enter the lock by comparing the defined parameters of the lock gate with the length, width and height of the ship.
[0036] The beneficial effects of the present invention compared with the prior art are as follows: the construction cost of this detection method is low, only four anchor points, a camera and reference benchmarks need to be arranged according to the requirements, and it is simple and efficient. The scene construction is simple, and the ship size information can be quickly obtained relying on computer vision technology, and it is not easily affected by external factors such as weather and temperature, and the measurement accuracy and efficiency are very high. Brief Description of the Drawings
[0037] Figure 1 is a flowchart of a method for detecting the safety of a ship entering a lock provided by an embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of the layout of anchor points and an image acquisition device provided by an embodiment of the present invention;
[0039] Figure 3 is a schematic diagram for calculating the length and width of a ship provided by an embodiment of the present invention;
[0040] Figure 4 is a schematic diagram for calculating the height of a ship provided by an embodiment of the present invention;
[0041] Figure 5 is a structural diagram of a method for detecting the safety of a ship entering a lock provided by an embodiment of the present invention. Embodiment
[0042] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0043] As Figure 1 shown, this embodiment provides a method for detecting the safety of a ship entering a lock, including the following steps:
[0044] S10: Set four anchor points in the river before the lock gate to form a rectangle;
[0045] Specifically, as Figure 2 shown, set four anchor points A, B, C, and D within the range that the ship must pass through in the river to form a rectangular frame. E and F are the intersections of the extended lines of AC and BD with the riverbank.
[0046] In this embodiment, the anchor points need to be set on the water surface, preferably with a bright color. Their size can be set between 20 and 50 cm, so that they can be clearly seen in the finally taken picture and represent a point without being too large. They can be square or circular.
[0047] In some other embodiments, the length L (AB) and width W (CD) of the rectangular frame ABCD need to satisfy being 30% - 50% larger than the largest ship passing through the lock.
[0048] S20: Set two reference poles on the water surface on the riverbank. The distance between the two reference poles is greater than the distance between two adjacent anchor points;
[0049] Specifically, as shown in Figure 2, at points H and I on the water surface at the junction of the water and the bank, erect a reference pole with a height h above the water surface. The pole needs to be perpendicular to the water surface. The position is selected so that the entire pole can be clearly seen in the taken picture.
[0050] S30: Set an image acquisition device on the riverbank on the other side of the pole. The image acquisition device is set on the perpendicular bisector of the line connecting two adjacent anchor points. In this embodiment, the image acquisition device uses a camera.
[0051] As Figure 2 shown, collect image data at point G on the riverbank. The position of point G on the left and right of the riverbank corresponds to the midpoint position of CD. The height of point G and the distance from CD need to satisfy: First, clearly and completely capture the four anchor points A, B, C, and D. Second, clearly and completely capture the length, width, and height of the ship. And clearly and completely capture the reference pole erected at point H. Finally, the time point for collecting the picture data needs to be selected during the period when the ship completely enters the square enclosed by ABCD.
[0052] S40: When the vessel to be detected passes through the rectangle, the image acquisition device acquires the image information of the vessel to be detected;
[0053] S50: Determine the length and width of the vessel to be detected according to the image information and the cross-ratio theorem;
[0054] As Figure 3 shown, the rectangular frame ABCD and the line segment XY are points in the real space. The line segment XY represents the length of the vessel. Each point is represented by a capital letter. The extension of XY intersects the two sides at J and K. The right figure represents the corresponding points (represented by lowercase letters) of the points in the real world in the space captured by the camera.
[0055] According to the imaging principle, ab and cd will intersect at the vanishing point m1 in the photo space, and ad and bc will intersect at m2. Since XY is parallel to AB and CD, j, x, y, k, and m1 are collinear (connect m1m2, then m1m2 is the vanishing line of this plane, and the vanishing points of all lines in this plane are on the vanishing line).
[0056] Take the four points j, y, k, and m1. According to the cross-ratio theorem , since is known, can be obtained.
[0057] Among them, represents the distance between two points. A, B, C, and D represent the positions of four anchor points in the real space; lowercase letters represent the positions of the points in the real space in the acquired image, and m1 is the vanishing point where ab and cd intersect.
[0058] Take the four points j, x, y, and m1. Similarly, can be obtained, so the length of the ship .
[0059] Similarly, the width of the vessel to be detected can be obtained.
[0060] S60: Determine the height of the vessel to be detected according to the image information and the cross-ratio theorem;
[0061] As Figure 4 shown, plane a is perpendicular to plane b, the reference benchmark HT and the height MN of the vessel are perpendicular to plane a;
[0062] m1m2 is the vanishing line of plane a, vz is the vanishing point of the line ht, and vp is the vanishing point of the line hn;
[0063] Connect the point vp and m to intersect ht at r. Since parallel lines in the real space will have the same vanishing point in the photo space, MN = HR in the real space;
[0064] Take the four points h, r, t, and vz. According to the cross-ratio theorem , determine the height of the ship ;
[0065] Wherein, represents the distance between two points, and R represents the projection of the vertex of the ship's height on the reference benchmark.
[0066] S70: Determine whether the ship to be detected is safe to enter the lock according to the defined parameters of the lock and the length, width and height of the ship.
[0067] After determining the length, width and height of the ship to be detected, compare them with the length, width and height of the ship with the maximum safe passage through the lock to determine whether the ship can safely pass through the lock.
[0068] The construction cost of this detection method is low. Only four anchor points, a camera and a reference benchmark need to be arranged according to the requirements. Moreover, it is simple and efficient. The scene setup is simple. Relying on computer vision technology, the ship size information can be quickly obtained, and it is not easily affected by external factors such as weather and temperature. The measurement accuracy and efficiency are very high.
[0069] As Figure 5 shown, this embodiment of the present invention also provides a ship lock-in safety detection device, including:
[0070] Four anchor points 100, and the four anchor points are arranged in the river channel in front of the lock to form a rectangle;
[0071] A reference benchmark 200, and the reference benchmark is arranged on the water surface on the bank of the river channel. The distance between the two reference benchmarks is greater than the distance between two adjacent anchor points;
[0072] An image acquisition device 300, and the image acquisition device is arranged on the river bank on the other side of the benchmark. The image acquisition device is arranged on the perpendicular bisector of the connection line of two adjacent anchor points; when the ship to be detected passes through the rectangle, the image acquisition device acquires the image information of the ship to be detected;
[0073] A first determination unit 400, configured to determine the length and width of the ship to be detected according to the image information and the cross-ratio theorem;
[0074] A second determination unit 500: Determine the height of the ship to be detected according to the image information and the cross-ratio theorem;
[0075] A third determination unit 600: Determine whether the ship to be detected is safe to enter the lock according to the defined parameters of the lock and the length, width and height of the ship.
[0076] In addition, this embodiment of the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium can store a program, and when the program is executed, it includes some or all of the steps of any ship lock-in safety detection method recorded in the above method embodiment.
[0077] In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0078] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. And the aforementioned memory includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs and other various media that can store program codes.
[0079] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory, and the memory can include: flash drives, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks, or optical discs, etc.
[0080] The above has described an exemplary flowchart for implementing a method for detecting the safety of a ship entering a lock according to an embodiment of the present invention with reference to the accompanying drawings. It should be noted that the large number of details included in the above description are only exemplary explanations of the present invention, rather than limitations on the present invention. In other embodiments of the present invention, the method may have more, fewer, or different steps, and the order, inclusion, function, etc. relationships between the steps may be different from those described and illustrated.
Claims
1. A method for detecting the safety of a ship entering a lock, characterized in that, Including: S1: Set up four anchor points in the river channel in front of the lock gate to form a rectangle; S2: Set up two reference poles on the water surface on the bank of the river channel, and the distance between the two reference poles is greater than the distance between two adjacent anchor points; S3: Set up an image acquisition device on the bank on the other side of the pole, and the image acquisition device is set on the perpendicular bisector of the line connecting two adjacent anchor points; S4: When the ship to be detected passes through the rectangle, the image acquisition device acquires the image information of the ship to be detected; S5: Determine the length and width of the ship to be detected according to the image information and the cross-ratio theorem, including that the extension line of the line segment XY where the length of the ship to be detected is located intersects the two sides of the rectangle at J and K; According to the theorem of cross ratio Since d(J, K) = d(A, B) is known, d(J, Y) can be obtained; Similarly, d(J, X) can be obtained; Get the ship length d(X, Y) = d(J, Y) - d(J, X); Wherein, d(*, *) represents the distance between two points, A, B, C, D represent the positions of the four anchor points in the real space, X, Y represent the positions of the ship to be detected in the real space, J, K represent the intersection points of the extension line of the line segment where the ship to be detected is located and the sides of the rectangle formed by the four anchor points; lowercase letters represent the positions of each point in the real space in the acquired image, and m1 is the vanishing point where ab intersects cd; S6: Determine the height of the ship to be detected according to the image information and the cross-ratio theorem, including that plane α is perpendicular to plane β, and the reference pole HT and the height MN of the ship are perpendicular to plane α; m1m2 is the vanishing line of plane α, vz is the vanishing point of line ht, and vp is the vanishing point of line hn; Connect point vp to m and intersect ht at r. Since parallel lines in the real space will have the same vanishing point in the photo space, so MN = HR in the real space; Take four points h, r, t, vz, and by the theorem of cross ratio Determine the height of the ship d(M,N) = d(H,R); Wherein, d(*, *) represents the distance between two points, and R represents the projection of the vertex of the ship height on the reference pole; S7: Determine whether it is safe for the ship to be detected to enter the lock according to the limit parameters of the lock gate and the length, width and height of the ship.
2. The method for detecting the safety of a ship entering a lock according to claim 1, characterized in that: The length of the rectangle is 30% - 50% greater than the length of the largest ship that can pass through the lock gate.
3. The method for detecting the safety of a ship entering a lock according to claim 1, wherein The width of the rectangle is 30% - 50% greater than the width of the largest ship that can pass through the lock gate.
4. The method for detecting the safety of a ship entering a lock according to claim 1, characterized in that: The reference pole is perpendicular to the water surface.
5. The method for detecting the safety of a ship entering a lock according to claim 1, characterized in that: The anchor points are perpendicular to the water surface and the length exposed above the water surface is 20 - 50 cm.
6. The method for detecting the safety of a ship entering a lock according to claim 1, wherein: The image acquired by the image acquisition device includes four anchor points, the whole body of the ship to be detected and the reference pole.
7. A safety detection device for a ship entering a lock, characterized in that, Including: Four anchor points, and the four anchor points are set in the river channel in front of the lock gate to form a rectangle; Reference poles, and the reference poles are set on the water surface on the bank of the river channel, and the distance between the two reference poles is greater than the distance between two adjacent anchor points; Image acquisition device, the image acquisition device is set on the bank on the other side of the pole, and the image acquisition device is set on the perpendicular bisector of the line connecting two adjacent anchor points; when the ship to be detected passes through the rectangle, the image acquisition device acquires the image information of the ship to be detected; The first determination unit is used to determine the length and width of the ship to be detected according to the image information and the cross-ratio theorem; Including , the extension line of the line segment XY where the length of the ship to be detected is located intersects the two sides of the rectangle at J and K; According to the theorem of cross ratio Since d(J, K) = d(A, B) is known, d(J, Y) can be obtained; Similarly, d(J, X) can be obtained; Obtain the ship's length \(d(X,Y)=d(J,Y)-d(J,X)\); where \(d(*,*)\) represents the distance between two points, \(A\), \(B\), \(C\), \(D\) represent the positions of four anchor points in the real space, \(X\), \(Y\) represent the positions of the ship to be detected in the real space, \(J\), \(K\) represent the intersection points of the extension lines of the line segment where the ship to be detected is located and the sides of the rectangle formed by the four anchor points; lowercase letters represent the positions of each point in the real space in the collected image, and \(m_1\) is the vanishing point where \(ab\) intersects \(cd\); The second determination unit: Determine the height of the ship to be detected according to the image information and the cross-ratio theorem; including, plane \(\alpha\) is perpendicular to plane \(\beta\), the reference benchmark \(HT\), and the height \(MN\) of the ship is perpendicular to plane \(\alpha\); \(m_1m_2\) is the vanishing line of plane \(\alpha\), \(vz\) is the vanishing point of the line \(ht\), and \(vp\) is the vanishing point of the line \(hn\); Connect the point \(vp\) and \(m\) to intersect \(ht\) at \(r\). Since parallel lines in the real space will have the same vanishing point in the photo space, so \(MN = HR\) in the real space; Take four points h, r, t, vz, according to the theorem of cross ratio Determine the ship height d(M, N) = d(H, R); where \(d(*,*)\) represents the distance between two points, and \(R\) represents the projection of the vertex of the ship's height on the reference benchmark; The third determination unit: Determine whether the ship to be detected is safe to enter the lock according to the limit parameters of the lock and the length, width and height of the ship.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of a ship lock-in safety detection as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Ship information display system, ship information display method, image generation device, and program
CN114258372A
Method of measuring dimension of image
JP2004212142A