Underwater robot visual positioning method for round pipe orifice docking task
By using monocular industrial cameras and semantic segmentation models based on convolutional neural networks to identify circular pipe ports on underwater robots, and combining least squares method and monocular space elliptical conical pose theory for positioning, the shortcomings of the existing underwater positioning methods in environments such as poor water quality, weak texture, electromagnetic shielding, etc., achieving high-precision autonomous positioning.
Patent Information
- Application Number
- CN202411992678.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The existing underwater positioning methods are difficult to achieve high-precision and long-term independent positioning in underwater environments such as poor water quality, weak texture, and electromagnetic shielding.
The monocular industrial camera is used to obtain the image of the front environment of the underwater robot in real time, combine the semantic segmentation model based on the convolutional neural network to identify the target circular tube port, use the least squares method to fit the elliptical parameters, and use the monocular space elliptical conical pose theory to the relative pose of the computer robot and the target tube port.
In a closed weak texture underwater environment, the autonomous positioning of underwater robots docking or entering cylindrical pipes is achieved, overcoming the shortcomings of traditional methods in the underwater environment and improving positioning accuracy and stability.
Smart Images

Figure CN119850733A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of underwater robots, and in particular relates to an underwater robot visual positioning method for a circular pipe orifice docking task. Background Art
[0002] With the rapid development of computer and electronic related software and hardware, the performance of robots has been greatly improved. The importance of various types of robots in the working environment of industrial production has become increasingly obvious. Among them, underwater robots relying on propeller thrusters have played a huge role in replacing manual work in underwater environments. Underwater robots are divided into autonomous and non-autonomous types according to whether human participation in control is required. Among them, non-autonomous underwater robots generally require operators to directly or indirectly visually and use remote control equipment for manual remote control, while autonomous underwater robots realize environmental perception based on sensors such as cameras or laser radars. The relevant planning algorithms judge the environmental information and then obtain the next control instructions to achieve the goal. The whole process is completed autonomously by the robot.
[0003] Autonomous underwater robots must be able to sense their own position in the environment in order to move autonomously, so underwater positioning is the primary task to achieve autonomy. The underwater positioning methods commonly used in the industry for underwater detection and operations are mainly divided into acoustic positioning systems, inertial navigation systems, and Doppler sonar velocimeters.
[0004] Acoustic positioning system: Relying on the propagation of mechanical waves such as sound waves underwater to complete positioning, it is mainly divided into two types: with beacons and without beacons. Among them, the methods with beacons include long baseline (LBL), short baseline (SBL) and ultra-short baseline (USBL). Positioning requires the installation of acoustic beacons at known locations such as the bottom of the water or ships. The underwater robot sends sound wave signals to these beacons, and then the beacons return signals to the robot. According to the signal propagation time and the known beacon position, the precise position of the robot can be calculated. Positioning without beacons relies on the reflection of the object emitted by the sonar to form an echo for positioning. Although the positioning distance of underwater acoustic positioning can reach thousands of meters, its positioning accuracy can generally only reach the decimeter level. Acoustic positioning with beacons requires the installation of beacons on the robot and the detection environment in advance, which is difficult to install. Due to the scattering characteristics of sound waves, the detection accuracy of sonar positioning without beacons for large objects such as pool walls is also at the decimeter level, and due to the multiple reflections of sound waves in the sealed pool, positioning errors will occur.
[0005] Inertial Navigation System (INS): uses accelerometers and gyroscopes to measure the robot's motion state. Since accelerometers and gyroscopes inevitably have bias, noise, and other non-ideal characteristics, these errors will accumulate during the integration process, causing the position and attitude estimates to gradually deviate from the true value, resulting in a significant decrease in accuracy during long-term operations. In addition, in some metal environments, the electromagnetic shielding effect makes it impossible for the gyroscope to be initialized using geomagnetism, causing the positioning system to fail.
[0006] Doppler Velocity Log (DVL) uses the Doppler effect to measure the speed of the underwater robot relative to the seabed, which can provide high-precision speed information. When used in conjunction with INS, it can effectively reduce the drift of the IMU. However, DVL is highly dependent on the environment of water characteristics, and the Doppler frequency shift caused by the vibration of small carriers will introduce errors. In addition, the price of each DVL device is tens of thousands of yuan, and the economic cost of installation is high.
[0007] Optical positioning: such as visual SLAM (VSALM, Visual Simultaneous Localization and Mapping): Capture images through cameras, and use computer vision technology to extract and match features to achieve simultaneous mapping and positioning. Since underwater environments are usually weak-texture environments such as pools, pipes or open seas, it is difficult to find visual feature points. In addition, the quality of underwater images is seriously degraded due to suspended matter and uneven lighting in the water. Therefore, this method is only applicable to underwater environments with good visibility and rich feature points. Laser radar (LiDAR): Due to the absorption of electromagnetic waves by water and the blocking and scattering of lasers by impurities in the water, its range and accuracy are significantly reduced. Summary of the invention
[0008] In order to solve the above technical problems, the present invention proposes a visual positioning method for an underwater robot in an underwater environment with a circular nozzle, which can detect and utilize the contour features of the circular nozzle, apply the spatial geometric principle of a spatial elliptical cone for relative positioning, and overcome the inapplicability of the above method for long-term operation in an underwater environment with poor water quality, weak texture, and electromagnetic shielding. The purpose of the present invention is to propose a visual positioning method for the task of an underwater robot docking or entering a cylindrical pipe in a closed, weak-textured, poorly illuminated underwater environment. The method uses a monocular industrial camera to obtain an image of the front environment under the current position and posture of the robot in real time, and inputs the image into a semantic segmentation model based on a convolutional neural network to complete the recognition of the target circular nozzle, and then uses the direct method of least squares to fit a standard ellipse that coincides with the contour of the circular nozzle, and calculates the relative position and posture of the robot with the geometric center of the target circular nozzle in the monocular camera coordinate system according to the monocular spatial elliptical cone posture theory. The corresponding software system controls the underwater robot to move forward to the target nozzle according to the real-time posture information, so as to realize the underwater robot autonomously completing the docking task to the circular nozzle.
[0009] The purpose of the present invention can be achieved by the following technical solution: a visual positioning method of an underwater robot for a circular pipe orifice docking task, comprising the following steps:
[0010] S1, obtaining an original image of the circular pipe opening in front of the underwater robot;
[0011] S2, enhancing the acquired underwater original image to obtain an enhanced image;
[0012] S3, using a real-time semantic segmentation model based on a convolutional neural network for the circular nozzle contour to analyze the enhanced image to obtain a segmentation mask image of the circular nozzle;
[0013] S4, using the least square method to perform ellipse fitting on the mask image to obtain the nozzle ellipse parameters;
[0014] S5. The relative position and posture of the underwater robot and the target nozzle in the monocular camera coordinate system are calculated using the monocular space elliptical cone pose measurement model for the nozzle ellipse parameters.
[0015] Compared with the prior art, the present invention has the following advantages:
[0016] 1. In the algorithm flow of the present invention, a multi-scale Retinex method with color restoration is used for preprocessing to obtain an enhanced image. The Retinex method helps to solve the problems of uneven local brightness and low overall contrast of the image due to uneven underwater illumination. At the same time, the multi-scale color restoration function helps to solve the color cast and color aberration problems of underwater images caused by impurities in the water, making the visual features of the target circular pipe mouth to be identified more obvious, effectively improving the recognition accuracy and segmentation accuracy of subsequent algorithms.
[0017] 2. The present invention uses a semantic segmentation model based on deep learning. The deep network can fully learn the high-level semantic information of the image during training. Compared with the traditional machine vision recognition method, the model can greatly reduce the misrecognition rate of the target after learning is completed, and has extremely strong robustness.
[0018] 3. The algorithm flow of the present invention uses a real-time semantic segmentation model of a neural network specially optimized for nozzle contour segmentation. The model uses a lightweight backbone network optimized with deep separable convolution, and extracts three paths of edge, contour and semantics according to the hierarchy of the backbone network feature extraction to enter the decoder for multi-level feature fusion upsampling, which helps to obtain an accurate target circular nozzle segmentation mask image. In addition, the semantic segmentation model has been lightweight optimized, taking into account accuracy, speed and model size.
[0019] 4. The algorithm flow of the present invention uses a direct ellipse fitting method based on the least squares method to obtain ellipse parameters for the circular nozzle mask binary image obtained by the semantic segmentation model, which is accurate and efficient, helps to save fitting time and improve the real-time performance of the algorithm.
[0020] 5. The method of the present invention is simple to implement. It only requires a monocular camera for collecting images and an embedded board for processing and calculation to be deployed on an underwater robot, and can be effectively implemented in both cases where the target circular nozzle radius is known or unknown. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of the present invention;
[0022] Figure 2 This is the structure diagram of the semantic segmentation model;
[0023] Figure 3 Schematic diagram of a three-branch fusion upsampling module;
[0024] Figure 4 It is the standard coordinate system diagram of elliptical cone;
[0025] Figure 5 It is a two-dimensional schematic diagram of the conic surface π and the section. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in each embodiment of the present invention described below can be combined with each other as long as they do not conflict with each other. To achieve the above-mentioned purpose, the present invention adopts the following technical scheme.
[0027] The present invention provides a visual positioning method for an underwater robot for a circular pipe orifice docking task. Figure 1 As shown, the following steps are included:
[0028] S1. Obtaining the original image of the circular pipe opening in front of the underwater robot, including: using a high-resolution monocular industrial camera located in a transparent sealed cabin at the front end of the underwater robot to continuously shoot the circular pipe opening in front of the underwater robot in real time through the secondary developed SDK software to obtain original target images with clear texture. These images will serve as the basic data input for the visual positioning method for the circular pipe opening docking task.
[0029] S2. Enhancing the original image to obtain an enhanced image, including: applying image enhancement technology to the obtained circular nozzle image in front of the underwater robot, determining the image enhancement technology as a multi-scale Retinex algorithm with color restoration (hereinafter referred to as MSRCR algorithm) according to the current lighting and water quality environment, and setting reasonable parameters.
[0030] The specific steps of applying the multi-scale Retinex algorithm with color restoration are as follows:
[0031] The MSRCR algorithm considers the color restoration result based on the multi-scale Retinex algorithm (hereinafter referred to as the MSR algorithm), while the MSR algorithm is obtained by weighted superposition of the single-scale Retinex algorithm (hereinafter referred to as the SSR algorithm) after multi-scaling. The single-scale Retinex algorithm (SSR) is a color perception model that approximates the retina-cerebral cortex. It assumes that the single-channel original image obtained by the human eye or image sensor is ,in is the horizontal and vertical coordinates of any pixel point in the two-dimensional image coordinate system, and the reflected image of the object is , the brightness image of the incident light is , then the relationship between the three is , the image enhancement result is the reflection image representing the real image of the object to be sought ,in Represents the convolution of the Gaussian function and the acquired original image. The two-dimensional Gaussian function is ,in is the amplitude of the two-dimensional Gaussian function, so that the function satisfies the Gaussian distribution ; is the scale parameter of the Gaussian function, which has a great influence on the image enhancement effect. When the value is smaller, the image details are better but the color is worse. Larger values can maintain better color balance but reduce image edge details.
[0032] The MSRCR algorithm first needs to calculate the colorimetric transformation factor ,in is the pixel value of the original image, N=3 in the RGB color space, Represents the three color channels of RGB. Then do log processing to get ,in is the gain constant, is the nonlinear transformation adjustment parameter.
[0033] The calculation process of MSRCR is to expand the single-scale SSR algorithm to k channels and add the colorimetric transformation factor The following operation is the k-channelization based on the SSR single-scale algorithm.
[0034] Then determine the k-channel two-dimensional Gaussian function k scale parameters (where subscript k can be any integer from 1 to k) The size here is the two-dimensional Gaussian function of each of the k channels, the same as in the SSR algorithm ,for k-scaling; is the scale parameter of the k-scale two-dimensional Gaussian function. Determine if the Gaussian distribution A two-dimensional Gaussian function is calculated for each of the k scales medium amplitude The value of .
[0035] Then according to the formula beg The value of k is the number of multi-scale scales, usually 3 represents large, medium and small scales. is the weight value for each scale.
[0036] Then Transformation from logarithmic domain to real number domain , then perform pixel linear stretching and output the result.
[0037] S3. Analyze the enhanced image using a real-time semantic segmentation model for circular nozzle contour recognition to extract a segmentation mask image of the circular nozzle area, including:
[0038] Data preparation: Collect underwater circular nozzle images under various viewing angles and lighting conditions, and then use annotation tools to complete the annotation of the circular nozzle target contour. Create a dataset containing the original image and the corresponding circular nozzle area annotation, and divide it into training set and validation set in a ratio of eight to two;
[0039] Model construction: Figure 2 As shown in the figure, a three-branch real-time semantic segmentation network TBNet for circular nozzle segmentation is built. Based on the lightweight backbone network, you can choose to use deep separable convolution to complete the lightweight deep backbone network MobileNet V2 or the densely connected STDC network as the backbone network to complete feature extraction, and introduce three branches of edge, contour, and semantics in the shallow, middle and deep layers of the backbone network respectively. Among them, the edge branch has the first edge convolution module and the second edge convolution module. During training, it is guided by the edge segmentation head and the edge loss function, focusing on segmenting the edges of objects in the labeled image. The contour branch has the first contour convolution module and the second contour convolution module, which are responsible for learning the target space contour information output by the middle layer of the backbone network during training. The semantic branch has a pyramid pooling module, which is responsible for capturing the global contextual information of the image, helping the network understand the large-scale structure and relationship in the image, and enhancing the model performance.
[0040] Multi-level feature extraction: The semantic branch output by the deep layer of the backbone network is used to output long-range context information. The contour branch derived from the middle layer of the backbone network is used to output local spatial information. The edge branch created by the shallow layer of the backbone network is used to output edge features and is only guided by the edge segmentation head and edge loss function during training.
[0041] Edge branch: First, the edge label is obtained from the label image through the Laplacian operator, and the edge label true value is further generated. The semantic segmentation model edge branch used in the present invention has a first edge convolution module responsible for edge feature extraction, a second edge convolution module, and an edge segmentation head is inserted at the end of the edge branch after the second edge convolution module to generate an edge feature map. Then, the edge label true value is used as a guide for the edge feature map to guide the edge branch and the edge segmentation head to learn the image edge features of the edge label true value.
[0042] Edge label generation: Artificial convolution kernels that can be used for edge extraction include Sobel, Laplacian, Canny, etc. Considering that there is no noise in the label image of image segmentation, a simple convolution kernel can be used to complete the edge extraction task. The present invention uses the Laplacian operator to generate detail feature maps with different step sizes, such as the step sizes of 1, 2, and 4 in the figure, to obtain multi-scale detail information, and uses dilated convolution to enhance weaker boundary features. The multi-scale detail feature map is then mapped and upsampled to the original size, and is fused with a trainable 1 × 1 convolution for dynamic reweighting. Finally, a threshold less than 1 is used to convert the predicted details of the 1 × 1 convolution into the final binary edge label true value with edge information.
[0043] The Laplace operator is: , the dilated convolution kernel is .
[0044] Hybrid loss function: Since the number of pixels in the edge part is much smaller than the number of spatial and semantic pixels, edge prediction is a class imbalance problem. Using only the cross entropy loss function will result in too rough prediction results. To solve this problem, the present invention uses binary cross entropy and Dice loss function to jointly optimize the detail learning of the boundary head. The edge loss function is defined as: ,in , They represent the single channel output of the edge segmentation head and the true value of the edge label during edge branch training. The BCE loss function is defined as , where N is the number of samples, is the true label of the i-th sample, It is the probability that the model predicts that the i-th sample is a positive class. Dice loss is a region-related loss that can be used in cases where the samples are extremely unbalanced. Its expression is obtained by the dice coefficient and the smoothing coefficient: , where H, W, Represents the height, width and smoothing coefficient of the image respectively.
[0045] The overall loss function of the model is a mixed loss function, which is obtained by adding the edge loss function and the semantic loss function, where the semantic loss function is Specifically, the hybrid loss function consists of three parts: .in, , Represent the final output of the network segmentation head and the original label respectively. The OhemCE loss function is an improved version of the cross entropy loss function for unbalanced data distribution and difficult sample training. It is defined as ( =0), ( ≠0), where The probability of the target class predicted by the model. Focal loss is improved by cross entropy loss: , ,in represents the cross entropy loss function; Represents the probability that the model predicts the positive category; is the balance coefficient, which is used to adjust the balance between positive and negative categories; is the weight coefficient.
[0046] The three-branch fusion upsampling module GBAU (Global Boundary Attention Upsampling), such as Figure 3 As shown in the figure: edge guidance is adopted. Specifically, the sizes of the edge, contour and semantic branches are different when entering the fusion module, because the model needs shallow and wide contour detail information and deep and compressed semantic information for the generation of segmentation masks, as well as boundary information with more detailed spatial detail information but irrelevant semantic information. The context branch with length and width compressed to 1 / 16 or 1 / 32 is compressed by global pooling and 1×1 convolution with regularization layer and nonlinear activation to obtain a global context weight vector with the same number of output channels as the contour branch, and then multiplied with the contour branch to obtain the weighted spatial detail feature. The edge branch has fully learned the edge information through the edge convolution module 1, edge convolution module 2 and the edge segmentation head guided by the edge loss function. The pixel values of the feature map are remapped to between 0 and 1 using 3×3 convolution and sigmoid activation function, and the result is regarded as edge attention a. At the same time, the semantic branch uses 3×3 convolution and global pooling and then adjusts the number of channels through 1×1 convolution to obtain a low-level feature channel number vector containing high-level features. Then, the low-level feature channel vector containing high-level features is multiplied by the contour branch output feature map and then multiplied by the edge attention a to obtain the final contour feature. After the semantic branch integrates context information through the pyramid pooling module, the feature map size is upsampled and expanded through the deconvolution module to keep the same size as the final contour feature, and the result is multiplied by 1-a to obtain the final semantic feature. Finally, the final contour feature and the final semantic feature are added to obtain the final output result of GBAU.
[0047] Model evaluation indicators: In terms of accuracy, the mean intersection over union (mIoU) is used as the evaluation indicator. In terms of speed, the number of frames per second is used as the unit of measurement. In terms of model complexity, the number of parameters (Param) is used to measure the model size, and the number of floating-point operations per second (FLOPS) is used to measure the computational complexity.
[0048] Model training: Use the prepared dataset to train the TBNet model. During training, data enhancement is introduced to randomly stretch, flip, Gaussian blur, and transform the color gamut of the input image to avoid overfitting. When the validation loss reaches the minimum and the generalization error between the training loss and the validation loss is the minimum, the training is stopped and the training is considered complete.
[0049] Target segmentation and extraction: The trained TBNet semantic segmentation model is applied to the target circular nozzle image after image enhancement to achieve pixel-level classification of the target circular nozzle image, accurately identify the target nozzle and segment the target contour area, and obtain a binary mask image of the target circular nozzle similar to the label image of the dataset.
[0050] S4. Using the least square method to perform ellipse fitting on the mask image to obtain the nozzle ellipse parameters, including:
[0051] In the Cartesian coordinate system, an ellipse can be represented by a quadratic equation:
[0052] , where a, b, c, d, e, and f are the five coefficients of the general equation of the ellipse. It can be expressed as a matrix: .
[0053] Ellipse fitting is to fit the optimal elliptic curve with n noisy points on a given curve, that is, fitting ,in , , ,because The existence of , the equation has a degree of freedom scale uncertainty, need to add additional scale constraints, because the curve to be fitted is an ellipse, so the discriminant The non-convex constraint becomes .
[0054] The above optimization problem becomes ,in , and then converted into ,in , discriminant becomes , where C is the upper left corner The original optimization problem becomes , using the Lagrange multiplier method to solve the six parameters of the ellipse.
[0055] S5. The relative position and posture of the underwater robot and the target nozzle in the monocular camera coordinate system are calculated using the monocular space elliptical cone position and posture measurement model for the nozzle ellipse parameters, including:
[0056] Step 1: Solve the conic surface in the camera coordinate system Mathematical expression of . Assume first that the world coordinate system , Camera coordinate system , Image coordinate system , pixel coordinate system , elliptic cone coordinate system The conversion formula between the pixel coordinate system and the world coordinate system is as follows:
[0057] ,
[0058] in,( ) is the three-dimensional coordinate in the world coordinate system, is the depth distance in the camera coordinate system, ( ) is the two-dimensional coordinate in the image coordinate system, is the focal length of the camera, the actual physical size of the pixel rectangle is represented by dx and dy, and the coordinates of the projection point of the camera optical center on the pixel coordinate system are represented by ( )express. is the three-dimensional rotation matrix, is a three-dimensional translation matrix. The coordinate system conversion formula between the pixel coordinate system and the world coordinate system can be simply written as:
[0059] ,
[0060] in, is the depth of the object in the field of view; is the position coordinate in the pixel coordinate system; It is called the camera intrinsic parameter matrix; is the camera extrinsic matrix; The physical three-dimensional coordinates of any point in the world coordinate system are combined into a coordinate vector .
[0061] Assume that the general equation of the nozzle contour ellipse on the imaging surface in the pixel coordinate system is:
[0062] ,
[0063] The elliptic coefficient matrix on the left side of the equation is It can be deduced that the conic surface in the camera coordinate system The equation is expressed as:
[0064] ,
[0065] Among them, M is the intrinsic parameter matrix of the camera, , , The next point in the world coordinate system Convert to the three-dimensional coordinates in the camera coordinate system.
[0066] make:
[0067] ,
[0068] is a real symmetric matrix. The above formula can be further simplified as:
[0069] ,
[0070] Step 2: Conic surface Convert to the standard coordinate system. For the convenience of calculation, the conic surface Convert from the camera coordinate system to Figure 4 The coordinate origin is still the camera optical center. This is a pure rotation transformation. Let the transformation matrix be , is an orthogonal matrix.
[0071] Will Substituting into the equation we get:
[0072] ,
[0073] in, Next point in the camera coordinate system Convert to Figure 4 Coordinates in the elliptical cone coordinate system.
[0074] According to matrix theory, You can Diagonalization, that is . Conic surface in standard coordinate system The expression is:
[0075] ,
[0076] , , is a matrix A set of eigenvalues of the conic surface before and after the known coordinate system rotation transformation The expression of , further find the transformation matrix ;
[0077] by The standard equation of a conic surface with the axis as the central axis is:
[0078] ,
[0079] From the above formula we can infer:
[0080] ,
[0081] in, is an arbitrary constant.
[0082] Step 3: Find the conic surface in the standard coordinate system radius The circular cross section of the conic surface can be deduced from the above formula. The expression of the cutting plane is:
[0083] ,
[0084] in, is an arbitrary constant. represents the radius of the circular cross section, it can be seen Controlled by The size of. It is easy to know, When:
[0085] ,
[0086] consider and situation, in The coordinate system forms similar triangles, such as Figure 5 By obtaining , The midpoint of the similar triangle can be combined with the proportional relationship of similar triangles to deduce , The midpoint of , that is, the three-dimensional center coordinates of the target circle in the standard coordinate system are:
[0087] ,
[0088] It is easy to obtain the target circular plane in the standard coordinate system The normal vector is:
[0089] ,
[0090] Step 4: Convert the center coordinates and normal vector back to the camera coordinate system to obtain the circle pose expression in the camera coordinate system:
[0091] ,
[0092] At this point, the contour of the target circular nozzle can be identified by machine vision and an ellipse can be fitted to calculate the relative position and posture of the origin and the center of the circular nozzle in the underwater robot camera coordinate system.
Claims
1. A visual positioning method for underwater robots for circular pipe orifice docking tasks, characterized in that: The following steps are involved: S1, obtaining an original image of the circular pipe opening in front of the underwater robot; S2, enhancing the acquired underwater original image to obtain an enhanced image; S3, using a real-time semantic segmentation model based on a convolutional neural network for the circular nozzle contour to analyze the enhanced image to obtain a segmentation mask image of the circular nozzle; S4, using the least square method to perform ellipse fitting on the mask image to obtain the nozzle ellipse parameters; S5. The relative position and posture of the underwater robot and the target nozzle in the monocular camera coordinate system are calculated using the monocular space elliptical cone pose measurement model for the nozzle ellipse parameters.
2. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 1 is characterized in that: In S2, the acquired underwater original image is enhanced by a multi-scale Retinex algorithm with color restoration. The multi-scale Retinex algorithm with color restoration is the result of considering color restoration on the basis of the multi-scale Retinex algorithm. The multi-scale Retinex algorithm is obtained by weighted superposition after multi-scaling of the single-scale Retinex algorithm. The single-scale Retinex algorithm is specifically: The single-channel original image obtained is ,in is the horizontal and vertical coordinates of any pixel point in the two-dimensional image coordinate system, and the reflected image of the object is , the brightness image of the incident light is , then the relationship between the three is , the image enhancement result is the reflection image representing the real image of the object to be sought: , in, Represents the convolution of the Gaussian function and the acquired original image. The two-dimensional Gaussian function is ,in is the amplitude of the two-dimensional Gaussian function, so that the function satisfies the Gaussian distribution ; is the scale parameter of the Gaussian function; The multi-scale Retinex algorithm with color restoration first calculates the colorimetric transformation factor ,in is the pixel value of the original image, N=3 in the RGB color space, Represents the three color channels of RGB, and then log processing is performed to obtain ,in is the gain constant, is the nonlinear transformation adjustment parameter; The calculation process of the multi-scale Retinex algorithm with color restoration is to expand the single-scale Retinex algorithm to k channels and add the colorimetric transformation factor The color restoration function of the single-scale Retinex algorithm is as follows: Determine the k-channel two-dimensional Gaussian function k scale parameters of The size here is the two-dimensional Gaussian function of each channel of k channels, calculated in the same way ,for k-scaling; is the scale parameter of the k-scale two-dimensional Gaussian function, which satisfies the Gaussian distribution A two-dimensional Gaussian function is calculated for each of the k scales medium amplitude The value of According to the formula beg The value of k is the number of multi-scale scales, and 3 represents large, medium, and small scales. is the weighted value for each scale; Then Transformation from logarithmic domain to real number domain , then perform pixel linear stretching and output the result.
3. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 2 is characterized in that: S3 specifically includes: A three-branch real-time semantic segmentation model for circular nozzle segmentation is built. Based on a lightweight backbone network, a lightweight deep backbone network MobileNet V2 or a densely connected STDC network is selected as the backbone network to complete feature extraction using depthwise separable convolution, and three branches of edge, contour, and semantics are derived from the shallow, middle, and deep layers of the backbone network respectively; the edge branch has the first edge convolution module and the second edge convolution module, which are guided by the edge segmentation head and the edge loss function during training, and focus on segmenting the object edges of the label image; the contour branch has the first contour convolution module and the second contour convolution module, which are used to learn the target space contour information output by the middle layer of the backbone network during training; the semantic branch output by the deep layer of the backbone network is used to output long-distance contextual information; the contour branch derived from the middle layer of the backbone network is used to output local spatial information; the edge branch created by the shallow layer of the backbone network is used to output edge features, and is only guided by the edge segmentation head and the edge loss function during training.
4. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 3 is characterized in that: In S3, the edge branch first obtains the edge label from the label image through the Laplacian operator, and further generates the edge label true value. The edge branch has the first edge convolution module and the second edge convolution module responsible for edge feature extraction, and an edge segmentation head is inserted at the end of the edge branch after the second edge convolution module to generate an edge feature map. Then, the edge label true value is used as a guide for the edge feature map to guide the edge branch and the edge segmentation head to learn the image edge features of the edge label true value. The Laplacian operator is used to generate detail feature maps of different step sizes, and the dilated convolution is used to enhance the weak boundary features. The multi-scale detail feature map is then upsampled to the original size and fused with a trainable 1 × 1 convolution for dynamic reweighting. Finally, a threshold less than 1 is used to convert the predicted details of the 1 × 1 convolution into the final binary edge label true value with edge information.
5. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 4 is characterized in that: In S3, the edge, contour, and semantic branches enter the three-branch fusion upsampling module for feature fusion. The output feature sizes of the edge, contour, and semantic branches are different. The semantic branch is compressed by global pooling and 1×1 convolution with regularization layer and nonlinear activation to obtain a global context weight vector with the same number of output channels as the contour branch, and then multiplied with the contour branch to obtain the weighted spatial detail features. The edge branch remaps the pixel values of the feature map to between 0 and 1 through 3×3 convolution and sigmoid activation function, and regards the result as edge attention a. At the same time, the semantic branch uses 3×3 convolution and global pooling and then adjusts the number of channels through 1×1 convolution to obtain a low-level feature channel vector containing high-level features; then the low-level feature channel vector containing high-level features is multiplied by the output feature map of the contour branch and then multiplied by the edge attention a to obtain the final contour feature. After the semantic branch integrates context information through the pyramid pooling module, it is upsampled and expanded through the deconvolution module to keep the same size as the final contour feature. The result is multiplied by 1-a to obtain the final semantic feature. Finally, the final contour feature and the final semantic feature are added to obtain the final output result of the three-branch fusion upsampling module.
6. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 5 is characterized in that: In step S3, the Laplace operator is: , the dilated convolution kernel is .
7. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 6 is characterized in that: In step S3, the hybrid loss function consists of three parts: ;in, , Represent the final output of the network segmentation head and the original label respectively, ( =0), ( ≠0), where Predict the probability of the target class for the model; ,in, Represents the probability that the model predicts the positive category; is the balance coefficient, which is used to adjust the balance between positive and negative categories; is the weight coefficient; the marginal loss function is defined as: ,in , They represent the single-channel output of the edge segmentation head and the true value of the edge label during edge branch training respectively; , where N is the number of samples, is the true label of the i-th sample, is the probability that the model predicts that the i-th sample is a positive class; , where H, W, Represents the height, width and smoothing coefficient of the image respectively.
8. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 7 is characterized in that: S4 specifically includes: In the Cartesian coordinate system, the ellipse can be expressed by a quadratic equation of two variables: , where a, b, c, d, e, and f are the five coefficients of the general equation of the ellipse, It can be expressed as a matrix: ; Ellipse fitting is to fit the optimal elliptic curve with n noisy points on a given curve, that is, fitting ,in , , , adding non-convex constraints becomes ; The above optimization problem becomes ,in , and then converted into ,in , discriminant becomes , where C is the upper left corner The original optimization problem becomes , using the Lagrange multiplier method to solve the six parameters of the ellipse.
9. The underwater robot visual positioning method for circular pipe orifice docking task according to claim 8, characterized in that: S5 specifically includes: Step 5.1: Solve the conic surface in the camera coordinate system Mathematical expression, assuming the world coordinate system , Camera coordinate system , Image coordinate system , pixel coordinate system , elliptic cone coordinate system The conversion formula between the pixel coordinate system and the world coordinate system is as follows: , in,( ) is the three-dimensional coordinate in the world coordinate system, is the depth distance in the camera coordinate system, ( ) is the two-dimensional coordinate in the image coordinate system, is the focal length of the camera, the actual physical size of the pixel rectangle is represented by dx and dy, and the coordinates of the projection point of the camera optical center on the pixel coordinate system are represented by ( )express, is the three-dimensional rotation matrix, is a three-dimensional translation matrix, and the coordinate system conversion formula between the pixel coordinate system and the world coordinate system is abbreviated as: , in, is the depth of the object in the field of view; is the position coordinate in the pixel coordinate system; It is called the camera intrinsic parameter matrix; is the camera extrinsic matrix; The physical three-dimensional coordinates of any point in the world coordinate system are combined into a coordinate vector ; Assume that the equation of the nozzle contour ellipse on the imaging surface in the pixel coordinate system is: , The elliptic coefficient matrix on the left side of the equation is It means that the conic surface in the camera coordinate system can be derived The equation is expressed as: , Among them, M is the intrinsic parameter matrix of the camera, , , The next point in the world coordinate system Convert to the three-dimensional coordinates in the camera coordinate system; order: , is a real symmetric matrix, the above formula can be further simplified to: , Step 5.2: Conic surface Convert the conic surface to the standard coordinate system Convert from the camera coordinate system to the standard coordinate system. The origin of the coordinate system is the optical center of the camera. Set the transformation matrix as , is an orthogonal matrix; Will Substituting into the equation we get: , in, Next point in the camera coordinate system Convert coordinates to the elliptic cone coordinate system; Will Diagonalization, that is ; Conic surface in standard coordinate system The expression is: , , , is a matrix A set of eigenvalues of the conic surface before and after the known coordinate system rotation transformation The expression of , further find the transformation matrix ; by The standard equation of a conic surface with the axis as the central axis is: , From the above formula, we can infer: , in, is an arbitrary constant; Step 5.3: Find the conic surface in the standard coordinate system radius The circular cross section of the conic surface is derived from the above formula. The expression of the cutting plane is: , in, is an arbitrary constant; Indicates the radius of the circular cross section When: , consider and situation, in The coordinate system forms similar triangles, and by finding , The midpoint of the triangle is combined with the proportional relationship of similar triangles, and the , The midpoint of , that is, the three-dimensional center coordinates of the target circle in the standard coordinate system are: , Get the target circular plane in the standard coordinate system The normal vector is: , Step 5.4: Convert the circle center coordinates and normal vector back to the camera coordinate system to obtain the circle pose expression in the camera coordinate system: , At this point, the contour of the target circular nozzle is identified by machine vision and an ellipse is fitted to calculate the relative position and posture of the origin and the center of the circular nozzle in the underwater robot camera coordinate system.
Citation Information
Patent Citations
Visual recognition and positioning method for robot intelligent capture application
CN108171748A
Image semantic segmentation method based on local and global feature enhancement modules
CN111210435A
Dynamic monitoring method for high-speed video measurement of waterproof membrane of underwater vibration table
CN113610925A
Coding and decoding end edge information enhancement and attention guidance image segmentation method and system
CN114677349A
Three-dimensional point-cloud semantic segmentation method based on multi-level boundary enhancement for unstructured environment
WO2024230038A1
Cited By
Restricted water area three-dimensional route planning method, system, equipment and medium
CN120351940A
Method, system, equipment and medium for three-dimensional route planning in restricted waters
CN120351940B