An underwater 3D reconstruction method based on multi-view binocular structured light

Through multi-view binocular structured light technology, combined with underwater refraction models, the problems of low single-view accuracy and refraction scattering in underwater 3D reconstruction are solved, and low-cost and high-precision underwater 3D model construction is achieved.

CN113971691BInactive Publication Date: 2024-08-23OCEAN UNIV OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111083286.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In underwater three-dimensional reconstruction, it is difficult to obtain panoramic data of objects with single-view technology, and binocular structured light technology is affected by refraction and scattering problems in water when applied underwater, resulting in low measurement accuracy.

Method used

Using a multi-view binocular structured light method, through camera parameter calibration, image acquisition, image correction, single-view 3D reconstruction, corrected point cloud, multi-group binocular camera pose calibration, multi-view stitching and surface reconstruction, we obtain images from each viewing angle. 3D data and fusion to build a complete 3D model of underwater target objects.

Benefits of technology

It achieves high-precision and complete underwater 3D model reconstruction at low cost, reduces equipment production costs, can effectively correct refraction and scattering errors, and reconstructs a high-precision, detailed 3D model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113971691B
    Figure CN113971691B
Patent Text Reader

Abstract

The present invention discloses an underwater 3D reconstruction method based on multi-view binocular structured light, which belongs to the technical field of underwater 3D reconstruction of computer vision, and comprises the following method steps: camera parameter calibration, firstly adjusting the focal length and aperture of the camera until the acquired image is clear, fixing the focal length and aperture of the camera so that they remain unchanged during the image acquisition process, shooting a plurality of groups of calibration plate images, and using Zhang Zhengyou calibration method to calibrate the internal parameters of the camera, and the whole parameter calibration process is completed in the air; the present invention provides a novel 3D reconstruction method for underwater target objects, which eliminates the step of watertight processing of the camera and reduces the equipment manufacturing cost; the present invention adopts a fixed multi-viewing angle to reconstruct a complete 3D model of an underwater object, and uses binocular structured light to reconstruct the surface of a low-texture object; relying on the method provided by the present invention, underwater objects can be reconstructed in 3D to reconstruct a high-precision, complete and detail-rich 3D model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of underwater three-dimensional reconstruction of computer vision, and relates to an underwater three-dimensional reconstruction method based on multi-view binocular structured light. Background Art

[0002] 3D reconstruction refers to the process of constructing a mathematical model of a 3D object in a real scene in a computer. It can be used to obtain and analyze the shape structure and geometric information of objects in the real world, and can fully display the characteristics of real objects. 3D reconstruction has a wide range of uses, and can be seen in many fields such as computer animation, geomorphology measurement, digital cultural relics collection, human-computer interaction, and modern medicine. Underwater 3D reconstruction can be applied to the fields of seabed exploration and seabed environment detection, and has important research value and practical significance.

[0003] Binocular structured light is a technology based on structured light encoding and decoding to achieve high-precision 3D reconstruction. Compared with binocular stereo vision, laser scanning and other technologies, binocular structured light has both a theoretical basis for binocular vision measurement, which can save the complex calibration of the projector, and structured light to increase the geometric feature information of the object surface, which can avoid the problem of difficulty in matching weak texture or repeated texture areas in binocular stereo vision, thus having higher measurement accuracy than traditional binocular stereo vision measurement methods. However, binocular structured light is currently mostly used for 3D measurement tasks in the air. If it is used underwater, it also faces the problem of refraction and scattering in water.

[0004] The influence of refraction and scattering in water will bring great errors to the measurement accuracy. Therefore, in order to correct the errors caused by refraction and scattering to obtain high-precision three-dimensional reconstruction results, it is necessary to combine the underwater refraction model and apply binocular structured light technology underwater, so as to achieve high-precision three-dimensional reconstruction using underwater binocular structured light technology.

[0005] However, in the 3D reconstruction process, single-view 3D reconstruction can only obtain the 3D data information of the object under a single view, and cannot obtain the 3D data of the whole view of the real object. Therefore, it is necessary to align and fuse the 3D data obtained from each view. Therefore, we propose an underwater 3D reconstruction method based on multi-view binocular structured light to solve the above problem. Summary of the invention

[0006] The present invention provides an underwater 3D reconstruction method based on multi-view binocular structured light. The 3D information of objects in a real underwater scene at each viewing angle is obtained respectively through single-view underwater binocular structured light technology, and then the 3D point clouds of each viewing angle are fused, thereby ensuring that a complete 3D model of the underwater target object is constructed at a low cost.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] An underwater 3D reconstruction method based on multi-view binocular structured light includes the following steps:

[0009] S1. Camera parameter calibration. First, adjust the focal length and aperture of the camera until the acquired image is clear. Fix the focal length and aperture of the camera so that they remain unchanged during the image acquisition process. Take several sets of calibration plate images. Use Zhang Zhengyou calibration method to calibrate the intrinsic parameters of the camera. The entire parameter calibration process is completed in the air.

[0010] S2, image acquisition, using the DLP optical machine to project a series of coded structured light images, including the following steps:

[0011] S21, using a 10-bit Gray code fringe image, including 10 longitudinal positive Gray codes and 10 longitudinal inverse Gray codes, the Gray code fringe image is an image of alternating black and white stripes, wherein black stripes represent a coding value of 0, and white stripes represent a coding value of 1; the positive Gray code fringe image is used to encode rows of a two-dimensional image, the inverse Gray code fringe image has the opposite coding value to the positive Gray code fringe image, the black stripes in the positive Gray code fringe image are changed into white stripes, and the white stripes are changed into black stripes, and the inverse Gray code fringe image is used to assist in the binarization operation of the target object image;

[0012] S22, placing the target object in water, and using a projection light machine to sequentially project a Gray code fringe pattern onto the target object, each time a Gray code fringe pattern is projected, the left and right eye cameras capture an image respectively, and the binocular camera sequentially captures the target object image with the Gray code fringe pattern, until 20 Gray code fringe patterns are projected, and then the binocular camera and the projection light machine are turned off;

[0013] S3, image correction, the image obtained in step S2 is subjected to stereo correction, and the two images that are actually not in coplanar row alignment are corrected to be in coplanar row alignment, which is used for matching corresponding points of the left and right images;

[0014] S4, single-view 3D reconstruction, including the following steps:

[0015] S41, image binarization: The binarized Gray code image is recorded as For the left camera image, the rectified image with positive Gray code stripes is recorded as and the image with inverse Gray code stripes is denoted as The pixel-by-pixel comparison and binarization process are expressed by the following formula:

[0016]

[0017] n (n = 0, 1, ..., 9) represents the index value of the fringe pattern, (i, j) represents the index value of each pixel position in the image, when When , the pixel belongs to the invalid area and is not binarized. The right camera image is also binarized in this way.

[0018] S42, decoding: a set of Gray code images Decode into a set of binary images Decoded into a decimal image D i,j ;

[0019] S43, matching: Gray code stripes uniquely encode the columns of the image. After stereo correction, the image can be corrected to coplanar row alignment, and a search is performed in the row direction. There is a unique point in the left image corresponding to a point in the right image;

[0020] S44, solving the point cloud: In the imaging process, this method takes the left camera as the reference, that is, establishes a world coordinate system with the optical center of the left camera as the origin. In step S43, all matching point pairs of the left and right eye images are obtained, and the depth value Z of a point on the target object is calculated. c , expressed as:

[0021]

[0022] Where f is the focal length of the camera, u l ,u r are the pixel positions of the matching point pairs in the row direction, d is the disparity value of the left and right eye images, and b is the baseline of the binocular camera;

[0023] According to the pinhole model, the three-dimensional coordinates P of a point on the target object in the world coordinate system can be obtained: w =X w ,Y w ,Z w , where the pinhole model is:

[0024]

[0025] Will Denoted as K, Denoted as T;

[0026] In the pinhole model, the coordinates are expressed in homogeneous coordinates, where (u, v, 1) is the point P in the world coordinate system. w Corresponding to the pixel position on the left camera image, (x, y, 1) is P w The position in the image coordinate system, (X c ,Y c ,Z c ,1) is P w The position in the camera coordinate system, K represents the camera's intrinsic parameter matrix, which is obtained by camera parameter calibration, T represents the extrinsic parameter matrix, the origin of the world coordinate system is established at the optical center of the left camera, T is a unit matrix that can be solved to get Pw for:

[0027]

[0028] For the pixel points with matching points on the left camera image, the corresponding three-dimensional coordinate points are solved by the above method to obtain the point cloud of the target object;

[0029] S45, corrected point cloud: During the reconstruction process, the camera plane and the glass plane are placed parallel, and the underwater refraction model is used to correct the three-dimensional coordinates P w The corrected three-dimensional coordinates of the target point are marked as P r =(X r ,Y r ,Z r ), the underwater refraction model can be expressed as:

[0030]

[0031] Where h is the distance from the optical center of the camera to the glass plane, and n is the refractive index of water, which is set to 1.33;

[0032] S5, multiple sets of binocular camera pose calibration, after obtaining the 3D point cloud under each viewing angle Vi (i = 1, 2, ..., 5) through step S4, estimate the left camera under each viewing angle, denoted as C vi ,i=1,2,…,5, the pose is denoted by T i→ , i = 1, 2, ..., 4, to merge and merge each group of point clouds to form a complete 3D model;

[0033] S6, multi-view stitching, after solving the camera pose of each view, transform the point cloud of each view according to the camera pose of each view, and transform the point cloud of each view to the view V5, that is, establish the origin of the world coordinate system on the optical center of the left camera of the view V5, so as to form a complete three-dimensional point cloud of the target object;

[0034] S7, surface reconstruction, comprising the following steps:

[0035] S71, point cloud filtering: In step S6, a complete 3D point cloud of the underwater target object is obtained. However, the noise in the real scene will affect the point cloud result, generating many noise points and outliers. The 3D point cloud is filtered, and radius filtering and straight-through filtering are used to denoise the 3D point cloud to obtain a smooth point cloud PC. filter ;

[0036] S72, Poisson reconstruction: After obtaining a smooth point cloud PC filterFinally, the surface is reconstructed to obtain the final complete three-dimensional model that retains the surface details of the object, and the three-dimensional point cloud is reconstructed using the Poisson surface reconstruction method to restore the complete three-dimensional model.

[0037] Preferably, in step S42, for the left camera image, a set of Gray code images Its first image Corresponding to the highest bit of Gray code, the last image Corresponding to the lowest bit of Gray code, the process of decoding Gray code into binary code is expressed by the following formula:

[0038]

[0039] After converting Gray code to binary code and then converting binary code to decimal code, the decoded image D can be obtained. i,j , each pixel value in the image is a decimal number after decoding the Gray code, and the right camera image is also decoded in this way.

[0040] Preferably, in step S42, the left camera decoded image DL is obtained. (i,j) , right camera decoded image DR i,j , assuming that there is a pixel u in the left camera image l ,v l , then the decoded value of the pixel position is There is a pixel u in the right camera image r ,v r , then the decoded value of the pixel position is like Then the pixel u l ,v l With pixel u r ,v r is a pair of matching point pairs, and the above matching strategy is used to obtain all matching point pairs of the left and right eye images.

[0041] Preferably, in step S45, the method uses a marker on the glass surface to solve the parameter h. For the left-eye image, the marker on the glass plane is identified and the pixel position of the center point of the marker is solved, which is recorded as M. i (i=0,1,2), the equation of the glass plane can be solved using the three marker center points:

[0042] Ax+By+Cz+D=0

[0043] The three-dimensional coordinates of the optical center are (0,0,0). Using the distance formula from a point to a plane, we can get

[0044] Preferably, after the parameters h and n are determined, they can be substituted into the underwater refraction model to obtain the corrected point cloud, and the three-dimensional point cloud of the target object under a single perspective can be solved to complete the underwater three-dimensional reconstruction of the single perspective, and the three-dimensional reconstruction under various perspectives can be performed. The three-dimensional point clouds of the target object under five perspectives are used, which are recorded as P vi ,i=1,2,…,5.

[0045] Preferably, in S5, 4 groups of binocular cameras are used with oblique downward viewing angles, 1 group of binocular cameras is used with a positive upward viewing angle, and a loop binocular positioning method is used to solve the position and posture of each group of left-eye cameras; for C v1 and C v2 , C v1 As the left camera, C v2 As the right camera, first take a number of calibration plate images, and then use Zhang Zhengyou calibration method to solve the camera's external parameters and get the camera C v1 To Camera C v2 The transformation matrix T 1→2 , and then solve for T 2→ , T 3→ , T 4→ ; The posture T is:

[0046]

[0047] Preferably, step S6 includes the following steps: first, reconstructing the three-dimensional point cloud P at the viewing angle V1 v1 Use the transformation matrix T 1→2 Transformed to the perspective V2, the transformed point cloud is P' v1 , the 3D point cloud P reconstructed under the viewing angle V2 v2 With point cloud P' v1 Fusion into point cloud P' v2 ; Then, the point cloud P' v2 Use the transformation matrix T 2→3 Transformed to the perspective V3, the transformed point cloud is P' v '2, the point cloud P reconstructed under the perspective V3 v3 With point cloud P' v '2 Fusion into point cloud P' v3 ; Then the point cloud P v3 'Use the transformation matrix T 3→4 Transformed to the perspective V4, the transformed point cloud is P' v '3, reconstruct the point cloud P under the perspective V4 v4 With point cloud P' v '3 fusion into point cloud P' v4 ; Finally, the point cloud P' v4 Use the transformation matrix T 4→5Transformed to the perspective V5, the transformed point cloud is P' v '4, reconstruct the point cloud P under the perspective V5 v5 With point cloud P' v '4 Fusion into point cloud P out .

[0048] Preferably, in step S6, during the transformation process, the transformation of the three-dimensional point at viewing angle i to viewing angle i+1 can be expressed by the formula:

[0049]

[0050] Where (X target ,Y target ,Z target ,1) is the three-dimensional point after transformation by the transformation matrix, (X source ,Y source ,Z source ,1) is the three-dimensional point before transformation. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a method flow chart;

[0052] Figure 2 It is a positive Gray code fringe pattern;

[0053] Figure 3 is the inverse Gray code fringe pattern;

[0054] Figure 4 This is a schematic diagram of the glass surface marker;

[0055] Figure 5 It is a schematic diagram of the support frame.

[0056] In the figure: 1. Binocular camera and optical-mechanical components; 2. Glass water tank; 3. Central platform for placing the glass water tank; 4. Rectangular frame. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0058] Reference Figure 1-4 , an underwater 3D reconstruction method based on multi-view binocular structured light, comprising the following method steps:

[0059] S1. Camera parameter calibration. First, adjust the focal length and aperture of the camera until the acquired image is clear. Fix the focal length and aperture of the camera so that they remain unchanged during the image acquisition process. Take several sets of calibration plate images and use Zhang Zhengyou calibration method to calibrate the intrinsic parameters of the camera. The entire parameter calibration process is completed in the air.

[0060] S2, image acquisition, using the DLP optical machine to project a series of coded structured light images, including the following steps:

[0061] S21, using a 10-bit Gray code fringe image, including 10 longitudinal positive Gray codes and 10 longitudinal inverse Gray codes, the Gray code fringe image is an image of alternating black and white stripes, wherein black stripes represent a coding value of 0, and white stripes represent a coding value of 1; the positive Gray code fringe image is used to encode rows of a two-dimensional image, and the inverse Gray code fringe image has the opposite coding value to the positive Gray code fringe image, that is, the black stripes in the positive Gray code fringe image become white stripes, and the white stripes become black stripes, and the inverse Gray code fringe image is used to assist in the binarization operation of the target object image;

[0062] S21, placing the target object in water, and using a projection light machine to sequentially project a Gray code fringe pattern onto the target object. Each time a Gray code fringe pattern is projected, the left and right eye cameras capture an image respectively, and the binocular camera sequentially captures the target object image with the Gray code fringe pattern, until 20 Gray code fringe patterns are projected, and then the binocular camera and the projection light machine are turned off.

[0063] S3, image correction. The image obtained in step S2 will cause certain distortion due to the manufacturing accuracy of the camera and the deviation of the assembly process. The distortion of the lens is mainly divided into radial distortion and tangential distortion. In order to reduce this error, the obtained image needs to be distorted. After distortion correction, the error introduced by the above reasons can be removed. At the same time, in an ideal binocular system, the image planes of the two cameras are parallel, but in an actual binocular system, there are no two camera planes that are completely coplanar and aligned, so we need to perform stereo correction on it and correct the two images that are actually not coplanar and aligned to coplanar alignment, so as to facilitate the matching of corresponding points of the left and right images.

[0064] S4, single-view 3D reconstruction, including the following steps:

[0065] S41, image binarization: The binarized Gray code image is recorded as For the left camera image, the rectified image with positive Gray code stripes with an image with inverse Gray code stripes The pixel-by-pixel comparison and binarization process are expressed by the following formula:

[0066]

[0067] Where n (n = 0, 1, ..., 9) represents the index value of the fringe pattern, (i, j) represents the index value of each pixel position in the image, and When , the pixel belongs to the invalid area and is not binarized. The right camera image is also binarized in this way.

[0068] Similarly, the right camera image is also binarized in this way.

[0069] S42. Decoding: A set of Gray code images Decode into a set of binary images Then decoded into a decimal image D i,j For the left camera image, a set of Gray code images Its first image Corresponding to the highest bit of Gray code, the last image Corresponding to the lowest bit of Gray code, the process of decoding Gray code into binary code is expressed by the following formula:

[0070]

[0071] After converting Gray code to binary code and then converting binary code to decimal code, the decoded image D can be obtained. i,j , each pixel value in the image is a decimal number after decoding the Gray code. Similarly, the right camera image is also decoded in this way.

[0072] S43. Matching: Gray code stripes can uniquely encode the columns of the image. After stereo correction, the image can be corrected to coplanar row alignment. Therefore, when searching in the row direction, there is a unique point in the left image that corresponds to a point in the right image. In step K2, the decoded image DL of the left camera is obtained. (i,j) , right camera decoded image DR i,j , assuming that there is a pixel u in the left camera image l ,v l , then the decoded value of the pixel position is There is a pixel u in the right camera image r ,v r , then the decoded value of the pixel position is like Then the pixel u l ,v l With pixel u r ,v r is a pair of matching points. All matching point pairs of the left and right images can be obtained by using the above matching strategy.

[0073] S44. Solve the point cloud: In the imaging process, this method takes the left camera as the reference, that is, the world coordinate system is established with the optical center of the left camera as the origin. In step K3, all matching point pairs of the left and right eye images are obtained. With the matching point pairs, the depth value Z of a point on the target object can be calculated. c, expressed as:

[0074]

[0075] Where f is the focal length of the camera, u l ,u r are the pixel positions of the matching point pairs in the row direction, d is the disparity value of the left and right eye images, and b is the baseline of the binocular camera.

[0076] According to the pinhole model, the three-dimensional coordinates P of a point on the target object in the world coordinate system can be obtained: w =X w ,Y w ,Z w , where the pinhole model can be expressed as:

[0077]

[0078] Here will Denoted as K, Denoted as T.

[0079] In the pinhole model, the coordinates are expressed in homogeneous coordinates, where (u, v, 1) is the point P in the world coordinate system. w Corresponding to the pixel position on the left camera image, (x, y, 1) is P w The position in the image coordinate system, (X c ,Y c ,Z c ,1) is P w The position in the camera coordinate system, K represents the camera's intrinsic parameter matrix, obtained by camera parameter calibration, and T represents the extrinsic parameter matrix. Because the origin of the world coordinate system of this method is established at the optical center of the left camera, T is a unit matrix. Then, P can be solved w for:

[0080]

[0081] For the pixel points with matching points on the left camera image, their corresponding three-dimensional coordinate points can be solved by the above method, so as to obtain the point cloud of the target object.

[0082] S45. Correction of point cloud: Because the target object is placed in water, there are refraction and scattering problems. At the same time, the camera plane and the glass plane are placed parallel in the reconstruction process of this method. Therefore, the underwater refraction model can be used to correct the three-dimensional coordinates P w The corrected three-dimensional coordinates of the target point are marked as P r =(X r ,Y r ,Z r ), the underwater refraction model can be expressed as:

[0083]

[0084] Among them, h is the distance from the optical center of the camera to the glass plane, and n is the refractive index of water, which is set to 1.33 here.

[0085] For the parameter h, this method uses the marker on the glass surface to solve it, as shown in Figure [4]. First, for the left image, identify the marker on the glass plane and solve the pixel position of the center point of the marker (denoted as M i (i=0,1,2)), the equation of the glass plane can be solved using the three marker center points:

[0086] Ax+By+Cz+D=0

[0087] Since the three-dimensional coordinates of the optical center are (0,0,0), using the distance formula from a point to a plane, we can get

[0088] After the parameters h and n are determined, they can be substituted into the underwater refraction model to obtain the corrected point cloud. So far, the three-dimensional point cloud of the target object under a single perspective has been solved, and the underwater three-dimensional reconstruction of a single perspective has been realized. Through this step, three-dimensional reconstruction can be performed under various perspectives to obtain the three-dimensional point cloud of the target object under various perspectives (this method uses five perspectives), which is recorded as P vi ,i=1,2,…,5.

[0089] S5, multiple sets of binocular camera pose calibration, including the following steps:

[0090] After obtaining the 3D point cloud at each viewing angle Vi (i=1, 2, ..., 5) in step S4, the left camera at each viewing angle is estimated, denoted as C vi ,i=1,2,…,5, the pose is denoted by T i→ , i = 1, 2, …, 4, to stitch and fuse each group of point clouds to form a complete three-dimensional model.

[0091] The camera arrangement of the device of the present invention is as follows Figure 5 As shown, Figure 5 The schematic diagram of the support frame includes a rectangular frame 4, four binocular cameras and an optical-mechanical assembly 1 are installed on the top of the rectangular frame 4, a binocular camera and an optical-mechanical assembly 1 is installed on the bottom of the rectangular frame 4, a central platform 3 of a glass water tank is placed in the rectangular frame 4, and a glass water tank 2 is installed on the central platform 3. Four groups of binocular cameras have a downward viewing angle, and one group of binocular cameras has an upward viewing angle, which can ensure that the target object can be captured completely. This method uses a loop binocular positioning method to solve the position and posture of each group of left-eye cameras. For C v1 and C v2, C v1 As the left camera, C v2 As the right camera, first take a number of calibration plate images, and then use Zhang Zhengyou calibration method to solve the camera's external parameters and get the camera C v2 To Camera C v1 The transformation matrix T 1→2 .

[0092] Similarly, T can be solved according to the above method. 2→3 , T 3→4 , T 4→5 .

[0093] Here, all poses T are:

[0094]

[0095] S6, multi-view stitching, including the following methods:

[0096] After solving the camera poses of each view, transform the point clouds of each view according to the camera poses of each view, and transform the point clouds of each view to the view V5, that is, establish the origin of the world coordinate system at the optical center of the left camera of the view V5 to form a complete 3D point cloud of the target object. First, reconstruct the 3D point cloud P at the view V1 v1 Use the transformation matrix T 1→2 Transformed to the perspective V2, the transformed point cloud is P' v1 , the 3D point cloud P reconstructed under the viewing angle V2 v2 With point cloud P' v1 Fusion into point cloud P' v2 ; Then, the point cloud P' v2 Use the transformation matrix T 2→3 Transformed to the perspective V3, the transformed point cloud is P' v '2, the point cloud P reconstructed under the perspective V3 v3 With point cloud P' v '2 Fusion into point cloud P' v3 ; Then the point cloud P v3 'Use the transformation matrix T 3→4 Transformed to the perspective V4, the transformed point cloud is P' v '3, reconstruct the point cloud P under the perspective V4 v4 With point cloud P' v '3 fusion into point cloud P' v4 ; Finally, the point cloud P' v4 Use the transformation matrix T 4→5 Transformed to the perspective V5, the transformed point cloud is P' v '4, reconstruct the point cloud P under the perspective V5 v5 With point cloud P'v '4 Fusion into point cloud P out .

[0097] In the above transformation process, the transformation from a 3D point at view i to view i+1 can be expressed by the formula:

[0098]

[0099] Where (X target ,Y target ,Z target ,1) is the three-dimensional point after transformation by the transformation matrix, (X source ,Y source ,Z source ,1) is the three-dimensional point before transformation.

[0100] S7, surface reconstruction, comprising the following steps:

[0101] S71. Point cloud filtering: In step S6, a complete 3D point cloud of the underwater target object is obtained. However, the noise in the real scene will affect the point cloud result, generating many noise points and outliers. Therefore, the 3D point cloud needs to be filtered to reduce these noise points and outliers. This method uses radius filtering and straight-through filtering to denoise the 3D point cloud, thereby obtaining a smooth point cloud PC. filter .

[0102] S72. Poisson reconstruction: After obtaining a smooth point cloud PC filter After that, the surface reconstruction is performed to obtain the final complete three-dimensional model with the surface details of the object. This method uses the Poisson surface reconstruction method to reconstruct the surface of the three-dimensional point cloud and restore the complete three-dimensional model.

[0103] The present invention provides a novel method for 3D reconstruction of underwater target objects, which eliminates the step of watertight processing of the camera and reduces the equipment manufacturing cost; the present invention adopts a fixed multi-perspective method to reconstruct a complete 3D model of an underwater object, and uses binocular structured light to reconstruct the surface of a low-texture object; relying on the method provided by the present invention, underwater objects can be reconstructed in 3D to reconstruct a high-precision, complete, and detail-rich 3D model.

[0104] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. An underwater 3D reconstruction method based on multi-view binocular structured light, characterized in that: The method comprises the following steps: S1. Camera parameter calibration. First, adjust the focal length and aperture of the camera until the acquired image is clear. Fix the focal length and aperture of the camera so that they remain unchanged during the image acquisition process. Take several sets of calibration plate images. Use Zhang Zhengyou calibration method to calibrate the intrinsic parameters of the camera. The entire parameter calibration process is completed in the air. S2, image acquisition, using the DLP optical machine to project a series of coded structured light images, including the following steps: S21, using a 10-bit Gray code fringe image, including 10 longitudinal positive Gray codes and 10 longitudinal inverse Gray codes, the Gray code fringe image is an image of alternating black and white stripes, wherein black stripes represent a coding value of 0, and white stripes represent a coding value of 1; the positive Gray code fringe image is used to encode rows of a two-dimensional image, and the inverse Gray code fringe image has the opposite coding value to the positive Gray code fringe image, wherein the black stripes in the positive Gray code fringe image are changed into white stripes, and the white stripes are changed into black stripes, and the inverse Gray code fringe image is used to assist in the binarization operation of the target object image; S22, placing the target object in water, and using a projection light machine to sequentially project a Gray code fringe pattern onto the target object, each time a Gray code fringe pattern is projected, the left and right eye cameras capture an image respectively, and the binocular camera sequentially captures the target object image with the Gray code fringe pattern, until 20 Gray code fringe patterns are projected, and then the binocular camera and the projection light machine are turned off; S3, image correction, the image obtained in step S2 is subjected to stereo correction, and the two images that are actually not in coplanar row alignment are corrected to be in coplanar row alignment, which is used for matching corresponding points of the left and right images; S4, single-view 3D reconstruction, including the following steps: S41, image binarization: The binarized Gray code image is recorded as For the left camera image, the rectified image with positive Gray code stripes is recorded as and the image with inverse Gray code stripes is denoted as The pixel-by-pixel comparison and binarization process are expressed by the following formula: n (n = 0, 1, ..., 9) represents the index value of the fringe pattern, (i, j) represents the index value of each pixel position in the image, when When , the pixel belongs to the invalid area and is not binarized. The right camera image is also binarized in this way. S42, decoding: a set of Gray code images Decode into a set of binary images Decoded into a decimal image D (i,j) ; S43, matching: Gray code stripes uniquely encode the columns of the image. After stereo correction, the image can be corrected to coplanar row alignment, and a search is performed in the row direction. There is a unique point in the left image corresponding to a point in the right image; S44, solving the point cloud: In the imaging process, this method takes the left camera as the reference, that is, establishes a world coordinate system with the optical center of the left camera as the origin. In step S43, all matching point pairs of the left and right eye images are obtained, and the depth value Z of a point on the target object is calculated. c , expressed as: Where f is the focal length of the camera, u l ,u r are the pixel positions of the matching point pairs in the row direction, d is the disparity value of the left and right eye images, and b is the baseline of the binocular camera; According to the pinhole model, the three-dimensional coordinates P of a point on the target object in the world coordinate system can be obtained: w =(X w ,Y w ,Z w ), where the pinhole model is: Will Denoted as K, Denoted as T; In the pinhole model, the coordinates are expressed in homogeneous coordinates, where (u, v, 1) is the point P in the world coordinate system. w Corresponding to the pixel position on the left camera image, (x, y, 1) is P w The position in the image coordinate system, (X c ,Y c ,Z c ,1) is P w The position in the camera coordinate system, K represents the camera's intrinsic parameter matrix, which is obtained by camera parameter calibration, T represents the extrinsic parameter matrix, the origin of the world coordinate system is established at the optical center of the left camera, T is a unit matrix that can be solved to get P w for: For the pixel points with matching points on the left camera image, the corresponding three-dimensional coordinate points are solved by the above method to obtain the point cloud of the target object; S45, corrected point cloud: During the reconstruction process, the camera plane and the glass plane are placed parallel, and the underwater refraction model is used to correct the three-dimensional coordinates P w The corrected three-dimensional coordinates of the target point are marked as P r =(X r ,Y r ,Z r ), the underwater refraction model can be expressed as: Where h is the distance from the optical center of the camera to the glass plane, and n is the refractive index of water, which is set to 1.33; S5, multiple sets of binocular camera pose calibration, after obtaining the 3D point cloud under each viewing angle Vi (i = 1, 2, ..., 5) through step S4, estimate the left camera under each viewing angle, denoted as C vi ,i=1,2,…,5, the pose is denoted by T i→i+1 , i = 1, 2, ..., 4, to merge and merge each group of point clouds to form a complete 3D model; S6, multi-view stitching, after solving the camera pose of each view, transform the point cloud of each view according to the camera pose of each view, and transform the point cloud of each view to the view V5, that is, establish the origin of the world coordinate system on the optical center of the left camera of the view V5, so as to form a complete three-dimensional point cloud of the target object; S7, surface reconstruction, comprising the following steps: S71, point cloud filtering: In step S6, a complete 3D point cloud of the underwater target object is obtained. However, the noise in the real scene will affect the point cloud result, generating many noise points and outliers. The 3D point cloud is filtered, and radius filtering and straight-through filtering are used to denoise the 3D point cloud to obtain a smooth point cloud PC. filter ; S72, Poisson reconstruction: After obtaining a smooth point cloud PC filter Finally, the surface is reconstructed to obtain the final complete three-dimensional model that retains the surface details of the object, and the three-dimensional point cloud is reconstructed using the Poisson surface reconstruction method to restore the complete three-dimensional model.

2. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 1, characterized in that: In step S42, for the left camera image, a set of Gray code images Its first image Corresponding to the highest bit of Gray code, the last image Corresponding to the lowest bit of Gray code, the process of decoding Gray code into binary code is expressed by the following formula: After converting Gray code to binary code and then converting binary code to decimal code, the decoded image D can be obtained. (i,j) , each pixel value in the image is a decimal number after decoding the Gray code, and the right camera image is also decoded in this way.

3. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 2, characterized in that: In step S42, the left camera decoded image DL is obtained. (i,j) , right camera decoded image DR (i,j) , assuming that there is a pixel point (u l ,v l ), then the decoded value of the pixel position is There is a pixel point (u r ,v r ), then the decoded value of the pixel position is like Then the pixel point (u l ,v l ) and pixel (u r ,v r is a pair of matching point pairs, and the above matching strategy is used to obtain all matching point pairs of the left and right eye images.

4. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 1, characterized in that: In step S45, the parameter h is solved with the help of the marker on the glass surface. For the left image, the marker on the glass plane is identified and the pixel position of the center point of the marker is solved, which is recorded as M i (i=0,1,2), the equation of the glass plane can be solved using the three marker center points: Ax+By+Cz+D=0 The three-dimensional coordinates of the optical center are (0,0,0). Using the distance formula from a point to a plane, we can get 5. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 4, characterized in that: After the parameters h and n are determined, they can be substituted into the underwater refraction model to obtain the corrected point cloud, and the three-dimensional point cloud of the target object under a single perspective can be solved to complete the underwater three-dimensional reconstruction under a single perspective. The three-dimensional reconstruction under various perspectives is performed, and the three-dimensional point clouds of the target object under five perspectives are used, which are recorded as P vi ,i=1,2,…,5.

6. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 1, characterized in that: In S5, 4 groups of binocular cameras are used with oblique downward viewing angles, 1 group of binocular cameras is used with positive upward viewing angles, and a loop binocular positioning method is used to solve the position and posture of each group of left-eye cameras; for C v1 and C v2 , C v1 As the left camera, C v2 As the right camera, first take a number of calibration plate images, and then use Zhang Zhengyou calibration method to solve the camera's external parameters and get the camera C v1 To Camera C v2 The transformation matrix T 1→2 , and then solve for T 2→3 , T 3→4 , T 4→5 ; The posture T is:

7. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 1, characterized in that: Step S6 includes the following steps: first, reconstruct the three-dimensional point cloud P at the viewing angle V1 v1 Use the transformation matrix T 1→2 Transformed to the perspective V2, the transformed point cloud is P' v1 , the 3D point cloud P reconstructed under the viewing angle V2 v2 With point cloud P' v1 Fusion into point cloud P' v2 ; Then, the point cloud P' v2 Use the transformation matrix T 2→3 Transformed to the perspective V3, the transformed point cloud is P' v '2, the point cloud P reconstructed under the perspective V3 v3 With point cloud P' v '2 Fusion into point cloud P' v3 ; Then the point cloud P v3 'Use the transformation matrix T 3→4 Transformed to the perspective V4, the transformed point cloud is P' v '3, reconstruct the point cloud P under the perspective V4 v4 With point cloud P' v '3 fusion into point cloud P' v4 ; Finally, the point cloud P' v4 Use the transformation matrix T 4→5 Transformed to the perspective V5, the transformed point cloud is P' v '4, reconstruct the point cloud P under the perspective V5 v5 With point cloud P' v '4 Fusion into point cloud P out .

8. The underwater 3D reconstruction method based on multi-view binocular structured light according to claim 7, characterized in that: In step S6, during the transformation process, the transformation from the three-dimensional point at the viewing angle i+1 to the viewing angle i can be expressed by the formula: Where (X target ,Y target ,Z target ,1) is the three-dimensional point after transformation by the transformation matrix, (X source ,Y source ,Z source ,1) is the three-dimensional point before transformation.