A dual-camera joint calibration method and system for ultra-large-range visual measurement
Through the dual-camera joint calibration method, a drone and a retroreflective ball are used to construct a virtual calibration field, and the camera parameters are optimized with the beam adjustment method, which solves the calibration complexity and accuracy problems in the measurement of large-size workpieces, and achieves efficient and accurate Measurement results.
Patent Information
- Application Number
- CN202210181441.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-02-25
AI Technical Summary
It is difficult to achieve high-efficiency and high-precision measurement of large-size workpieces with existing technology. Traditional calibration methods are complex, time-consuming and costly, and lack high-precision reference space coordinates, resulting in large system errors.
A dual-camera joint calibration method for ultra-large-scale visual measurement is adopted. The drone carries a length ruler and flies in the measurement space. The two-dimensional coordinates of the image plane of the retroreflective ball are used to construct a large-scale spatial virtual calibration field. The camera is optimized with the beam adjustment method. The internal parameters and external orientation parameters realize joint calibration of dual cameras.
It reduces the calibration cost and improves the accuracy. It is suitable for measuring large-sized workpieces under long distances and large fields of view. It provides high-precision data basis and solves the problems of small field of view, high cost, difficult production and cumbersome layout of traditional methods. .
Smart Images

Figure CN114663520B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual measurement, and in particular to a dual-camera joint calibration method and system for ultra-large-range visual measurement. Background Art
[0002] In recent years, with the rapid development of aerospace, large shipbuilding, mining and new energy industries, the demand for unconventional workpieces has increased day by day. Large-sized workpieces are generally more than ten meters or even hundreds of meters long. Compared with conventional measurement, large-sized measurement has great differences in measurement efficiency, accuracy and measurement environment. Conventional methods generally only measure and process geometric quantities in a specific plane, and the measuring tools used are also highly specialized, which imposes certain restrictions on measurement efficiency and accuracy, and it is difficult to achieve the high efficiency and high accuracy requirements of large-sized workpiece measurement. Conventional measurement methods for large-sized workpieces will present disadvantages such as high manual participation and small measurement range.
[0003] At present, large-size workpieces are generally measured through spatial coordinate conversion. The spatial coordinate measurement equipment that has been put into use includes laser trackers, three-coordinate measuring machines, etc. These devices all adopt a point-by-point measurement method, which not only has low actual efficiency and requires relevant staff to have strong professional knowledge and skills, but also has high equipment costs, making it difficult to achieve high-precision and rapid detection of large workpieces.
[0004] There is also a method of using a visual measurement system to measure large-sized workpieces, and camera calibration is an important part of the visual measurement system. The accuracy of the calibration orientation directly affects the final measurement accuracy of the photogrammetry system. With the increase in the volume of the measured object, the processing and production of the calibration object is becoming more and more complicated. Traditional calibration is achieved by shooting high-precision calibration objects, calibration walls or calibration fields. In practical applications, it is extremely difficult to build calibration objects that match the size of the measured space, and the calibration process is extremely complex, time-consuming and costly. At the same time, due to the lack of high-precision reference space coordinates or space lengths, the calibration results have large systematic errors.
[0005] Based on the above problems, a new calibration method is urgently needed to improve the accuracy of camera calibration. Summary of the invention
[0006] The purpose of the present invention is to provide a dual-camera joint calibration method and system for ultra-large-scale visual measurement, which can improve the calibration accuracy of the dual cameras.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A dual-camera joint calibration method for ultra-large-scale visual measurement, comprising:
[0009] Initializing the intrinsic parameters of the first camera and the second camera to obtain initial values of the intrinsic parameters of the first camera and the second camera;
[0010] The drone carries a length ruler and flies in various postures in the measurement space; both ends of the length ruler are provided with back-light reflecting balls;
[0011] The first camera and the second camera are used to collect images of the light-reflecting balls at both ends of the length scale in each posture to obtain an image set; the image set includes multiple pairs of first images and second images; the first image is an image collected by the first camera, and the second image is an image collected by the second camera;
[0012] Determine the image plane two-dimensional coordinates of each return light reflection ball in each first image and each second image;
[0013] Determine the essential matrix according to the two-dimensional coordinates of the image plane of each return light reflection ball in each first image and each second image;
[0014] Determine a rotation matrix and a translation matrix of the second camera relative to the first camera according to the intrinsic matrix; the rotation matrix and the translation matrix are initial values of exterior orientation parameters of the first camera and the second camera;
[0015] Using a bundle adjustment method, the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters are optimized to obtain optimal intrinsic parameters of the first camera, optimal intrinsic parameters of the second camera, and optimal exterior parameters;
[0016] According to the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters and the optimal extrinsic parameters of the second camera, the large-size workpiece is measured by the first camera and the second camera.
[0017] Optionally, determining the image plane two-dimensional coordinates of each returning light reflection ball in each first image and each second image specifically includes:
[0018] Binarizing each first image and each second image to obtain a corresponding binary image;
[0019] Connected regions of each binary image are marked, and the center coordinates of the brightness values of the connected regions in each binary image are solved by using the grayscale centroid method; the center coordinates of the brightness values of the connected regions are the two-dimensional coordinates of the image plane of the backlight reflection ball.
[0020] Optionally, the performing binarization processing on each first image and each second image to obtain a corresponding binary image specifically includes:
[0021] The im2bw function is used to binarize each first image and each second image to obtain a corresponding binary image.
[0022] Optionally, the two-dimensional coordinates of the image plane of the retro-light reflecting ball are determined according to the following formula:
[0023]
[0024]
[0025] in, is the two-dimensional coordinate of the image plane of the retroreflector, is the set of pixels in the connected area, and f(u,v) is the grayscale value of the pixel with coordinates (u,v).
[0026] Optionally, determining the intrinsic matrix according to the two-dimensional coordinates of the image plane of each return light reflection ball in each first image and each second image specifically includes:
[0027] The essential matrix is determined based on the two-dimensional coordinates of the image plane of five pairs of non-collinear retroreflection spheres.
[0028] Optionally, the initial values of the intrinsic parameters include focal length, position of the principal point on the image plane, radial distortion parameters and eccentric distortion parameters;
[0029] The bundle adjustment method is used to optimize the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters to obtain the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal exterior parameters, specifically including:
[0030] For any second image, determine the spatial point coordinates of the two retro-light reflecting balls in the second image according to the focal length of the second camera, the initial value of the exterior orientation parameter and the image point coordinates of the two retro-light reflecting balls in the second image;
[0031] According to the spatial point coordinates of the two retroreflection balls, the spatial distance between the two retroreflection balls is determined;
[0032] Determine an extended error equation according to the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, the initial values of the exterior orientation parameters, and the spatial point coordinates and spatial distances of two retroreflection balls in each second image;
[0033] The bundle adjustment method is used to determine the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal extrinsic parameters according to the expanded error equation.
[0034] Optionally, the spatial point coordinates of the retroreflective sphere are determined according to the following formula:
[0035]
[0036]
[0037] b1=cos(ω)sin(κ);
[0038]
[0039]
[0040] b2=cos(ω)cos(κ);
[0041]
[0042]
[0043] b3=-sin(ω);
[0044]
[0045] Among them, (X, Y, Z) are the spatial coordinates of the reflected light ball, (x r ,y r ) is the image point coordinate of the reflected light ball in the second image, c is the focal length, is the rotation matrix, is the translation matrix, ω, κ is the rotation angle of the second camera relative to the first camera around the X, Y, and Z axes, respectively, T x 、T y 、T z are the translation amounts of the second camera relative to the first camera along the X, Y, and Z axes, respectively.
[0046] To achieve the above object, the present invention also provides the following solution:
[0047] A dual-camera joint calibration system for ultra-large-scale visual measurement, comprising: a first camera, a second camera, a drone, a length ruler and a host computer; both ends of the length ruler are provided with backlight reflection balls;
[0048] The drone is used to carry the length ruler and fly in various postures in the measurement space;
[0049] The first camera and the second camera are used to collect images of the light-reflecting balls at both ends of the length ruler to obtain an image set; the image set includes multiple pairs of first images and second images; the first image is an image collected by the first camera, and the second image is an image collected by the second camera;
[0050] The host computer comprises:
[0051] an initialization unit, connected to the first camera and the second camera respectively, for initializing the intrinsic parameters of the first camera and the second camera, and obtaining an initial value of the intrinsic parameter of the first camera and an initial value of the intrinsic parameter of the second camera;
[0052] A two-dimensional coordinate determination unit, connected to the first camera and the second camera respectively, for determining the image plane two-dimensional coordinates of each return light reflection ball in each first image and each second image;
[0053] An essential matrix determining unit, connected to the two-dimensional coordinate determining unit, for determining the essential matrix according to the image plane two-dimensional coordinates of each return light reflecting ball in each first image and each second image;
[0054] an extrinsic parameter determination unit, connected to the intrinsic matrix determination unit, and configured to determine a rotation matrix and a translation matrix of the second camera relative to the first camera according to the intrinsic matrix; the rotation matrix and the translation matrix are initial values of the extrinsic orientation parameters of the first camera and the second camera;
[0055] an optimization unit, connected to the initialization unit and the extrinsic parameter determination unit, respectively, for optimizing the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters by using a bundle adjustment method, so as to obtain the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal extrinsic parameters;
[0056] The measuring unit is connected to the optimization unit, the first camera and the second camera respectively, and is used to measure the large-size workpiece through the first camera and the second camera according to the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera and the optimal extrinsic parameters.
[0057] Optionally, the two-dimensional coordinate determining unit includes:
[0058] A binary module, connected to the first camera and the second camera respectively, for performing a binary process on each first image and each second image to obtain a corresponding binary image;
[0059] The marking module is connected to the binarization module and is used to mark the connected areas of each binary image and use the grayscale centroid method to solve the central coordinates of the brightness values of the connected areas in each binary image; the central coordinates of the brightness values of the connected areas are the two-dimensional coordinates of the image plane of the backlight reflection ball.
[0060] Optionally, the initial values of the intrinsic parameters include focal length, position of the principal point on the image plane, radial distortion parameters and eccentric distortion parameters;
[0061] The optimization unit comprises:
[0062] a spatial point coordinate determination module, connected to the initialization unit and the external parameter determination unit, respectively, for determining the spatial point coordinates of two return light reflection balls in the second image according to the focal length of the second camera, the initial value of the external orientation parameter and the image point coordinates of the two return light reflection balls in the second image for any second image;
[0063] A spatial distance determination module, connected to the spatial point coordinate determination module, for determining the spatial distance between the two light return reflection balls according to the spatial point coordinates of the two light return reflection balls;
[0064] an error equation determination module, connected to the spatial point coordinate determination module, the spatial distance determination module, the intrinsic parameter acquisition unit and the extrinsic parameter determination unit, respectively, and configured to determine an extended error equation according to the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, the initial values of the extrinsic orientation parameters, and the spatial point coordinates and spatial distances of the two backlight reflection balls in each second image;
[0065] The optimal parameter determination module is connected to the error equation determination module and is used to determine the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera and the optimal extrinsic parameters according to the extended error equation by using the bundle adjustment method.
[0066] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: a large-scale virtual calibration field is constructed by using the two-dimensional coordinates of the image plane of the retroreflective balls at both ends of the length ruler, and the rotation matrix and translation matrix of the second camera relative to the first camera are determined according to the essential matrix, and the initial values of the intrinsic parameters and the initial values of the exterior orientation parameters of the two cameras are optimized by the bundle adjustment method to realize the joint calibration of the two cameras, and the intrinsic parameters, exterior orientation parameters and distortion coefficients of the cameras can be calibrated at the same time, which reduces the calibration cost and improves the accuracy, and provides a reference and data basis for the measurement of large-size workpieces at a long distance and a large field of view. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0068] Figure 1 It is a schematic diagram of the process of the dual-camera joint calibration method for ultra-large-scale visual measurement of the present invention;
[0069] Figure 2 It is a module schematic diagram of the dual-camera joint calibration system for ultra-large-scale visual measurement of the present invention;
[0070] Figure 3 It is a structural schematic diagram of a dual-camera joint calibration system for ultra-large-scale visual measurement of the present invention;
[0071] Figure 4 This is a schematic diagram of the structure of a drone carrying a length ruler;
[0072] Figure 5 Reconstruction error histogram for the length scale.
[0073] Explanation of symbols:
[0074] First camera-1, second camera-2, host computer-3, initialization unit-31, two-dimensional coordinate determination unit-32, essential matrix determination unit-33, external parameter determination unit-34, optimization unit-35, measurement unit-36, drone-4, length ruler-5, retroreflective ball-6, tripod-7, synchronization trigger-8. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] The purpose of the present invention is to provide a dual-camera joint calibration method and system for ultra-large-scale visual measurement. A large-scale virtual calibration field is constructed by using the two-dimensional coordinates of the image plane of the backlight reflection balls at both ends of the length ruler, and the initial values of the internal parameters and the external orientation parameters of the two cameras are optimized by the bundle adjustment method to realize the joint calibration of the dual cameras. There is no need to build a calibration wall, which reduces the calibration cost and improves the accuracy, providing a reference and data basis for the measurement of large-size workpieces at a long distance and a large field of view.
[0077] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0078] like Figure 1 As shown, the dual-camera joint calibration method for ultra-large-scale visual measurement of the present invention includes:
[0079] S1: Initialize the intrinsic parameters of the first camera and the second camera to obtain the initial values of the intrinsic parameters of the first camera and the second camera. The initial values of the intrinsic parameters include the focal length c, the position of the principal point on the image plane (x0, y0), the radial distortion parameters K1, K2, K3, and the eccentric distortion parameters P1 and P2.
[0080] In this embodiment, the static photogrammetry system is first used to calibrate the initial values of the intrinsic parameters of the two cameras, and the initial values of the intrinsic parameters of the two cameras are obtained. Then, the laser tracker is used to measure the center distance of the light reflection balls at both ends of the length ruler to obtain the length L of the length ruler.
[0081] S2: The drone carries the length ruler and flies in various postures in the measurement space. Both ends of the length ruler are provided with reflective balls. Specifically, the measurement space is preferably an outdoor space. The drones are distributed as evenly as possible in the measurement space. At each position, the drone rotates so that the length ruler faces different directions. The drone hovers once in each direction to increase the number of image point observation data and provide multi-directional length constraints for the bundle adjustment. The combination of a position and a direction of the length ruler is a posture.
[0082] S3: The first camera and the second camera are used to collect images of the light-reflecting balls at both ends of the length scale in each posture to obtain an image set. The image set includes multiple pairs of first images and second images. The first image is an image collected by the first camera, and the second image is an image collected by the second camera.
[0083] Specifically, when the drone is hovering, two cameras synchronously collect images of the backlight reflection ball in each posture. After the camera takes an image at one position, the drone moves to another position to hover and rotate to take pictures. When the movement and rotation process of the length ruler is completed, the spatial coordinates of the backlight reflection ball establish a large virtual calibration field covering the measurement space. The virtual calibration field provides a large number of three-dimensional spatial points and spatial distances to solve the initial values of the exterior orientation parameters and provide length constraints for the self-calibration beam adjustment.
[0084] S4: Determine the image plane two-dimensional coordinates of each returning light reflection ball in each first image and each second image.
[0085] S5: Determine the essential matrix according to the two-dimensional coordinates of the image plane of each back-light reflection ball in each first image and each second image. In this embodiment, the five-point method is used to determine the essential matrix. Specifically, the essential matrix is determined according to the two-dimensional coordinates of the image plane of 5 pairs of non-collinear back-light reflection balls. The present invention uses the five-point method to relatively orient the camera. The five-point method only uses the coordinates of five pairs of image plane matching points to solve the essential matrix between images, and obtains the rotation matrix and translation vector between the two cameras by decomposing the essential matrix. Compared with other minimum point algorithms, the five-point method solves the solution space of the essential matrix without losing solutions, and can also achieve good results when processing planar scenes.
[0086] S6: Determine the rotation matrix and translation matrix of the second camera relative to the first camera according to the intrinsic matrix. The rotation matrix and translation matrix are initial values of the exterior orientation parameters of the first camera and the second camera.
[0087] S7: Using the bundle adjustment method, the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters are optimized to obtain the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal exterior parameters.
[0088] S8: According to the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera and the optimal extrinsic parameters, the first camera and the second camera are used to measure the large-sized workpiece. After the two cameras are calibrated, the photogrammetry method or other methods can be used to measure the size of the large workpiece.
[0089] Furthermore, step S4 specifically includes:
[0090] S41: Binarization is performed on each first image and each second image to obtain a corresponding binary image. In this embodiment, each first image and each second image is binarized using the im2bw function to obtain a corresponding binary image.
[0091] S42: Mark the connected regions of each binary image, and use the grayscale centroid method to solve the center coordinates of the brightness values of the connected regions in each binary image. The center coordinates of the brightness values of the connected regions are the two-dimensional coordinates of the image plane of the backlight reflection ball. Specifically, the two-dimensional coordinates of the image plane of the backlight reflection ball are determined according to the following formula:
[0092]
[0093] in, is the two-dimensional coordinate of the image plane of the retroreflector, is the set of pixels in the connected area, and f(u,v) is the grayscale value of the pixel with coordinates (u,v).
[0094] Before step S4, the image points on the first camera and the second camera images need to be matched. The image points are matched using the sparsity and relative position relationship of the target points (retroreflection balls) on the image. That is, each image contains only two target points (retroreflection balls), so the top, bottom, left, and right points in the first image must correspond to the top, bottom, left, and right points in the second image.
[0095] In the field of measurement, camera models are usually used to express the relationship between three-dimensional scene information and two-dimensional information in the image. Since the camera imaging geometric model is only related to the three-dimensional information of the space, the various camera parameters and the relative motion parameters between the objects in the space, and has nothing to do with the grayscale information of the two-dimensional image. Therefore, establishing a camera model is to establish the coordinate relationship between the three-dimensional real world information and the two-dimensional space information of the image, and the geometric model parameters are the camera parameters. In order to solve the problem that the solutions of each camera parameter are not unique, the present invention models the external orientation parameters of the dynamic camera measurement through the relative posture between the cameras. The model establishes the spatial coordinate system on the camera coordinate system of the left camera (the first camera), so that the angle and translation of the external orientation parameters of the left camera are both zero, and the external orientation parameters of the right camera (the second camera) are the rigid body motion parameters of the right camera coordinate system relative to the left camera coordinate system. Using the relative external parameter model, the external orientation parameters to be determined for the dual-camera system will be reduced to 6, eliminating the correlation between the external orientation parameters and the spatial coordinates, and ensuring the reliability and accuracy of the calibration results.
[0096] After the matching is completed, the present invention uses the coordinate system with the optical center of the first camera as the coordinate origin as the world coordinate system to determine the position and posture of the second camera relative to the first camera. The essential matrix satisfies the condition that the light from the origin of the first camera and the second camera to the spatial target point is coplanar with the baseline. According to the coordinate system of the second camera, the rotation matrix and translation matrix Can be switched with the first camera.
[0097] The rotation matrix R represents the rotation transformation between the second camera coordinate system and the first camera coordinate system, and the rotation angles around the X, Y, and Z axes are Calculated. b1=cos(ω)sin(κ); b2=cos(ω)cos(κ); b3=-sin(ω);
[0098] The formula is derived: x' T K' -T [t] x R -1 x=0, where x, x' represent the coordinates of the corresponding image points in the first image and the second image respectively [xy 1]', K is the intrinsic parameter matrix of the first camera, and K' is the intrinsic parameter matrix of the second camera. Let X=K -1 x,X'=K' -1 x', E = [t] x R, the simplified formula is X' TEX=0. E is the essential matrix, and X and X' are the corresponding two-dimensional coordinates of the image plane. Substitute 5 or more pairs of non-collinear two-dimensional coordinates of the image plane of the return light reflection point into the above formula for solution, and select the solution with the smallest back-projection residual as the correct solution. By decomposing the correct essential matrix, the rotation matrix R and the translation matrix T are obtained, that is, the initial values of the exterior orientation parameters between the cameras are obtained.
[0099] Furthermore, step S7 specifically includes:
[0100] S71: For any second image, determine the spatial point coordinates of the two light-reflecting balls in the second image according to the focal length of the second camera, the initial value of the exterior orientation parameter, and the image point coordinates of the two light-reflecting balls in the second image. Specifically, determine the spatial point coordinates of the light-reflecting balls according to the following formula:
[0101]
[0102] Among them, (X, Y, Z) are the spatial coordinates of the reflected light ball, (x r ,y r ) is the image point coordinate of the reflected light ball in the second image, c is the focal length, is the rotation matrix, is the translation matrix, ω, κ is the rotation angle of the second camera relative to the first camera around the X, Y, and Z axes, respectively, T x 、T y 、T z are the translation amounts of the second camera relative to the first camera along the X, Y, and Z axes, respectively.
[0103] Specifically, it is known that the image point coordinates (x r ,y r ), the initial values of the camera's internal orientation parameters [c x0 y0 K1 K2 K3 P1 P2] and the initial values of the external orientation parameters between the cameras Use the collinear equation to solve the spatial point coordinates (X, Y, Z) of the reflected light sphere.
[0104] S72: Determine the spatial distance between the two light-returning reflection balls according to the spatial point coordinates of the two light-returning reflection balls.
[0105] S73: determining an extended error equation according to the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, the initial values of the exterior orientation parameters, and the spatial point coordinates and spatial distances of two return light reflection balls in each second image.
[0106] S74: Using the bundle adjustment method, according to the extended error equation, determine the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal extrinsic parameters.
[0107] Since the principal point position and distortion parameters are not considered in the relative exterior orientation parameter solution process, the relative exterior orientation parameters obtained are inaccurate and need to be further optimized through the light bundle adjustment process. The spatial distance s between the two retroreflection balls can be calculated based on the spatial point coordinates (X, Y, Z) of the retroreflection ball. m , a large number of spatial distances are introduced into the bundle adjustment process as spatial constraints to eliminate the correlation between unknown parameters and the lack of rank in the normal equation.
[0108] Specifically, a dual-camera dynamic photogrammetry system is combined with length-scale imaging of n poses to construct a large-scale extended error equation: Where v is the residual error of the image point, which represents the deviation between the measured coordinates of the target point on the image plane and the true coordinates; l is the simplified observation vector, which represents the difference between the measured coordinates of the target point on the image plane and the coordinates obtained by solving the estimated values of each parameter. A represents the Jacobian matrix of the collinear equation derived with respect to the camera's internal orientation parameters, distortion coefficients, and external orientation parameters; B represents the Jacobian matrix of the collinear equation derived with respect to the coordinates of the space point; and Represent the correction of camera parameters and spatial coordinates respectively. Through the error equation, the internal parameters of the two cameras, the relative external orientation parameters and the spatial coordinates of the return light reflection ball are optimized and solved. Finally, the internal and external parameters of the camera are optimized to complete the calibration and orientation of the camera.
[0109] Since there is no pre-calibration information, and the self-calibration bundle adjustment requires relatively accurate initial parameter values, an effective method is needed to solve the defined relative exterior orientation parameters. Relative orientation is a common technique for locating oriented images in computer vision. It only uses the image plane coordinate information of the target point to determine the rotation matrix and translation vector between the two images, which is very suitable for solving the relative exterior orientation parameters of dynamic photogrammetry cameras.
[0110] In the stage of estimating the relative exterior orientation parameters, the camera's principal point coordinates and distortion parameters are set to zero, and all parameters are optimized in the subsequent adjustment process. For a spatial point, the collinear equations on its left and right sides are simplified as:
[0111]
[0112] Among them, xy li is the image point coordinate vector of the spatial point i in the first camera (left camera), xy ri is the image point coordinate vector of space point i in the second camera (right camera); I lis the intrinsic parameter vector of the left camera, I r is the intrinsic parameter vector of the right camera; Er is the exterior orientation parameter vector of the right camera relative to the left camera, including three angles and three translations; X i is the three-dimensional coordinate vector of the space point i. For any image point, the linear change of the collinear equation is approximately:
[0113]
[0114] Among them, v li is the residual error of the image point in the first image, v ri is the residual error of the image point in the first image, l li is the simplified observation vector of the first image, l ri is the simplified observation vector of the second image. li A represents the Jacobian matrix of the collinear equation f with respect to the internal orientation parameters, distortion coefficients and external orientation parameters of the first camera. ri The Jacobian matrix representing the derivative of the collinear equation f with respect to the internal orientation parameters, distortion coefficients, and external orientation parameters of the second camera, B li represents the Jacobian matrix of the collinear equation f with respect to the coordinates of the spatial point in the first image, B ri represents the Jacobian matrix of the collinear equation f with respect to the coordinates of the spatial point in the second image, δ l and They represent the correction of the first camera parameters and the spatial coordinates of the reflected light sphere, δ r and They represent the correction values of the second camera parameters and space coordinates respectively.
[0115] The length scale of n postures provides 2n spatial points. According to the imaging on the image plane of the left and right cameras, n point-to-point distances in space are also provided as constraints, where the mth distance is:
[0116]
[0117] Among them, s m is the distance between the two light-reflecting balls on the length scale in the mth posture, m1 and m2 represent the two light-reflecting balls on the length scale in the mth posture, (X m1 ,Y m1 ,Z m1 ) and (X m2 ,Y m2 ,Z m2 ) are the spatial coordinates of the two reflective balls on the length scale in the mth posture. In order to make the nonlinear expression participate in the beam adjustment calculation process as a constraint condition, it needs to be linearized, and its linear correction equation is:
[0118]
[0119] Among them, C m1 and C m2 They represent the Jacobian matrix of the distance equation derived from the spatial coordinates of the two reflective balls in the mth posture, δ m1 and They respectively represent the correction values of the coordinates of the two reflected light balls in the mth posture.
[0120] The present invention introduces the marker point-point distance into the bundle adjustment process as a spatial constraint to eliminate the correlation between unknown parameters. The dual-camera system images n length scale postures, including the image point error equation and the extended error equation of the point-point distance constraint:
[0121]
[0122] The subscript (i, j, j) represents the imaging point of the kth (k = 1, 2)th reflected light ball on the length scale of the jth (j = 1, 2, ..., n)th posture on the i-th (i = 1, 2)th camera.
[0123] The normal equation corresponding to the error equation is:
[0124]
[0125] Among them, P represents the diagonal matrix of the weights of the image points and spatial distance data. Since the coefficient matrix N in the error correction equation is a (22+6n)×(22+6n) matrix, n is the number of attitudes of the length scale, and the calculation of the coefficient matrix is huge, the block matrix method is used to solve it, and the correction value δ of the camera parameters and the spatial coordinates of the backlight reflection ball is obtained. The estimated values of the camera parameters and the spatial coordinates of the backlight reflection ball are continuously corrected by iteration until the bundle adjustment process converges.
[0126] After the dual-camera calibration and orientation is completed, the accuracy of the calibration result is evaluated by the posterior unit weighted mean error value obtained by solving the variance-covariance matrix of the camera's internal and external orientation parameters. Since the distance L between the centers of the two end reflective spheres under each attitude is known, the ratio of the root mean square error of the reconstructed length scale to the diagonal length of the measurement space volume can be used as the external accuracy evaluation of the system.
[0127] like Figure 2 , Figure 3 and Figure 4 As shown, the dual-camera joint calibration system for ultra-large-scale visual measurement of the present invention includes: a first camera 1, a second camera 2, a drone 4, a length ruler 5 and a host computer 3; both ends of the length ruler 5 are provided with retroreflective balls 6.
[0128] The drone 4 is used to carry the length ruler 5 and fly in various postures in the measurement space.
[0129] The first camera 1 and the second camera 2 are used to collect images of the retroreflective balls 6 at both ends of the length ruler 5 to obtain an image set; the image set includes multiple pairs of first images and second images; the first image is the image collected by the first camera 1, and the second image is the image collected by the second camera 2.
[0130] The host computer 3 includes: an initialization unit 31 , a two-dimensional coordinate determination unit 32 , an essential matrix determination unit 33 , an extrinsic parameter determination unit 34 , an optimization unit 35 and a measurement unit 36 .
[0131] The initialization unit 31 is connected to the first camera 1 and the second camera 2 respectively, and is used to initialize the intrinsic parameters of the first camera 1 and the second camera 2 to obtain the initial values of the intrinsic parameters of the first camera 1 and the second camera 2 .
[0132] The two-dimensional coordinate determination unit 32 is connected to the first camera 1 and the second camera 2 respectively, and is used to determine the image plane two-dimensional coordinates of each return light reflection ball 6 in each first image and each second image.
[0133] The intrinsic matrix determination unit 33 is connected to the two-dimensional coordinate determination unit 32, and the intrinsic matrix determination unit 33 is used to determine the intrinsic matrix according to the two-dimensional coordinates of the image plane of each return light reflection ball 6 in each first image and each second image.
[0134] The extrinsic parameter determination unit 34 is connected to the intrinsic matrix determination unit 33, and is used to determine the rotation matrix and translation matrix of the second camera 2 relative to the first camera 1 according to the intrinsic matrix. The rotation matrix and translation matrix are the initial values of the extrinsic orientation parameters of the first camera 1 and the second camera 2.
[0135] The optimization unit 35 is connected to the initialization unit 31 and the external parameter determination unit 34 respectively. The optimization unit 35 is used to optimize the initial values of the intrinsic parameters of the first camera 1, the initial values of the intrinsic parameters of the second camera 2 and the initial values of the external orientation parameters by using the bundle adjustment method to obtain the optimal intrinsic parameters of the first camera 1, the optimal intrinsic parameters and the optimal external parameters of the second camera 2.
[0136] The measuring unit 36 is connected to the optimization unit 35, the first camera 1 and the second camera 2 respectively. The measuring unit 36 is used to measure the large-size workpiece through the first camera 1 and the second camera 2 according to the optimal internal parameters of the first camera 1, the optimal internal parameters and the optimal external parameters of the second camera 2.
[0137] Furthermore, the two-dimensional coordinate determination unit 32 includes a binary module and a marking module.
[0138] The binary module is connected to the first camera 1 and the second camera 2 respectively, and is used to perform binarization processing on each first image and each second image to obtain a corresponding binary image.
[0139] The marking module is connected to the binarization module, and is used to mark the connected areas of each binary image and use the grayscale centroid method to solve the central coordinates of the brightness values of the connected areas in each binary image; the central coordinates of the brightness values of the connected areas are the two-dimensional coordinates of the image plane of the return light reflection ball 6.
[0140] Furthermore, the initial values of the intrinsic parameters include focal length, position of the principal point on the image plane, radial distortion parameters and eccentric distortion parameters;
[0141] The optimization unit 35 includes: a space point coordinate determination module, a space distance determination module, an error equation determination module and an optimal parameter determination module.
[0142] Among them, the spatial point coordinate determination module is respectively connected to the initialization unit 31 and the external parameter determination unit 34, and the spatial point coordinate determination module is used to determine the spatial point coordinates of the two returning light reflecting balls in the second image according to the focal length of the second camera, the initial value of the external orientation parameter and the image point coordinates of the two returning light reflecting balls in the second image for any second image.
[0143] The spatial distance determination module is connected to the spatial point coordinate determination module, and the spatial distance determination module is used to determine the spatial distance between the two light return reflection balls according to the spatial point coordinates of the two light return reflection balls.
[0144] The error equation determination module is respectively connected to the spatial point coordinate determination module, the spatial distance determination module, the intrinsic parameter acquisition unit and the external parameter determination unit 34, and the error equation determination module is used to determine the extended error equation according to the initial values of the intrinsic parameters of the first camera 1, the initial values of the intrinsic parameters of the second camera 2, the initial values of the external orientation parameters, the spatial point coordinates and the spatial distance of the two returning light reflection balls in each second image.
[0145] The optimal parameter determination module is connected to the error equation determination module, and the optimal parameter determination module is used to determine the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera and the optimal extrinsic parameters according to the expanded error equation by using the bundle adjustment method.
[0146] In order to ensure that the relative position and absolute position of the two cameras do not change during the measurement and to ensure the accuracy of the measurement results, the dual-camera joint calibration system for ultra-large-scale visual measurement of the present invention further includes a tripod 7. The number of the tripods 7 is two, and the two tripods 7 are used to fix the positions of the first camera 1 and the second camera 2, respectively.
[0147] In order to illuminate the object to be measured while taking photos, the dual-camera joint calibration system for ultra-large-scale visual measurement of the present invention also includes a flash. The flash is set on the first camera 1 and the second camera 2. In addition, in order to reduce the influence of ambient light sources, the experiment was carried out at night.
[0148] The dual-camera joint calibration system for ultra-large-scale visual measurement of the present invention also includes a synchronization trigger 8. In this embodiment, the synchronization trigger 8 adopts an Altai USB3202-0 data acquisition card. By changing the high and low levels, the image acquisition signal is synchronously sent to the two cameras to ensure that the left and right cameras and the flash are exposed and collect photos at the same time. When there is a lot of background image information in the measurement, the shutter time can be reduced to reduce the background brightness, the flash intensity can be increased, and the target brightness can be improved.
[0149] The first camera 1 and the second camera 2 have four interfaces, namely, network cable port, signal input, signal output and power supply. The network cable is connected to the computer and is responsible for transmitting the pictures collected by the front-end camera. The signal input is connected to the camera through a USB data logger to provide the camera with a synchronous photo signal. The signal output is connected to the flash to ensure that the flash is triggered at the same time as the camera takes a photo. The power cord powers the camera. Camera image acquisition is achieved by using the matching GigE Sample Viewer for Windows v1.26 software.
[0150] After the system is ready, the drone 4 carrying the length ruler 5 is controlled to fly to the measurement space. In order to accurately calibrate the camera's internal orientation parameters and distortion coefficients, the drone 4 is distributed as evenly as possible in the measurement space, and the length ruler 5 is rotated to different directions at each position to increase the number of image plane point observation data and provide multi-directional length constraints for bundle adjustment.
[0151] In order to better understand the solution of the present invention, it is further described below in conjunction with a specific experimental process.
[0152] During the experiment, the measurement space size was 40m (length) × 10m (width) × 14m (depth), the camera resolution was 4872 × 3248 pixels, and the pixel size was 7.4μm × 7.4μm. 40 posture pictures were taken of the drone carrying the length ruler. Table 1 lists the calibration results and posterior standard deviations of the internal orientation parameters and distortion coefficients after bundle adjustment optimization, and Table 2 lists the calibration results of the relative exterior orientation parameters.
[0153] Table 1 Calibration results of internal orientation parameters and distortion coefficients after bundle adjustment
[0154]
[0155] Table 2 Calibration results of relative exterior orientation parameters of two cameras
[0156]
[0157] According to the above data, it can be found that the present invention successfully calibrates the internal and external parameters of each camera. The camera calibration accuracy is verified by reconstructing the virtual length array, where the number represents the number of postures. As can be seen from the figure, the length scale distribution is consistent with the actual shooting position.
[0158] Table 3 Average error, root mean square error and maximum error of reconstructed length scale
[0159]
[0160] Table 3 shows the statistical results of the length error of the length scale obtained through 3D reconstruction. The average length of the length scale reconstructed in 40 postures is 983.3918 mm, and the length of the length scale measured by the laser tracker is 983.1979 mm. The average error of the length scale is 0.1939 mm, and the root mean square error is 2.3163 mm. Its relative precision is about 1 / 20000. Figure 5 The histogram of the length reconstruction error of the length scale is attached with a normal density curve, where the error value refers to the difference from the mean of the reconstructed length. It can be seen that the length reconstruction error presents an obvious normal distribution, indicating that there is no systematic error in the calibration result.
[0161] It can be found from the experimental results and precision analysis that the calibration results of the camera have high reliability and accuracy. The present invention can be used to conveniently, accurately and simultaneously calibrate the internal and external parameters of the dual-camera system. According to the experimental data and analysis, the measurement network is the source of error. Self-calibration has high requirements for the measurement network, requiring a stable and spatially uniformly distributed three-dimensional point array. However, drones are severely affected by the environment, making it difficult to meet the ideal grid construction, thus causing errors. Subsequently, a drone platform with better stability can be used to make its control accuracy higher and ensure the standard degree of grid construction.
[0162] The present invention extends the theoretical solution model from indoors to outdoors, and verifies that the method has high reliability and accuracy in a super-large range. The present invention can complete the calibration by using only a length ruler and a drone to construct a calibration field. Different from the previous methods, a large-scale virtual calibration field is constructed using a length ruler to replace the traditional calibration field, and the spatial length is used as a constraint to perform a joint adjustment solution for the dual-camera system. The intrinsic parameters, external orientation parameters and distortion coefficients of the two cameras can be calibrated at the same time, solving the problems of small field of view, high cost, difficult production and cumbersome layout of the traditional method, and having greater flexibility. It provides a reference and data basis for the measurement of large-size workpieces at long distances and large fields of view, and has greater applicability and versatility.
[0163] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0164] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A dual-camera joint calibration method for ultra-large-scale visual measurement, characterized in that: The dual-camera joint calibration method for ultra-large-scale visual measurement includes: Initializing the intrinsic parameters of the first camera and the second camera to obtain initial values of the intrinsic parameters of the first camera and the second camera; The drone carries a length ruler and flies in various postures in the measurement space; both ends of the length ruler are provided with back-light reflecting balls; The first camera and the second camera are used to collect images of the light-reflecting balls at both ends of the length scale in each posture to obtain an image set; the image set includes multiple pairs of first images and second images; the first image is an image collected by the first camera, and the second image is an image collected by the second camera; Determine the image plane two-dimensional coordinates of each return light reflection ball in each first image and each second image; Determine the essential matrix according to the two-dimensional coordinates of the image plane of each return light reflection ball in each first image and each second image; Determine a rotation matrix and a translation matrix of the second camera relative to the first camera according to the intrinsic matrix; the rotation matrix and the translation matrix are initial values of exterior orientation parameters of the first camera and the second camera; Using a bundle adjustment method, the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters are optimized to obtain optimal intrinsic parameters of the first camera, optimal intrinsic parameters of the second camera, and optimal exterior parameters; According to the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters and the optimal extrinsic parameters of the second camera, the large-size workpiece is measured by the first camera and the second camera.
2. The dual-camera joint calibration method for ultra-large-scale visual measurement according to claim 1 is characterized in that: The determining of the image plane two-dimensional coordinates of each return light reflection ball in each first image and each second image specifically includes: Binarizing each first image and each second image to obtain a corresponding binary image; Connected regions of each binary image are marked, and the center coordinates of the brightness values of the connected regions in each binary image are solved by using the grayscale centroid method; the center coordinates of the brightness values of the connected regions are the two-dimensional coordinates of the image plane of the backlight reflection ball.
3. The dual-camera joint calibration method for ultra-large-scale visual measurement according to claim 2 is characterized in that: The binarization of each first image and each second image to obtain a corresponding binary image specifically includes: The im2bw function is used to binarize each first image and each second image to obtain a corresponding binary image.
4. The dual-camera joint calibration method for ultra-large-scale visual measurement according to claim 2 is characterized in that: According to the following formula, determine the two-dimensional coordinates of the image plane of the retroreflective sphere: in, is the two-dimensional coordinate of the image plane of the retroreflection sphere, is the set of pixels in the connected area, and f(u,v) is the grayscale value of the pixel with coordinates (u,v).
5. The dual-camera joint calibration method for ultra-large-scale visual measurement according to claim 1 is characterized in that: Determining the essential matrix according to the image plane two-dimensional coordinates of each return light reflection ball in each first image and each second image specifically includes: The essential matrix is determined based on the two-dimensional coordinates of the image plane of five pairs of non-collinear retroreflection spheres.
6. The dual-camera joint calibration method for ultra-large-scale visual measurement according to claim 1 is characterized in that: The initial values of the internal parameters include focal length, position of the principal point on the image plane, radial distortion parameters and eccentric distortion parameters; The bundle adjustment method is used to optimize the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters to obtain the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal exterior parameters, specifically including: For any second image, determine the spatial point coordinates of the two light-returning reflection balls in the second image according to the focal length of the second camera, the initial value of the exterior orientation parameter and the image point coordinates of the two light-returning reflection balls in the second image; According to the spatial point coordinates of the two retroreflection balls, the spatial distance between the two retroreflection balls is determined; Determine an extended error equation according to the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, the initial values of the exterior orientation parameters, and the spatial point coordinates and spatial distances of two retroreflection balls in each second image; The bundle adjustment method is used to determine the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal extrinsic parameters according to the expanded error equation.
7. The dual-camera joint calibration method for ultra-large-scale visual measurement according to claim 6 is characterized in that: According to the following formula, the spatial coordinates of the reflective ball are determined: b1=cos(ω)sin(κ); b2=cos(ω)cos(κ); b3=-sin(ω); Among them, (X, Y, Z) are the spatial coordinates of the reflected light ball, (x r ,y r ) is the image point coordinate of the reflected light ball in the second image, c is the focal length, is the rotation matrix, is the translation matrix, ω, κ is the rotation angle of the second camera relative to the first camera around the X, Y, and Z axes, respectively, T x , T y , T z are the translation amounts of the second camera relative to the first camera along the X, Y, and Z axes, respectively.
8. A dual-camera joint calibration system for ultra-large-scale visual measurement, characterized in that: The dual-camera joint calibration system for ultra-large-scale visual measurement includes: a first camera, a second camera, a drone, a length ruler and a host computer; both ends of the length ruler are provided with backlight reflection balls; The drone is used to carry the length ruler and fly in various postures in the measurement space; The first camera and the second camera are used to collect images of the light-reflecting balls at both ends of the length ruler to obtain an image set; the image set includes multiple pairs of first images and second images; the first image is an image collected by the first camera, and the second image is an image collected by the second camera; The host computer comprises: an initialization unit, connected to the first camera and the second camera respectively, for initializing the intrinsic parameters of the first camera and the second camera, and obtaining an initial value of the intrinsic parameter of the first camera and an initial value of the intrinsic parameter of the second camera; A two-dimensional coordinate determination unit, connected to the first camera and the second camera respectively, for determining the image plane two-dimensional coordinates of each return light reflection ball in each first image and each second image; An essential matrix determining unit, connected to the two-dimensional coordinate determining unit, for determining the essential matrix according to the image plane two-dimensional coordinates of each return light reflecting ball in each first image and each second image; an extrinsic parameter determination unit, connected to the intrinsic matrix determination unit, and configured to determine a rotation matrix and a translation matrix of the second camera relative to the first camera according to the intrinsic matrix; the rotation matrix and the translation matrix are initial values of the extrinsic orientation parameters of the first camera and the second camera; an optimization unit, connected to the initialization unit and the extrinsic parameter determination unit, respectively, for optimizing the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, and the initial values of the exterior orientation parameters by using a bundle adjustment method, so as to obtain the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera, and the optimal extrinsic parameters; The measuring unit is connected to the optimization unit, the first camera and the second camera respectively, and is used to measure the large-size workpiece through the first camera and the second camera according to the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera and the optimal extrinsic parameters.
9. The dual-camera joint calibration system for ultra-large-scale visual measurement according to claim 8, characterized in that: The two-dimensional coordinate determination unit comprises: A binarization module, connected to the first camera and the second camera respectively, for performing binarization processing on each first image and each second image to obtain a corresponding binary image; The marking module is connected to the binarization module and is used to mark the connected areas of each binary image and use the grayscale centroid method to solve the central coordinates of the brightness values of the connected areas in each binary image; the central coordinates of the brightness values of the connected areas are the two-dimensional coordinates of the image plane of the backlight reflection ball.
10. The dual-camera joint calibration system for ultra-large-scale visual measurement according to claim 8, characterized in that: The initial values of the internal parameters include focal length, position of the principal point on the image plane, radial distortion parameters and eccentric distortion parameters; The optimization unit comprises: a spatial point coordinate determination module, connected to the initialization unit and the external parameter determination unit, respectively, for determining the spatial point coordinates of two return light reflection balls in the second image according to the focal length of the second camera, the initial value of the external orientation parameter and the image point coordinates of the two return light reflection balls in the second image for any second image; A spatial distance determination module, connected to the spatial point coordinate determination module, for determining the spatial distance between the two light return reflection balls according to the spatial point coordinates of the two light return reflection balls; an error equation determination module, connected to the spatial point coordinate determination module, the spatial distance determination module, the intrinsic parameter acquisition unit and the extrinsic parameter determination unit, respectively, and configured to determine an extended error equation according to the initial values of the intrinsic parameters of the first camera, the initial values of the intrinsic parameters of the second camera, the initial values of the extrinsic orientation parameters, and the spatial point coordinates and spatial distances of the two backlight reflection balls in each second image; The optimal parameter determination module is connected to the error equation determination module and is used to determine the optimal intrinsic parameters of the first camera, the optimal intrinsic parameters of the second camera and the optimal extrinsic parameters according to the extended error equation by using the bundle adjustment method.
Citation Information
Patent Citations
Method for camera calibration and relative orientation
CN108182709A
Camera parameter calibration method and system under condition long-distance large field of view
CN108510551A
Three-dimensional distance measurement method for adaptively adjusting baseline of binocular camera
CN111402315A
Method for measuring size of object by monocular camera based on two-dimensional code
CN113822942A
Visual positioning method and device, server and computer readable storage medium
CN113920192A
