Multi-view camera external parameter calibration method based on sphere

By using the sphere calibration and beam method adjustment optimization system in the multi-camera, the problem of low camera external parameter calibration accuracy in the existing technology is solved, and accurate calibration of the camera external parameters and three-dimensional points is achieved, ensuring the authenticity of the results. World size compliance.

CN118736017APending Publication Date: 2024-10-01HUBEI CHUCK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410675969.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing camera extrinsic parameter calibration methods cannot ensure that the reprojection error of all three-dimensional points within the device space is minimized, resulting in low calculation accuracy in the global range, possible introduction of systematic errors and non-convergence of the results, and the size does not match the size of the real world.

Method used

Using a sphere-based multi-camera external parameter calibration method, a sphere with a known radius is placed inside the multi-camera surround equipment, the sphere calibration pictures are taken, distortion correction and ellipse detection are performed, and the beam adjustment optimization system is used, combined with The internal parameters of the camera and the center coordinates and major and minor axes of the ellipse are optimized to obtain the external parameters of the camera and three-dimensional points that match the real size.

Benefits of technology

It improves the accuracy of multi-objective camera calibration, ensures calculation accuracy on a global scale, and obtains camera extrinsic parameters consistent with real-world dimensions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736017A_ABST
    Figure CN118736017A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-view camera external parameter calibration method based on a sphere, and the method comprises the following steps: S1, placing a sphere with a known radius in a multi-view camera surrounding type device, enabling the sphere to make spatial displacement, and shooting and recording a sphere calibration picture of each time, the method comprises the following steps: moving a sphere with a known diameter for multiple times in a multi-view camera surrounding equipment range, shooting and recording a sphere calibration picture, carrying out distortion correction on an original sphere calibration picture based on camera internal reference to obtain a distortion correction picture sequence, carrying out ellipse detection on the distortion correction sequence, screening out a calibration sphere picture which is not shot, and meanwhile, carrying out ellipse detection on the distortion correction picture sequence. The pixel coordinates of the circle center of the ellipse and the long axis and the short axis of the ellipse are detected, the camera internal reference, the pixel coordinates of the circle center of the ellipse and the long axis and the short axis of the ellipse are added into a bundle adjustment system to calibrate the camera external reference, the camera external reference conforming to the actual size of the real world is obtained, and the calibration accuracy of the multi-view camera is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of camera calibration, and in particular to a sphere-based multi-eye camera extrinsic parameter calibration method. Background Art

[0002] Camera extrinsics describe the position and rotation relationship of a set of cameras in the world coordinate system. In the field of visual measurement and visual 3D reconstruction, the calibration accuracy of camera extrinsics directly affects the accuracy of measurement and reconstruction results. Previous camera extrinsic calibration methods preset a fixed set of 3D points and optimized camera extrinsics based on the reprojection error from 3D points to 2D points.

[0003] Although this method is fast, it cannot ensure that the reprojection errors of all 3D points within the device space are minimized, so the calculation accuracy is low in the global scope. Due to the introduction of systematic errors, it may also cause the results to not converge and the size to be inconsistent with the real world size. Summary of the invention

[0004] The present invention provides a sphere-based multi-camera extrinsic calibration method, which can effectively solve the problem raised in the above background technology that it is impossible to ensure that the reprojection errors of all three-dimensional points within the device space range are minimized, so the calculation accuracy is low in the global range. Due to the introduction of systematic errors, it may also cause the results to not converge and the size does not match the real world size.

[0005] To achieve the above object, the present invention provides the following technical solution: a multi-camera extrinsic calibration method based on a sphere, comprising the following steps:

[0006] Step S1, placing a sphere with a known radius inside a multi-camera surround device, allowing the sphere to move in space and taking and recording each sphere calibration picture;

[0007] Step S2, performing distortion correction on the original sphere calibration image based on known camera intrinsic parameters to obtain a distortion correction image sequence;

[0008] Step S3: Since the image is distorted, the ball appears as an ellipse in the image after distortion removal. Therefore, ellipse detection is performed on the distortion correction image sequence, and the image sequence that does not capture the calibration ball is screened, that is, to ensure that the sphere pixels are completely present in each camera image plane of the multi-camera surround device in each shot, and at the same time, the center coordinates and the size of the major and minor axes of the corresponding ball are detected from the image;

[0009] Step S4, the camera intrinsic parameters, the coordinates of the center of the circle and the size of the major and minor axes in the image are known, and these are used as constraints. The N×3 random matrix is ​​used as the initial value of the spherical three-dimensional point, and the M×6×1 random matrix is ​​used as the initial value of the camera pose, and is sent to the bundle adjustment optimization system to optimize the camera extrinsic parameters and three-dimensional points that meet the actual size.

[0010] According to the above technical solution, step S1 is the data preparation part. Ideally, the pixel sequences of the sphere captured multiple times should be evenly distributed on the image plane of each camera;

[0011] Step S2 is the image sequence correction part. The original image of the sphere calibration image is the original image sequence recorded by the multi-camera surround device at each displacement of the sphere.

[0012] Step S3 performs ellipse detection on the distortion correction image sequence, uses the sphere color as a constraint, reduces the amount of calculation so that the ellipse can be accurately detected. If there are undetected or incomplete images in a certain sphere movement image sequence, the sphere calibration image sequence is screened out, that is, it is ensured that in each shot, the sphere pixels are completely present in each camera image plane of the multi-camera surround device;

[0013] Step S4 obtains external parameters through the bundle adjustment optimization system. Specifically, in a three-dimensional scene, the N×3 random matrix is ​​regarded as the three-dimensional point of the ball in the real space, and the M×6×1 random matrix is ​​used as the initial value of the camera posture, which is input into the bundle adjustment system;

[0014] First, perform matrix transformation on the camera external parameters. The first three parameters of each camera posture are used as rotation parameters, and the last three parameters are used as translation parameters. Use the Rodrigues algorithm of opencv to transform the rotation parameters into a matrix.

[0015] R,_ = cv2.Rodrigues(rvec)

[0016]

[0017] Let the center of the sphere be O i The coordinates of the three-dimensional point in real space are (X w ,Y w ,Z w ), the external parameter matrix of the jth camera is T j , then the coordinates of the three-dimensional point in the space in the camera coordinate system (X c ,Y c ,Z c )for:

[0018]

[0019] Camera intrinsic parameter matrix K j It is also known that it can be expressed as:

[0020]

[0021] Use the fitEllipse ellipse detection method of opencv to detect the ellipse from the image I jThe pixel coordinates of the center of the ellipse (x o ,y o ) and the size of the major and minor axes a, b, that is:

[0022] (x o ,y o ),(a,b),_=cv2.fitEllipse(I j )

[0023] Knowing the true radius r of the sphere and the size a, b of the major and minor axes of the ellipse in the image, when the focal length f x =f y =f, based on the three-dimensional point coordinates of the sphere center in the camera coordinate system, the size of the major axis A and minor axis B of the sphere in the image can be calculated:

[0024]

[0025] When the focal length f x ≠f y When the major axis A and the minor axis B are:

[0026]

[0027] Then the size error of the ellipse can be calculated:

[0028]

[0029] The pixel coordinates obtained by reprojecting the sphere center coincide with the coordinates of the ellipse center in the image, so a nonlinear least squares problem about the reprojection error is constructed here. i The reprojected coordinates (x c ,y c )for:

[0030]

[0031] Then the reprojection error can be defined as:

[0032] e2=(x c -x o ) 2 +(y c -y o ) 2

[0033] Based on this, the loss function can be defined as, where λ,μ are weights, then:

[0034] e=λe1+μe2

[0035] Bundle Adjustment is used here to minimize the reprojection error, namely:

[0036]

[0037] In this way, the multi-camera extrinsics that are accurate and consistent with the real-world size are obtained.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] The present invention moves a sphere of known diameter multiple times within the range of a multi-eye camera surround device and shoots and records sphere calibration pictures, performs distortion correction on the original sphere calibration picture based on camera intrinsic parameters to obtain a distortion correction picture sequence, performs ellipse detection on the distortion correction sequence, and while screening out the calibration sphere picture that has not been taken, detects the pixel coordinates of the ellipse center and the major axis and minor axis of the ellipse, adds the camera intrinsic parameters, the pixel coordinates of the ellipse center, the major axis and minor axis of the ellipse into a bundle adjustment system to calibrate the camera extrinsic parameters, obtains the camera extrinsic parameters that meet the actual size of the real world, and improves the accuracy of multi-eye camera calibration. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0041] In the attached picture:

[0042] Figure 1 is a flow chart of the steps of the present invention;

[0043] Figure 2 The pixel sequence of the sphere shot multiple times by the present invention should be evenly distributed on the image plane of each camera;

[0044] Figure 3 is a sequence diagram of original pictures recorded by the multi-camera surround device of the present invention;

[0045] Figure 4 It is a detection schematic diagram of the ellipse detection method of the present invention;

[0046] Figure 5 It is a schematic diagram of the external parameters of a multi-eye camera of the present invention that conforms to the real-world size. DETAILED DESCRIPTION

[0047] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0048] Example: Figure 1-3 As shown, the present invention provides a technical solution, a multi-camera extrinsic calibration method based on a sphere, comprising the following steps:

[0049] Step S1, place a sphere with a known radius inside a multi-camera surround device, allow the sphere to move in space, and take and record each sphere calibration picture. The sphere pixel sequences taken multiple times should be evenly distributed on the image plane of each camera;

[0050] Step S2, performing distortion correction on the original image of the sphere calibration image based on the known camera internal parameters to obtain a sequence of distortion correction images, wherein the original image of the sphere calibration image is a sequence of original images recorded by the multi-camera surround device at each displacement of the sphere;

[0051] Step S3, performing ellipse detection on the distortion correction image sequence, using the sphere color as a constraint, reducing the amount of calculation so that the ellipse can be accurately detected. If there are undetected or incomplete images in a certain sphere movement image sequence, the sphere calibration image sequence is screened out, that is, ensuring that the sphere pixels are completely present in each camera image plane of the multi-camera surround device in each shooting;

[0052] Step S4, obtains external parameters through the bundle adjustment optimization system. Specifically, in a three-dimensional scene, the random matrix of is regarded as the three-dimensional point of the ball in real space, and the random matrix of M×6×1 is used as the initial value of the camera posture, which is input into the bundle adjustment system;

[0053] First, perform matrix transformation on the camera external parameters. The first three parameters of each camera posture are used as rotation parameters, and the last three parameters are used as translation parameters. Use the Rodrigues algorithm of opencv to transform the rotation parameters into a matrix.

[0054] R,_ = cv2.Rodrigues(rvec)

[0055]

[0056] Assume that the coordinates of the 3D point of the center of the sphere in the real space are , and the external parameter matrix of the th camera is , then the coordinates of the 3D point in the space in the camera coordinate system are:

[0057]

[0058] Camera intrinsic parameter matrix K j It is also known that it can be expressed as:

[0059]

[0060] like Figure 4 As shown, using the fitEllipse ellipse detection method of opencv, from image I j The pixel coordinates of the center of the ellipse (x o ,y o ) and the size of the major and minor axes a, b, that is

[0061] (x o ,y o ),(a,b),_=cv2.fitEllipse(I j )

[0062] Knowing the true radius r of the sphere and the size a, b of the major and minor axes of the ellipse in the image, when the focal length f x =f y =f, based on the three-dimensional point coordinates of the sphere center in the camera coordinate system, the size of the major axis A and minor axis B of the sphere in the image can be calculated:

[0063]

[0064] When the focal length f x ≠f y When the major axis A and the minor axis B are:

[0065]

[0066] Then the size error of the ellipse can be calculated:

[0067]

[0068] The pixel coordinates obtained by reprojecting the sphere center coincide with the coordinates of the ellipse center in the image. Therefore, a nonlinear least squares problem about the reprojection error is constructed here. i The reprojected coordinates (x c ,y c )for:

[0069]

[0070] Then the reprojection error can be defined as:

[0071] e2=(x c -x o ) 2 +(y c -y o ) 2

[0072] Based on this, the loss function can be defined as, where λ,μ are weights, then:

[0073] e=λe1+μe2

[0074] Bundle Adjustment is used here to minimize the reprojection error, namely:

[0075]

[0076] like Figure 5 As shown, in this way, the multi-camera extrinsics that are accurate and consistent with the real-world size are obtained.

[0077] Finally, it should be noted that the above description is only a preferred example of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A multi-camera extrinsic calibration method based on a sphere, characterized by: The following steps are involved: Step S1, placing a sphere with a known radius inside a multi-camera surround device, allowing the sphere to move in space and taking and recording each sphere calibration picture; Step S2, performing distortion correction on the original sphere calibration image based on known camera intrinsic parameters to obtain a distortion correction image sequence; Step S3: Since the image is distorted, the ball appears as an ellipse in the image after distortion removal. Therefore, ellipse detection is performed on the distortion correction image sequence, and the image sequence that does not capture the calibration ball is screened, that is, to ensure that the sphere pixels are completely present in each camera image plane of the multi-camera surround device in each shot, and at the same time, the center coordinates and the size of the major and minor axes of the corresponding ball are detected from the image; Step S4, the camera intrinsic parameters, the coordinates of the center of the circle and the size of the major and minor axes in the image are known, and these are used as constraints. The N×3 random matrix is ​​used as the initial value of the spherical three-dimensional point, and the M×6×1 random matrix is ​​used as the initial value of the camera pose, and they are sent to the bundle adjustment optimization system to optimize the camera extrinsic parameters and three-dimensional points that meet the actual size.

2. The spherical multi-camera extrinsic calibration method according to claim 1, characterized in that: The step S1 is a data preparation part. Ideally, the pixel sequences of the sphere captured multiple times should be evenly distributed on the image plane of each camera. The step S2 is the image sequence correction part, and the original image of the sphere calibration image is the original image sequence recorded by the multi-camera surround device at each displacement of the sphere; The step S3 performs ellipse detection on the distortion correction image sequence, uses the sphere color as a constraint, reduces the amount of calculation so that the ellipse can be accurately detected, and if there are undetected or incomplete images in a certain sphere movement image sequence, the sphere calibration image sequence is screened out, that is, it is ensured that in each shooting, the sphere pixels are completely present in each camera image plane of the multi-camera surround device; The step S4 obtains external parameters through a bundle adjustment optimization system. Specifically, in a three-dimensional scene, an N×3 random matrix is ​​used as a three-dimensional point of a ball in real space, and an M×6×1 random matrix is ​​used as an initial value of a camera pose, which is input into a bundle adjustment system. First, perform matrix transformation on the camera external parameters. The first three parameters of each camera posture are used as rotation parameters, and the last three parameters are used as translation parameters. Use the Rodrigues algorithm of opencv to transform the rotation parameters into a matrix. R,_ = cv2.Rodrigues(rvec) Let the center of the sphere be O i The coordinates of the three-dimensional point in real space are (X w ,Y w ,Z w ), the external parameter matrix of the jth camera is T j , then the coordinates of the three-dimensional point in the space in the camera coordinate system (X c ,Y c ,Z c )for: Camera intrinsic parameter matrix K j It is also known that it can be expressed as: Use the fitEllipse ellipse detection method of opencv to detect the ellipse from the image I j The pixel coordinates of the center of the ellipse (x o ,y o ) and the size of the major and minor axes a, b, that is: (x o ,y o ),(a,b),_=cv2.fitEllipse(I j ) Knowing the true radius r of the sphere and the size a, b of the major and minor axes of the ellipse in the image, when the focal length f x =f y =f, based on the three-dimensional point coordinates of the sphere center in the camera coordinate system, the size of the major axis A and minor axis B of the sphere in the image can be calculated: When the focal length f x ≠f y When the major axis A and the minor axis B are: Then the size error of the ellipse can be calculated: The pixel coordinates obtained by reprojecting the sphere center coincide with the coordinates of the ellipse center in the image, so a nonlinear least squares problem about the reprojection error is constructed here. i The reprojected coordinates (x c ,y c )for: Then the reprojection error can be defined as: e2=(x c -x o ) 2 +(y c -y o ) 2 Based on this, the loss function can be defined as, where λ,μ are weights, then: e=λe1+μe2 Bundle Adjustment is used here to minimize the reprojection error, namely: In this way, the multi-camera extrinsics that are accurate and consistent with the real-world size are obtained.