A multi-camera calibration method, device, multi-camera and storage medium
By collecting images at multiple locations and using bilinear interpolation to determine three-dimensional coordinates and calculate multi-camera parameters, the problem of insufficient accuracy caused by the coupling of camera parameters and distortion coefficients in the existing technology is solved, and the accuracy of multi-camera calibration is improved. and efficiency.
Patent Information
- Application Number
- CN202110883125.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-02
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-08-02
AI Technical Summary
In existing binocular camera calibration methods, camera parameters and lens distortion coefficients are highly coupled, resulting in low calibration accuracy, which in turn affects measurement accuracy.
By collecting images of the calibration plate at multiple locations, using the pixel coordinates and spatial coordinates of the calibration plate's feature points, and using bilinear interpolation to determine the three-dimensional coordinates corresponding to the pixels, the multi-eye camera parameter equations are calculated to complete the multi-eye camera calibration. It avoids the separate calculation and coupling of internal and external parameters and distortion coefficients of the camera.
It improves the accuracy and efficiency of camera calibration, reduces errors caused by the coupling of internal camera parameters and lens distortion coefficients, and can quickly obtain multiple sets of data for calculating parameters.
Smart Images

Figure CN113487686B
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional vision measurement technology, and in particular to a calibration method and device for a multi-eye camera, a multi-eye camera and a storage medium. Background Art
[0002] In recent years, various technologies have been applied to three-dimensional information measurement, thus forming various three-dimensional measurement systems. Three-dimensional visual measurement technology uses computer analysis and processing to allow computers to not only have the same visual experience as human eyes, but also obtain quantified object parameters that human eyes cannot directly obtain. It has a wide range of practical application value.
[0003] In the existing binocular camera calibration methods, the main method is: using the pinhole camera model, calibrating the intrinsic parameters and lens distortion coefficients of the two cameras respectively, and calibrating the rotation and translation parameters between the two cameras. Due to the high coupling of camera parameters and lens distortion coefficients, the camera calibration accuracy is not high, which further affects the solution of the rotation and translation parameters between the two cameras. As a result, the measurement accuracy is insufficient. Summary of the invention
[0004] Based on this, it is necessary to provide a multi-eye camera calibration method, device, multi-eye camera and storage medium to address the above technical problems.
[0005] A multi-camera calibration method, the method comprising:
[0006] When a first image of the calibration plate is acquired at the first position, determining the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate;
[0007] Acquire a second image each time the calibration plate is moved to a different second position, and determine the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the characteristic points of the calibration plate in the second image acquired each time and the second spatial coordinates of the characteristic points of the calibration plate;
[0008] Parameters in the multi-eye camera parameter equation are calculated based on the three-dimensional coordinates corresponding to each of the pixels, thereby completing the calibration of the multi-eye camera; wherein each pixel in the first image corresponds to a multi-eye camera parameter equation, and the multi-eye camera parameter equation constitutes a model of the multi-eye camera.
[0009] In one embodiment, when a first image about a calibration plate is acquired at a first position, determining the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of a feature point of the calibration plate in the first image and the first spatial coordinates of the feature point of the calibration plate includes:
[0010] When the calibration plate is at the first position, obtaining the first spatial coordinates of the characteristic points of the calibration plate in the world coordinate system;
[0011] photographing the calibration plate to obtain a first image;
[0012] Obtaining pixel coordinates of each pixel in the first image in a pixel coordinate system;
[0013] Based on the first spatial coordinates and the pixel coordinates, a three-dimensional coordinate corresponding to each pixel in the first image is determined by bilinear interpolation.
[0014] In one embodiment, acquiring a second image each time the calibration plate is moved to a different second position, and determining the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the calibration plate feature points in the second image acquired each time and the second spatial coordinates of the calibration plate feature points includes:
[0015] Each time the calibration plate is moved to a different second position, obtaining a second spatial coordinate of the calibration plate in the world coordinate system;
[0016] photographing the calibration plate to obtain a second image;
[0017] Obtaining pixel coordinates of each pixel in the second image in a pixel coordinate system;
[0018] Based on the second spatial coordinates and the pixel coordinates, the three-dimensional coordinates corresponding to each pixel in the second image are determined by bilinear interpolation.
[0019] In one embodiment, the expression of bilinear interpolation is:
[0020]
[0021] Among them, ε i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the first image, or the three-dimensional coordinates corresponding to each pixel in the second image; ε t and ε b v respectively represent parameter values, the parameter values are parameter values determined based on the pixel coordinates of the calibration plate feature points in the first image and the first spatial coordinates of the calibration plate feature points, or are parameter values determined based on the pixel coordinates of the calibration plate feature points in the second image and the second spatial coordinates of the calibration plate feature points; i is the pixel coordinate corresponding to each pixel in the first image or the second image, v t and v bIt represents the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point being sought in the first image, or represents the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point being sought in the second image.
[0022] In one embodiment, the calculation of the parameters in the multi-camera parameter equation based on the three-dimensional coordinates corresponding to each pixel includes:
[0023] Establish multi-camera parameter equations;
[0024] Input the three-dimensional coordinates corresponding to each pixel in the first image and the three-dimensional coordinates corresponding to each pixel in the second image into the corresponding multi-camera parameter equation respectively;
[0025] Calculate the parameters in the multi-camera parameter equation based on the input three-dimensional coordinates.
[0026] In one embodiment, the multi-camera parameter equation is a first camera parameter straight line equation or a second camera parameter straight line equation; the general expression of the first camera parameter straight line equation is:
[0027]
[0028] Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, (n x ,n y ,n z ), (x0, y0, z0) and t are the parameters in the first camera parameter line equation;
[0029] The general expression of the second camera parameter line equation is:
[0030]
[0031] Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each of the pixels, and A1, B1, C1, D1, A2, B2, C2, and D2 are parameters in the parameter line equation of the second camera;
[0032] The parameters in the multi-camera parameter equation calculated based on the three-dimensional coordinates corresponding to each pixel include:
[0033] Parameters in the first camera parameter straight line equation or parameters in the second camera parameter straight line equation are calculated based on the three-dimensional coordinates corresponding to each of the pixels.
[0034] In one embodiment, before determining the three-dimensional coordinates corresponding to each pixel in the first image, the method further includes:
[0035] A movement request is sent to the calibration plate; the movement request is used to instruct the calibration plate to move to the first position according to the position identifier carried by the calibration plate.
[0036] A multi-camera calibration device, the device comprising:
[0037] A first determination module is used to determine the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate when a first image about the calibration plate is collected at a first position;
[0038] A second determination module is used to collect a second image each time the calibration plate is moved to a different second position, and determine the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the characteristic points of the calibration plate in the second image collected each time and the second spatial coordinates of the characteristic points of the calibration plate;
[0039] A calculation module is used to calculate the parameters in the multi-eye camera parameter equation based on the three-dimensional coordinates corresponding to each of the pixels, so as to complete the calibration of the multi-eye camera; wherein each pixel in the first image corresponds to a multi-eye camera parameter equation, and the multi-eye camera parameter equation constitutes a model of the multi-eye camera.
[0040] In one embodiment, the first determination module is further used to obtain the first spatial coordinates of the feature points of the calibration plate in the world coordinate system when the calibration plate is in the first position; photograph the calibration plate to obtain a first image; obtain the pixel coordinates of each pixel in the first image in the pixel coordinate system; and determine the three-dimensional coordinates corresponding to each pixel in the first image by bilinear interpolation based on the first spatial coordinates and the pixel coordinates.
[0041] In one embodiment, the second determination module is further used to obtain the second spatial coordinates of the calibration plate in the world coordinate system each time the calibration plate is moved to a different second position; photograph the calibration plate to obtain a second image; obtain the pixel coordinates of each pixel in the second image in the pixel coordinate system; and determine the three-dimensional coordinates corresponding to each pixel in the second image by bilinear interpolation based on the second spatial coordinates and the pixel coordinates.
[0042] In one embodiment, the expression of bilinear interpolation is:
[0043]
[0044] Among them, ε i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the first image, or the three-dimensional coordinates corresponding to each pixel in the second image; ε tand ε b v respectively represent parameter values, the parameter values are parameter values determined based on the pixel coordinates of the calibration plate feature points in the first image and the first spatial coordinates of the calibration plate feature points, or are parameter values determined based on the pixel coordinates of the calibration plate feature points in the second image and the second spatial coordinates of the calibration plate feature points; i is the pixel coordinate corresponding to each pixel in the first image or the second image, v t and v b It represents the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point being sought in the first image, or represents the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point being sought in the second image.
[0045] In one embodiment, the calculation module is also used to establish a multi-eye camera parameter equation; the three-dimensional coordinates corresponding to each pixel in the first image and the three-dimensional coordinates corresponding to each pixel in the second image are respectively input into the corresponding multi-eye camera parameter equation; and the parameters in the multi-eye camera parameter equation are calculated based on the input three-dimensional coordinates.
[0046] In one embodiment, the multi-camera parameter equation is a first camera parameter straight line equation or a second camera parameter straight line equation; the general expression of the first camera parameter straight line equation is:
[0047]
[0048] Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, (n x ,n y ,n z ), (x0, y0, z0) and t are the parameters in the first camera parameter line equation;
[0049] The general expression of the second camera parameter line equation is:
[0050]
[0051] Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each of the pixels, and A1, B1, C1, D1, A2, B2, C2, and D2 are parameters in the parameter line equation of the second camera;
[0052] The calculation module is further used to calculate the parameters in the first camera parameter straight line equation or the parameters in the second camera parameter straight line equation based on the three-dimensional coordinates corresponding to each of the pixels.
[0053] In one embodiment, the calibration device of the multi-eye camera further includes:
[0054] The sending module is used to send a movement request to the calibration plate; the movement request is used to instruct the calibration plate to move to the first position according to the position identifier carried by the calibration plate.
[0055] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the multi-eye camera calibration method.
[0056] A multi-eye camera comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the multi-eye camera calibration method.
[0057] The calibration method, device, multi-eye camera and storage medium of the multi-eye camera, when the first image of the calibration plate is collected at the first position, the three-dimensional coordinates corresponding to each pixel in the first image are determined based on the pixel coordinates of the characteristic points of the calibration plate in the first image and the first spatial coordinates of the characteristic points of the calibration plate; the above process is repeated continuously to obtain the three-dimensional coordinates corresponding to each pixel in the image corresponding to each position, and then the parameters in the multi-eye camera parameter equation are calculated according to these three-dimensional coordinates, so as to complete the calibration of the multi-eye camera, so that there is no need to calculate the internal and external parameters and distortion coefficients of the camera separately, and there is no coupling of the distortion coefficients in the camera, so the calibration accuracy of the camera can be effectively improved. In addition, by continuously moving the calibration plate to quickly obtain multiple sets of data to calculate the parameters, it is beneficial to improve the efficiency of the multi-eye camera calibration. After the calibration is completed, the three-dimensional coordinates of the object to be measured are derived using the multi-eye camera parameter equation, which can avoid the error caused by the high coupling of the camera internal parameters and the lens distortion coefficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is an application scenario diagram of a multi-camera calibration method in one embodiment;
[0059] Figure 2 1 is a flow chart of a calibration method for a multi-camera in one embodiment;
[0060] Figure 3 A schematic diagram of calculating the three-dimensional coordinates of a measured object by a binocular camera in one embodiment;
[0061] Figure 4 is a structural block diagram of a calibration device for a multi-eye camera in one embodiment;
[0062] Figure 5 is a structural block diagram of a calibration device for a multi-eye camera in one embodiment;
[0063] Figure 6 1 is a diagram showing the internal structure of a multi-eye camera in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0065] Figure 1 FIG. 1 is an application scenario diagram of a multi-camera calibration method in an embodiment. Figure 1 The application scenario includes a left camera (110) and a right camera (120) of a multi-eye camera, a calibration plate (130), and a linear guide rail (140). The calibration plate (130) moves on the linear guide rail (140). In practical applications, the multi-eye camera can specifically be a binocular camera or a camera with more than binocular functions.
[0066] like Figure 2 As shown, in one embodiment, a calibration method for a multi-camera is provided. This embodiment mainly applies the method to the above Figure 1 Multi-camera in . Figure 2 , the multi-camera calibration method specifically includes the following steps:
[0067] S202, when a first image of the calibration plate is acquired at a first position, determining three-dimensional coordinates corresponding to each pixel in the first image based on pixel coordinates of feature points of the calibration plate in the first image and first spatial coordinates of the feature points of the calibration plate.
[0068] The first position refers to the designated position where the calibration plate is placed for the first time, such as Figure 1 The first image may be an image obtained by photographing the calibration plate at the first position, and specifically may be two images obtained by respectively photographing the calibration plate by the left camera and the right camera in the multi-eye camera, or a fused image obtained by fusing the two images.
[0069] The calibration plate may be a flat plate used to calibrate a camera, and the characteristic points of the calibration plate may refer to a pattern array with a fixed spacing on the flat plate.
[0070] The first spatial coordinate may be a three-dimensional coordinate of a characteristic point of the calibration plate in the calibration plate in a world coordinate system when the calibration plate is in the first position. In the world coordinate system, a coordinate system may be established with the horizontal axis and the vertical axis of the calibration plate as the x-axis and the y-axis, respectively, and the linear guide as the z-axis.
[0071] In one embodiment, when the calibration plate is placed in the first position, the multi-eye camera shoots the calibration plate to obtain a first image, and obtains the pixel coordinates of the feature points of the calibration plate in the first image in the pixel coordinate system, and obtains the first spatial coordinates of the calibration plate in the world coordinate system, and then the three-dimensional coordinates corresponding to each pixel in the first image can be determined by bilinear interpolation. Figure 1 When Pos1 is selected, the three-dimensional coordinates under Pos1 can be obtained.
[0072] Among them, the expression of bilinear interpolation is:
[0073]
[0074] Among them, ε i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the first image; t and ε b respectively represent parameter values, which are parameter values determined based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate; v i is the pixel coordinate corresponding to each pixel in the image, v t and v b Indicates the pixel coordinates of the pixel in the first image adjacent to the feature point of the calibration plate.
[0075] In one embodiment, before S202, a movement request is sent to the calibration plate, where the movement request is used to instruct the calibration plate to move to the first position according to the position identifier carried by the calibration plate.
[0076] S204, capturing a second image each time the calibration plate is moved to a different second position, and determining the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the feature points of the calibration plate in each captured second image and the second spatial coordinates of the feature points of the calibration plate.
[0077] The second position is the position of the calibration plate each time it is moved to collect images. For example, when the calibration plate is moved to an adjacent designated position along the target direction for the first time, the adjacent designated position is the second position. Figure 1 In addition, when the calibration plate continues to move along the target direction to the next adjacent designated position, the next adjacent designated position is also the second position obtained during the second movement, such as Figure 1 pos3 in , and so on.
[0078] The second image may be an image obtained by photographing the calibration plate at the second position, specifically, two images obtained by respectively photographing the calibration plate by the left camera and the right camera in the multi-eye camera, or a fused image obtained by fusing the two images.
[0079] In one embodiment, each time the calibration plate is moved to a different second position, the second spatial coordinates of the characteristic points of the calibration plate in the world coordinate system are obtained. The calibration plate is photographed to obtain a second image, the pixel coordinates of each pixel in the second image in the pixel coordinate system are obtained, and based on the second spatial coordinates and the pixel coordinates, the three-dimensional coordinates corresponding to each pixel in the second image are determined by bilinear interpolation.
[0080] Among them, the expression of bilinear interpolation is:
[0081]
[0082] Among them, θ i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the second image; θ t and θ b respectively represent parameter values, and the parameter values are parameter values determined based on the pixel coordinates of the feature points of the calibration plate in the second image and the second spatial coordinates of the feature points of the calibration plate; i is the pixel coordinate corresponding to each pixel in the image, v t and v b Indicates the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point in the second image.
[0083] In one embodiment, the step of obtaining the second spatial coordinates of the characteristic points of the calibration plate in the world coordinate system may specifically include: obtaining the three-dimensional coordinates of the calibration plate in the world coordinate system, and then calculating the first spatial coordinates of the characteristic points of the calibration plate in the world coordinate system according to the three-dimensional coordinates of the calibration plate. In the world coordinate system, a coordinate system may be established with the horizontal axis and the vertical axis of the calibration plate as the x-axis and the y-axis, respectively, and the linear guide as the z-axis.
[0084] For example, Figure 1 As shown, when the calibration plate is moved to Pos2, the second spatial coordinates of the calibration plate in the world coordinate system are obtained; the calibration plate is photographed to obtain a second image; the pixel coordinates of each pixel in the second image in the pixel coordinate system are obtained; based on the second spatial coordinates and the pixel coordinates, the three-dimensional coordinates corresponding to each pixel in the second image are determined by bilinear interpolation; thus, the three-dimensional coordinates at Pos2 are obtained.
[0085] When the calibration plate is moved to Pos3, the second spatial coordinates of the calibration plate in the world coordinate system are obtained; the calibration plate is photographed to obtain a second image; the pixel coordinates of each pixel in the second image in the pixel coordinate system are obtained; based on the second spatial coordinates and the pixel coordinates, the three-dimensional coordinates corresponding to each pixel in the second image are determined by bilinear interpolation; thus, the three-dimensional coordinates at Pos3 are obtained.
[0086] By analogy, when the calibration plate is moved to the Posn position, the second spatial coordinates of the calibration plate in the world coordinate system are obtained; the calibration plate is photographed to obtain a second image; the pixel coordinates of each pixel in the second image in the pixel coordinate system are obtained; based on the second spatial coordinates and the pixel coordinates, the three-dimensional coordinates corresponding to each pixel in the second image are determined by bilinear interpolation; thus, the three-dimensional coordinates at Posn are obtained, and thus the three-dimensional coordinates at Pos1, Pos2, ..., Posn are obtained respectively.
[0087] S206, calculating parameters in a multi-eye camera parameter equation based on the three-dimensional coordinates corresponding to each of the pixels, thereby completing the calibration of the multi-eye camera; wherein each pixel in the first image corresponds to a multi-eye camera parameter equation, and the multi-eye camera parameter equation constitutes a model of the multi-eye camera.
[0088] In one embodiment, before S206 , the three-dimensional coordinates corresponding to each pixel in the first image and the three-dimensional coordinates corresponding to each pixel in the second image are saved in sequence.
[0089] In one embodiment, S206 may specifically include: establishing a multi-eye camera parameter equation, and then inputting the three-dimensional coordinates corresponding to each pixel in the first image and the three-dimensional coordinates corresponding to each pixel in the second image into the corresponding multi-eye camera parameter equation, and calculating the parameters in the multi-eye camera parameter equation based on the input three-dimensional coordinates.
[0090] In one embodiment, when the camera parameter straight line equation is the first camera parameter straight line equation; the first camera parameter straight line equation is:
[0091]
[0092] Among them, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, (n x ,n y ,n z ), (x0, y0, z0) and t are the parameters in the first camera parameter line equation;
[0093] Therefore, S206 may specifically include: calculating the parameters in the first camera parameter line equation based on the three-dimensional coordinates corresponding to each pixel.
[0094] In another embodiment, if the camera parameter straight line equation is a second camera parameter straight line equation, the second camera parameter straight line equation is:
[0095]
[0096] Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, A1, B1, C1, D1, A2, B2, C2, D2 are the parameters in the second camera parameter line equation;
[0097] Therefore, S206 may specifically include: calculating the parameters in the second camera parameter line equation based on the three-dimensional coordinates corresponding to each pixel.
[0098] In one embodiment, after S206, the method further includes: when using the terminal for measurement, first, performing image acquisition on the object to be measured to obtain the pixel coordinates of the object to be measured; secondly, searching for the corresponding camera parameter linear equation according to the pixel coordinates, combining the camera parameter linear equations, and finally solving the three-dimensional coordinates of the object to be measured.
[0099] like Figure 3 As shown, a schematic diagram of calculating the three-dimensional coordinates of the object under test using a calibrated binocular camera is shown. Figure 3 The same point P in the image has image pixels p in the left and right cameras respectively. L and p R , the camera parameter line equations corresponding to the left and right camera pixels are L L and L R , L L and L R The intersection point is the three-dimensional coordinate of P.
[0100] In the above embodiment, when the first image of the calibration plate is collected at the first position, the three-dimensional coordinates corresponding to each pixel in the first image are determined based on the pixel coordinates of the characteristic points of the calibration plate in the first image and the first spatial coordinates of the characteristic points of the calibration plate; the above process is repeated continuously to obtain the three-dimensional coordinates corresponding to each pixel in the image corresponding to each position, and then the parameters in the multi-eye camera parameter equation are calculated according to these three-dimensional coordinates, thereby completing the calibration of the multi-eye camera, so that there is no need to calculate the internal and external parameters and distortion coefficients of the camera separately, and there is no situation where the camera participates in the coupling of the distortion coefficient, so the calibration accuracy of the camera can be effectively improved. In addition, by continuously moving the calibration plate to quickly obtain multiple sets of data to calculate the parameters, it is beneficial to improve the efficiency of the multi-eye camera calibration. After the calibration is completed, the three-dimensional coordinates of the object to be measured are derived using the multi-eye camera parameter equation, which can avoid the error caused by the high coupling of the camera internal parameters and the lens distortion coefficient.
[0101] like Figure 4 As shown, in one embodiment, a calibration device for a multi-eye camera is provided, and the calibration device for a multi-eye camera specifically includes: a first determination module 402, a first determination module 404, and a calculation module 406; wherein:
[0102] A first determination module 402 is configured to determine, when a first image about the calibration plate is acquired at the first position, the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate at the first position;
[0103] A second determination module 404 is used to acquire a second image each time the calibration plate is moved to a different second position, and determine the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the characteristic points of the calibration plate in each acquired second image and the second spatial coordinates of the characteristic points of the calibration plate;
[0104] The calculation module 406 is used to calculate the parameters in the multi-eye camera parameter equation based on the three-dimensional coordinates corresponding to each of the pixels, so as to complete the calibration of the multi-eye camera; wherein each pixel in the first image corresponds to a multi-eye camera parameter equation, and the multi-eye camera parameter equation constitutes a model of the multi-eye camera.
[0105] In one embodiment, the first determination module 402 is also used to obtain the first spatial coordinates of the feature points of the calibration plate in the world coordinate system when the calibration plate is in the first position; photograph the calibration plate to obtain a first image; obtain the pixel coordinates of each pixel in the first image in the pixel coordinate system; and determine the three-dimensional coordinates corresponding to each pixel in the first image by bilinear interpolation based on the first spatial coordinates and the pixel coordinates.
[0106] Among them, the expression of bilinear interpolation is:
[0107]
[0108] Among them, ε i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the first image; t and ε b respectively represent parameter values, which are parameter values determined based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate; v i is the pixel coordinate corresponding to each pixel in the image, v t and v b Indicates the pixel coordinates of the pixel in the first image adjacent to the feature point of the calibration plate.
[0109] In one embodiment, the second determination module 404 is further used to obtain the second spatial coordinates of the calibration plate in the world coordinate system each time the calibration plate is moved to a different second position; photograph the calibration plate to obtain a second image; obtain the pixel coordinates of each pixel in the second image in the pixel coordinate system; and determine the three-dimensional coordinates corresponding to each pixel in the second image by bilinear interpolation based on the second spatial coordinates and the pixel coordinates.
[0110] Among them, the expression of bilinear interpolation is:
[0111]
[0112] Among them, θ i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the second image; θ t and θ b respectively represent parameter values, and the parameter values are parameter values determined based on the pixel coordinates of the feature points of the calibration plate in the second image and the second spatial coordinates of the feature points of the calibration plate; i is the pixel coordinate corresponding to each pixel in the image, v t and v b Indicates the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point in the second image.
[0113] In one embodiment, the calculation module 406 is also used to establish a multi-eye camera parameter equation; the three-dimensional coordinates corresponding to each pixel in the first image and the three-dimensional coordinates corresponding to each pixel in the second image are respectively input into the corresponding multi-eye camera parameter equation; and the parameters in the multi-eye camera parameter equation are calculated based on the input three-dimensional coordinates.
[0114] In one embodiment, if the multi-camera parameter equation is the first camera parameter straight line equation; the general expression of the first camera parameter straight line equation is:
[0115]
[0116] Among them, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, (n x ,n y ,n z ), (x0, y0, z0) and t are the parameters in the first camera parameter line equation;
[0117] The calculation module 406 is further configured to calculate parameters in the first camera parameter line equation based on the three-dimensional coordinates corresponding to each pixel.
[0118] In one embodiment, if the multi-camera parameter equation is the first camera parameter straight line equation; the general expression of the second camera parameter straight line equation is:
[0119]
[0120] Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, A1, B1, C1, D1, A2, B2, C2, D2 are the parameters in the second camera parameter line equation;
[0121] The calculation module 406 is further configured to calculate parameters in the second camera parameter line equation based on the three-dimensional coordinates corresponding to each pixel.
[0122] In one embodiment, Figure 5 As shown, the device includes: a sending module 408; wherein,
[0123] The sending module 408 is used to send a movement request to the calibration plate; the movement request is used to instruct the calibration plate to move to the first position according to the position identifier carried by the calibration plate.
[0124] In the above embodiment, when the first image of the calibration plate is collected at the first position, the three-dimensional coordinates corresponding to each pixel in the first image are determined based on the pixel coordinates of the characteristic points of the calibration plate in the first image and the first spatial coordinates of the characteristic points of the calibration plate; the above process is repeated continuously to obtain the three-dimensional coordinates corresponding to each pixel in the image corresponding to each position, and then the parameters in the multi-eye camera parameter equation are calculated according to these three-dimensional coordinates, thereby completing the calibration of the multi-eye camera, so that there is no need to calculate the internal and external parameters and distortion coefficients of the camera separately, and there is no situation where the camera participates in the coupling of the distortion coefficient, so the calibration accuracy of the camera can be effectively improved. In addition, by continuously moving the calibration plate to quickly obtain multiple sets of data to calculate the parameters, it is beneficial to improve the efficiency of the multi-eye camera calibration. After the calibration is completed, the three-dimensional coordinates of the object to be measured are derived using the multi-eye camera parameter equation, which can avoid the error caused by the high coupling of the camera internal parameters and the lens distortion coefficient.
[0125] In one embodiment, a multi-eye camera is provided, which can be a multi-eye camera, and its internal structure diagram can be as follows: Figure 6 As shown. The multi-eye camera includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the multi-eye camera is used to provide computing and control capabilities. The memory of the multi-eye camera includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the multi-eye camera is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a speech synthesis method can be implemented, and a speech synthesis model processing method can also be implemented. The display screen of the multi-eye camera can be a liquid crystal display screen or an electronic ink display screen, and the input device of the multi-eye camera can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the housing of the multi-eye camera, or an external keyboard, touchpad or mouse, etc.
[0126] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the multi-eye camera to which the scheme of the present application is applied. The specific multi-eye camera may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0127] In one embodiment, a multi-eye camera is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented.
[0128] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0129] In one embodiment, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a multi-eye camera reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the multi-eye camera performs the steps in the above-mentioned method embodiments.
[0130] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A multi-camera calibration method, characterized in that: The method comprises: When a first image of the calibration plate is acquired at the first position, determining the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate; Acquire a second image each time the calibration plate is moved to a different second position, and determine the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the characteristic points of the calibration plate in the second image acquired each time and the second spatial coordinates of the characteristic points of the calibration plate; The parameters in the multi-eye camera parameter equation are calculated based on the three-dimensional coordinates corresponding to each of the pixels, thereby completing the calibration of the multi-eye camera; wherein each pixel in the first image corresponds to a multi-eye camera parameter equation, and the multi-eye camera parameter equation constitutes a model of the multi-eye camera; the multi-eye camera parameter equation is a first camera parameter straight line equation or a second camera parameter straight line equation; the general expression of the first camera parameter straight line equation is: Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, (n x ,n y ,n z ), (x0, y0, z0) and t are the parameters in the first camera parameter line equation; The general expression of the second camera parameter line equation is: Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each of the pixels, and A1, B1, C1, D1, A2, B2, C2, and D2 are parameters in the parameter line equation of the second camera; The calculating of the parameters in the multi-camera parameter equation based on the three-dimensional coordinates corresponding to each of the pixels includes: calculating the parameters in the first camera parameter straight line equation or the parameters in the second camera parameter straight line equation based on the three-dimensional coordinates corresponding to each of the pixels.
2. The method according to claim 1, characterized in that When a first image about the calibration plate is acquired at the first position, determining the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate includes: When the calibration plate is at the first position, obtaining the first spatial coordinates of the characteristic points of the calibration plate in the world coordinate system; photographing the calibration plate to obtain a first image; Obtaining pixel coordinates of each pixel in the first image in a pixel coordinate system; Based on the first spatial coordinates and the pixel coordinates, a three-dimensional coordinate corresponding to each pixel in the first image is determined by bilinear interpolation.
3. The method according to claim 1, characterized in that The step of acquiring a second image each time the calibration plate is moved to a different second position, and determining the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the calibration plate feature points in the second image acquired each time and the second spatial coordinates of the calibration plate feature points comprises: Each time the calibration plate is moved to a different second position, obtaining a second spatial coordinate of the calibration plate in the world coordinate system; photographing the calibration plate to obtain a second image; Obtaining pixel coordinates of each pixel in the second image in a pixel coordinate system; Based on the second spatial coordinates and the pixel coordinates, the three-dimensional coordinates corresponding to each pixel in the second image are determined by bilinear interpolation.
4. The method according to claim 2 or 3, characterized in that: The expression of the bilinear interpolation is: Among them, ε i,m Used to represent the three-dimensional coordinates corresponding to each pixel in the first image, or the three-dimensional coordinates corresponding to each pixel in the second image; ε t and ε b v respectively represent parameter values, and the parameter values are parameter values determined based on the pixel coordinates of the calibration plate feature points in the first image and the first spatial coordinates of the calibration plate feature points, or are parameter values determined based on the pixel coordinates of the calibration plate feature points in the second image and the second spatial coordinates of the calibration plate feature points; i is the pixel coordinate corresponding to each pixel in the first image or the second image, v t and v b It represents the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point being sought in the first image, or represents the pixel coordinates of the feature points of the calibration plate adjacent to the pixel point being sought in the second image.
5. The method according to claim 1, characterized in that The parameters in the multi-camera parameter equation calculated based on the three-dimensional coordinates corresponding to each pixel include: Establish multi-camera parameter equations; Input the three-dimensional coordinates corresponding to each pixel in the first image and the three-dimensional coordinates corresponding to each pixel in the second image into the corresponding multi-camera parameter equation respectively; Calculate the parameters in the multi-camera parameter equation based on the input three-dimensional coordinates.
6. The method according to any one of claims 1 to 3 and 5, characterized in that: Before determining the three-dimensional coordinates corresponding to each pixel in the first image, the method further includes: A movement request is sent to the calibration plate; the movement request is used to instruct the calibration plate to move to the first position according to the position identifier carried by the calibration plate.
7. A multi-camera calibration device, characterized in that: The device comprises: A first determination module is used to determine the three-dimensional coordinates corresponding to each pixel in the first image based on the pixel coordinates of the feature points of the calibration plate in the first image and the first spatial coordinates of the feature points of the calibration plate when a first image about the calibration plate is collected at a first position; A second determination module is used to collect a second image each time the calibration plate is moved to a different second position, and determine the three-dimensional coordinates corresponding to each pixel in the second image based on the pixel coordinates of the characteristic points of the calibration plate in the second image collected each time and the second spatial coordinates of the characteristic points of the calibration plate; A calculation module is used to calculate the parameters in the multi-eye camera parameter equation based on the three-dimensional coordinates corresponding to each pixel, so as to complete the calibration of the multi-eye camera; wherein each pixel in the first image corresponds to a multi-eye camera parameter equation, and the multi-eye camera parameter equation constitutes a model of the multi-eye camera; the multi-eye camera parameter equation is a first camera parameter straight line equation or a second camera parameter straight line equation; the general expression of the first camera parameter straight line equation is: Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each pixel, (n x ,n y ,n z )、(x0,y O , z O ) and t are parameters in the first camera parameter line equation; The general expression of the second camera parameter line equation is: Wherein, (x, y, z) represents the three-dimensional coordinates corresponding to each of the pixels, and A1, B1, C1, D1, A2, B2, C2, and D2 are parameters in the parameter line equation of the second camera; Calculating the parameters in the multi-camera parameter equation based on the three-dimensional coordinates corresponding to each of the pixels includes: calculating the parameters in the first camera parameter straight line equation or the parameters in the second camera parameter straight line equation based on the three-dimensional coordinates corresponding to each of the pixels.
8. The device according to claim 7, characterized in that The first determination module is also used to obtain the first spatial coordinates of the feature points of the calibration plate in the world coordinate system when the calibration plate is in the first position; photograph the calibration plate to obtain a first image; obtain the pixel coordinates of each pixel in the first image in the pixel coordinate system; and determine the three-dimensional coordinates corresponding to each pixel in the first image by bilinear interpolation based on the first spatial coordinates and the pixel coordinates.
9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to execute the steps of the method according to any one of claims 1 to 6.
10. A multi-eye camera, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method as claimed in any one of claims 1 to 6.
