A near-far distance compatible underwater active binocular camera calibration method, system, device and storage medium
By employing initial calibration in air and underwater compensation for refraction effects, the calibration problem of underwater cameras in both near and far distance scenarios was solved, achieving high-precision underwater vision system calibration and depth calculation, thus improving the application effects of underwater exploration and marine engineering.
Patent Information
- Application Number
- CN202510669995.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2026-11-24
AI Technical Summary
Traditional underwater camera calibration methods struggle to achieve high-precision calibration simultaneously at both near and far distances. The complexity of the underwater environment leads to image blurring and distortion, affecting the accuracy and stability of the vision system.
Initial calibration is performed in air to calculate the intrinsic and extrinsic parameters of the binocular camera. Then, the camera is recalibrated by taking into account the effect of underwater light refraction, generating the final mapping matrix to compensate for the effect of underwater light refraction and improve calibration accuracy.
It significantly improves the calibration accuracy and depth calculation precision of underwater active binocular cameras, expands the close-range reconstruction range, enhances the adaptability and stability of underwater vision systems, and meets the requirements of high-precision visual measurement.
Smart Images

Figure CN123160672A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of calibration technology, and more specifically, to a calibration method, system, device, and storage medium for an underwater active binocular camera that is compatible with both short and long ranges. Background Technology
[0002] In fields such as underwater exploration, marine resource development, and underwater robot navigation, underwater binocular vision systems have become a key technology for target recognition, localization, and measurement due to their ability to quickly acquire three-dimensional spatial information. However, the underwater environment is characterized by strong scattering, high absorption, and complex light refraction, which can lead to image blurring and distortion, severely affecting the accuracy of binocular vision systems. Traditional underwater camera calibration methods are usually designed for single distances or specific environmental conditions, making it difficult to achieve high-precision calibration simultaneously at both near and far distances. This results in large measurement errors and poor stability in practical applications of underwater binocular vision systems.
[0003] Furthermore, the refraction of light at the interface between the water and the camera's glass cover alters the light propagation path, causing image distortion and further reducing the accuracy of the vision system. Simultaneously, the complexity of the underwater environment leads to deformation and distortion of the pattern projected by structured light, increasing the difficulty of structured light-based calibration. Therefore, developing a calibration method for underwater active binocular cameras that is compatible with both near and far-distance scenes and effectively compensates for the effects of underwater light refraction and scattering has become an urgent need to improve the performance of underwater binocular vision systems and promote the development of related fields.
[0004] The above background information is provided only to aid in understanding the inventive concept and technical solution of this invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above information was disclosed on the filing date of this patent application, the above background information should not be used to evaluate the novelty and inventiveness of this application. Summary of the Invention
[0005] Therefore, this invention is based on an active binocular camera, which is suitable for both close-range and long-range measurements. Initial calibration is performed on the water to calculate the intrinsic and extrinsic parameters of the binocular camera and the intrinsic and extrinsic parameters of the monocular structured light, respectively. Then, recalibration is performed underwater, and the final mapping matrix is obtained by taking into account the effect of refraction. This greatly improves the accuracy of the underwater active binocular camera, makes subsequent depth calculation more convenient, and can expand the reconstruction range at close range.
[0006] In a first aspect, the present invention provides a calibration method for an underwater active binocular camera that is compatible with both short and long ranges, characterized in that it includes:
[0007] Step S1: Project structured light onto the calibration plate in the air and obtain the first left image and the first right image through the left camera and the right camera respectively to perform the calibration of the intrinsic and extrinsic parameters of the underwater binocular camera;
[0008] Step S2: Locate the underwater structure based on the parameters of the first left image, the left camera, and the projector; locate the right underwater structure based on the parameters of the first right image, the right camera, and the projector.
[0009] Step S3: Underwater, the projector projects structured light to illuminate the calibration plate. The left and right cameras respectively obtain the second left image and the second right image. By combining the first left image, the first right image, the calibration results of the left structured light above water and the calibration results of the right structured light above water, the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate are calibrated.
[0010] Step S4: Calculate the mapping matrix from the original underwater image to the stereo image;
[0011] Step S5: Take pictures of the plane at different underwater distances as reference planes for underwater left and right single-target positioning, and generate reference plane information that satisfies the single-target calculation.
[0012] Optionally, the underwater active binocular camera calibration method that is compatible with both short and long ranges is characterized in that the calibration plate is composed of a composite material substrate and a waterproof reflective coating.
[0013] Optionally, the underwater active binocular camera calibration method that is compatible with both near and far distances is characterized in that, in step S1, the Zhang calibration method is used to calibrate the intrinsic and extrinsic parameters of the underwater binocular camera. By taking multiple sets of the first left image and the first right image of the calibration plate in different postures, the intrinsic and extrinsic parameters are solved by the least squares method to improve the calibration accuracy.
[0014] Optionally, the underwater active binocular camera calibration method compatible with both near and far distances is characterized in that, in step S2, during the calibration of the underwater structured object, multiple Gray code patterns with different codes are projected onto the calibration board using Gray code structured light encoding. Based on the decoding information of the Gray code stripes in the first left image and the first right image, combined with the parameters of the left camera, the right camera, and the projector, the structured light plane equation is calculated to achieve high-precision underwater structured object calibration.
[0015] Optionally, the underwater active binocular camera calibration method compatible with both near and far distances is characterized in that, in step S3, when calibrating the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate, a refraction model is introduced to consider the effect of light refraction at the interface between the water and the glass cover plate. By establishing a refraction equation and combining the first left image, the first right image, the calibration results of the left structure above water and the calibration results of the right structure above water, the relative positional parameters between the left camera, the right camera and the glass cover plate are solved, thereby improving the accuracy of underwater calibration.
[0016] Optionally, the underwater active binocular camera calibration method compatible with both short and long ranges is characterized in that, after step S3, it further includes:
[0017] Step S31: Perform error analysis on the calibration results of the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate. When the error exceeds the preset threshold, repeat steps S1-S3 until the error meets the requirements.
[0018] Optionally, the underwater active binocular camera calibration method that is compatible with both near and far distances is characterized in that, in step S5, at least one of the reference surfaces is at a distance from the binocular camera that is less than the minimum measurement distance of the binocular camera.
[0019] Secondly, the present invention provides a long-range compatible underwater active binocular camera calibration system for implementing the long-range compatible underwater active binocular camera calibration method described in any of the preceding claims, characterized in that it includes:
[0020] The first calibration module is used to project structured light onto the calibration plate in the air, and obtain the first left image and the first right image through the left camera and the right camera respectively, and perform the calibration of the intrinsic and extrinsic parameters of the underwater binocular camera.
[0021] The first calculation module is used to perform underwater structure cursor positioning based on the parameters of the first left image, the left camera, and the projector; and to perform underwater right structure cursor positioning based on the parameters of the first right image, the right camera, and the projector.
[0022] The second calibration module projects structured light onto the calibration plate underwater using the projector, and obtains a second left image and a second right image through the left camera and the right camera respectively. By combining the first left image, the first right image, the calibration results of the left structured light above water and the calibration results of the right structured light above water, the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate are calibrated.
[0023] The second calculation module is used to calculate the mapping matrix from the original underwater image to the stereo image.
[0024] The third calculation module is used to capture images of the plane at different underwater distances, which serve as reference surfaces for underwater left and right single-target positioning, and generate reference surface information that satisfies the requirements of single-target calculation.
[0025] Thirdly, the present invention provides an underwater active binocular camera calibration device compatible with both short and long ranges, characterized in that it comprises:
[0026] processor;
[0027] A memory in which executable instructions of the processor are stored;
[0028] The processor is configured to perform the steps of any of the aforementioned range-compatible underwater active binocular camera calibration methods by executing the executable instructions.
[0029] Fourthly, the present invention provides a computer-readable storage medium for storing a program, characterized in that, when the program is executed, it implements the steps of the underwater active binocular camera calibration method that is compatible with both near and long ranges as described in any of the preceding claims.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] This invention completes the calibration of the intrinsic and extrinsic parameters and structural cursors of a surface binocular camera in air through steps S1 and S2. Light propagation is stable in air, which can obtain high-precision basic calibration data and provide a reliable benchmark for subsequent underwater calibration.
[0032] In the underwater calibration stage, step S3 of this invention innovatively combines the results of the surface calibration and considers the effect of light refraction at the interface between the water and the glass cover plate to accurately calibrate the relative positional relationship between the left camera, the right camera and the glass cover plate. This effectively compensates for the imaging deviation caused by underwater light refraction and significantly improves the accuracy of underwater camera calibration.
[0033] In step S4, this invention calculates the mapping matrix from the original underwater image to a binocular computing image, which can specifically correct underwater imaging distortion, making the image more in line with the requirements of binocular computing and improving the accuracy of three-dimensional information acquisition by the binocular vision system.
[0034] Step S5 of this invention sets up the shooting plane at different underwater distances to generate monocular calculation reference surface information, breaking the limitation of traditional calibration methods that cannot take into account both near and far distances. Through adaptive adjustment, it achieves high-precision calibration in near and far distance scenarios, greatly enhancing the adaptability and stability of the underwater binocular vision system in complex underwater environments, effectively reducing measurement errors, and meeting the urgent needs of underwater exploration, marine engineering and other fields for high-precision visual measurement.
[0035] This invention calibrates both the binocular camera and the structured light camera simultaneously, and can supplement the depth of the binocular camera at close range by using the structured light depth, thereby increasing the range of depth reconstruction at close range and expanding the reconstruction range at close range. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort. Other features, objects, and advantages of the present invention will become more apparent by reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0037] Figure 1 This is a flowchart illustrating the steps of a calibration method for an underwater active binocular camera that is compatible with both short and long ranges, as described in an embodiment of the present invention.
[0038] Figure 2 This is a flowchart illustrating the steps of another underwater active binocular camera calibration method compatible with both short and long ranges, as described in this embodiment of the invention.
[0039] Figure 3 This is a schematic diagram of the field of view of an active binocular camera in an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram of the structure of an underwater active binocular camera calibration system that is compatible with both short and long ranges, according to an embodiment of the present invention.
[0041] Figure 5 This is a schematic diagram of the structure of an underwater active binocular camera calibration device compatible with both short and long ranges, as described in an embodiment of the present invention; and
[0042] Figure 6 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. Detailed Implementation
[0043] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention. These all fall within the scope of protection of the present invention.
[0044] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0045] This invention provides a calibration method for an underwater active binocular camera that is compatible with both short and long ranges, aiming to solve the problems existing in the prior art.
[0046] The technical solutions of the present invention and how they solve the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0047] This invention is based on an active binocular camera, which is suitable for both close-range and long-range measurements. Initial calibration is performed on the water to calculate the intrinsic and extrinsic parameters of the binocular camera and the intrinsic and extrinsic parameters of the monocular structured light. The camera is then recalibrated underwater, and the final mapping matrix is obtained by taking into account the effect of refraction. This greatly improves the accuracy of the underwater active binocular camera, makes subsequent depth calculations more convenient, and can expand the reconstruction range at close range.
[0048] Figure 1 This is a flowchart illustrating the steps of a calibration method for an underwater active binocular camera that is compatible with both short and long ranges, as described in an embodiment of the present invention. Figure 1 As shown, the steps of a calibration method for an underwater active binocular camera that is compatible with both short and long ranges in an embodiment of the present invention include:
[0049] Step S1: Project structured light onto the calibration plate in the air and obtain the first left image and the first right image through the left camera and the right camera respectively to perform the calibration of the intrinsic and extrinsic parameters of the underwater binocular camera.
[0050] In this step, calibration is performed in an aquatic environment. First, the active binocular camera and calibration board are positioned in the air. The active binocular camera consists of a projector, a left camera, and a right camera. It is ensured that the projector can project structured light correctly, that the calibration board is clearly illuminated by the structured light, and that the left and right cameras can clearly capture the structured light pattern on the calibration board. The calibration board typically has known, precise geometric features (such as a regular grid array) for subsequent calculation of camera parameters.
[0051] The structured light projected by the projector forms a specific pattern on the calibration board. The left and right cameras capture images of the calibration board from different angles, obtaining the first left image and the first right image, respectively. The structured light pattern can be any structured light pattern, such as random speckle, stripes, or coded speckle.
[0052] Intrinsic parameter calibration primarily determines the inherent parameters of the camera, such as focal length, principal point position, and distortion coefficients. For the left and right cameras, their respective intrinsic parameter matrices are calculated by analyzing feature points (such as corner points of squares) on the calibration board in the first left and first right images, using existing camera calibration algorithms (such as the Zhang Zhengyou calibration method). These intrinsic parameter matrices describe the projection relationship of the camera from three-dimensional space to the two-dimensional image plane, and are crucial for subsequent image correction and depth calculation.
[0053] Extrinsic parameter calibration is used to determine the relative position and pose relationship between the left and right cameras, i.e., the rotation matrix and translation vector. By analyzing the correspondence of identical feature points on the calibration board in the first left and first right images, geometric transformations and optimization algorithms (such as least squares) are used to calculate the extrinsic parameters between the left and right cameras. The extrinsic parameter calibration results can link the coordinate systems of the left and right cameras, providing a foundation for subsequent binocular matching and depth calculation.
[0054] Step S2: Locate the underwater structure based on the parameters of the first left image, the left camera, and the projector; locate the right underwater structure based on the parameters of the first right image, the right camera, and the projector.
[0055] In this step, the structured light camera is calibrated using the first left image obtained in step S1, along with the intrinsic and extrinsic parameters (already calibrated) of the left camera and relevant parameters of the projector (such as the projector's position and orientation). The purpose of structured light camera calibration is to determine the correspondence between the geometric information of the structured light projected by the projector in space and the left camera image. An active stereo camera can obtain depth calculated through stereo imaging and may also form two structured light cameras, one with the left camera and one with the right camera, via the projector. The fields of view of the two structured light cameras are different and different from the field of view of the stereo camera. The intersection of the fields of view of the two structured light cameras constitutes the field of view of the stereo camera. By processing the structured light camera, the field of view of the stereo camera can be supplemented, thereby obtaining a larger field of view range.
[0056] Specifically, by analyzing the features of the structured light pattern in the first left image (such as the position and shape of the stripes), and combining the geometric relationship between the projector and the left camera, a planar equation or other geometric model of the structured light in space is established, and this model is correlated with the pixel coordinates in the left camera image. This step can be achieved using methods based on feature matching, stereo vision principles, etc., ultimately yielding the calibration result of the left structured light on the water, which describes the parameter information of the structured light in the left camera coordinate system.
[0057] Similar to the calibration of the left structured light beam above water, the structured light pattern captured by the right camera is analyzed based on the first right image, the parameters (intrinsic and extrinsic) of the right camera, and the parameters of the projector. Similarly, through feature matching and geometric calculations, the correspondence between the geometric information of the structured light in the right camera coordinate system and the right camera image is determined, yielding the calibration results of the right structured light beam above water. These results provide important reference for subsequent underwater calibration of the relative positional relationship between the camera and the glass cover, as well as for binocular calculations.
[0058] Step S3: Underwater, the projector projects structured light to illuminate the calibration plate. The left and right cameras respectively obtain the second left image and the second right image. By combining the first left image, the first right image, the calibration results of the left structured light above water and the calibration results of the right structured light above water, the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate are calibrated.
[0059] In this step, the entire system (active binocular camera and calibration board) is placed in an underwater environment to ensure that the projector can project structured light normally and that the left and right cameras can clearly capture the structured light pattern on the calibration board, thus obtaining the second left image and the second right image, respectively. Due to the special characteristics of the underwater environment (such as light refraction and scattering), the images may be affected to some extent, which is why subsequent calibration is necessary.
[0060] Combining the first left and first right images obtained in air with the calibration results of the left and right structured light beams on the water, the differences between the structured light patterns in the second left and second right images and those in the first left and right images are analyzed. It should be noted that the glass cover is always on the active stereo camera. However, while refraction in air is negligible, underwater, the refractive index of the air inside the active stereo camera and the water outside the glass cover is very high. This causes light to refract at the glass cover, resulting in a different structured light pattern in the images compared to that in air.
[0061] By comparing image features in air and underwater, along with structure calibration results, and utilizing geometric optics principles (such as the law of refraction) and optimization algorithms, the relative positional relationships (including distance and angle) between the left camera and the glass cover, as well as between the right camera and the glass cover, are calculated. This step is crucial for correcting distortion in underwater images and accurately calculating depth information, because the presence of the glass cover alters the light propagation path; only by accurately calibrating the relative positional relationships between the cameras and the glass cover can this effect be eliminated.
[0062] Step S4: Calculate the mapping matrix from the original underwater image to the stereo image.
[0063] In this step, due to the underwater environment and the influence of the glass cover, the original images captured by the left and right cameras have geometric distortions and positional deviations, making them unsuitable for direct binocular computation (such as stereo matching). Therefore, the original images need to be corrected to meet the requirements of binocular computation.
[0064] Based on the intrinsic and extrinsic parameters of the stereo camera obtained in step S1, and the relative positional relationship between the camera and the glass cover obtained in step S3, a mapping matrix is calculated from the original underwater image to an image suitable for stereo calculation using geometric transformations and image correction algorithms (such as perspective transformation). This mapping matrix contains transformation information such as translation, rotation, and scaling, and can map the pixel coordinates in the original image to the corrected image coordinates. By applying this mapping matrix, the original images of the left and right cameras can be corrected, so that the corrected images have the same epipolar lines in the horizontal direction, thus facilitating subsequent stereo matching and depth calculation.
[0065] Step S5: Take pictures of the plane at different underwater distances as reference planes for underwater left and right single-target positioning, and generate reference plane information that satisfies the single-target calculation.
[0066] In this step, in the underwater environment, multiple planes at different distances (such as plane calibration plates or other planar objects with known geometry) are selected, and these planes are photographed using both the left and right cameras. These planes serve as reference surfaces for single-target calibration, and their spatial positions and geometric information are known.
[0067] For each reference surface image captured by the left and right cameras, using previously calibrated camera intrinsic and extrinsic parameters, as well as information on their relative position to the glass cover, monocular vision algorithms (such as planar feature-based monocular calibration algorithms) are used to calculate the parameter information (such as plane equations and normal vectors) of each reference surface in the camera coordinate system, generating reference surface information that satisfies monocular calculation requirements. This reference surface information can be used for subsequent monocular vision tasks, such as object detection and distance measurement, providing a foundation for monocular vision calculations in underwater environments. By capturing reference surfaces at different distances, a wider depth range can be covered, improving the accuracy and robustness of monocular calculations.
[0068] In some embodiments, the calibration plate is constructed from a composite material substrate and a waterproof reflective coating. The composite material substrate possesses several excellent properties, providing a solid physical foundation for the calibration plate. Firstly, its high strength and toughness effectively resist external impacts from complex underwater environments, such as water flow and pressure, ensuring the calibration plate is not easily deformed or damaged during underwater use, maintaining the stability of its geometric structure, and thus guaranteeing the accuracy of the calibration results. Secondly, the lightweight nature of the composite material facilitates the operation and movement of the calibration plate underwater, reducing the difficulty and labor intensity of calibration work. Furthermore, it has good corrosion resistance, allowing it to be immersed in water for extended periods without corrosion, extending the service life of the calibration plate and ensuring the continuity of underwater calibration work.
[0069] The presence of a waterproof and reflective coating significantly enhances the calibration plate's suitability for underwater environments. Its waterproof properties prevent water penetration into the composite substrate, avoiding performance degradation due to water absorption and further strengthening the calibration plate's waterproof capabilities. The reflective coating plays an equally crucial role. Underwater lighting conditions are complex, with weak light intensity and scattering. The reflective coating effectively reflects the structured light projected by the projector, enhancing the pattern contrast on the calibration plate. This allows the left and right cameras to capture feature points on the calibration plate more clearly and accurately, improving image acquisition quality and providing more precise data for subsequent camera calibration calculations, ensuring the smooth progress of underwater camera calibration.
[0070] In some embodiments, in step S1, the intrinsic and extrinsic parameters of the underwater binocular camera are calibrated using Zhang's calibration method. By taking multiple sets of the first left and first right images of the calibration board in different postures, the intrinsic and extrinsic parameters are solved using the least squares method to improve the calibration accuracy.
[0071] Zhang's calibration method, proposed by Professor Zhang Zhengyou, is a widely used camera calibration method with advantages such as ease of operation and high accuracy. In the calibration of underwater binocular cameras, this method mainly uses images of the calibration board at different positions and attitudes to establish a camera imaging model, thereby solving for the camera's intrinsic and extrinsic parameters.
[0072] Camera intrinsic parameters reflect the camera's inherent characteristics, including focal length, principal point position, and distortion coefficients. Zhang's calibration method establishes a mapping relationship between image pixel coordinates and calibration board world coordinates by analyzing feature points (such as the corners of a checkerboard) on a calibration board in different images. Based on the principle of perspective projection, equations about the intrinsic parameters are constructed, and then the camera's intrinsic parameter matrix is solved. For example, the focal length determines the image scaling ratio, and the principal point position corresponds to the origin of the image coordinate system. Accurate calibration of these intrinsic parameters is crucial for subsequent image correction and 3D reconstruction.
[0073] The extrinsic parameters describe the camera's position and orientation in the world coordinate system, namely the rotation matrix and translation vector. Zhang's calibration method uses geometric relationships to solve for the relative position and orientation between the left and right cameras by comparing the position and orientation changes of the calibration board in different images. This allows the coordinate systems of the two cameras to be correlated, providing a foundation for subsequent binocular matching and depth calculation.
[0074] To improve the accuracy and reliability of calibration, multiple sets of first left and first right images need to be captured on the calibration board in different poses. Images from a single pose may not fully reflect the various characteristics and errors of the camera, while multiple sets of images from different poses can provide richer information.
[0075] Images of the calibration board in different poses encompass the camera's imaging performance from various viewpoints, providing a more comprehensive picture of the camera's imaging characteristics. For instance, when the calibration board tilts, rotates, or translates, the distribution of feature points in the images changes. Analyzing these changes allows for a more accurate estimation of the camera's intrinsic and extrinsic parameters.
[0076] Using multiple sets of images can reduce the impact of image noise, feature point extraction errors, and other factors on the calibration results. By comprehensively analyzing multiple sets of images, some random errors can be averaged out, improving the stability and accuracy of the calibration results.
[0077] After obtaining multiple sets of images, the least squares method is needed to solve for the camera's intrinsic and extrinsic parameters. The least squares method is a commonly used parameter estimation method, and its basic idea is to find the optimal parameter solution by minimizing the sum of squared errors.
[0078] In camera calibration, the error function is typically defined as the sum of squared errors between the actual pixel coordinates of feature points in an image and the theoretical pixel coordinates calculated from the camera model. This sum of squared errors is minimized by adjusting the camera's intrinsic and extrinsic parameters.
[0079] The least squares method iteratively adjusts the parameters until the sum of squared errors reaches its minimum. In each iteration, the gradient of the error function is calculated based on the current parameter values, and then the parameters are updated in the opposite direction of the gradient, gradually approaching the optimal solution. This method can effectively handle nonlinear camera calibration problems and obtain relatively accurate estimates of intrinsic and extrinsic parameters.
[0080] In summary, the Zhang calibration method, the capture of multiple sets of images in different poses, and the use of the least squares method to solve for parameters in step S1 work together to significantly improve the calibration accuracy of the intrinsic and extrinsic parameters of the underwater binocular camera, providing a reliable foundation for subsequent underwater calibration and depth calculation.
[0081] In some embodiments, in step S2, during the calibration of the underwater structured object, multiple Gray code patterns with different codes are projected onto the calibration board using Gray code structured light encoding. Based on the decoding information of the Gray code stripes in the first left image and the first right image, combined with the parameters of the left camera, the right camera, and the projector, the structured light plane equation is calculated to achieve high-precision underwater structured object calibration.
[0082] Gray code is a special type of binary encoding, characterized by a difference of only one bit between adjacent codes. Using Gray code structured light encoding in structured light calibration offers significant advantages. When projecting a Gray code pattern, even if environmental interference or image acquisition errors cause minor decoding errors in individual pixels, it will only affect the adjacent bit, preventing significant deviations in the decoding result. This results in high stability and reliability of the decoding outcome.
[0083] The projector projects multiple Gray code patterns with different encodings onto the calibration board. Each pattern represents different binary encoded information, and these patterns are projected sequentially, covering the entire calibration board area. In this way, each point on the calibration board can be assigned a unique encoded identifier. For example, assuming 8-bit Gray code is used for encoding, then 8 different Gray code patterns need to be projected. By combining the decoding information of these 8 patterns, the unique code of each point on the calibration board can be determined.
[0084] The left and right cameras respectively capture images of the calibration board projected with Gray code patterns, resulting in the first left image and the first right image. In these images, the Gray code stripes are displayed with different grayscale values or colors. A specific decoding algorithm is used to decode the Gray code stripes in the first left and first right images, extracting the encoded information corresponding to each pixel. The decoding process needs to consider factors such as image noise and uneven lighting, and typically employs preprocessing steps, such as filtering and thresholding, to improve decoding accuracy.
[0085] After obtaining the decoding information of the Gray code stripes in the first left and first right images, the structured light plane equation can be calculated by combining the parameters of the left camera, the right camera, and the projector (such as the intrinsic and extrinsic parameters of the cameras, and the position and orientation of the projector).
[0086] Based on the decoded information, the pixel coordinates of each point on the calibration board in the camera image can be determined. Combining the camera's intrinsic and extrinsic parameters, the pixel coordinates can be converted into three-dimensional coordinates in the camera coordinate system. Simultaneously, since the structured light projected by the projector has a specific geometry (usually a plane), the position and orientation of the structured light plane in the world coordinate system can be determined using the projector's parameters.
[0087] By utilizing the three-dimensional coordinates of multiple points on the calibration plate and the geometric constraints of the structured light plane, and employing optimization algorithms such as the least squares method, the equation of the structured light plane can be calculated. This equation describes the mathematical expression of the structured light plane in the world coordinate system, which allows for the accurate determination of the position and direction of the structured light in space.
[0088] Through the above steps, utilizing Gray code structured light encoding, multi-pattern projection, decoding, and parameter calculation, high-precision underwater structure calibration can be achieved. High-precision structure calibration results are of great significance for subsequent applications such as 3D reconstruction and depth measurement, as they can improve the accuracy and reliability of measurements and reduce the impact of errors.
[0089] In summary, the underwater structured light calibration method in step S2 utilizes Gray code structured light encoding, projects multiple patterns, decodes stripe information, and calculates the structured light plane equation by combining camera and projector parameters, thus providing accurate structured light information for the calibration of underwater active binocular cameras.
[0090] In some embodiments, in step S3, when calibrating the relative positional relationship between the left camera and the glass cover plate, and the relative positional relationship between the right camera and the glass cover plate, a refraction model is introduced to consider the effect of light refraction at the interface between the water and the glass cover plate. By establishing a refraction equation and combining the first left image, the first right image, the calibration results of the left structure above water and the calibration results of the right structure above water, the relative positional parameters between the left camera, the right camera and the glass cover plate are solved, thereby improving the accuracy of underwater calibration.
[0091] In an underwater environment, light refracts as it enters the glass cover from the water and exits the glass cover into the camera due to differences in the refractive index of the medium. According to Snell's law, the direction of light propagation changes, causing distortion in the image captured by the camera, resulting in a discrepancy between the actual position of objects and their position in the image. Introducing a refraction model is precisely to quantify the impact of this light refraction on imaging, providing a theoretical basis for accurately calibrating the relative positional relationship between the camera and the glass cover.
[0092] Establishing Refraction Equations: Based on the refraction model and considering the actual path of light propagation underwater, refraction equations are established. These equations must incorporate parameters such as the refractive indices of water and the glass cover, the angle of incidence of light, and the geometric relationship of camera imaging. By establishing multiple equations, a system of equations is constructed to comprehensively describe the refraction of light at different medium interfaces and its relationship with camera imaging. These equations accurately characterize the change in direction of light before and after refraction, as well as the positional relationship of the refracted light rays in the camera coordinate system, thus laying the foundation for subsequent solutions to the relative positional parameters of the camera and the glass cover.
[0093] The parameters are solved by combining multiple sets of calibration results: The second left and second right images captured underwater are combined with the first left and first right images captured in the air, as well as the calibration results of the left and right structured light beams above water. By comparing the differences in the structured light patterns in the air and underwater images, the correspondence between image feature points is established using the refraction equation. For example, if the position of a structured light feature point is known in the air, its position changes underwater due to light refraction. By solving the refraction equation and combining the spatial position information determined by the structured light beam calibration results above water, optimization algorithms such as the least squares method are used to continuously adjust the relative position parameters (such as distance and angle) between the left and right cameras and the glass cover plate, so as to minimize the error between the theoretically calculated image feature point position and the actual captured image feature point position, and finally solve for the accurate relative position parameters.
[0094] Improving underwater calibration accuracy: By introducing a refraction model and establishing a refraction equation, the complex effects of underwater light refraction are fully considered, avoiding interference from image distortion caused by light refraction on camera calibration. Combining multiple calibration results to solve parameters allows for the comprehensive utilization of calibration information under different environments, complementing and verifying each other, eliminating errors and uncertainties that may exist with single data points. This significantly improves the accuracy of underwater calibration, providing a reliable parameter basis for subsequent applications such as depth calculation and 3D reconstruction of underwater binocular cameras.
[0095] Figure 2 This is a flowchart illustrating the steps of another underwater active binocular camera calibration method compatible with both short and long ranges, as described in an embodiment of the present invention. Figure 2 As shown, another underwater active binocular camera calibration method compatible with both near and far ranges in this embodiment of the invention further includes, after step S3:
[0096] Step S31: Perform error analysis on the calibration results of the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate. When the error exceeds the preset threshold, repeat steps S1-S3 until the error meets the requirements.
[0097] In this step, error analysis of the calibration results is crucial to ensuring calibration accuracy. In complex underwater environments, factors such as water flow disturbances, light variations, and the inherent precision of the equipment can influence the results, potentially leading to errors even after the calibration process in steps S1-S3. During the analysis, the relative position parameters of the left camera and the glass cover, and the right camera and the glass cover obtained from calibration, are compared with reference values acquired through high-precision measuring equipment, or evaluated based on the consistency of multiple calibration results. By calculating the deviations of position parameters (such as distance and angle) and analyzing the distribution of these deviations in different scenarios, a comprehensive understanding of the accuracy and stability of the calibration results is achieved.
[0098] The preset threshold is the standard for judging whether the calibration results are qualified. Its setting needs to comprehensively consider the actual application requirements and measurement accuracy requirements of the underwater binocular camera. If the camera is used for tasks such as underwater object detection and precision measurement with extremely high accuracy requirements, the preset threshold will be set lower to ensure the high accuracy of the calibration results; if the application scenario has relatively relaxed accuracy requirements, the threshold can be appropriately relaxed. For example, in the scenario of high-precision modeling of underwater cultural relics, the distance error threshold may be set at the centimeter level, and the angle error threshold may be set to a very small angle; while in the scenario of general underwater environmental monitoring, the threshold can be appropriately increased.
[0099] When the error analysis results show that the error exceeds the preset threshold, it indicates that the current calibration results cannot meet the actual application requirements, and steps S1-S3 need to be repeated. During the recalibration process, the previous error analysis results can provide a reference for optimizing the calibration process. For example, if it is found that the error mainly comes from the inaccuracy of the light refraction model, the refraction equation parameters can be optimized or a more complex refraction model can be used during recalibration; if the error is caused by inaccurate camera intrinsic parameter calibration, the number of shooting postures of the calibration plate can be increased in step S1 to improve the accuracy of the intrinsic parameter calibration. By continuously repeating the calibration and error analysis process, the error is gradually reduced until the error meets the preset threshold requirements, thereby obtaining reliable calibration results of the relative positional relationship between the camera and the glass cover, ensuring the accuracy and stability of the underwater binocular camera in subsequent operations.
[0100] In some embodiments, in step S5, at least one of the reference surfaces is at a distance from the binocular camera that is less than the minimum measurement distance of the binocular camera.
[0101] In this step, the stereo camera has a minimum measurement distance limitation in its design and operating principle; only by exceeding this range can relatively accurate measurement results be obtained. The minimum measurement distance of a stereo camera refers to the closest limit at which the camera can accurately measure the distance to an object under normal operating conditions. Figure 3 In this context, 'h' represents the minimum measurement distance. However, in practical underwater applications, the target object to be measured may be located within the minimum measurement distance of the binocular camera. Setting at least one reference surface smaller than the minimum measurement distance extends the calibration range to near-field areas that are difficult to cover with conventional measurements. This overcomes the measurement distance limitations of the binocular camera itself, enabling the camera to perform effective image processing and data calculation based on calibration results even in close-range scenarios. Monocular structured light, on the other hand, only needs to compare the captured image with the reference surface when calculating depth. Therefore, when the reference surface is close, the measurement accuracy of monocular structured light at close range can be improved, allowing for depth measurements in areas that binocular cameras cannot reach.
[0102] like Figure 3 As shown, for an active stereo camera, it can only acquire depth information within range b, and cannot acquire information within ranges a and c. a is the field of view that the left camera can obtain but the right camera cannot, and c is the field of view that the right camera can obtain but the left camera cannot. Since ranges a and c can be obtained using monocular structured light, the field of view of the stereo camera is extended. The calibration in this embodiment can improve the accuracy of monocular structured light at close range.
[0103] Improving close-range measurement accuracy: When the target is within the minimum measurement distance of a binocular camera, conventional calibration methods struggle to guarantee measurement accuracy due to factors such as imaging characteristics and parallax calculation. Introducing a close-range reference surface allows for targeted correction of imaging errors and distortions during close-range shooting through calibration and analysis. The reference surface information generated based on this surface provides more realistic parameters for monocular calculations in close-range scenarios, thereby improving the measurement accuracy of close-range targets and meeting the application needs of underwater close-range target detection and micro-object recognition.
[0104] Achieving compatibility at both near and far distances: The underwater environment is complex, and target objects are distributed across a wide range of distances, from tiny organisms close to the camera to underwater structures at a greater distance. By setting at least one reference surface smaller than the minimum measurement distance, and combining it with other reference surfaces at different distances, a calibration system covering a wide range of distances can be constructed. This allows underwater binocular cameras to perform accurate calculations and analyses based on the corresponding reference surface information, regardless of whether the target is at close or far distance, achieving compatible use in both near and far distance scenarios and enhancing the camera's adaptability and versatility in various underwater applications.
[0105] Figure 4 This is a schematic diagram of a long- and short-range compatible underwater active binocular camera calibration system according to an embodiment of the present invention. Figure 4 As shown, an underwater active binocular camera calibration system compatible with both short and long ranges in an embodiment of the present invention includes:
[0106] The first calibration module is used to project structured light onto the calibration plate in the air, and obtain the first left image and the first right image through the left camera and the right camera respectively, and perform the calibration of the intrinsic and extrinsic parameters of the underwater binocular camera.
[0107] The first calculation module is used to perform underwater structure cursor positioning based on the parameters of the first left image, the left camera, and the projector; and to perform underwater right structure cursor positioning based on the parameters of the first right image, the right camera, and the projector.
[0108] The second calibration module projects structured light onto the calibration plate underwater using the projector, and obtains a second left image and a second right image through the left camera and the right camera respectively. By combining the first left image, the first right image, the calibration results of the left structured light above water and the calibration results of the right structured light above water, the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate are calibrated.
[0109] The second calculation module is used to calculate the mapping matrix from the original underwater image to the stereo image.
[0110] The third calculation module is used to capture images of the plane at different underwater distances, which serve as reference surfaces for underwater left and right single-target positioning, and generate reference surface information that satisfies the requirements of single-target calculation.
[0111] Specifically, the first calibration module projects structured light onto the calibration board in the air using a projector, and acquires the first left and first right images through the left and right cameras, thereby calibrating the intrinsic and extrinsic parameters of the underwater binocular camera. This module provides the basic camera parameter calibration for the entire calibration system and is a prerequisite for all subsequent calibrations and calculations. The intrinsic and extrinsic parameters are solved using the least squares method and other methods, such as Zhang's calibration method, to improve calibration accuracy.
[0112] The first calculation module performs underwater left structure cursor calibration based on the parameters of the first left image, the left camera, and the projector, and performs underwater right structure cursor calibration based on the parameters of the first right image, the right camera, and the projector. This module primarily determines the structured light plane equation, achieving high-precision underwater structure cursor calibration, and providing crucial reference data for subsequent underwater structure cursor calibration and the calibration of the relative positional relationship between the camera and the glass cover.
[0113] The second calibration module projects structured light onto the calibration plate underwater, and the left and right cameras acquire the second left and second right images, respectively. These images are then combined with the first left and first right images, along with the surface calibration results of the left and right structured beams, to calibrate the relative positions between the left and right cameras and the glass cover. This module considers the refraction of light at the water-glass cover interface in the underwater environment and improves the accuracy of underwater calibration by establishing a refraction equation to solve for the relative position parameters.
[0114] The second calculation module calculates the mapping matrix from the original underwater image to an image suitable for binocular computing. Based on the calibration results obtained from the previous modules, this module converts the original underwater images into an image format suitable for binocular computing, providing the necessary image preprocessing for subsequent binocular vision computing, enabling the binocular camera to perform target recognition, distance measurement, and other operations more accurately.
[0115] The third calculation module captures images of the underwater planes at different distances, using them as reference surfaces for underwater monocular calibration (left and right), and generates reference surface information that satisfies monocular calculation requirements. This reference surface information helps the camera provide accurate parameters for targets at different distances during monocular calculations, achieving underwater calibration compatible with both near and far distances, and improving the camera's measurement accuracy and adaptability at different distances.
[0116] The first calibration module is the starting module of the entire system, providing other modules with basic parameters such as the camera's intrinsic and extrinsic parameters. The first calculation module performs surface structure calibration based on the images and related parameters obtained by the first calibration module, and its results provide important support for the second calibration module to perform more complex underwater calibration.
[0117] The second calibration module combines various information from the previous modules to calibrate the relative positional relationship between the camera and the glass cover, providing key parameters for the second calculation module to calculate the mapping matrix.
[0118] The mapping matrix calculation result of the second calculation module is used to ensure that the image meets the requirements of binocular computing. Working together with the reference surface information generated by the third calculation module, it ultimately achieves underwater active binocular camera calibration that is compatible with both near and far distances. This allows the system to accurately perform target detection and measurement operations in underwater scenes at different distances. The various modules collaborate and progress step by step, together forming a complete underwater active binocular camera calibration system.
[0119] This embodiment is based on an active binocular camera, which is suitable for both close-range and long-range measurements. Initial calibration is performed on the water to calculate the intrinsic and extrinsic parameters of the binocular camera and the intrinsic and extrinsic parameters of the monocular structured light. The camera is then recalibrated underwater, and the final mapping matrix is obtained by taking into account the effect of refraction. This greatly improves the accuracy of the underwater active binocular camera, makes subsequent depth calculations more convenient, and can expand the reconstruction range at close range.
[0120] This invention also provides a range-compatible underwater active binocular camera calibration device, including a processor and a memory storing executable instructions for the processor. The processor is configured to execute steps of a range-compatible underwater active binocular camera calibration method by executing the executable instructions.
[0121] As described above, this embodiment is based on an active binocular camera, which is suitable for both close-range and long-range measurements. Initial calibration is performed on the water to calculate the intrinsic and extrinsic parameters of the binocular camera and the intrinsic and extrinsic parameters of the monocular structured light, respectively. Then, recalibration is performed underwater, and the final mapping matrix is obtained by taking into account the effect of refraction. This greatly improves the accuracy of the underwater active binocular camera, makes subsequent depth calculation more convenient, and can expand the reconstruction range at close range.
[0122] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "platform."
[0123] Figure 5 This is a schematic diagram of a long-range and short-range compatible underwater active binocular camera calibration device according to an embodiment of the present invention. The following refers to... Figure 5 To describe an electronic device 600 according to this embodiment of the present invention. Figure 5 The electronic device 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0124] like Figure 5 As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.
[0125] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the section on a method for calibrating an underwater active binocular camera compatible with both short and long ranges, according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.
[0126] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.
[0127] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a grid environment.
[0128] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0129] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more meshes (e.g., local area network (LAN), wide area network (WAN), and / or public meshes, such as the Internet) via mesh adapter 660. Mesh adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although... Figure 5 As not shown in the diagram, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0130] This invention also provides a computer-readable storage medium for storing a program that, when executed, implements the steps of a range-compatible underwater active binocular camera calibration method. In some possible implementations, various aspects of the invention can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the above-described range-compatible underwater active binocular camera calibration method section of this specification, according to various exemplary embodiments of the invention.
[0131] As shown above, this embodiment is based on an active binocular camera, which is suitable for both close-range and long-range measurements. Initial calibration is performed on the water to calculate the intrinsic and extrinsic parameters of the binocular camera and the intrinsic and extrinsic parameters of the monocular structured light. The camera is then recalibrated underwater, and the final mapping matrix is obtained by taking into account the effect of refraction. This greatly improves the accuracy of the underwater active binocular camera, makes subsequent depth calculations more convenient, and can expand the reconstruction range at close range.
[0132] Figure 6 This is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. (Reference) Figure 6 As shown, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0133] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0134] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0135] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of mesh, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0136] This embodiment is based on an active binocular camera, which is suitable for both close-range and long-range measurements. Initial calibration is performed on the water to calculate the intrinsic and extrinsic parameters of the binocular camera and the intrinsic and extrinsic parameters of the monocular structured light. The camera is then recalibrated underwater, and the final mapping matrix is obtained by taking into account the effect of refraction. This greatly improves the accuracy of the underwater active binocular camera, makes subsequent depth calculations more convenient, and can expand the reconstruction range at close range.
[0137] The various embodiments described in this specification are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0138] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A calibration method for an underwater active binocular camera that is compatible with both short and long ranges, characterized in that, include: Step S1: Project structured light onto the calibration plate in the air and obtain the first left image and the first right image through the left camera and the right camera respectively to perform the calibration of the intrinsic and extrinsic parameters of the underwater binocular camera; Step S2: Locate the underwater structure based on the parameters of the first left image, the left camera, and the projector; locate the right underwater structure based on the parameters of the first right image, the right camera, and the projector. Step S3: Underwater, the projector projects structured light to illuminate the calibration plate. The left and right cameras respectively obtain the second left image and the second right image. By combining the first left image, the first right image, the calibration results of the left structured light above water and the calibration results of the right structured light above water, the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate are calibrated. Step S4: Calculate the mapping matrix from the original underwater image to the stereo image; Step S5: Take pictures of the plane at different underwater distances as reference planes for underwater left and right single-target positioning, and generate reference plane information that satisfies the single-target calculation.
2. The underwater active binocular camera calibration method compatible with both short and long ranges according to claim 1, characterized in that, The calibration plate is made of a composite material substrate and a waterproof and reflective coating.
3. The underwater active binocular camera calibration method compatible with both short and long ranges according to claim 1, characterized in that, In step S1, the intrinsic and extrinsic parameters of the underwater binocular camera are calibrated using Zhang's calibration method. Multiple sets of the first left and first right images are captured on the calibration board under different postures, and the intrinsic and extrinsic parameters are solved using the least squares method to improve the calibration accuracy.
4. The underwater active binocular camera calibration method compatible with both short and long ranges according to claim 1, characterized in that, In step S2, during the calibration of the underwater structured object, multiple Gray code patterns with different codes are projected onto the calibration board using Gray code structured light encoding. Based on the decoding information of the Gray code stripes in the first left image and the first right image, and combined with the parameters of the left camera, the right camera, and the projector, the structured light plane equation is calculated to achieve high-precision underwater structured object calibration.
5. The underwater active binocular camera calibration method compatible with both short and long ranges according to claim 1, characterized in that, In step S3, when calibrating the relative positional relationship between the left camera and the glass cover plate, and the relative positional relationship between the right camera and the glass cover plate, a refraction model is introduced to consider the effect of light refraction at the interface between the water and the glass cover plate. By establishing a refraction equation and combining the first left image, the first right image, the calibration results of the left structure above water and the calibration results of the right structure above water, the relative positional parameters between the left camera, the right camera and the glass cover plate are solved, thereby improving the accuracy of underwater calibration.
6. The underwater active binocular camera calibration method compatible with both short and long ranges according to claim 1, characterized in that, Following step S3, the following is also included: Step S31: Perform error analysis on the calibration results of the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate. When the error exceeds the preset threshold, repeat steps S1-S3 until the error meets the requirements.
7. The underwater active binocular camera calibration method compatible with both short and long ranges according to claim 1, characterized in that, In step S5, at least one of the reference surfaces is at a distance from the binocular camera that is less than the minimum measurement distance of the binocular camera.
8. A calibration system for an underwater active binocular camera compatible with both near and long ranges, used to implement the calibration method for an underwater active binocular camera compatible with both near and long ranges as described in any one of claims 1 to 7, characterized in that, include: The first calibration module is used to project structured light onto the calibration plate in the air, and obtain the first left image and the first right image through the left camera and the right camera respectively, and perform the calibration of the intrinsic and extrinsic parameters of the underwater binocular camera. The first calculation module is used to perform underwater structure cursor positioning based on the parameters of the first left image, the left camera, and the projector; and to perform underwater right structure cursor positioning based on the parameters of the first right image, the right camera, and the projector. The second calibration module projects structured light onto the calibration plate underwater using the projector, and obtains a second left image and a second right image through the left camera and the right camera respectively. By combining the first left image, the first right image, the calibration results of the left structured light above water and the calibration results of the right structured light above water, the relative positional relationship between the left camera and the glass cover plate and the relative positional relationship between the right camera and the glass cover plate are calibrated. The second calculation module is used to calculate the mapping matrix from the original underwater image to the stereo image. The third calculation module is used to capture images of the plane at different underwater distances, which serve as reference surfaces for underwater left and right single-target positioning, and generate reference surface information that satisfies the requirements of single-target calculation.
9. A calibration device for an underwater active binocular camera that is compatible with both short and long ranges, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the underwater active binocular camera calibration method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium for storing a program, characterized in that, When the program is executed, it implements the steps of the underwater active binocular camera calibration method that is compatible with both short and long ranges, as described in any one of claims 1 to 7.
