Abstract
Port loading automation systems can improve the efficiency of cargo transfer, save port operation time and create greater economic benefits. The recognition of ship hatch is the basis and premise of building an automatic loading system, it is a major time cost in the loading system meanwhile. How to identify the hatch quickly and accurately is an important problem that needs to be solved urgently under the actual production needs of ports. In order to save the time of ship hatch recognition, this paper proposes a fast hatch recognition algorithm based on point cloud contour extraction. The ship point cloud model generated by lidar scanning is preprocessed to remove the noise and isolated points in the model. Projecting the preprocessed point cloud on the XOY plane, converting the three-dimensional point cloud into a two-dimensional image, extracting the outline further getting the point cloud pixels with linear features of the two-dimensional image by
Introduction
Ocean shipping plays a pivotal role in cargo transportation with low cost and huge throughput when the transoceanic transportation of huge volumes of cargo can only be done by it especially. Port is the hub of marine transportation which realizes the conversion of land and sea. It is the eternal pursuit of the port to continuously improve its production efficiency and create higher economic benefits. Guoneng Tianjin Port Corporation, which production and operation field is coal, has a series of complex transportation processes from coal entering the port to leaving the port, of which the most important and complex is the loading link. It needs to improve the efficiency of loading predominantly to increase the production capacity of the port which directly limits the throughput level of the port’s cargo. Due to the complex operating environment of bulk cargo ports and the various types of industrial equipment involved, most of the industrial equipment in bulk ports is still manually operated, which greatly limits the efficiency of cargo transfer. It is an effective way to improve production efficiency and create greater economic benefits to establish the automatic loading system1–5 and carry out loading operation continuously and stably. Ship hatch identification is the first link of loading operation in the automatic ship loading system which is the foundation and prerequisite. The hatch recognition program calculates the hatch coordinates and feeds them back to the ship loader motion control system for coal loading operations in real-time. The speed of recognition directly restricts the efficiency of coal loading and affects the coal output of the port. It is imperative to establish a set of fast and accurate hatch identification procedures which is a requirement of actual port production.
Lidar is an important sensing device in the automation system of ship loading6–8 as it can provide stable ship scanning data and is not affected by time, light, and weather conditions which meets the needs of port operations. Compared with single-line lidar, multi-line lidar data is more abundant and more robust. It can not only ensure the stability of point cloud stitching but also provide a larger viewing angle in a static state, which is convenient for subsequent real-time hatch identification. There has been some certain research foundation for the identification of ship hatches through the processing of lidar data.9–11
Mi
9
proposed a fast ship identification algorithm based on the ship point cloud generated by line lidar scanning. By projecting the ship point cloud into the XOY plane, the point cloud pixels are counted along the X-axis and the Y-axis separately for the hatch recognition. But its research object is limited to the point cloud of whole ship scanning, which is not a common process in actual production. Taking Guoneng Tianjin Port as an example, it takes more than 10 min to perform a full ship scan, which affects the output of thousands of
Xi-Liang et al. 10 is also processing single-line lidar data. The point cloud is projected onto the XOY plane and transformed into a two-dimensional image. A variable size rectangular box is used as a seed searching in the two-dimensional image and extracting rectangular features. This method is suitable for a more regular point cloud, and the determination of search starting point will have greater randomness for the irregular point cloud. At the same time, when using the matrix operator to find the starting point, it needs to traverse the whole point cloud data while the whole hatch identification process takes too much time when the volume of the point cloud is large.
Miao
11
transforms the real-time point cloud in the operation area into a two-dimensional image, uses the
These algorithms all process the ship’s point cloud or the ship’s point cloud projected on a two-dimensional plane. When the merging point cloud model obtained is huge, it greatly limits the speed of hatch recognition. For this reason, this article considers that avoiding the overall point cloud, but choosing to process the point cloud outline, can greatly reduce the volume of the point cloud and further improve the speed of hatch recognition.
In order to ensure the port production efficiency and improve the ship automation system, this paper proposes a fast identification algorithm of ship hatch.
Point cloud modeling
Before the ship hatch recognition, the lidar’s three-dimensional scan model of the ship must be obtained firstly. The experimental site of this article is the Tianjin Port Terminal, and the research objects are mainly but not limited to the Tianjin Port Shenhua series ships. Figure 1 shows the real 3D model of the Tianjin Port Wharf, in which the yellow mechanism is the model of the ship loader, and the ship model is one of the Shenhua series ships of Tianjin Port. As shown in Figure 1, the world coordinate system OXYZ is established, and the coordinate origin O is established at the starting point of the port berth. Taking the center of the ship loader guide rail as the X-axis, and facing the left side of the ship loader as the positive direction. The Y-axis and the X-axis are in the same plane of the port shore which the direction perpendicular to the X-axis pointing to the ship is the positive direction. And the Z-axis is perpendicular to X-Axis and Y-axis, in the form of a

3D model of Tianjin Port Wharf.
Six LIVOX horizon lidars are fixed on the ship loader as the splicing of ship point clouds with the specific location as shown in Figure 1. Each lidar scans the ship’s area in real-time in the form of a fixed angle of view. Through calibrating the attitude matrix of the lidar in advance, the transformation matrix from lidar coordinates to the world coordinate system is obtained in combination with the position information of the ship loader measured by the encoder. Under normal working conditions, the ship loader is moving left or right with a constant speed of 1

Lidar scanning model of Shenhua 512.
Recognition algorithm
Preprocessing of splicing point cloud
The point cloud model obtained is mixed with a lot of noise and isolated points after completing the original lidar point cloud splicing. It is a normal phenomenon that the occurrence of noise and isolated points for the number of pixels is large as the laser lidar used is of surface laser data. In order to ensure the accuracy of hatch recognition, the first step is to filter noise and outliers. Traversing each pixel
Contour extraction
Projecting the preprocessed point cloud model onto the XOY plane, as shown in formula 6. Among them,
Using the

Schematic diagram of
In the specific operation of the ship point cloud model shown in Figure 2, the

Contour extraction result of point cloud in XOY plane by
Line feature extraction
After obtaining the contour point cloud in the two-dimensional plane, the linear feature extraction is performed on it. The bow and stern cables are fixed to ensure that the hull is basically parallel to the wharf sideline. For each pixel in the contour point cloud, setting a circular with a radius of

Contour point cloud after linear feature extraction.
Projection along the X-axis
The contour point cloud after linear feature extraction is projected onto the X-axis for clustering processing. It can be seen from Figure 5 that the contour point cloud is mostly the horizontal point cloud and the vertical point cloud surrounding the hatch after the linear feature extraction. By projecting to the X-axis, the point cloud around the same hatch can be gathered together and use clustering algorithms to easily separate them. In the specific operation, the Y-axis coordinate of each point is assigned to the intensity variable for temporary storage, so that the Y-axis coordinate can be restored later, and the Y-axis coordinate of each point cloud is directly set to 0 as formula 12. Ships need to be fixed with cables at the bow and stern when berthing, and it cannot be ensured that they are completely parallel to the edge of the wharf with little error of the ship’s front and back. The method of directly setting the Y-axis coordinate of each point cloud to 0 has little effect on the result of hatch recognition.
Using the

Projection result of contour point cloud on X axis.
Feature point search
When the point cloud clustering is completed, the center point
After obtaining the feature points of the hatch, searching for points satisfied formula 16 in the initial three-dimensional point cloud model of the ship, setting the search neighborhood with the radius of
The complete algorithm of hatch identification is summarized in Table 1.
Steps of hatch recognition algorithm.
Experiment
Experiment 1
T600 made by TUWEI is used as the computing platform to receive and process lidar’s point cloud data which is based on NVIDIA Jetson Xavier core board with the CPU of 8-core Carmel arm structure and 16GB memory. The hatch recognition algorithm proposed in Table 1 was used to identify the three-dimensional point cloud model of the ship in Figure 2, and the final results are shown in Figures 7 and 8. Figure 7 is the perspective of the recognition results from the top of the Z-axis, and Figure 8 is the recognition result is the view of the bottom of the Z-axis. It can be seen that the proposed algorithm realizes each hatch recognition of the ship correctly, and the recognition accuracy is fine. In addition, there is a missing corner in the point cloud of the leftmost hatch, and the algorithm still makes a correct identification, indicating that the algorithm has a certain degree of robustness.

Hatch recognition result of the algorithm in this paper viewed from the top.

Hatch recognition result of the algorithm in this paper viewed from the bottom.
The specific hatch identification result and algorithm time-consuming are shown in Tables 2 and 3. The actual ship hatch size data is obtained from the Shenhua 512 ship chart, and the algorithm in this paper is compared with the Miao
11
algorithm. It can be seen from Table 2 that the algorithm in this paper has the largest error in the recognition of cabin
Hatch recognition results of Shenhua 512.
Shenhua 512 ship hatch identification time-consuming.
As shown in Table 2, the Miao
11
algorithm has taken several different sets of original point cloud down-sampling parameter values for comparison. For the same ship point cloud model, the VoxelGrid
13
filter is used for down-sampling filtering with the grid size parameter value of 0.2, the result of down-sampling the original point cloud by twice the voxel is recorded as Miao
11
-1, the result after the original point cloud is down-sampled by the voxel is recorded as Miao
11
-2, and the result of the original point cloud without down-sampling is recorded as Miao
11
-3. It can be seen from Table 2 that after down-sampling the original point cloud data by 2 times the voxel as Miao
11
-1, the recognition accuracy reached the highest. The hatch recognition error is basically within 0.3
In addition, it can be seen from Table 3 that compared with the method of Miao,
11
the algorithm speed of recognition in this paper has been significantly improved in terms of the algorithm time-consuming. Even though the algorithm in this article directly performs hatch recognition on the original stitching point cloud without down-sampling, the final recognition time is 15.302
Experiment 2
As shown in Figure 9, the second experiment is the hatch recognition result of the point cloud generated by the lidar splicing when the ship loader is stationary. As can be seen from Figure 9, in this experiment, the algorithm in this paper still has a good recognition effect for local point cloud with a total of 891 contour point cloud extracted pixels. The algorithm takes 3.39

Hatch recognition result under static view.
Conclusion and future work
This paper proposes a fast recognition algorithm for ship hatch edges based on point cloud contour extraction. The contour is extracted by projecting the ship point cloud model onto a two-dimensional plane, and further according to the hatch features, the contour point cloud is extracted in a horizontal and vertical straight-line feature, and the point cloud is projected to X-axis for clustering to realize different cabins separation. Searching for the nearest neighbor feature points of each hatch cluster center while considering the actual production anti-collision requirements of the port, and finally realize the identification of ship hatch. According to the actual docking ship Shenhua 512 three-dimensional point cloud model data of Guoneng Tianjin Port, the experimental results show that the algorithm proposed in this paper can quickly identify the ship’s hatch, and has good reliability and robustness. Compared with the previous algorithm, the speed of the algorithm in this article is several times faster. For the actual production anti-collision requirements of the port, the identification result fully meets the production needs, and there is an opportunity to merge point cloud while performing the hatch recognition, which further improves the efficiency of automated port shipment.
In order to further improve the algorithm in this paper and make it more stable in the actual production environment of the port, there are still some problems to be further studied and improved.
Improving the preprocessing effect of the scanning point cloud. Now, after the preprocessing algorithm, this paper mainly uses the variance filtering of the point cloud to remove the noise and outliers in the overall point cloud and highlight the main body of the ship point cloud. Later, it can consider adopting more extensive filtering methods, such as light intensity filtering, threshold filtering of the number of the point cloud in the neighborhood, to further highlight the main point cloud and eliminate point cloud noise in the hatch to improve the stability of the algorithm.
Improving the accuracy of hatch recognition. When searching for the feature points of the hatch, this paper selects the feature points closest to the center point considering the anti-collision requirements of the ship loader in actual production. Due to the selection of the nearest point, the recognition result is relatively conservative, which restricts the path planning of the ship loader and is not conducive to better deployment of cloth work. Later, the method of point cloud fitting on the side of the cabin can be used to further improve the recognition result.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported partially by the State Key Laboratory of Robotics and System (Grant No. SKLRS-2018-KF-12), the Heilongjiang Natural Science Foundation (Grant No. LH2019F020), the National Natural Science Foundation of China (Grant No. 62073101), and the Self-Planned Task of State Key Laboratory of Robotics and Systems of the Harbin Institute of Technology (Grant No. SKLRS202007B).
