AUV pose detection method and system based on underwater light vision, medium and program product
Through the method based on underwater light vision, blue channel feature analysis and adaptive threshold optimization, combined with projective intersection invariance and exponential smoothing filtering, the anti-interference problem of AUV posture detection in various sea conditions is solved, and high-precision feature point matching and posture solution are achieved, which improves the stability and accuracy of the detection.
Patent Information
- Application Number
- CN202510441526.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
AI Technical Summary
The existing underwater unmanned aerial vehicle (AUV) posture detection method has poor anti-interference ability under various sea conditions, making it difficult to achieve high-precision blue light source feature extraction and matching feature points, affecting the accuracy and stability of guiding information.
Using an underwater optical vision method, the grayscale weight is dynamically adjusted by analyzing the blue channel characteristics of the image, combining the triple constraints of the number of contours, the spacing of the center point and the area, adaptive threshold optimization is performed, and feature point matching and compensation is used to achieve AUV pose solution.
It improves the stability and accuracy of AUV posture detection, can adapt to a variety of water environments, enhances anti-interference ability, and ensures the accuracy of guiding information.
Smart Images

Figure CN120374723A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of underwater robots, and particularly relates to a method, system, medium and program product for detecting the pose of an AUV based on underwater optical vision. Background Art
[0002] Autonomous Underwater Vehicles (AUVs) have the characteristics of miniaturization, intelligence, and strong concealment, and can dive into deeper waters to perform various scientific research or military tasks. Underwater endurance has always been one of the key technologies to ensure the smooth execution of tasks. Through underwater docking technology, underwater charging can be realized, which can improve the endurance of the vehicle without compromising its concealment. Underwater docking is divided into two stages: long-distance acoustic guidance and short-distance optical guidance. The optical guidance system usually uses an optical sensor for target recognition, and its applicable range depends on conditions such as lighting conditions and environmental turbidity, with a detection range from several meters to several hundred meters. The acoustic guidance system uses sound waves for target detection and positioning, and its detection range is affected by factors such as the performance of the sonar system, water temperature, and environmental noise level, with an effective detection range from several hundred meters to several kilometers. Compared with the acoustic guidance stage, the optical guidance stage has higher requirements for the accuracy of guidance information. The current mainstream method is to use the classical image binarization and contour connectivity domain judgment method to extract the position information of the guiding light, and this method usually cannot adapt to various sea conditions and has very poor anti-interference ability. The mainstream method for solving the AUV pose information is P3P, which has relatively high requirements for the matching accuracy of pixel coordinates and world coordinates, and a coordinate matching strategy with strong anti-interference ability is needed. Summary of the Invention
[0003] The purpose of the present invention is to provide a method, system, medium and program product for detecting the pose of an AUV based on underwater optical vision, which can adapt to various water areas, better realize the blue light source feature extraction and feature point matching tasks, and improve the stability and accuracy of AUV pose detection.
[0004] The purpose of the present invention is achieved through the following technical solutions:
[0005] A method for detecting the pose of an AUV based on underwater optical vision, the specific steps are as follows:
[0006] Step 1: When the AUV initially obtains an image, decompose the image into RGB components, extract the blue channel features, calculate the proportion of the contour area after binarization processing in the total area of the image, and when the proportion exceeds 50%, it is determined to be a clear water environment, otherwise it is a turbid water environment;
[0007] Step 2: Adjust the grayscale weight based on the water quality characteristics, adopt a blue channel weighted enhancement strategy to generate a grayscale image, and perform Gaussian filtering and threshold segmentation on the image by setting the threshold of the initial binary value;
[0008] Step 3: According to the threshold segmentation result and the information of the light array to be detected, introduce three constraint conditions: the number of contours, the distance between the center points of the contours, and the area of the contours, and make judgments in sequence. If there is a non-conforming condition, immediately skip the subsequent judgments, adjust the threshold and make judgments again, and adopt a variable step size strategy to iteratively adjust the segmentation threshold;
[0009] Step 4: Perform white contour processing on the segmented image, remove the noise contours according to the circularity of the contours, and use the center of the minimum circumscribed circle of the remaining contours as the feature point coordinates, that is, the pixel coordinates of the wick;
[0010] Step 5: Evaluate the extracted feature points and the actual number of light sources. If there is no missed detection, set the attitude solution confidence to 3, then match the feature points based on the projective cross-ratio invariance theory, complete the sorting of pixel coordinates, and proceed to Step 7; if 1, 2, or 3 points are missed, set the attitude solution confidence to 2, 1, or 0 respectively, and proceed to Step 6;
[0011] Step 6: Perform exponential smoothing filtering on the current frame feature points based on the last 10 frames of images without missed detection; achieve feature point compensation through Euclidean distance comparison, calculate the Euclidean distance between the corresponding feature points of the current frame after compensation and the predicted frame. If the distance exceeds 20 pixels, reset the confidence to 0; otherwise, retain the attitude solution confidence in Step 5 and complete the sorting of pixel coordinates;
[0012] Step 7: When the confidence is 0, abandon the attitude solution, and return the solution result as [0,0,0,0,0,0]; when the confidence is 3, 2, or 1, use the P3P method to perform the pose solution of the underwater unmanned vehicle.
[0013] Further, in Step 1, considering the timing continuity characteristics of the AUV working environment, the water quality information is collected in the first 5 frames of images and default parameters are established.
[0014] Further, in Step 1, the water quality and imaging state are evaluated based on the blue component gray matrix: under good water area conditions, the overall image shows a blue tone and the wick area is white; under poor water area conditions, the overall image is greenish and the wick area shows blue.
[0015] Further, in Step 2, for the blue channel weight distribution function, the weight in clear water environment is 0.6, and the weight in turbid water environment is 0.8. The formula for weighted fusion to generate the enhanced gray image is:
[0016]
[0017] where Gray is the gray matrix, W b is the blue channel weight, and R, G, B are the red, green, and blue channel matrices;
[0018] Set the initial binarization threshold according to the grayscale information. Take 50% of the maximum grayscale value of the weighted fusion grayscale matrix as the initial threshold for binarization processing. When the initial threshold is lower than 100, it is forcibly set to 100. Subsequently, perform Gaussian filtering for noise reduction and binarization processing based on the initial threshold on the image in sequence.
[0019] Further, the introduction of the triple constraint conditions of the number of contours, the distance between the contour center points, and the contour area in step 3 is specifically as follows:
[0020] (1) Contour number condition: Analyze the result of threshold segmentation, and judge the size relationship between the number of contours obtained by segmentation and the actual number of lights in the lamp array. If the number of contours is not greater than the actual number of lights, it is considered to meet the contour number condition. For the "L-shaped" lamp array, the contour number condition is that the number of segmented contours is not greater than 5.
[0021] (2) Contour center point distance condition: Calculate the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the detected contour center points, and judge whether each contour center point is too close to avoid noise interference. If the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the contour center points is not greater than 1.5 times the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the lamp cores in the actual lamp array, it is considered to meet the contour center point distance condition.
[0022] (3) Contour area condition: Calculate the ratio of the area of each contour to the average contour area. If the ratio of the area of each contour to the average contour area is within the range of 0.5 - 1.5, it is considered to meet the contour area condition.
[0023] Further, the iterative threshold in step 3 adopts a variable step size adjustment strategy, specifically as follows:
[0024] When the segmentation result does not meet the contour number condition, it is considered that the current threshold needs to be adjusted significantly. Set the threshold adjustment step size to 20, and increase the threshold by 20 in a single iteration. When the segmentation result meets the contour number condition but does not meet the contour center point distance condition, it is considered that the current threshold needs to be adjusted moderately. Set the threshold adjustment step size to 10, and increase the threshold by 10 in a single iteration. When the segmentation result meets the contour number condition and the contour center point distance condition but does not meet the contour area condition, it is considered that the current threshold needs to be adjusted slightly. Set the threshold adjustment step size to 5, and increase the threshold by 5 in a single iteration.
[0025] Further, when there is no missed detection in step 5, for the "L-shaped" lamp array, using the invariance of projective cross-ratio, the cross-ratio of four collinear points remains unchanged, and the cross-ratio of four lines passing through a point remains unchanged. Sort the five groups of pixel coordinates; calculate the cross-ratio of four collinear points and the cross-ratio of four lines passing through a point in the world coordinate system; traverse the five groups of pixel coordinates to find four collinear points and a point outside the line, sort the four collinear points according to the x and y coordinates respectively, calculate the cross-ratio of the four collinear points and find the difference from the cross-ratio of the four collinear points in the world coordinate system, and select the sorting method with a smaller absolute value of the difference; similarly, compare the cross-ratio of the four lines formed by the point outside the line and the four collinear points to determine the positional relationship between the four collinear points and the remaining points, and complete the sorting of pixel coordinates.
[0026] Further, when it is detected that 2 or more lamps are missed in 3 consecutive frames in step 5, the re-calibration mechanism is triggered in the next frame to re-perform single water quality information collection and update the default parameters.
[0027] A computer device / system, including a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program to implement the steps of an AUV pose detection method based on underwater optical vision.
[0028] A computer-readable storage medium, on which a computer program / instructions are stored, and when the computer program / instructions are executed by a processor, the steps of an AUV pose detection method based on underwater optical vision are implemented.
[0029] A computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of an AUV pose detection method based on underwater optical vision are implemented.
[0030] The beneficial effects of the present invention are as follows:
[0031] The present invention designs a feature point matching compensation method based on the invariance of projective cross-ratio and the exponential smoothing prediction theory, and proposes an image segmentation method with multiple constraint adaptive thresholds that integrates water quality information, can adapt to various water areas, and better realizes the blue light source feature extraction and feature point matching tasks, improving the stability and accuracy of AUV pose detection.
[0032] The present invention makes full use of the lamp array structure information, adopts relatively reliable traditional image morphology processing methods, the invariance of projective cross-ratio, and exponential smoothing filtering, can accurately detect the pose of the AUV, can adapt to various water qualities, and has strong anti-interference ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Attached Figure 1 is the overall flowchart of the present invention;
[0034] Attached Figure 2 is the structure diagram of the "L-shaped" lamp array;
[0035] Attached Figure 3 It is the image segmentation flow chart;
[0036] Attached Figure 4 This is the principle diagram of the projective cross ratio invariance;
[0037] Attached Figure 5 It is a comparison chart between the detected value and predicted value of X-axis displacement in the posture information;
[0038] Attached Figure 6 It is a comparison chart between the detected value and predicted value of Z-axis displacement in the posture information;
[0039] Attached Figure 7 Abstract diagram of the P3P problem. DETAILED DESCRIPTION
[0040] The present invention is further described below in conjunction with the accompanying drawings.
[0041] The present invention provides an AUV posture detection method based on underwater optical vision, according to Figure 1 , the specific steps are as follows:
[0042] Step 1: Extraction of water quality features. Due to the selective absorption and scattering of electromagnetic waves by water molecules and suspended particles, different wavelengths of light follow the Beer-Lambert Law and show differential attenuation during the propagation of seawater. This wavelength selective attenuation characteristic causes asymmetric degradation of the RGB channels of underwater images: the red channel shows a significant decrease in contrast and loss of details due to rapid attenuation, and the blue-green channel retains more high-frequency information, but the white balance is disturbed by the spectral energy distribution offset. Although the use of blue light source as a characteristic light source can retain more information, the interference of phytoplankton, suspended matter and dissolved matter during underwater shooting will still lead to degradation of image quality, which is manifested as large-area color deviation (bluish or greenish). In view of the performance of AUV onboard equipment and the real-time limitations of the controller, complex underwater image enhancement algorithms are difficult to apply in practice. In this method, the numerical changes and distribution characteristics of the three channels of R, G, and B in the image are analyzed to determine the water quality information of the current water area. After decomposing the image into red, green, and blue components, the water quality and imaging status are evaluated based on the grayscale matrix of the blue component: under high-quality water conditions, the image is blue as a whole and the wick area is white; under poor-quality water conditions, the image is green as a whole and the wick area is blue. By extracting the distribution characteristics of the blue component, the proportion of the contour area to the total image area after binarization (pixel coordinate system) is used as the basis for judgment. When the contour area exceeds 50% of the image area, it is considered a clear water environment; otherwise, it is a muddy water environment. Taking into account the temporal continuity characteristics of the AUV working environment, this method completes the water quality information collection in the first 5 frames of images and establishes default parameters.
[0043] Step 2: Image preprocessing. Reassign the grayscale weights according to the water quality characteristics in Step 1, and adopt a blue-channel weighted enhancement strategy to obtain a grayscale image, assigning different weight coefficients to the blue component. The blue-channel weight distribution function is 0.6 for a clear water environment and 0.8 for a turbid water environment:
[0044]
[0045] Formula for generating an enhanced grayscale image by weighted fusion:
[0046]
[0047] where Gray is the grayscale matrix, W b is the blue-channel weight, and R, G, B are the red, green, and blue channel matrices;
[0048] Set the initial binarization threshold according to the grayscale information, taking 50% of the maximum grayscale value of the weighted fusion grayscale matrix as the initial threshold for binarization. When the initial threshold is lower than 100, it is forcibly set to 100. Subsequently, perform Gaussian filtering (5×5 convolution kernel) denoising and binarization processing based on the initial threshold on the image in sequence.
[0049] Core formula for two-dimensional Gaussian function filtering:
[0050]
[0051] where x and y represent the horizontal and vertical coordinate offsets relative to the center of the Gaussian kernel, and σ 2 represents the variance.
[0052] Step 3: Threshold adaption. Aiming at the problem of insufficient adaptability of fixed-threshold segmentation caused by differences in water body optical properties in underwater imaging, this method proposes an adaptive threshold optimization strategy. By introducing three constraint conditions: the number of contours, the distance between the center points of the contours, and the area of the contours, the dynamic adjustment of the threshold parameters is realized.
[0053] Details of the method are as follows:
[0054] 1) Contour number condition: Analyze the result of threshold segmentation, and judge the size relationship between the number of contours obtained by segmentation and the actual number of lights in the lamp array. If the number of contours is not greater than the actual number of lights, it is considered to meet the contour number condition. For an "L-shaped" lamp array, the contour number condition is that the number of contours segmented is not greater than 5;
[0055] 2) Condition for the distance between the contour center points: Calculate the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the detected contour center points, and determine whether each contour center point is too close to avoid noise interference. If the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the contour center points is not greater than 1.5 times the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the actual lamp wicks in the lamp array, it is considered to meet the condition for the distance between the contour center points;
[0056] 3) Condition for the contour area: Calculate the ratio of the area of each contour to the average contour area. If the ratio of the area of each contour to the average contour area is within the range of 0.5 - 1.5, it is considered to meet the condition for the contour area.
[0057] The above three conditions need to be judged in sequence. If there is a non - compliant situation, immediately skip the subsequent judgment and adjust the threshold for re - judgment. The iterative threshold adopts a variable step - size adjustment strategy: When the segmentation result does not meet the contour number condition, it is considered that the current threshold needs to be adjusted significantly, and the threshold adjustment step - size is set to 20, and the threshold increases by 20 in a single iteration; when the segmentation result meets the contour number condition but does not meet the condition for the distance between the contour center points, it is considered that the current threshold needs to be adjusted moderately, and the threshold adjustment step - size is set to 10, and the threshold increases by 10 in a single iteration; when the segmentation result meets the contour number condition and the condition for the distance between the contour center points but does not meet the contour area condition, it is considered that the current threshold needs to be adjusted slightly, and the threshold adjustment step - size is set to 5, and the threshold increases by 5 in a single iteration. The above - mentioned threshold adjustment strategy can effectively reduce the image - processing time compared with the single - step threshold adjustment. The specific process is as Figure 3 .
[0058] Step 4: Feature point extraction. Based on the binary image in Step 3, process the white contours of the image, and screen out the noise contours according to the circularity of the contours. Contours with a circularity less than 0.6 are regarded as noise, and the center of the minimum circumscribed circle of each remaining contour is regarded as the pixel coordinate of the lamp wick.
[0059] Circularity calculation formula:
[0060]
[0061] Among them, e represents the circularity of the contour, S represents the contour area, and l represents the contour perimeter.
[0062] Step 5: Missed detection judgment and coordinate matching. P3P estimation of the lamp array pose requires at least four groups of pixel - world coordinate point pairs, and the pose estimation accuracy is proportional to the number of key points. When underwater projection, there may be phenomena such as fish, plants, or equipment blocking the light source. By comparing the feature points extracted in Step 4 with the actual number of light sources, determine whether there is a missed detection of the light source. If there is no missed detection, set the attitude solution confidence level to 3. For the "L - shaped" lamp array ( Figure 2 ), utilize the projective cross - ratio invariance ( Figure 4) The cross-ratio of four collinear points remains unchanged, the cross-ratio of four lines passing through a point remains unchanged, and the five sets of pixel coordinates are sorted. Calculate the cross-ratio of four collinear points and the cross-ratio of four lines passing through a point in the world coordinate system. Traverse the five sets of pixel coordinates, find four collinear points and a point outside the line, sort the four collinear points according to the x and y coordinates respectively, calculate the cross-ratio of the four collinear points and find the difference from the cross-ratio of the four collinear points in the world coordinate system, and select the sorting method with a smaller absolute value of the difference. Similarly, compare the cross-ratio of the four lines formed by the point outside the line and the four collinear points, determine the positional relationship between the four collinear points and the remaining points, complete the sorting of the pixel coordinates, and then proceed to step 7. If one point is missed, set the attitude solution confidence level to 2; if two points are missed, set the attitude solution confidence level to 1; if three points are missed, set the attitude solution confidence level to 0; if there are missed detections, the above sorting method fails, consider missed detection compensation, and proceed to step 6. If it is detected that two or more lights are missed continuously in three frames, trigger the re-calibration mechanism in the next frame to re-execute the single water quality information collection and update the default parameters (see step 1 for details).
[0063] Cross-ratio formula for four collinear points A, B, C, and D:
[0064]
[0065] Among them, AC, BC, AD, and BD represent the lengths of the actual directed line segments, and ac, bc, ad, and bd represent the lengths of the directed line segments of the pixel coordinates.
[0066] Cross-ratio formula for four lines PA, PB, PC, and PD passing through a point P:
[0067]
[0068] Among them, P, A, B, C, and D are the actual five points; p', a, b, c, and d are the five pixel points after photography.
[0069] Step 6: Feature point prediction and compensation. Retain the image information of the 10 frames closest to the current image frame without missed detections, and use the double exponential smoothing filter to predict the pixel coordinates of each wick in the current frame image.
[0070] The content of the exponential smoothing filter method is as follows: Let the time series be y1, y2, ……, y t , ……, α and β are the weighting coefficients and are less than 1.
[0071] Formula for the single exponential smoothing method:
[0072]
[0073] is the weighted average of all historical data, and the weighting coefficients are α, α(1 - α), α(1 - α) 2 ,
[0074] Its prediction model is as follows:
[0075]
[0076] Formula for double exponential smoothing method:
[0077]
[0078] is the single exponential smoothing value, is the double exponential smoothing value, α = 0.4;
[0079] Its single-step prediction model (T = 1) formula is:
[0080]
[0081] where β = 0.65, represents the single-step prediction value.
[0082] Figure 5 is the detection and prediction comparison chart of the X-axis displacement, Figure 6 is the detection and prediction comparison chart of the Z-axis displacement. Calculate the Euclidean distance between the detected point and the predicted point of the current frame in the pixel coordinate system. Considering the continuity of the AUV movement, its pose will not have sudden changes. According to the Euclidean distance, the point order of the current frame can be judged. For example: Take a detected point and calculate its Euclidean distance from all predicted points and sort them. The one with the smallest distance is the feature point at the corresponding position. After sorting, supplement the missed detected feature points. Check the compensated feature points: Calculate the Euclidean distance between the corresponding feature points of the compensated current frame and the predicted frame. If the Euclidean distance between a certain pair of points exceeds 20 pixels, reset the confidence level to 0.
[0083] Step 7: Pose solution and confidence level. Determine whether to activate the pose solution according to the confidence level: If the confidence level is 0, abandon the pose solution, and the solution result returns [0,0,0,0,0,0]; if the confidence level is 3, 2, or 1, activate the pose solution, and use the P3P method to perform the pose solution of the underwater unmanned vehicle.
[0084] The P3P pose solution method is as follows:
[0085] P3P is a set algorithm based on perspective projection. By using 3 pairs of accurately matched 2D-3D points and combining the ICP method, the pose transformation information of the image is solved. Its core idea is: Establish equations through three corresponding point pairs, solve the rotation matrix and translation vector of the camera, so as to determine the pose of the camera. Let the center point of the camera be O, and A, B, and C be three non-collinear 3D points in space, and their corresponding projection points on the image are a, b, and c, as shown in the appendix Figure 7 as shown.
[0086] The projection equation can be expressed as:
[0087]
[0088] where K is the camera intrinsic matrix, (X, Y, Z) are the coordinates of a spatial point, (u, v) are the coordinates of the corresponding image point, and R and t are the rotation matrix and translation vector to be solved.
[0089] The specific solution steps are as follows:
[0090] First, use the camera intrinsic matrix K to normalize the image coordinates to obtain the corresponding unit direction vector:
[0091]
[0092] The corresponding unit direction vector is:
[0093]
[0094] where a, b, and c are the unit direction vectors.
[0095] Calculate the angle between the direction vectors through the dot product to obtain cosθ ab , cosθ ac , cosθ bc :
[0096]
[0097] Let the distance from the camera center to the 3D point be x = OA, y = OB, z = OC. Using the cosine theorem and the 3D point spacing:
[0098]
[0099] where d AB , d BC , d AC represent the distance between two points.
[0100] Introduce the variables u = y / x, v = z / x, and the equation can be simplified to:
[0101]
[0102] After eliminating x, a system of equations about u and v is obtained. Further elimination yields a quartic equation about u. Use the Ferrari method to solve the equation to obtain the analytical solution of u (at most four). Substitute u back into the original equation to obtain the values of v and x, and further obtain the values of y and z. Finally, according to the obtained distance from the camera optical center to the guiding light source, the coordinates of the spatial point in the camera coordinate system can be calculated:
[0103]
[0104] Among them, A c , B c , C c represent the camera coordinate system coordinates of points A, B, and C.
[0105] Solve the 3D-3D correspondence relationship through the point cloud registration algorithm. First, calculate the spatial coordinates of three points A w , B w , C w and the centroid G w of their camera coordinates, G c :
[0106]
[0107] Solve the displacement vector of each point relative to the centroid:
[0108]
[0109] Construct the covariance matrix:
[0110]
[0111] Perform SVD decomposition on the constructed covariance matrix to obtain the rotation matrix R:
[0112]
[0113] Calculate the translation vector t:
[0114] t = G c - RG w
[0115] When solving the quartic equation, generally four sets of solutions will be obtained. The light sources not involved in the calculation among the five light sources can be reprojected onto the image plane, and the set of solutions with the smallest error is selected as the final solution result.
[0116] The present invention adopts a multi-constraint adaptive threshold binary segmentation method that fuses water quality information to accurately detect the pixel coordinates of the lamp wick, and uses the projective cross-ratio invariance and exponential filtering prediction compensation to achieve accurate sorting of the coordinates, greatly improving the applicable range and anti-interference ability of the algorithm, and being able to obtain relatively accurate pose information of the AUV.
[0117] The functions of an AUV pose detection system based on underwater optical vision according to the present invention can be illustrated by the aforementioned AUV pose detection method based on underwater optical vision. The system includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in a Read-Only Memory (ROM) 302 or the program loaded from a storage section 308 into a Random Access Memory (RAM) 303, such as executing the method described in the above embodiments. In the RAM 303, various programs and data required for the operation of the rescue response system are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An Input / Output (I / O) interface 305 is also connected to the bus 304.
[0118] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a Liquid Crystal Display (LCD), an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A driver 310 is also connected to the I / O interface 305 as required. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the driver 310 as required so that a computer program read from it can be installed into the storage section 308 as required.
[0119] Specifically, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 309, and / or installed from the removable medium 311. When the computer program is executed by a Central Processing Unit (CPU) 301, various functions defined in the present invention are executed.
[0120] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.
[0121] Specifically, a posture detection system of an AUV based on underwater optical vision in this embodiment includes a processor and a memory. A computer program is stored on the memory. When the computer program is executed by the processor, it implements a method for detecting the posture of an AUV based on underwater optical vision provided in the above embodiment.
[0122] On the other hand, the present invention also provides a computer-readable storage medium. This storage medium can be included in a posture detection system of an AUV based on underwater optical vision described in the above embodiment; or it can exist alone and not be assembled into the posture detection system of an AUV based on underwater optical vision. The above storage medium carries one or more computer programs. When the one or more computer programs are executed by a processor of a posture detection system of an AUV based on underwater optical vision, the posture detection system of an AUV based on underwater optical vision is enabled to implement a method for detecting the posture of an AUV based on underwater optical vision provided in the above embodiment.
[0123] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An AUV pose detection method based on underwater optical vision, characterized in that: The specific steps are as follows: Step 1: When the AUV acquires the image for the first time, the image is decomposed into RGB components and the blue channel features are extracted. The proportion of the contour area after binarization processing to the total image area is calculated. When the proportion exceeds 50%, it is judged as a clear water environment, otherwise it is a turbid water environment; Step 2: Adjust the grayscale weight based on water quality characteristics, use the blue channel weighted enhancement strategy to generate a grayscale image, and perform Gaussian filtering and threshold segmentation on the image by setting the initial binary threshold; Step 3: According to the threshold segmentation result and the information of the light array to be detected, the triple constraints of the number of contours, the distance between the center points of contours and the contour area are introduced, and judgments are made in sequence. If any condition is not met, the subsequent judgment is skipped immediately, the threshold is adjusted and re-judged, and the segmentation threshold is iteratively adjusted using a variable step size strategy; Step 4: Perform white contour processing on the segmented image, remove the noise contour according to the contour circularity, and use the center of the minimum circumscribed circle of the remaining contour as the feature point coordinates, that is, the wick pixel coordinates; Step 5: Evaluate the extracted feature points and the actual number of light sources. If there is no missed detection, set the attitude solution confidence to 3, then match the feature points based on the projective cross ratio invariance theory, complete the pixel coordinate sorting, and proceed to step 7; if 1, 2, or 3 points are missed, set the attitude solution confidence to 2, 1, or 0, respectively, and proceed to step 6; Step 6: Based on the latest 10 frames of non-missed images, perform exponential smoothing filtering to predict the feature points of the current frame; achieve feature point compensation through Euclidean distance comparison, calculate the Euclidean distance between the feature points of the current frame and the predicted frame after compensation, and reset the confidence to 0 if the distance exceeds 20 pixels; otherwise, retain the confidence of the posture solution in step 5 and complete the pixel coordinate sorting; Step 7: When the confidence level is 0, the attitude solution is abandoned and the solution result is returned to [0,0,0,0,0,0]; when the confidence level is 3 or 2 or 1, the P3P method is used to solve the posture of the underwater unmanned vehicle.
2. The AUV pose detection method based on underwater optical vision according to claim 1, wherein: The step 1 takes into account the temporal continuity characteristics of the AUV working environment, completes the water quality information acquisition in the first 5 frames of images and establishes default parameters.
3. A method for detecting the pose of an AUV based on underwater optical vision according to claim 1 or 2, characterized in that: The step 1 evaluates the water quality and imaging status based on the blue component grayscale matrix: under high-quality water conditions, the image as a whole is blue and the core area is white; under poor-quality water conditions, the image as a whole is green and the core area is blue.
4. A method for detecting the pose of an AUV based on underwater optical vision according to claim 1, characterized in that: The blue channel weight distribution function in step 2 is 0.6 for clear water environment and 0.8 for muddy water environment. The formula for weighted fusion to generate enhanced grayscale image is: where Gray is the grayscale matrix, W b is the blue channel weight, and R, G, B are the red, green, and blue channel matrices; The initial binarization threshold is set according to the grayscale information, and 50% of the maximum grayscale value of the weighted fused grayscale matrix is used as the initial threshold for binarization processing. When the initial threshold is lower than 100, it is forcibly set to 100; then Gaussian filtering denoising and binarization based on the initial threshold are performed on the image in sequence.
5. The AUV pose detection method based on underwater optical vision according to claim 1, wherein: The triple constraints of the number of contours, the distance between contour center points and the contour area introduced in step 3 are specifically: (1) Contour number condition: Analyze the result of threshold segmentation and determine the relationship between the number of contours obtained by segmentation and the number of actual lights in the light array. If the number of contours is not greater than the actual number of lights, the contour number condition is considered to be met. For an "L-shaped" light array, the contour number condition is that the number of contours obtained by segmentation is not greater than 5. (2) Contour center point spacing condition: Calculate the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the detected contour center points to determine whether each contour center point is too close to avoid noise interference. If the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the contour center points is not greater than 1.5 times the ratio of the maximum Euclidean distance to the minimum Euclidean distance between the actual lamp array cores, the contour center point spacing condition is considered to be met; (3) Contour area condition: Calculate the ratio of the area of each contour to the average area of the contours. If the ratio of the area of each contour to the average area of the contours is within the range of 0.5-1.5, the contour area condition is considered to be met.
6. The AUV pose detection method based on underwater optical vision according to claim 5, characterized in that: In step 3, the iterative threshold adopts a variable step size adjustment strategy, specifically: When the segmentation result does not meet the contour number condition, it is considered that the current threshold needs to be adjusted significantly. The threshold adjustment step is set to 20, and the single iteration threshold is increased by 20; when the segmentation result meets the contour number condition but does not meet the contour center point spacing condition, it is considered that the current threshold needs to be adjusted moderately. The threshold adjustment step is set to 10, and the single iteration threshold is increased by 10; when the segmentation result meets the contour number condition and the contour center point spacing condition but does not meet the contour area condition, it is considered that the current threshold needs to be adjusted slightly. The threshold adjustment step is set to 5, and the single iteration threshold is increased by 5.
7. The AUV pose detection method based on underwater optical vision according to claim 1, characterized in that: If there is no missed detection in the step 5, for the "L-shaped" light array, the projective intersection ratio invariance is used to keep the intersection ratio of the four collinear points unchanged and the intersection ratio of the four straight lines passing through a point unchanged, and the five groups of pixel coordinates are sorted; the intersection ratio of the four collinear points and the intersection ratio of the four straight lines passing through a point in the world coordinate system are calculated; the five groups of pixel coordinates are traversed to find the four collinear points and the points outside the straight lines, and the collinear four points are sorted according to the x and y coordinates respectively, the intersection ratio of the four collinear points is calculated and subtracted from the intersection ratio of the four collinear points in the world coordinate system, and the sorting method with the smaller absolute value of the difference is selected; similarly, the intersection ratio of the four straight lines composed of the points outside the straight line and the four collinear points is compared to determine the positional relationship between the four collinear points and the remaining points, and the pixel coordinate sorting is completed.
8. The AUV pose detection method based on underwater optical vision according to claim 1, wherein: In step 5, when it is detected that two or more lights are missed in three consecutive frames, the recalibration mechanism is triggered in the next frame to re-execute a single water quality information collection and update the default parameters.
9. A computer device / apparatus / system, comprising a memory, a processor, and a computer program stored on the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer programs / instructions stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Method, device, equipment, product and storage medium for identifying skull defect by constructing characteristic spectrum through nuclear magnetic image
CN120953270A