Abstract
A novel binocular vision error compensation method is proposed to solve the major error compensation problem caused by nonlinear distortion of camera and projector on underwater target detection. By optimizing the visual structure and integrating the projector with two cameras, the method enhances the adaptability and robustness of the system in the complex underwater environment. Through fine signal preprocessing such as multi-scale decomposition and feature extraction, the three-dimensional information of the target is captured more effectively and the data noise is effectively removed. The characteristics of underwater target detection error compensation data are extracted, and the characteristic parameters reflecting the significant difference between them are obtained. In order to ensure the accuracy of compensation results, a multi-scale attention mechanism is introduced into the improved binocular vision, and feature parameters are taken as the input of binocular vision model. After continuous learning and training, high-precision error compensation for underwater targets is realized. Experimental results show that different underwater targets can be detected when the average error value compensated by this method is less than 0.1 mm, and the maximum error value is always less than 1.5 mm. The structural similarity index measure of the proposed method is above 0.91, and the fluctuation is small. This method has significant advantages in reducing errors, adapting to different terrain targets, and providing stable and high-precision output, which shows its application potential and superiority in the field of underwater target detection, and provides a more effective and reliable technical solution for underwater target detection.
Keywords
Introduction
Binocular vision is one of the important means for machines to understand the world. In recent years, due to the needs of people's production and life, improving binocular vision has become an important content in the field of underwater target detection.1–3 During underwater target detection, due to the significant difference between the object and the surrounding environment and the large size of the measured object, the target information generated by various interference factors will greatly affect the detection accuracy,4,5 Thus, the detection effect is greatly reduced. Therefore, how to effectively detect underwater targets and improve the performance of detection error compensation has become an important research topic.6,7 Underwater target detection error compensation based on improved binocular vision has attracted the attention of many experts and scholars. Wang et al. 8 proposed an attitude accuracy compensation method for mobile industrial robots based on binocular vision measurement and depth belief network. This technology not only enhances the positioning accuracy of robots but also has the potential to be extended to fields requiring high-precision navigation and positioning, such as autonomous vehicles and drones. Huang et al. 9 introduced a high-precision measurement method for chamfer hole radius and spacing of large workpieces using binocular vision and plane dynamic adjustment technology. This is of significant importance for improving product quality inspection and control in the manufacturing industry, and it can also be applied to the inspection of precision instruments and equipment. Song et al. 10 addressed the error compensation issue in underwater object detection by proposing a two-stage detector called boosting R-CNN, which significantly improves the detection accuracy of vague objects in complex underwater environments through the introduction of uncertainty modeling and hard example mining techniques. The potential applications of this technology are not limited to underwater exploration but can also be extended to other similar complex environments for object detection, such as forest fire monitoring and animal tracking in wildlife reserves. In these applications, the vagueness of targets and the complexity of the environment often render traditional detection methods ineffective, while the robustness and accuracy demonstrated by boosting R-CNN provide new solutions for these fields. Literature 11 deeply analyzed the impact of target reflected sound waves on water surface vibration, established the quantitative relationship between water surface vibration disturbance and target position, and built the mmwave radar signal model. A technique for estimating the phase power spectrum of water surface vibration is also proposed. The application value of the scheme is verified by using frequency modulation radar in laboratory water tank environment. In literature, 12 a new filtering technique of shifted Rayleigh filter (SHRF) is introduced, which is specially used for 3D underwater target tracking, and focuses on solving the challenge of how to accurately determine the target position and velocity when dealing with the azimuth and elevation measurement noise of a single moving target.
The binocular vision system is very sensitive to illumination conditions, and strong illumination changes or uneven illumination will lead to measurement errors. If the training data is not diverse enough or the network structure is too complex, overfitting will be caused and the generalization ability of the model will be reduced. However, deep belief networks require a large amount of annotation data for training, and data acquisition and annotation will be time-consuming and costly. On this basis, an error compensation method for underwater target detection based on improved binocular vision is proposed to improve the error compensation effect. In this paper, a projector is used to project structured light or other patterns onto the target, so that even in the case of unsatisfactory lighting conditions, it can provide additional texture information to help the camera better capture the three-dimensional information of the target. Using two cameras can capture targets from different angles, increasing the diversity of data and helping to improve the robustness and resilience of the system to changes in lighting. Breaking down the signal into multiple scales can help extract features at different levels, which helps improve the model's ability to generalize and reduce dependence on specific lighting conditions. By extracting the supplementary data features, the model can enhance the recognition ability of target detection errors, which helps to reduce overfitting and improve the generalization ability of the model. In order to avoid excessive correction effect, set the control factor to compensate, complete the phase compensation, and get the actual phase. Compared with other methods, the proposed method improves the error control by at least 33%, and the structural similarity index measure (SSIM) value reaches above 0.91, while the highest value of other methods is only 0.86. By extracting supplementary data features, the performance of the proposed method in recovering target structure information is improved by about 5.8%, overfitting is reduced, and the generalization ability of the model is improved.
The organization of the paper proposing the method is as follows:
Problem Statement: Investigates the compensation of nonlinear distortion errors in underwater target detection. Method Proposal: Introduces an innovative binocular vision error compensation method. Technical Details: Optimizes the visual structure, integrates a projector with a dual camera system, and performs signal preprocessing. Model Construction: Develops a binocular vision model, optimizes solution space, parameters, objective functions, and pheromone update. Experimental Validation: Demonstrates the method's advantage in reducing error, adaptability, and stability.
Compared to previous studies, the main contributions of this paper are:
Innovative Error Compensation Method: Proposes a binocular vision-based error compensation method for underwater target detection, effectively reducing errors caused by hardware distortion. Precise Control Mechanism: Introduces control factors to accurately adjust the compensation process, avoiding over-correction, and ensuring the accuracy of error compensation. Data Preprocessing Technology: Utilizes multi-scale decomposition and preprocessing techniques, improving data accuracy and reliability, providing a more reliable data foundation for error compensation.
These contributions not only enrich the research in related fields but also provide new insights and methods for future underwater target detection.
Improved binocular vision for underwater target detection error compensation
Improved binocular vision
The improvement of the binocular vision system is grounded in the parallax principle, utilizing a projector and two cameras to capture the three-dimensional information of the measured object. The principle of the main theory is shown in Figure 1.

Improved binocular vision imaging principle.
If it is assumed in Figure 1 that the two cameras are on the same horizontal line, the effective focal lengths mapped to the two cameras are
The stereo vision measurement error is mainly caused by the improper calibration of system parameters and the interference of actual measurement environment. At this stage, the parameter calibration has been relatively mature and can achieve high accuracy. Therefore, the error of improved binocular vision in this paper is the error generated in the actual measurement process.
If the accuracy requirements of the coordinate system are the same, the measurement error is the smallest. Because the measurement target of the improved binocular vision is generally in the central area of the image, the main factors affecting the measurement accuracy can be summarized as follows:
Lens focal length
The f deviation of the camera focal length is reflected in the imaging principle. The deviation can be reduced by using a telephoto lens. However, if it is improperly selected, the depth of field of the lens will be too small.
Lens resolution
Because the light of the measured object will pass through the lens and concentrate on the pixel points, a diffuse spot with a certain radius will be generated, resulting in the ambiguity of the imaging. If the diameter of the light spot exceeds the pixel size of the sensor, it will affect the analysis results of the image, thus increasing the error of the detection results.
Lens distortion
In practical use, lens distortion is a common phenomenon, that is, the difference between the real image and the ideal image. At present, due to the continuous enhancement of system performance, the system design, processing, and installation can achieve greater accuracy, thus significantly improving lens distortion correction. Therefore, it can be ignored. Only the measurement error caused by radial distortion caused by projection and camera offset can be considered. The expression is as follows:
This section discusses an improved binocular vision system that uses a projector and two cameras to capture 3D information, focus on key factors such as lens focal length, resolution, and distortion, and improve the measurement performance of binocular vision by optimizing the focal length to reduce the offset.
Denoising principle of underwater target detection error supplementary data
In the process of denoising the underwater target detection error compensation data, all the collected signals are preprocessed, 13 and the signal coefficients are threshold processed according to the underwater target detection characteristics to eliminate the noise in the target data. The specific steps are detailed as follows:
Step 1: assuming that
Step 2: assuming that
Step 3: assuming
Through signal preprocessing and threshold processing based on multi-scale decomposition, the underwater target data features are extracted and reconstructed, and then the SNR gain adjustment and standard deviation optimization are used to effectively eliminate noise and achieve efficient denoising of underwater target detection error compensation data.
Feature extraction of underwater target detection error compensation data
The underwater environment contains noise from multiple sources, such as hydrodynamic noise, marine biological activity, ships, and other non-target interferences. Through feature extraction, these noises can be identified and removed, and the signal-to-noise ratio can be improved, thus enhancing the recognition accuracy of the target signal. Extract the characteristics of underwater target detection error compensation data,14,15 and the specific steps are detailed as follows:
Step 1: assume that
Step 2: assuming that
Step 3: the biggest difference between the target data and the surrounding media is reflected in the time development and adjustment signals. Therefore, time delay is a very important characteristic parameter for judging the underwater target detection error compensation data.16,17 Assuming that the target data power is represented by J, the characteristics of underwater target detection error compensation data are extracted by formula (7):
To sum up, by extracting signals during observation time and calculating characteristic parameters such as sparse metric and power delay, the method can effectively distinguish and quantify the difference between noise and target signal in underwater environment, which provides key data preprocessing and characteristic basis for underwater target detection error compensation based on binocular vision.
Realization of underwater target detection error compensation based on improved binocular vision
In underwater environment, due to the complexity of sound wave propagation, noise in water, multipath effect and the change of target reflection characteristics, the detection system often produces errors. These errors will lead to inaccurate target detection results, so it is necessary to compensate the error. Extracting the information that can best represent the characteristics of the target is very important for the target recognition. By feature extraction, a large amount of original data can be condensed into a few key features, which is convenient for subsequent processing.
The objects in underwater environment have different sizes and shapes, and the multi-scale attention mechanism can process the information of different scales at the same time, so as to capture the characteristics of the objects more comprehensively. This mechanism can help the network better understand the large and small objects in the scene and improve the accuracy of detection and recognition. The attention mechanism allows the network to focus more on important features and ignore irrelevant background noise when processing information. In underwater environments, where the background is complex and variable, the attention mechanism allows the network to focus on the target area more effectively, reducing false and missed detections. In order to ensure the accuracy of compensation results, 18 a multi-scale attention mechanism is introduced into the improved binocular vision to achieve network optimization. The parameters obtained in the previous section are taken as the input of the binocular vision model. After continuous learning and training, the results of the transform parameters are output, and the error compensation of underwater target detection is completed according to the transform parameters.
Construction of binocular vision model
The binocular vision model is able to provide depth information, which is crucial for the localization and tracking of underwater objects. In underwater environment, due to the scattering and absorption of light, monocular vision is often difficult to accurately estimate the distance and depth of the target. Binocular vision By comparing the differences in the images captured by the two cameras, the depth information of the target can be calculated. The binocular vision model structure is constructed
In the process of implementing underwater target detection error compensation through the network, it is necessary to obtain the optimal solution of gradient descent in the process of back propagation.

Structure of binocular vision model.
Parameter tuning optimization
After building the binocular vision model, the parameters are adjusted and optimized through the following steps:
Feasible solution space
Underwater target detection error compensation parameter tuning method the ant colony optimization algorithm is used to tune the motion control parameters of the underwater robot, and the combinatorial optimization problem is used to replace the motion control parameter tuning problem. First, the range of motion control parameters to be tuned is set, and the discretization process is used to understand the space.19,20
Initialization parameters
Set the initial time, introduce the learning factor into the ant colony optimization algorithm, and adjust the moving step size of the ants, including the optimal ant. When the moving step size of the ant is small, the distance between the ant and the target area is far. When the moving step size of the ant is large, it will be far away from the target area.
21
By introducing appropriate learning factors
The parameter setting method of underwater target detection error compensation system uses sigmoid function to describe the functional relationship between variable learning factors
Objective function
The error compensation parameters of underwater target detection are balanced by three indicators: rapidity, accuracy, and stability. Rapidity can be reflected by response rise time. The dynamic response of motion control is inversely proportional to rise time. If only the dynamic response of PID controller is considered in motion control, the adjusted motion control parameters will easily lead to unstable error compensation. The parameter tuning method of underwater target detection error compensation introduces the term of control quantity into the objective function to avoid the problem of excessive control quantity.
Build the following objective functions:
In formula (12),
The parameter setting method of underwater target detection error compensation solves the problem of overshoot in the underwater target detection error compensation control system through the penalty function. The constraint condition of overshoot is introduced into the parameter setting objective function. At this time, the parameter setting objective function can be described by the following formula:
In formula (13),
Update pheromone
The ant colony optimization algorithm is used to adjust the error compensation parameters of underwater target detection. The objective function usually includes the performance index information of the PID controller and the nodes passed by the ants. The pheromone is updated by the following formula:
This section describes in detail the process of using ant colony optimization algorithm to adjust and optimize the error compensation parameters of underwater target detection under binocular vision model, including setting feasible solution space, initializing parameters with variable learning factors, constructing objective functions of comprehensive rapidity, accuracy and stability, and optimizing PID controller parameters by updating pheromones. The accuracy of error compensation and the stability of the system are improved.
Realization of underwater target detection error compensation based on optimized network
On the basis of the above parameter setting, after the image results obtained by convolution are processed by normalization, the activation function is used to complete the nonlinear superposition processing of the image, and the convolution operation is performed again on this basis. Combined with the multi-scale attention mechanism, the spatial thinning of the measured image is realized, and the improved image information is obtained. The results are added with the input, and finally the output result of the underwater target detection error compensation image is obtained.
After the spatial thinning of the measured image, the partial area of the image can be adjusted. Obtain more reliable image feature description results. Through global average and maximum pooling operations, at the same time, the two features are processed by superposition, and the graph is scaled by activation function.
After the generation of the spatial attention map, the image spatial thinning processing is realized. In the information processing, in order to avoid the damage of the edge information, the detail difference loss function is introduced to ensure the reliability of the underwater target detection error compensation image results. In this process, it is necessary to calculate the detail difference loss and complete the edge detection of the underwater target detection error compensation image. In the process of convolution operation in convolution layer, convolution operation is completed through convolution kernel, which operates on the measured image after Laplace detection to obtain the detailed feature map; at the same time, the detailed feature map of the label image is obtained by Laplacian. The mean square error of the two detail characteristic maps is solved, and the result is taken as the loss result of detail difference. The formula is:
In formula (15), N represents the number of convolution operations;
After the processing is completed based on the above steps, the transformation parameter results are output to generate a new underwater target detection error compensation image, and the similarity between the measured image and the label image is calculated. The parameter compensation in the process of underwater target detection error compensation image generation is completed according to the maximum image similarity calculation results, which is completed by bilinear interpolation back propagation. The calculation formula is:
In formula (16),
When the network implements measurement error compensation, the similarity in the network is described by the loss function in the network, and its calculation formula is:
In formula (17):
On the basis of parameter setting, this section introduces the methods to improve image quality through normalization, activation function, multi-scale attention mechanism and spatial refinement processing, protect edge information by using detailed difference loss function, extract feature map through convolution operation and Laplacian detection, and finally optimize error compensation parameters by combining bilinear interpolation and similarity. Generate high quality underwater target detection error compensation image.
Experimental analysis
In order to verify the feasibility of underwater target detection error compensation based on improved binocular vision in the actual process, an error compensation system composed of camera and projector is built. The resolution of the projector selected in the system is 1280 × 1280 pixel, camera resolution 1390 × 1390 pixel. Two different groups of grating fringes are generated, one is 4-step phase-shifting fringe, the other is 8-step phase-shifting fringe. They are close to the ideal state, and a single gray-scale image is encoded according to different regions. Project the area information of the camera onto the target surface of the projector, and record the zoning results of the projector. Solve the phase information of two groups of grating fringes, set the phase information of the second group as the standard value, and calculate the phase error. Set the control factor to compensate the over compensation and complete the phase compensation to obtain the actual phase value.
After obtaining the specific 3D information of the measured object through the above steps, 108 corner boxes of the error compensation parameters of the camera and projector are extracted, including 54 black boxes and 54 white boxes, as shown in Figure 3.

Standard checkerboard corner.
According to Figure 3, 108 points are fitted to form a plane, and the error compensation effect of the proposed method is measured by the coplanar error of corner points, that is, the distance between the points and the plane. The visual measurement results before and after compensation are shown in Figure 4, respectively.

Coplanarity deviation distribution (a) before and (b) after error compensation.
It can be seen from Figure 4 that the average value of the error after compensation is reduced to a large extent, which further proves the effectiveness of the method in this paper.
Due to generate animation can simulate real environment is difficult to direct observation or experiment, such as water under complex environment. These animations can show the working mechanism and performance of the algorithm under different conditions. Through computer-generated animation, the experimental process can be repeated, reducing the randomness and uncontrollable factors that may occur in the actual experiment. This helps to more accurately evaluate the performance and reliability of the algorithm. In order to test the applicability of the method in this paper in the error compensation of underwater target detection, two underwater terrains, namely, submarine plain and submarine trench, are taken as examples, as shown in Figure 5.

Schematic diagram of (a) submarine plain and (b) submarine trench.
In the above underwater plain trench and trench environment, there are more sea stars and sea urchins, and sea stars and sea urchins have unique morphological characteristics, sea stars usually have five or more arms, while sea urchins are spherical or oval, and the surface is full of thorns. These different morphological features can test the recognition and detection ability of the algorithm for objects with different shapes. After compensation by the proposed method, the underwater target is detected, and the results are shown in Figure 6.

Underwater target detection results.
According to the analysis of the test results in Figure 6, it can be seen that the proposed method can detect different underwater targets, mainly because the proposed method compensates the measurement error and significantly improves the accuracy of underwater target detection. The method proposed in this paper has proved that it can generate robust error compensation models for different underwater terrain. The compensated output results show a high degree of stability, indicating consistent and reliable performance in different environments. Specifically, the resulting error compensation models are tailored to specific terrain, taking into account changes in water clarity, sediment content, and other factors that may affect sonar or other detection systems. The method not only corrects systematic errors, but also takes into account random variations that can occur during underwater target detection, significantly improving the performance of sonar and other systems in various marine applications.
In underwater target detection, the magnitude of error is directly related to the accuracy and reliability of detection. By reducing errors, detection accuracy and system stability can be improved, which is crucial for underwater target detection tasks. Therefore, in the above experimental setup, a set of comparative experiments was designed, including the proposed method, the methods in Wang et al., 8 Huang et al., 9 and Song et al. 10 In the experiment, 108 standard checkerboard corner points (as shown in Figure 3) were used, and the coplanar errors before and after compensation were calculated. The error value index is selected to evaluate the performance of different methods. In the box plot, the line in the middle of the box represents the median error of the data, the upper and lower edges represent the upper and lower quartiles of the error, respectively, and the height represents the distribution range of the middle 50% of the error. The lines that extend up and down are called whiskers and usually represent the maximum and minimum values of the error. The error results are shown in Figure 7.

Comparison of error results of different methods.
The experimental results show that the error value of this method is better than that of the methods in the literature.8–10 The maximum error value has been below 1.5 mm. These data show that through the improved binocular vision technology and accurate phase information calculation, the method compensates the error in underwater target detection, maintains high performance across various underwater terrain, and shows good adaptability and robustness. The minimum error values of other methods are all above 1.0 mm, and the data fluctuation is large, which indicates that the method has certain instability.
In order to verify the advantages of the proposed research method, the SSIM is used as an evaluation index, which is very useful for evaluating the performance of the algorithm at different resolutions and scales. In underwater target detection, targets may be captured at different distances and angles, so multi-scale evaluation can provide a more comprehensive performance evaluation. The closer the SSIM value is to 1, the better the error compensation performance of the method is. The experimental results are shown in Table 1.
Comparison of SSIM results of different methods.
According to Table 1, the highest SSIM value of the other three methods is only 0.86, while the SSIM of the proposed method is above 0.91 and closest to 1, and the SSIM value of different samples shows high stability and small fluctuation. This shows that the proposed method has higher performance in recovering the structural information of the target and can compensate the errors in underwater target detection more accurately. The experimental results clearly demonstrate the significant advantages of the proposed method in underwater target detection error compensation, and provide a more accurate and reliable technical solution for underwater target detection, and lay a solid foundation for further research and application.
In order to further verify the advantages of the proposed research method, statistical analysis was performed on the experimental results. The p-value was calculated to quantify the differences between the proposed method and the existing methods. The p-value is a statistical indicator used to measure whether the differences between two or more samples are significant. In this study, the proposed method was compared with the methods in literature,8–10 and the p-values between them were calculated.
According to the results of statistical analysis, it was found that the differences between the proposed method and the existing methods were statistically significant (p < 0.05). This means that the proposed method is significantly better than the existing methods in recovering the structural information of the target and compensating for the errors in underwater target detection.
In conclusion, through the quantitative analysis of the p-value, the significant advantages of the proposed method in underwater target detection error compensation have been further proved. This result provides a more accurate and reliable technical solution for underwater target detection, and lays a solid foundation for further research and application.
Conclusion and prospect
Conclusion
An improved binocular vision error compensation method for underwater target detection is studied. After compensation, the error is reduced to 0.1 mm, which further proves the effectiveness of the method. After the measurement error compensation is completed, the method can generate the underwater target detection error compensation model of different terrain, and output the target error compensation result. The output result is stable and the effect is good. Even when detecting different underwater targets, the maximum error is always controlled within 1.5 mm. In addition, the SSIM of the proposed method is stable above 0.91. These results not only demonstrate the effectiveness of the proposed method in reducing detection errors, but also demonstrate its flexibility in adapting to various underwater terrain and target diversity. This method significantly improves the reliability and accuracy of underwater target detection by providing a stable and highly accurate output. It not only shows the extensive application potential of this method in the field of underwater target detection, but also provides a more efficient and reliable technical means for this field.
Prospect
Although this paper successfully realizes the error compensation of underwater target detection by improving binocular vision, there are still many shortcomings, which need to be further improved in the next research work. The details are as follows:
Improve the speed of underwater target detection error compensation to achieve the best compensation effect. This is because the hardware structure of binocular vision is not high and has its own complexity. To overcome this problem, consider adding parallel operations to speed up the error compensation. There is still room for improvement in the accuracy of binocular visual ranging. In the future, the propagation characteristics of structured light in the underwater environment will be studied, and the shape and intensity of the beam will be optimized to adapt to different underwater conditions. Explore multi-modal fusion methods that combine binocular vision with other underwater detection technologies (such as sonar, laser scanning, etc.) to improve the comprehensiveness and accuracy of target detection.
