Underwater three-dimensional mapping method and device based on side-scan sonar
Through the processing of side-scan sonar echo data and the application of reprojection functions, data association and elevation angle recovery of underwater three-dimensional mapping are realized, which solves the problem of inability to carry out three-dimensional mapping in the existing technology and achieves high-precision Underwater map construction.
Patent Information
- Application Number
- CN202410720821.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-08-30
AI Technical Summary
Existing side-scan sonar cannot achieve three-dimensional mapping in underwater detection, cannot obtain the elevation angle of the target, and cannot perform inter-frame data correlation, resulting in insufficient mapping accuracy in complex waters.
By acquiring side-scan sonar echo data, we perform key frame generation and loop detection, correct poses, use side-scan sonar reprojection functions to perform epipolar search and beam adjustment, build a three-dimensional point cloud map, and achieve data association and elevation angle recovery. .
It achieves decimeter-level three-dimensional mapping accuracy in large viewing angle changes and complex waters, provides powerful data association capabilities, and optimizes the pose and landmark position estimation of autonomous underwater vehicles.
Smart Images

Figure CN118570388A
Abstract
Description
Technical Field
[0001] The present invention belongs to underwater surveying and mapping technology, and in particular relates to a method and device for underwater three-dimensional mapping based on side-scan sonar. Background Art
[0002] Over the past few decades, human demand for underwater exploration has continued to increase. Autonomous underwater vehicles (AUVs) have many applications in seafloor mapping, underwater monitoring, and other areas. Similar to unmanned systems on the ground, underwater simultaneous positioning and mapping technology plays a decisive role in the autonomous ability of AUVs to explore unknown waters. In underwater scenes, the application of sensors using electromagnetic waves such as GPS (Global Positioning System), cameras, and lidar is hindered, and acoustic-based sonar has become the first choice for underwater perception sensors. Side-scan sonar can achieve centimeter-level resolution within a detection range of several hundred meters and has a low cost, so it is suitable for large-scale underwater exploration tasks. Usually, side-scan sonars are installed on both sides of the AUV to scan both sides of the seabed. The heading direction beam is very narrow (less than or equal to 1°), and the beam perpendicular to the heading is wider (greater than 30°). Side-scan sonar generates a one-dimensional echo signal based on the intensity and time of the echo, and calculates the distance of the target by the speed of sound. When the AUV is sailing in a straight line, the continuous echo signals have no common view part, and the data association between frames cannot be performed. In addition, the side scan sonar cannot obtain the elevation angle of the target, that is, it cannot directly obtain the three-dimensional position of the target. Summary of the invention
[0003] In view of the shortcomings of the existing technology, this application proposes a method and device for underwater three-dimensional mapping based on side-scan sonar, which can realize strong data association of side-scan sonar images under large viewing angle transformation and achieve decimeter-level mapping accuracy in complex waters.
[0004] In the first aspect, the present application proposes a method for underwater three-dimensional mapping based on side-scan sonar, comprising:
[0005] Acquire side scan sonar echo data of an autonomous underwater vehicle traveling at a constant speed;
[0006] Obtaining a current key frame according to the side scan sonar echo data;
[0007] Perform loop detection on the current key frame and use the historical frame with the largest overlapping common view area as the reference frame;
[0008] Correct the relative pose of the current key frame and the reference frame to obtain the corrected pose and three-dimensional point cloud;
[0009] Based on the corrected posture and 3D point cloud, the side scan sonar reprojection function is used to search the polar line of the current key frame to obtain the coordinates of the matching points of the current key frame;
[0010] Construct a reprojection error based on the coordinates of the matching points of the current key frame, perform bundle adjustment on the current key frame and the reference frame, and obtain the elevation angle of the landmark in the reference frame, the pose of the current key frame after bundle adjustment, and the relative transformation between the reference frame and the current key frame;
[0011] The elevation angle of the landmark in the current key frame is calculated according to the coordinates of the feature points of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame;
[0012] According to the pose of the current key frame after all bundle adjustments and the elevation angle of the landmark in the current key frame, an underwater three-dimensional point cloud map is obtained.
[0013] The step of obtaining a current key frame according to the side scan sonar echo data comprises:
[0014] Using the side scan sonar echo data for stitching to obtain a two-dimensional stitched image;
[0015] Preprocessing the two-dimensional stitched image to obtain a two-dimensional image containing feature points;
[0016] The current key frame is generated using the two-dimensional image containing the feature points, the posture of the current key frame and the initial value of the elevation angle, wherein the initial value of the elevation angle is an initial estimated value obtained according to a plane assumption method, and the posture of the current key frame is determined by the posture determined by the side scan sonar echo data.
[0017] The correcting the relative posture of the current key frame and the reference frame to obtain the corrected posture and three-dimensional point cloud includes:
[0018] Using a two-dimensional to three-dimensional back-projection function, the feature points in the current key frame and the reference frame are back-projected to obtain the current key frame point cloud and the reference frame point cloud;
[0019] The iterative closest point algorithm is used to solve the relative pose of the current key frame point cloud and the reference frame point cloud to obtain the corrected pose and three-dimensional point cloud.
[0020] Based on the corrected posture and three-dimensional point cloud, the side scan sonar reprojection function is used to perform an epipolar search on the current key frame to obtain the coordinates of the matching points of the current key frame, including:
[0021] Input the maximum elevation angle and the minimum elevation angle of each feature point in the preset historical frame into the side scan sonar reprojection function to obtain two first reprojection points on the current key frame;
[0022] The line segment formed by the two first reprojection points is taken as the epipolar line;
[0023] The minimum value of the intensity error along the epipolar line is found, and the coordinates corresponding to the minimum value of the intensity error are used as the coordinates of the matching point of the current key frame. The intensity error is the difference between the pixel intensity value of the feature point of the reference frame and the pixel intensity value of the feature point of the current key frame.
[0024] The reprojection error constructed according to the matching point coordinates of the current key frame, performing bundle adjustment on the current key frame and the reference frame, and obtaining the elevation angle of the landmark in the reference frame and the relative transformation between the reference frame and the current key frame, includes:
[0025] The side scan sonar reprojection function is used to reproject the feature points of the reference frame to the feature points of the current key frame to obtain the second reprojection point;
[0026] The pixel distance between the second projection point and the matching point coordinates of the current key frame is taken as the reprojection error;
[0027] The reprojection error is minimized by adjusting the relative transformation between the reference frame and the current keyframe and the elevation angles of all landmarks in the reference frame;
[0028] When the reprojection error converges, the current key frame, the pose of the current key frame after bundle adjustment, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame are saved.
[0029] The elevation angle of the landmark in the current key frame is calculated based on the feature point coordinates of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame. The calculation formula is as follows:
[0030]
[0031] Among them, p r is the coordinate of the landmark feature point in the reference frame, θ r is the elevation angle of the landmark in the reference frame, π -1 (p r ,θ r ) is the back-projection function of the feature points in the reference frame from two dimensions to three dimensions, The relative transformation between the reference frame and the current keyframe, is the 3D coordinate of the landmark in the current keyframe, θ c It is the elevation angle of the landmark in the current keyframe.
[0032] In the second aspect, the present application proposes an underwater three-dimensional mapping device based on side-scan sonar, including: a data acquisition module, a key frame generation module, a loop detection module, a point cloud correction module, a polar line search module, a bundle adjustment module, an elevation angle calculation module and a three-dimensional point cloud map generation module;
[0033] The data acquisition module is used to acquire side scan sonar echo data when the autonomous underwater vehicle is traveling at a constant speed;
[0034] The key frame generation module is used to obtain the current key frame according to the side scan sonar echo data;
[0035] The loop detection module is used to perform loop detection on the current key frame, and in the sub-image, the historical frame with the largest overlapping common view area is used as the reference frame;
[0036] The point cloud correction module is used to correct the relative posture of the current key frame and the reference frame to obtain the corrected posture and three-dimensional point cloud;
[0037] The epipolar line search module is used to perform an epipolar line search on the current key frame based on the corrected posture and three-dimensional point cloud using a side scan sonar reprojection function to obtain the coordinates of the matching points of the current key frame;
[0038] The bundle adjustment module is used to construct a reprojection error according to the coordinates of the matching points of the current key frame, perform bundle adjustment on the current key frame and the reference frame, and obtain the elevation angle of the landmark in the reference frame, the pose of the current key frame after the bundle adjustment, and the relative transformation between the reference frame and the current key frame;
[0039] The elevation angle calculation module is used to calculate the elevation angle of the landmark in the current key frame according to the feature point coordinates of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame;
[0040] The three-dimensional point cloud map generation module is used to obtain an underwater three-dimensional point cloud map according to the pose of the current key frame after all bundle adjustments and the elevation angle of the landmark in the current key frame.
[0041] In a third aspect, the present application proposes an electronic device, comprising: one or more processors, and a memory, wherein the memory is used to store instructions, and when the instructions are executed by the one or more processors, the one or more processors execute the side-scan sonar-based underwater three-dimensional mapping method.
[0042] In a fourth aspect, the present application proposes a computer-readable storage medium storing executable instructions, which, when executed, enable a processor to execute the side-scan sonar-based underwater three-dimensional mapping method.
[0043] In a fifth aspect, the present application proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the side-scan sonar-based underwater three-dimensional mapping method.
[0044] Beneficial effects:
[0045] This application proposes a method and device for underwater three-dimensional mapping based on side-scan sonar. This application establishes the mutual transformation relationship between two-dimensional pixels and three-dimensional landmarks through the side-scan sonar projection geometric model. And use polar line search for data association, minimize the reprojection error to restore the elevation angle of the landmark, and optimize the position of the autonomous underwater vehicle. This application can provide strong data association in underwater scenes with large perspective changes, and realize high-precision three-dimensional mapping in underwater scenes with complex terrain. Strong data association of side-scan sonar images is achieved under large perspective changes, and decimeter-level mapping accuracy can be achieved in complex waters. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Flow chart of a method for underwater three-dimensional mapping based on side-scan sonar according to an embodiment of the present invention;
[0047] Figure 2 A schematic diagram of a process flow of a method for underwater three-dimensional mapping based on side-scan sonar according to an embodiment of the present invention;
[0048] Figure 3 A schematic diagram of loop detection principle according to an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of the side scan sonar projection geometric model construction according to an embodiment of the present invention;
[0050] Figure 5 The epipolar line search matching effect diagram of the embodiment of the present invention;
[0051] Figure 6 An underwater three-dimensional map rendering of an embodiment of the present invention;
[0052] Figure 7 Principle block diagram of an underwater 3D mapping device based on side-scan sonar according to an embodiment of the present invention DETAILED DESCRIPTION
[0053] In the prior art, when the AUV is sailing in a straight line, the continuous echo signals do not have a common view part, and data association between frames cannot be performed. In addition, the side scan sonar cannot obtain the elevation angle of the target, that is, it cannot directly obtain the three-dimensional position of the target. In the work of using sonar for mapping, data association is a prerequisite for posture optimization and mapping. For example, the Chinese patent "CN113744337A A synchronous positioning and mapping method integrating vision, IMU and sonar" obtains the carrier posture transformation of the local time and space field and then complements it with the IMU data. At the same time, the texture information of the image is used to assist in the recognition and frame of the target information in the environment to form a bounded voxel frame. The loop part first uses sonar for a large-scale loop, and then in the point cloud data fused by the camera image, the three-dimensional vector parameters are selected to define the clustered target features, and the bag of words model (BoW) is established to use the classifier for judgment. The kd tree is used to quickly search for the target features to complete the rough matching, and finally the iterative closest point (ICP) is used to complete the precise matching to complete the loop detection.
[0054] When using sonar for mapping, the position estimation of landmarks has a crucial impact on the accuracy of mapping. For example, the Chinese patent "CN112946660A A simultaneous positioning and mapping method based on multi-beam forward-looking sonar" uses multi-beam forward-looking sonar as a perception module, combined with the IMU and DVL data inside the AUV, for underwater positioning and map construction. First, the image data of the forward-looking sonar is converted into point cloud data of a two-dimensional lidar, and then the point cloud data, IMU data, and DVL data are time-synchronized. Finally, the simultaneous positioning and mapping of the AUV are completed based on the laser SLAM algorithm framework.
[0055] The present application proposes a method and device for underwater three-dimensional mapping based on side-scan sonar, which realizes strong data association of side-scan sonar images under perspective transformation, and can achieve decimeter-level mapping accuracy in complex waters by obtaining the accurate elevation angle of the target.
[0056] Embodiment 1:
[0057] This embodiment proposes a method for underwater three-dimensional mapping based on side-scan sonar. Figure 1 , Figure 2 Shown include:
[0058] Step S1: Acquire side scan sonar echo data when the autonomous underwater vehicle travels at a constant speed;
[0059] Step S2: obtaining a current key frame according to the side scan sonar echo data;
[0060] In this embodiment, a uniform speed detection is performed based on the dead reckoning data provided by the combined inertial navigation system. When it is detected that the autonomous underwater vehicle is moving at a uniform speed, the received side-scan sonar echo signals are spliced frame by frame, and a side-scan sonar image reflecting the terrain information is obtained.
[0061] Step S2.1: stitching the side scan sonar echo data to obtain a two-dimensional stitched image;
[0062] In this embodiment, a side scan sonar image is generated using dead reckoning and side scan sonar echo signals (i.e., side scan sonar echo data), and the autonomous underwater vehicle travels at a constant speed in a short period of time. 2k+1 echo data, i.e., echo signals, with a travel distance d are obtained by dead reckoning, and a side scan sonar image is generated by splicing 2k+1 echo signals, where k=50 in this embodiment. The pose of the current key frame is determined by the sonar pose when the k+1th echo signal is collected.
[0063] The side scan sonar image is regarded as all observation data projected onto a plane with an elevation angle of 0 in the sonar coordinate system, and scaled along the u-axis and v-axis of the image coordinates. In this embodiment, the scaling factors γ of the u-axis and v-axis of the side scan sonar image are defined as u and γ v as follows:
[0064]
[0065] Where r is the maximum detection range of the side scan sonar, w is the width of the side scan sonar image, that is, the number of sampling points in each pulse, d is the travel distance of the autonomous underwater vehicle, provided by dead reckoning, and h is the height of the side scan sonar image, that is, the number of echo signals used to generate the image.
[0066] Step S2.2: preprocessing the two-dimensional stitched image to obtain a two-dimensional image containing feature points, including:
[0067] Step S2.2.1: Smoothing the side scan sonar image using Gaussian filtering;
[0068] Step S2.2.2: equalizing the smoothed side-scan sonar image using histogram equalization to obtain an equalized side-scan sonar image;
[0069] Step S2.2.3: using the Sobel operator to calculate the pixel gradient of the equalized side scan sonar image;
[0070] Step S2.2.4: binarizing the equalized side scan sonar image;
[0071] Step S2.2.5: Calculate the score of the binarized side scan sonar image, and select the first NF pixels with the highest scores as feature points, thereby obtaining a two-dimensional image containing the feature points;
[0072] In this embodiment, a variety of image processing methods are used to preprocess the side scan sonar image. In this embodiment, the side scan sonar image is smoothed using Gaussian filtering to process salt and pepper noise. Then, contrast limited adaptive histogram equalization (CLAHE) is applied to enhance the contrast between the low-intensity flat seabed and the high-intensity landmark. Next, the Sobel operator is used to calculate the u-axis gradient d of the pixel. u (p) and v-axis gradient d v (p). Then use the threshold I th The image is binarized to segment the landform features and the flat bottom. Finally, the score W(p) of all pixels is calculated using the following formula:
[0073]
[0074] According to the above scores, the scores of all points are sorted, and the top 500 points with the highest scores (ie, NF=500) are selected as feature points.
[0075] Step S2.3: Generate the current key frame using the two-dimensional image containing the feature points, the position and posture of the current key frame, and the initial value of the elevation angle, wherein the initial value of the elevation angle is an initial estimated value obtained according to the plane assumption method, and the position and posture of the current key frame is determined by the position and posture determined by the side scan sonar echo data. The specific process is as follows:
[0076] In this embodiment, feature points are extracted from the preprocessed image based on gradient information, each feature point corresponds to an underwater landmark, the elevation angle of the underwater landmark is initialized using a plane assumption, and the pose of the current key frame is set;
[0077] Initialize the elevation angle of the landmark point and generate the key frame based on the pose information of the key frame. In the sonar coordinate system, calculate the initial value of the elevation angle θ of the corresponding landmark by plane assumption. init , the calculation formula is as follows:
[0078]
[0079] Where H is the height from the autonomous underwater vehicle to the seabed, which can be measured by a Doppler velocity log (DVL) or estimated based on the water column area of the image. roll is the roll angle of the autonomous underwater vehicle, θ pitchθ is the pitch angle of the autonomous underwater vehicle, both of which can be obtained from the dead reckoning data. s is the mounting angle of the side scan sonar. R' is the distance measurement to the landmark, which can be calculated using the speed of sound. The pose of the keyframe is set based on the dead reckoning data, and can be set to the sonar pose at the k+1th echo signal.
[0080] Step S3: perform loop detection on the current key frame, and use the historical frame with the largest overlapping common view area as the reference frame;
[0081] In this embodiment, a kd tree is used for loop detection, such as Figure 3 The autonomous underwater vehicle travels along the dotted line of the dead reckoning and sails in the direction of the arrow of the dead reckoning. When it sails to the position of the dead reckoning dot, a key frame is generated. The key frame includes the key frame's posture, the key frame's image, and the key frame's elevation angle. The range that the key frame can see is represented by the rectangle in the figure, that is, the underwater range that the image can see is represented in the rectangle. Figure 3 In the figure, it is assumed that the autonomous underwater vehicle has traveled to the current black dot position, and the range seen by the current key frame is the square where the black long dot is located. The kd tree of the historical frame's position is constructed to query the historical frames that may generate loop detection with the current key frame. The loop detection algorithm is used to find the historical key frames (referred to as historical frames) with the current key frame having a common view area (i.e., overlapping area). The set of historical frames that have a common view relationship with the current key frame is taken as a subgraph, that is, the historical frames with a common view relationship are activated as subgraphs, and being found is equivalent to being activated. The feature points of all the queried historical frames and the current key frame are back-projected into their respective sonar coordinate systems as landmarks, and the activated historical frame with the largest common view area is used as the reference frame in the subgraph.
[0082] Step S4: Correct the relative posture of the current key frame and the reference frame to obtain the corrected posture and three-dimensional point cloud, including:
[0083] Step S4.1: using a two-dimensional to three-dimensional back-projection function, back-projecting the feature points of the current key frame and the reference frame respectively to obtain the current key frame point cloud and the reference frame point cloud;
[0084] Step S4.2: According to the point clouds of the current frame and the reference frame, ICP (Iterative Closest Point) is used to solve the relative pose of the current key frame and the reference frame to obtain the corrected pose and three-dimensional point cloud.
[0085] In this embodiment, it is necessary to pre-construct a projection geometry model of the side scan sonar, including: a two-dimensional to three-dimensional back projection function and a three-dimensional to two-dimensional projection function. The pre-constructed projection geometry model represents the mutual conversion relationship between the two-dimensional pixel points on the sonar image and the three-dimensional space points in the sonar coordinate system.
[0086] In this embodiment, the projection geometry model of the side scan sonar is constructed based on the imaging principle of the side scan sonar, such as Figure 4 As shown in Figure 2. Among them, the pixel coordinates of the feature points are The coordinates of the corresponding 3D landmark in the sonar coordinate system are defined as The relationship between the two is:
[0087]
[0088] Among them, π -1 (p,θ) represents the two-dimensional to three-dimensional back-projection function, which is used to back-project the pixel coordinates in the 2D image into the 3D coordinates of the sonar coordinate system. Conversely, the three-dimensional to two-dimensional projection function π(P) projects the 3D coordinates of the landmark in the sonar coordinate system into the pixel coordinates in the 2D image. θ represents the elevation angle of the landmark in the sonar coordinate system. Since the elevation angle cannot be obtained directly from the measurement, an initial estimate can be obtained based on the plane assumption, and then the accurate value of the elevation angle can be obtained according to subsequent steps. This embodiment uses the two-dimensional to three-dimensional back-projection function in the above calculation formula to back-project the current key frame and the sub-image respectively to obtain the key frame point cloud and the reference frame point cloud.
[0089] In this embodiment, the landmarks of the reference frame and the current key frame are used to correct the relative pose between the current key frame and the reference frame using ICP (Iterated Closest Point) registration. This embodiment uses the SVD (Singular Value Decomposition) method of linear algebra to solve the relative pose between the reference frame and the current key frame. This embodiment uses a two-dimensional to three-dimensional back projection function to obtain a set of landmark point clouds that are matched using the nearest neighbor, which are the reference frame landmark point set and the current keyframe landmark point set P = {p1, p2, ..., p n}. This embodiment needs to find a Euclidean transformation R, t that satisfies the following calculation formula:
[0090]
[0091] Wherein, R is the rotation matrix, t is the translation vector, and this embodiment uses an algebraic method to solve and define the error term of the i-th pair of matching points:
[0092]
[0093] Constructing the least squares problem Find R, t that minimizes the sum of squared errors.
[0094] According to the above algorithm, the rotation matrix R and translation vector t of the coordinate transformation parameters are obtained. Then the obtained R and t are applied to the current autonomous underwater vehicle position x t On the basis of the following calculation formula
[0095] x' t =Rx t +t
[0096] Get a more accurate position x' of the autonomous underwater vehicle t .
[0097] Through the above and the current keyframe landmark point set P = {p1, p2, ..., p n} to obtain more accurate corrected pose and three-dimensional point cloud.
[0098] Step S5: Based on the corrected posture and three-dimensional point cloud, the side scan sonar reprojection function is used to perform an epipolar search on the current key frame to obtain the coordinates of the matching points of the current key frame, including:
[0099] Step S5.1: input the maximum elevation angle and the minimum elevation angle of each feature point in the preset historical frame into the side scan sonar reprojection function to obtain two first reprojection points on the current key frame;
[0100] Step S5.2: taking the line segment formed by the two first reprojection points as the epipolar line;
[0101] Step S5.3: Find the minimum value of the intensity error along the epipolar line, and use the coordinates corresponding to the minimum value of the intensity error as the matching point coordinates of the current key frame. The intensity error is the difference between the pixel intensity value of the feature point of the reference frame and the pixel intensity value of the feature point of the current key frame.
[0102] In this embodiment, the concept of epipolar line search in the camera is borrowed, and the side scan sonar projection geometric model is pre-built to construct a reprojection function, thereby constructing the concept of epipolar line search in the side scan sonar, and a further matching method of epipolar line search is proposed. In this embodiment, the feature points of the historical frame are reprojected into the current frame image by using the side scan sonar reprojection function, the epipolar line is calculated according to the uncertainty range of the elevation angle, and feature matching is performed through epipolar line search.
[0103] Among them, the reprojection function is derived as follows:
[0104] Assume that there is a reference frame (the reference frame applied in step S5.1 is a historical frame) and a current key frame. Given the pixel coordinates p of a point in the reference frame r and its elevation angle θ r , and the transformation from the reference frame to the current keyframe The reprojection function is derived as follows:
[0105]
[0106] Among them, p c is the pixel coordinate of the point reprojected to the current keyframe, p r is the pixel coordinate of the feature point in the reference frame, θ r is the elevation angle of the feature point in the reference frame, π -1 (p r ,θ r ) is the back projection function of the feature points in the reference frame from 2D to 3D, π(·) is the projection function of the feature points in the reference frame from 3D to 2D, is the relative transformation between the reference frame and the current key frame.
[0107] This embodiment uses the side scan sonar reprojection function to achieve polar line search for matching, as shown in reference Figure 5 As shown. The system sets the uncertainty range of the elevation angle of each feature point in the historical frame to 5°. Then the maximum elevation angle and the minimum elevation angle are substituted into the reprojection function to generate two reprojection points in the current key frame. The line segment formed by these two points is the epipolar line. By minimizing the intensity error along the epipolar line, the coordinates of the matching point are found, and the calculation is as follows:
[0108]
[0109] Among them, I r is the intensity of the feature point in the reference frame, p c is the pixel coordinate along the epipolar line to be searched in the current keyframe, I(p c ) represents the feature point p of the current key frame c The pixel intensity value.
[0110] Step S6: According to the reprojection error constructed by the coordinates of the matching points of the current key frame, the current key frame and the reference frame are bundle adjusted to obtain the elevation angle of the landmark in the reference frame and the relative transformation between the reference frame and the current key frame, including:
[0111] Step S6.1: Use the side scan sonar reprojection function to reproject the feature points of the reference frame to the feature points of the current key frame to obtain the second reprojection point (also using the reprojection function in step S5.3);
[0112] Step S6.2: taking the pixel distance between the second projection point and the matching point coordinates of the current key frame as the reprojection error;
[0113] Step S6.3: minimizing the reprojection error by adjusting the relative transformation between the reference frame and the current key frame and the elevation angles of all landmarks in the reference frame;
[0114] Step S6.4: When the reprojection error converges, save the pose of the current key frame after bundle adjustment, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame.
[0115] This embodiment uses the side scan sonar reprojection function to construct a bundle adjustment problem, optimizes the elevation angle of the landmark and the position and posture of the autonomous underwater vehicle by minimizing the reprojection error, and uses bundle adjustment to optimize the position and posture of the autonomous underwater vehicle and the elevation angle information of the landmark point to achieve high-precision underwater three-dimensional mapping. In the loop detection step, when the loop is found, the same landmark cannot appear in more than two key frames. Therefore, bundle adjustment only needs to be performed on two key frames. The feature points associated with the reference frame and the current key frame should correspond to the same landmark on the seabed. Therefore, the feature points are reprojected from the reference frame to the current key frame. The pixel distance between the reprojected point and the associated feature point in the current key frame is the reprojection error. The reprojection error is minimized by adjusting the relative transformation and the elevation angle of the feature point. The following least squares problem is constructed using the reprojection error:
[0116]
[0117] Among them, the state vector Contains all state variables: relative transformation between two keyframes and the elevation angles θ of all landmarks in the reference frame k .h i (X) is the reprojection function, which reprojects the feature points of the i-th landmark in the reference frame image to the current key frame image. p' ci is the coordinate of the matching point of the i-th landmark in the current keyframe image. It is optimized using the Ceres optimizer and the Levenberg-Marquardt algorithm. After convergence, the relative transformation between the two keyframes is and the elevation angle θ of the landmark in the reference frame k is optimized.
[0118] Step S7: Calculate the elevation angle of the landmark in the current key frame according to the coordinates of the feature points of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame;
[0119] The elevation angle of the landmark in the current key frame is calculated based on the feature point coordinates of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame. The calculation formula is as follows:
[0120]
[0121] Among them, p r is the coordinate of the landmark feature point in the reference frame, θ r is the elevation angle of the landmark in the reference frame, π -1 (p r ,θ r ) is the back-projection function of the feature points in the reference frame from two dimensions to three dimensions, The relative transformation between the reference frame and the current keyframe, is the 3D / Cartesian coordinate of the landmark in the current keyframe, θ c It is the elevation angle of the landmark in the current keyframe.
[0122] Step S8: Obtain an underwater three-dimensional point cloud map according to the pose of the current key frame after all bundle adjustments and the elevation angle of the landmark in the current key frame.
[0123] In this embodiment, the elevation angles of the associated landmarks in the current key frame and the reference frame are restored. Each current key frame is used to stitch the 3D point cloud of the current key frame according to the pose of each current key frame to form a larger underwater 3D point cloud map. That is, these landmarks and poses can be combined to create an accurate 3D map. The top view of the map is as follows Figure 6 As shown. It can be understood that the current key frame refers to the latest key frame being processed. After the current key frame is processed by the above steps S1 to S8, the current key frame is called a historical key frame. As a historical key frame, it is possible to be optimized as a reference frame. Therefore, the current key frame in step S8 refers to all current key frames in the processing process.
[0124] The present application proposes a method for underwater three-dimensional mapping based on side-scan sonar, including: preprocessing based on original data, data association based on side-scan sonar reprojection function, and mapping based on side-scan sonar beam adjustment.
[0125] In the preprocessing based on raw data, uniform speed detection is first performed. If the autonomous underwater vehicle is traveling at a uniform speed, the side scan sonar echo data is spliced to form an image. Then, Gaussian filtering, histogram equalization, and binarization techniques are used to segment the underwater features and flat landforms. Finally, feature points are selected based on gradient information, and the elevation angle information of the corresponding landmark is initialized using a plane hypothesis, which is then fused with the posture information to form a key frame.
[0126] In the data association based on the side-scan sonar reprojection function, the pose of the historical frame is first constructed as a kd tree. Then, the reference frame is obtained by querying the historical frame that has common view with the current key frame for loop detection, and the feature points of the current key frame and the reference frame are back-projected into the sonar coordinate system to form a point cloud. After that, the point cloud is ICP-aligned to optimize the relative pose between the two frames. Finally, the side-scan sonar reprojection function is used to perform polar line search to obtain the matching relationship of the feature data between the two frames, with a matching rate of more than 90%, which exceeds other existing methods.
[0127] In the mapping based on side scan sonar beam adjustment, the reprojection error is constructed using the side scan sonar reprojection function, and the elevation angle of the landmark points is restored and the pose is optimized using the Ceres optimizer and the Levenberg-Marquardt algorithm. Finally, the optimized landmark points of all key frames are combined into a high-precision underwater three-dimensional map, and the mapping error is reduced to less than 0.2m.
[0128] This embodiment transmits the original side scan sonar echo data and the dead reckoning data given by the combined inertial navigation to the preprocessing based on the original data to generate key frame data; based on the data association of the side scan sonar projection geometric model, the mutual transformation relationship between two-dimensional pixels and three-dimensional landmarks is established, and the data of the current key frame and the historical frame are associated; the data association is performed by using the polar line search, and the elevation angle of the landmark is restored and the position and posture of the autonomous underwater vehicle are optimized to achieve high-precision three-dimensional mapping. This embodiment connects these three modules so that the autonomous underwater vehicle mapping system can perform high-precision three-dimensional mapping in waters with complex topography. It provides powerful data association in underwater scenes with large changes in perspective and builds an accurate map in complex underwater terrain. The data association matching rate of this embodiment is greater than 90%, and the average mapping error is less than 0.2m. The method proposed in this embodiment realizes high-precision three-dimensional mapping in underwater scenes with complex topography.
[0129] Embodiment 2:
[0130] This embodiment proposes an underwater three-dimensional mapping device based on side-scan sonar, such as Figure 7 As shown, it includes: a data acquisition module, a key frame generation module, a loop detection module, a point cloud correction module, a polar line search module, a bundle adjustment module, an elevation angle calculation module and a three-dimensional point cloud map generation module;
[0131] The data acquisition module is connected to the key frame generation module, the key frame generation module is connected to the loop detection module, the loop detection module is connected to the point cloud correction module, the point cloud correction module is connected to the epipolar line search module, the epipolar line search module is connected to the bundle adjustment module, the bundle adjustment module is connected to the elevation angle calculation module, the elevation angle calculation module is connected to the three-dimensional point cloud map generation module, and the point cloud map is connected to the bundle adjustment module;
[0132] The data acquisition module is used to acquire side scan sonar echo data when the autonomous underwater vehicle is traveling at a constant speed;
[0133] The key frame generation module is used to obtain the current key frame according to the side scan sonar echo data;
[0134] The loop detection module is used to perform loop detection on the current key frame, and take the historical frame with the largest overlapping common view area as the reference frame;
[0135] The point cloud correction module is used to correct the relative posture of the current key frame and the reference frame to obtain the corrected posture and three-dimensional point cloud;
[0136] The epipolar line search module is used to perform an epipolar line search on the current key frame based on the corrected posture and three-dimensional point cloud using a side scan sonar reprojection function to obtain the coordinates of the matching points of the current key frame;
[0137] The bundle adjustment module is used to construct a reprojection error according to the coordinates of the matching points of the current key frame, perform bundle adjustment on the current key frame and the reference frame, and obtain the elevation angle of the landmark in the reference frame, the pose of the current key frame after the bundle adjustment, and the relative transformation between the reference frame and the current key frame;
[0138] The elevation angle calculation module is used to calculate the elevation angle of the landmark in the current key frame according to the feature point coordinates of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame;
[0139] The three-dimensional point cloud map generation module is used to obtain an underwater three-dimensional point cloud map according to the pose of the current key frame after all bundle adjustments and the elevation angle of the landmark in the current key frame.
[0140] Embodiment 3:
[0141] This embodiment proposes an electronic device, including: one or more processors, and a memory, wherein the memory is used to store instructions, and when the instructions are executed by the one or more processors, the one or more processors execute the side-scan sonar-based underwater three-dimensional mapping method.
[0142] The electronic device may be a mobile phone, a computer or a tablet computer, etc., including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method for underwater three-dimensional mapping based on side-scan sonar as described in the embodiment is implemented. It can be understood that the electronic device may also include an input / output (I / O) interface and a communication component.
[0143] The processor is used to execute all or part of the steps in the method for underwater three-dimensional mapping based on side-scan sonar as described in the above embodiment. The memory is used to store various types of data, which may include instructions of any application or method in the electronic device, as well as data related to the application.
[0144] The processor can be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, and is used to execute the side scan sonar underwater three-dimensional mapping method described in the above embodiment.
[0145] Embodiment 4:
[0146] This embodiment provides a computer-readable storage medium storing executable instructions. When the instructions are executed and implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0147] The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the side-scan sonar-based underwater three-dimensional mapping method described in each embodiment of the present application.
[0148] The aforementioned storage media include: flash memory, hard disk, multimedia card, card-type memory (for example, SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR abbreviation, memory data register) memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, CD, server, APP (Application, abbreviation of application software) application store and other media that can store program verification codes, on which a computer program is stored. When the computer program is executed by the processor, the various steps of the above-mentioned side-scan sonar underwater three-dimensional mapping method can be implemented.
[0149] Embodiment 5:
[0150] This embodiment provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the method for underwater three-dimensional mapping based on side-scan sonar.
[0151] Based on such understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a computer program product.
[0152] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0153] The protection scope of the present application is not limited to the above-mentioned embodiments. Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the scope and spirit of the present disclosure. If these changes and modifications fall within the scope of the claims of the present disclosure and their equivalents, the intention of the present disclosure also includes these changes and modifications.
Claims
1. A method for underwater three-dimensional mapping based on side-scan sonar, characterized in that: include: Acquire side scan sonar echo data of an autonomous underwater vehicle traveling at a constant speed; Obtaining a current key frame according to the side scan sonar echo data; Perform loop detection on the current key frame and use the historical frame with the largest overlapping common view area as the reference frame; Correct the relative pose of the current key frame and the reference frame to obtain the corrected pose and three-dimensional point cloud; Based on the corrected posture and 3D point cloud, the side scan sonar reprojection function is used to search the polar line of the current key frame to obtain the coordinates of the matching points of the current key frame; Construct a reprojection error based on the coordinates of the matching points of the current key frame, perform bundle adjustment on the current key frame and the reference frame, and obtain the elevation angle of the landmark in the reference frame, the pose of the current key frame after bundle adjustment, and the relative transformation between the reference frame and the current key frame; The elevation angle of the landmark in the current key frame is calculated according to the coordinates of the feature points of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame; According to the pose of the current key frame after all bundle adjustments and the elevation angle of the landmark in the current key frame, an underwater three-dimensional point cloud map is obtained.
2. The method for underwater three-dimensional mapping based on side-scan sonar according to claim 1, characterized in that: The step of obtaining a current key frame according to the side scan sonar echo data comprises: Using the side scan sonar echo data for stitching to obtain a two-dimensional stitched image; Preprocessing the two-dimensional stitched image to obtain a two-dimensional image containing feature points; The current key frame is generated using the two-dimensional image containing the feature points, the posture of the current key frame and the initial value of the elevation angle, wherein the initial value of the elevation angle is an initial estimated value obtained according to a plane assumption method, and the posture of the current key frame is determined by the posture determined by the side scan sonar echo data.
3. The method for underwater three-dimensional mapping based on side-scan sonar according to claim 1, characterized in that: The correcting the relative posture of the current key frame and the reference frame to obtain the corrected posture and three-dimensional point cloud includes: Using a two-dimensional to three-dimensional back-projection function, the feature points in the current key frame and the reference frame are back-projected to obtain the current key frame point cloud and the reference frame point cloud; The iterative closest point algorithm is used to solve the relative pose of the current key frame point cloud and the reference frame point cloud to obtain the corrected pose and three-dimensional point cloud.
4. The method for underwater three-dimensional mapping based on side-scan sonar according to claim 1, characterized in that: The method of using the side scan sonar reprojection function to perform an epipolar search on the current key frame to obtain the coordinates of the matching points of the current key frame includes: Based on the corrected posture and three-dimensional point cloud, the side scan sonar reprojection function is used to perform an epipolar search on the current key frame to obtain the coordinates of the matching points of the current key frame, including: Input the maximum elevation angle and the minimum elevation angle of each feature point in the preset historical frame into the side scan sonar reprojection function to obtain two first reprojection points on the current key frame; The line segment formed by the two first reprojection points is taken as the epipolar line; The minimum value of the intensity error along the epipolar line is found, and the coordinates corresponding to the minimum value of the intensity error are used as the coordinates of the matching point of the current key frame. The intensity error is the difference between the pixel intensity value of the feature point of the reference frame and the pixel intensity value of the feature point of the current key frame.
5. The method for underwater three-dimensional mapping based on side-scan sonar according to claim 1, characterized in that: The reprojection error constructed according to the matching point coordinates of the current key frame, performing bundle adjustment on the current key frame and the reference frame, and obtaining the elevation angle of the landmark in the reference frame and the relative transformation between the reference frame and the current key frame, includes: The side scan sonar reprojection function is used to reproject the feature points of the reference frame to the feature points of the current key frame to obtain the second reprojection point; The pixel distance between the second projection point and the matching point coordinates of the current key frame is taken as the reprojection error; The reprojection error is minimized by adjusting the relative transformation between the reference frame and the current keyframe and the elevation angles of all landmarks in the reference frame; When the reprojection error converges, the pose of the current key frame after bundle adjustment, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame are saved.
6. The method for underwater three-dimensional mapping based on side-scan sonar according to claim 1, characterized in that: The elevation angle of the landmark in the current key frame is calculated based on the feature point coordinates of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame. The calculation formula is as follows: Among them, p r is the coordinate of the landmark feature point in the reference frame, θ r is the elevation angle of the landmark in the reference frame, π -1 (p r ,θ r ) is the back-projection function of the feature points in the reference frame from two dimensions to three dimensions, The relative transformation between the reference frame and the current keyframe, is the 3D coordinate of the landmark in the current keyframe, θ c It is the elevation angle of the landmark in the current keyframe.
7. An underwater three-dimensional mapping device based on side-scan sonar, characterized in that: Data acquisition module, key frame generation module, loop detection module, point cloud correction module, polar line search module, bundle adjustment module, elevation angle calculation module and 3D point cloud map generation module; The data acquisition module is used to acquire side scan sonar echo data when the autonomous underwater vehicle is traveling at a constant speed; The key frame generation module is used to obtain the current key frame according to the side scan sonar echo data; The loop detection module is used to perform loop detection on the current key frame, and take the historical frame with the largest overlapping common view area as the reference frame; The point cloud correction module is used to correct the relative posture of the current key frame and the reference frame to obtain the corrected posture and three-dimensional point cloud; The epipolar line search module is used to perform an epipolar line search on the current key frame based on the corrected posture and three-dimensional point cloud using a side scan sonar reprojection function to obtain the coordinates of the matching points of the current key frame; The bundle adjustment module is used to construct a reprojection error according to the coordinates of the matching points of the current key frame, perform bundle adjustment on the current key frame and the reference frame, and obtain the elevation angle of the landmark in the reference frame, the pose of the current key frame after the bundle adjustment, and the relative transformation between the reference frame and the current key frame; The elevation angle calculation module is used to calculate the elevation angle of the landmark in the current key frame according to the feature point coordinates of the landmark in the reference frame, the elevation angle of the landmark in the reference frame, and the relative transformation between the reference frame and the current key frame; The three-dimensional point cloud map generation module is used to obtain an underwater three-dimensional point cloud map according to the pose of the current key frame after all bundle adjustments and the elevation angle of the landmark in the current key frame.
8. An electronic device, characterized in that: include: One or more processors, and a memory, wherein the memory is used to store instructions, and when the instructions are executed by the one or more processors, the one or more processors execute the side-scan sonar underwater three-dimensional mapping method described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: It stores executable instructions, which, when executed, enable the processor to execute the side-scan sonar-based underwater three-dimensional mapping method as described in any one of claims 1 to 6.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method for underwater three-dimensional mapping based on side-scan sonar described in any one of claims 1 to 6 is implemented.
