2.1. Calibration
To solve
, the coordinates of the center point and the normal vector of the reference object in each sensor coordinate system must be obtained. Binocular cameras need to be pre-calibrated to establish internal parameters. In addition, the subsequent calculation also needs the length and width of the chessboard, as well as the number of corners and the size of each grid in the chessboard. We use the OpenCV built-in function [
38] to determine the position of the checkerboard grid in the image and locate its edges and corners. The detected checkerboard edges and corners are combined with preset parameters as input to tackle the perspective-N-point problem (PnP). The output results include the calibrated center coordinate
and the normal vector
, which accurately describe the position relationship of the checkerboard grid in the camera coordinate system.
For the LiDAR, we manually select a specific 3D region to ensure that the checkerboard is the only object within this range. To achieve this, we use the RANSAC algorithm to fit the point clouds in this region and generate a plane that accurately matches the checkerboard. The four vertices of this plane represent its extreme points. We then select four clusters that contain these extreme points and connect two points from each nearby cluster to obtain the edges of the fitted rectangular board. By calculating the variance of these fitted edges, we iterate until we find the edge and four vertices with minimal error. Additionally, for a given plane, we obtained both its center point coordinate by connecting diagonals and its normal vector .
To solve the overfitting problem, we rotate the chessboard through a specific angle to ensure that the normal vector is evenly distributed after each sampling. After repeating the process for many times, we obtain four groups of samples:
, each with a dimension of
. Here,
represent the matrices of normal vectors for the calibration board in the LiDAR and camera frames respectively, while
correspond to the center points of the calibration board in the LiDAR and camera frames respectively. The extrinsic matrix can be described by Equation (
1).
Here, the rotation and translation between multiple sensors are denoted by
and
, respectively. While
can be directly computed, the
can be obtained using the following formula:
In order to obtain more accurate extrinsic parameters, we incorporate the estimated values into the sample set and optimize until the error is minimized. Eventually we can fuse the point cloud and pixels through an extrinsic matrix, as shown in
Figure 2 2.4. Two-Stage Point Cloud Clustering Algorithm
After preprocessing, the point cloud data generated by LiDAR is used to identify obstacles on the water surface. In order to achieve real-time detection with low computational cost, the scheme based on clustering is more suitable. At present, Euclidean distance clustering method is widely used as a density based algorithm because of its robustness and fast response characteristics. Through calculating the distance between two points in two spaces, points can be determined whether they belong to the same object through threshold comparison.
However, in complex scenes, most methods are prone to producing false-positives, especially when multiple objects are densely distributed. Therefore, we propose a two-stage detection framework: The first stage uses Euclidean distance clustering algorithm to achieve fast object detection. In the second stage, the depth map adaptive threshold clustering algorithm is used to fine segment the small area.
First stage clustering module.The Euclidean clustering algorithm is utilized as the first stage detector for point cloud object detection. It takes inputs such as the clustering radius R, the minimum number of points in a cluster and the filtered point cloud set after removing water surface points. However, in reality, the collected point cloud is not uniform and becomes sparser as it gets farther from the unmanned ship. Using the same parameters for distant objects could result in false detections. To address this issue, we modify the algorithm by making the clustering radius distance-adaptive, allowing for a larger threshold for distant objects. The first stage clustering method is described in Algorithm 1. Each point in is assigned a number to facilitate later classification. An initial center point is selected, and a non-empty neighborhood with radius r is constructed around it. All points within this neighborhood are added to a cluster, and this process continues until no new points are found within radius r. These points are then grouped together and labeled under a specific category representing their cluster. If a cluster has too few points, which may result in false detection, we delete it and move on to the next loop. Finally, the 3D bounding box of the detected object is obtained based on the extreme value of the coordinates of the points inside the clusters.
| Algorithm 1: Euclidean clustering. |
![Remotesensing 17 03708 i001 Remotesensing 17 03708 i001]() |
Second stage clustering module. The Euclidean clustering method has a significant effect on the distribution of objects scattered on the water surface. However, when multiple objects are closely adjacent, this method is difficult to distinguish a single object from multiple objects. Although this limitation does not affect the obstacle detection of unmanned ship, it is still a defect. To solve this problem, we developed a two-stage point cloud detection scheme called depth map adaptive threshold clustering method. Compared with the previous stage method, this scheme significantly improves the object segmentation accuracy and the overall detection effect.
When the detected 3D bounding box may contain multiple objects, and the distance between adjacent objects is less than the clustering radius, different horizontal and vertical resolutions will lead to the difference in the distance between points in each direction. As shown in
Figure 4, directly adopting the same clustering radius will directly increase the risk of misjudgment. This strategy combines point cloud distribution and attribute information to identify discontinuities between points. In addition, the method also considers the multi-azimuth resolution and accurately adjusts the clustering radius to accurately detect the point cloud of adjacent objects.
When there is a discontinuity between points, the coordinate values should change abruptly. In Case 1 of
Figure 5, as the clustering algorithm becomes more tolerant of offsets in the X-axis dimension and stricter with offsets in other axis dimensions, the distribution of points satisfying the clustering criterion shifts from spherical to elliptical. This dynamic adjustment improves the ability to identify discontinuities and reduces misclassification. The same principle applies when performing clustering in the vertical dimension, where more attention is given to axes without fixed offsets, as shown in Case 2 of
Figure 5.
To address the issue of an unordered set of points in a point cloud, we convert it into a hash table format. This format resembles a 2D image with pixels arranged in predetermined patterns. Each element in the hash table contains coordinates, intensity and line count per point in the point cloud. This structured representation improves searchability and efficiency. For input point cloud data, we introduce a hash table with dimensions
H (number of scan lines) and
W (horizontal resolution of LiDAR). The index for each element
in the hash table can be represented as follows:
After clustering the point cloud data in the first stage, the resulting clusters can be transformed into a hash table format. Each row in the hash table represents a group of points on the same horizontal plane under realistic conditions. The maximum number of points in a single row is denoted as . The property within the point cloud attributes indicates the laser beam number to which each point belongs. The difference in line numbers between points within a cluster is defined as . By considering the parameters and , we can approximate the shape of the point cloud.
A point
p in space can be represented in polar coordinates as
, where
r is the distance of the point and
and
are the vertical and horizontal angles from the point to the plane, respectively. In sensing system, the following transformation hold:
To adapt to the sparsity of point clouds at greater distances, we adjust the clustering radius accordingly. We achieve this by applying a density-based adaptive thresholding method, which was originally proposed for 2D detection [
39,
40], to 3D clustering approach. In
Figure 6,
represents the current centroid, while
is randomly distributed in space as proximity points. The angle
between these two points and the origin corresponds to the angular of LiDAR resolution. By modifying the custom parameter
, we can obtain a more precise area-adaptive clustering scale
R. This relationship can be deduced from
Figure 6:
When , it can be ensured that the neighborhood radius needs to grow approximately linearly with distance and that each clustered neighborhood contains a sufficient number of points.
In Algorithm 2, we describe the second stage of clustering. This stage involves building a hash table, which is achieved from line 1 to line 10. Once the hash table construction is complete, the search for neighbors takes place.
Figure 4 illustrates that the point clouds have varying resolutions in the horizontal and vertical dimensions. To account for this, different parameters
are used in different directions, as indicated in line 16 and line 17.
| Algorithm 2: The Second Stage Clustering. |
![Remotesensing 17 03708 i002 Remotesensing 17 03708 i002]() |
Considering the distribution of point cloud data, we have designed an elliptical mask that closely matches the shape of current point cloud clusters. The purpose of this design is to minimize empty elements within the hash table and maximize neighboring elements relevant to each current point during neighborhood searches. Equation (
8) represents the expression for this designed mask.
where
is the current center point in hash table and
and
are the scaling parameters.
and
are obtained above to represent the horizontal and vertical shape of the point cloud.
and
constrain the pitch and azimuth differences between pairs of points, respectively, and are used to filter across objects or noisy points; since LiDAR has a much lower pitch resolution,
and
are taken to ensure that the masks cover similar numbers of valid neighboring points at different distances.
Since there are varying resolutions in the hash table for both horizontal and vertical dimensions, different clustering criteria need to be developed. Additionally, as points move away from the center point within a neighborhood, their confidence level should decrease. Equation (
9) illustrates an elliptical heatmap centered on the current point, which has the same shape as the previously mentioned mask design. The intensity value at its center is 1, gradually decreasing towards its edges. Equation (
9) provides each element’s heat value, as shown in
Figure 7.
Algorithm 2 outlines the second stage of clustering, which involves conducting neighborhood searches for each element in the hash table. To identify points within the same cluster, two criteria must be met: first, the distance between two points should be less than the clustering radius defined in Equation (10).
where
is the relative distance between two points,
is the value calculated from the heat map and
and
denote the cluster radius in the horizontal and vertical directions, respectively. An additional criterion for identifying whether points within a neighborhood belong to the same category is that consecutive angle changes should be below a given threshold, as shown in Equation (
11).
where both
and
are threshold parameters. Only when both of the above criteria are satisfied will the points be labeled as belonging to the same category. Moreover,
and
for filtering across objects or noise points.
In the above clustering process, only points that strictly meet the criteria will be marked as part of the cluster. This means that only points that are adjacent to each other will be grouped and points that deviate slightly from the group may not be marked as belonging to the same object. Unmarked points do not belong to any category and need to be further distinguished. Therefore, we finally identify all unmarked points based on the distribution and characteristics of the marked points.
Considering the characteristics of the LiDAR point cloud, it can be inferred that the points on the water surface and the object are usually distributed on a plane or smooth surface. So we regard these points in the cluster as points on the same plane. To determine the plane, we use the extreme points in the point cloud cluster to find the center point O and then use the RANSAC plane fitting algorithm to fit and identify the best model of the plane. At the same time, the normal vector of the fitting plane is obtained.
For both labeled and unlabeled points within this cluster, we connect them with either their centroid or with centroid of their respective planes to form vectors
. These vectors should ideally have a dot product value of 0 when compared with their corresponding planes’ normal vector
. The calculation for this dot product is shown in Equation (
12), illustrated in
Figure 8.
If the
is greater than a threshold, the point is considered to not belong to the plane; otherwise, the point is identified as belonging to the current cluster. If there are multiple clusters that meet this condition, the unlabeled point will be compared with each plane, as shown in
Figure 8, and assigned to the cluster with a smaller angle. This process results in obtaining the refined 3D bounding box
.
2.5. Saliency Detection
In order to achieve accurate segmentation of water surface objects, we combine the coordinates obtained by LiDAR with the fine features captured by camera. The proposed method uses the point cloud detection results as the input to detect the prominent objects on the water surface. This scheme can effectively correct the detection results and achieve accurate segmentation, so as to realize water surface object detection by fusing LiDAR and camera data.
In order to reduce the interference of reflection, overexposure and other factors on saliency detection in the whole image, we project the 3D point cloud detection results to the image to define the candidate region. In this way, the detection range is reduced and the external interference is successfully avoided. However, due to the extrinsic matrix error, the projection area may not fully contain the real object. To solve this problem, we expand the projection area in proportion before implementing the saliency object detection algorithm.
From a visual point of view, areas with unique characteristics tend to be more prominent in the image. The saliency detection algorithm quantifies the contrast between the foreground and the background by using the differentiated saliency value. After obtaining the region of interest with significant color contrast between the object and the background, we use the global contrast saliency detection algorithm. In the image taken on the water surface, the background can be regarded as low-frequency information but may contain high-frequency noise components. The object belongs to a high-frequency signal relative to the background. Our goal is to filter high-frequency noise and low-frequency background signals so as to identify objects with the largest significant area. Therefore, the accurate selection of bandpass filter parameters is very important [
41,
42].
We use the combination of multiple Gaussian differences as bandpass filters. A single Gaussian filter can be expressed as Equation (
13).
where
,
are the standard deviation, the filter whose bandpass width is determined by
, suppose
. Each time the Gaussian function is executed, it is equivalent to a bandpass filter to find out the potential location of the object in the image. The full bandpass filter can be expressed as follows:
Gaussian filtering is performed
N times on different scales and summed to filter as much noise and background as possible so that the location of the object is more prominent. The original and Gaussian filtered images are then transformed into
space, and the final saliency score of each pixel on the image can be expressed as Equation (
15).
is the arithmetic mean of pixels in space and means is the result of Gaussian filtering in space. The largest connected region with a pixel score above the threshold should be the location where the actual object.