Error interval estimation and precision evaluation method for camera calibration model

By improving the error estimation of the camera calibration model, using the diamond window to identify calibration points and convert them into world coordinates, calculate interval error and error confidence intervals, the problem of insufficient calibration accuracy caused by ignoring the calibration point interval in the prior art is solved, and the calibration accuracy problem is achieved. Higher calibration accuracy and accuracy.

CN119478063APending Publication Date: 2025-02-18HEFEI JUNDA HI TECH INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411559979.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art ignores the true interval of calibration points in the error estimation of camera calibration models, resulting in insufficient calibration accuracy.

Method used

By acquiring the calibration image of the calibration plate for preprocessing, identifying the calibration points using a diamond window, and converting the target point coordinates into world coordinates, computing the interval error and error confidence intervals to comprehensively evaluate the accuracy of the calibration model.

Benefits of technology

Improve calibration accuracy, enhance the utilization of real intervals between calibration points, and ensure the accuracy and comprehensiveness of camera calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478063A_ABST
    Figure CN119478063A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, solves the technical problem of insufficient calibration precision caused by neglecting the real interval of calibration points in error estimation in the prior art, and particularly relates to an error interval estimation and precision evaluation method of a camera calibration model, which comprises the following steps: S1, acquiring a calibration image of a calibration plate, preprocessing the calibration image to obtain a preprocessed image; s2, a two-dimensional rectangular coordinate system is created with the pixel point O in the center of the preprocessed image as an original point, and a rhombic window is constructed based on any pixel point of the preprocessed image, the rhombic window is used for calibration point detection, the calculation amount of pixel values is greatly reduced, the recognition efficiency of the calibration points is improved, and through calculation of real intervals and three-dimensional coordinates, the accuracy of calibration points is improved. The problem that some key information is ignored and the calibration precision cannot be comprehensively reflected in the prior art is avoided, the comprehensiveness of camera calibration is greatly improved, and the shooting quality of the camera is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to an error interval estimation and accuracy evaluation method for a camera calibration model. Background Art

[0002] Camera calibration refers to the process of determining the intrinsic parameters, extrinsic parameters and distortion parameters of a camera through a series of calculations and calibrations. Its main purpose is to correct lens distortion, generate a corrected image, and reconstruct a three-dimensional scene based on the obtained image. In existing calibration scenarios, a common method for evaluating the accuracy of a calibration model is to calculate the reprojection error. The reprojection error describes the pixel coordinate error between a three-dimensional point in physical space converted into a two-dimensional point on the image plane by a calibration model and the actual observed image point. Ideally, the two points should completely coincide, but due to the inaccuracy of the calibration model and the presence of noise, there are usually some deviations between the two points. The existing reprojection error algorithm is not intuitive enough, and only focuses on the projection error, and does not fully utilize the actual interval information between the calibration points on the calibration plate for accuracy evaluation and error estimation. This may result in some key information being ignored when evaluating the calibration results, and the calibration accuracy cannot be fully reflected. Summary of the invention

[0003] In view of the deficiencies in the prior art, the present invention provides an error interval estimation and accuracy evaluation method for a camera calibration model, which solves the technical problem in the prior art of ignoring the true interval of calibration points in error estimation, resulting in insufficient calibration accuracy, and achieves the purpose of making full use of the true interval between calibration points to improve the calibration accuracy.

[0004] In order to solve the above technical problems, the present invention provides the following technical solution: a method for error interval estimation and accuracy evaluation of a camera calibration model, the method comprising the following steps:

[0005] S1, obtaining a calibration image of a calibration plate, and preprocessing the calibration image to obtain a preprocessed image;

[0006] S2, creating a two-dimensional rectangular coordinate system with the pixel point O at the center of the preprocessed image as the origin, and constructing a diamond window based on any pixel point of the preprocessed image;

[0007] S3, identifying the type of graphics in the preprocessed image according to the shape of the gray value of the pixel point in the diamond window, and identifying the coordinates of multiple target points (x a ,y d );

[0008] S4, build a calibration model based on the camera calibration method, and convert the coordinates of multiple target points (x a ,y a ) into multiple world coordinates (xh ,y h , z h );

[0009] S5, according to the world coordinates of the target point (x h ,y h , z h ) calculate the interval error N, and obtain the single point evaluation result of the calibration model according to the interval error N;

[0010] S6. Calculate the sample mean based on the world coordinates in the same direction in the world coordinate set and sample variance S;

[0011] S7, based on sample mean Calculate the error confidence interval W of the calibration model using the sample variance S;

[0012] S8. Perform error evaluation on the calibration model through the single-point evaluation result and the error confidence interval W, and obtain the evaluation result.

[0013] Preferably, in step S1, the specific implementation steps are as follows:

[0014] S11, convert the calibration image into RGB channel and calculate the gray value Gr of the pixel in the calibration image a , the calculation formula is:

[0015] G a =0.299×R ij +0.578×G ij +0.114×B ij

[0016] Among them, Gr a Represents the gray value of the pixel in the ath calibration image, R ij , G ij and B ij Respectively represent the pixel value of pixel point (i, j) in RGB channel;

[0017] S12, take any pixel point p a Create a square window Sq with a width of k for the center a , with a width of k as the step size, obtain each pixel point p in the window a Gray value Gr a ;

[0018] S13, the square window Sq a The gray value Gr of the pixel within a Sort and get the pixel median Me a , the expression is:

[0019] Mea =median{Gr a}, Gr a ∈Sq a

[0020] Among them, Me a Represents the pixel median, Sq a Represents a square window;

[0021] S14, use pixel median Me a Replacement square window Sq a The inner center pixel p a The pixel value of

[0022] S15, repeating steps S12-S14 until all pixels of the calibration image are replaced and a median image is obtained;

[0023] S16. Perform edge detection on the median image using a Sobel operator method, and obtain a preprocessed image, the preprocessed image including a grid image and a dot image.

[0024] Preferably, in step S2, the specific implementation steps are as follows:

[0025] S21, in the pre-processed image, taking the pixel point O located at the center as the origin, the horizontal line of the pixels as the X-axis, and the vertical line of the pixels as the Y-axis, to establish a two-dimensional rectangular coordinate system;

[0026] S22. Taking any pixel point in the preprocessed image as the center point, construct a diamond window with diagonal lines e and f.

[0027] Preferably, in step S3, the specific implementation steps are as follows:

[0028] S31, selecting an arbitrary position on the pre-processed image as the initial position of the diamond window, using the diagonal lines e and f in the diamond window as boundaries, and dividing the area within the diamond window into recognition areas A, B, C and D in sequence;

[0029] S32, respectively obtain the sum E of the pixel values ​​of the pixels in the recognition areas A, B, C and D a 、E b , G c and H d , the calculation formula is:

[0030]

[0031] Among them, E a 、F b , G c and H drepresents the sum of the pixel values ​​of each pixel in the recognition areas A, B, C and D, respectively; m, n, p and r represent the number of pixels in the recognition areas A, B, C and D, respectively; e a 、f b , g c and h d Respectively represent the pixel values ​​of the a, b, c and d pixels in the recognition areas A, B, C and D;

[0032] S33, according to the graphic shape and the sum of pixel values ​​E of the pre-processed image a 、F b , G c and H d Identify the target point coordinates (x a ,y d );

[0033] The preprocessed image is a grid image, and the recognition steps are:

[0034] If E a =G c =0 and F b =H d =255 or E a =G c =255 and F b =H d = 0, the center of the diamond window is determined as the target point coordinate (x a ,y d ) and ends;

[0035] If E a ≠F b ≠G c ≠H d or E a =G c =F b =H d , then move the diamond window with a step length R and return to step S31;

[0036] The preprocessed image is a dot image, and the recognition steps are:

[0037] If E a =G c =F b =H d , then determine the center of the diamond window as the target point coordinate (x a ,y d ) and ends;

[0038] If E a ≠F b ≠G c ≠H d, then move the diamond window with a step length R and return to step S31;

[0039] S34, repeat steps S31-S33 until multiple target point coordinates (x a ,y d ), where x a Indicates the horizontal coordinate of the ath target point, y d Represents the ordinate of the dth target point.

[0040] Preferably, in step S4, the specific implementation steps are as follows:

[0041] S41, obtaining the rotation matrix R, translation vector t and intrinsic parameter matrix K of the camera through Zhang Zhengyou calibration method;

[0042] S42. Construct a camera calibration model according to the camera's rotation matrix R, translation vector t and intrinsic parameter matrix K. The calibration model is expressed as:

[0043]

[0044] Among them, x r ,y s 、z t are the world coordinates of the target point coordinates respectively;

[0045] S43, multiple target point coordinates (x a ,y d ) is converted into multiple primitive coordinates (x r ,y s , 1), according to the embryonic coordinates (x r ,y s , 1) Calculate the world coordinates (x h ,y h , z h ) and form a world coordinate set. The world coordinate calculation formula is as follows:

[0046]

[0047] Among them, x h ,y h 、z h Represents the horizontal coordinate, vertical coordinate, and depth coordinate of the world coordinate respectively.

[0048] Preferably, in step S5, the specific implementation steps are as follows:

[0049] S51, select any world coordinate in the world coordinate set as the reference point coordinate (x h,k ,y h,k , z h, k), and calculate the horizontal prediction interval d of the reference pointx and the vertical prediction interval d y , the calculation formula is:

[0050]

[0051] Among them, (x h,k ,y h,k , z h,k ) represents the coordinates of the reference point in the hth row and the kth column, (x h,k+1 ,y h,k+1 , z h,k+1 ) and (x h+1,k ,y h+1,k , z h+1,k ) represent two world coordinates adjacent to the reference point coordinates in the horizontal and vertical directions;

[0052] S52, obtaining the horizontal true interval Dx and the vertical true interval Dy based on the specification parameters of the calibration plate;

[0053] S53, according to the horizontal prediction interval d x and the vertical prediction interval d y Calculate the interval error N.

[0054] Preferably, the calculation formula of the interval error N is:

[0055]

[0056] Where N represents the interval error and M represents the number of reference point coordinates.

[0057] Preferably, in step S6, the specific implementation steps are as follows:

[0058] S61, selecting multiple world coordinates in the same direction from the world coordinate set, and calculating multiple distances d of each pair of adjacent world coordinates q , the spacing between adjacent coordinates is d q The calculation formula is:

[0059] d q =x h,k -x h,k+1

[0060] Among them, d q Indicates the distance between adjacent coordinates in the same direction;

[0061] S62, according to the spacing d of adjacent coordinates q Calculate the sample mean The calculation formula is:

[0062]

[0063] in, represents the sample mean, T represents the spacing d between adjacent coordinates q the number of

[0064] S63. According to the sample mean Calculate the sample variance S, the calculation formula is:

[0065]

[0066] Where S represents the sample variance.

[0067] Preferably, in step S7, the specific implementation steps are as follows:

[0068] S71. According to the sample mean Calculate the population mean using the sample variance S The distribution of is expressed as:

[0069]

[0070] in, represents the overall mean, n-1 represents the overall mean degrees of freedom in the t distribution;

[0071] S72, according to the overall mean In the case of t distribution, the population mean is obtained The error confidence interval W is expressed as:

[0072]

[0073] Where W represents the confidence interval, It means that t is distributed with (n-1) degrees of freedom. quantile of .

[0074] By means of the above technical solution, the present invention provides a method for estimating the error interval and evaluating the accuracy of a camera calibration model, which has at least the following beneficial effects:

[0075] 1. The present invention preprocesses the calibration plate image and uses a diamond window to detect calibration points on the squares or dots of the calibration plate. Under the premise of equal radius and diagonal length, the diamond window has fewer pixels, which greatly reduces the amount of pixel value calculation, improves the recognition efficiency of the calibration points, and shortens the recognition time of the calibration points.

[0076] 2. The present invention converts the coordinates of the calibration points into world coordinates and then calculates the errors of the world coordinates, thereby avoiding the problem of calculating errors by projecting three-dimensional coordinates into two-dimensional pixel coordinates and failing to depict the errors in the real world coordinate system. This improves the accuracy of the calibration point error calculation and greatly improves the accuracy of camera calibration.

[0077] 3. The present invention avoids the problem that the error calculation method of the prior art is not intuitive enough through the calculation of real intervals and three-dimensional coordinates. It only focuses on the projection error and does not fully utilize the real interval information between the calibration points on the calibration plate to perform accuracy evaluation and error estimation. As a result, some key information may be ignored when evaluating the calibration results, and the calibration accuracy cannot be fully reflected. The comprehensiveness of camera calibration is greatly improved, and the camera shooting quality is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0079] Figure 1 A flowchart of a method for error interval estimation and accuracy evaluation of a camera calibration model of the present invention;

[0080] Figure 2 It is a distribution diagram of the confidence interval of the present invention under the degree of freedom (n-1) of t distribution;

[0081] Figure 3 It is a schematic diagram of the calibration plate and the diamond-shaped window of the present invention;

[0082] Figure 4 Schematic diagram of reprojection error in the prior art. DETAILED DESCRIPTION

[0083] In order to make the above-mentioned purposes, 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, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.

[0084] Due to the technical problem of insufficient calibration accuracy caused by ignoring the actual interval of calibration points in error estimation in the prior art, please refer to Figure 1 - Figure 4 This embodiment provides a method for estimating the error interval and evaluating the accuracy of a camera calibration model, which can make full use of the actual interval between calibration points to improve the calibration accuracy. The method includes the following steps:

[0085] S1, obtain the calibration image of the calibration plate, and preprocess the calibration image to obtain the preprocessed image; the calibration plate is a calibration tool used for camera calibration, which is divided into two types: square type and dot type. After obtaining the image of the calibration plate, since the image is not processed and is very unclear, the image needs to be further processed. In step S1, the specific implementation steps are as follows:

[0086] S11, convert the calibration image into RGB channel and calculate the gray value Gr of the pixel in the calibration image a , the calculation formula is:

[0087] G a =0.299×R ij +0.578×G ij +0.114×B ij

[0088] Among them, Gr a Represents the gray value of the pixel in the ath calibration image, R ij , G ij and B ij They represent the pixel values ​​of pixel point (i, j) in RGB channels respectively; firstly, the pixel points in the image are grayed out, and the pixel values ​​in RGB channels are weightedly calculated, where 0.299, 0.578 and 0.114 are set according to the number of visual cells of the human eye corresponding to different colors.

[0089] S12, take any pixel point p a Create a square window Sq with a width of k for the center a , with a width of k as the step size, obtain each pixel point p in the window a Gray value Gr a ; The grayscale values ​​of the pixels of the calibration image are extracted multiple times to facilitate the subsequent steps.

[0090] S13, the square window Sq a The gray value Gr of the pixel within a Sort and get the pixel median Me a , the expression is:

[0091] Me a =median{Gr a}, Gr a ∈Sq a

[0092] Among them, Me a Represents the pixel median, Sq a Represents a square window; sort the pixel values ​​in the window to obtain the median of the pixel values. a It is acquired every time it moves until all pixels in the image are processed.

[0093] S14, use pixel median Me a Replacement square window Sq a The inner center pixel p aThe pixel value of the window center is replaced by the median value, so that the noise in the image is effectively filtered and the image is clearer.

[0094] S15, repeating steps S12-S14 until all pixels of the calibration image are replaced and a median image is obtained;

[0095] S16. Perform edge detection on the median image by using the Sobel operator method, and obtain a preprocessed image. The preprocessed image includes a grid image and a dot image. By preprocessing the image, the grids and dots in the preprocessed image are clearer, which can improve the accuracy of recognition and calculation of calibration points in subsequent steps.

[0096] S2, create a two-dimensional rectangular coordinate system with the pixel point O at the center of the preprocessed image as the origin, and construct a diamond window based on any pixel point of the preprocessed image; in the prior art, the most common circular window is generally used for the recognition of calibration points, but because the circular window has an area about 3 times that of the diamond window when the radius is equal to the diagonal of the diamond window, this seriously affects the amount of pixel calculation. In step S2, the specific implementation steps are as follows:

[0097] S21. In the preprocessed image, a two-dimensional rectangular coordinate system is established with the pixel point O located at the center as the origin, the horizontal line of the pixels as the X-axis, and the vertical line of the pixels as the Y-axis. In order to facilitate the subsequent steps and the calculation of the coordinates of the calibration points, the two-dimensional coordinates of the pixel points can be quickly obtained by establishing the coordinate system in this step.

[0098] S22. In the preprocessed image, take any pixel point as the center point and construct a diamond window with diagonals e and f. Since there are two different calibration plates, square type and dot type, and the sizes of squares and dots are different, the diagonal lines of the diamond need to meet certain conditions, that is, In this way, in the subsequent calibration point calculation, it is convenient for the window to identify the specific coordinate position of the calibration point. By preprocessing the calibration plate image and using a diamond window to detect the calibration points on the squares or dots of the calibration plate, the diamond window has fewer pixels under the premise of the same radius and diagonal length, which greatly reduces the amount of pixel value calculation, improves the recognition efficiency of the calibration point, and shortens the recognition time of the calibration point.

[0099] S3, identifying the type of graphics in the preprocessed image according to the shape of the gray value of the pixel point in the diamond window, and identifying the coordinates of multiple target points (x a ,y d ); By identifying the pixel points in the diamond window, the position of the calibration point can be quickly obtained. In step S3, the specific implementation steps are as follows:

[0100] S31. Select any position on the preprocessed image as the initial position of the diamond window, and use the diagonals e and f in the diamond window as boundaries to divide the area within the diamond window into recognition areas A, B, C and D in sequence; based on the diagonals of the diamond window, further divide the diamond window to make the recognition result more accurate, and the areas of the recognition areas A, B, C and D are exactly the same four right-angled triangles.

[0101] S32, respectively obtain the sum E of the pixel values ​​of the pixels in the recognition areas A, B, C and D a 、F b , G c and H d , the calculation formula is:

[0102]

[0103]

[0104] Among them, E a 、F b , G c and H d represents the sum of the pixel values ​​of each pixel in the recognition areas A, B, C and D, respectively; m, n, p and r represent the number of pixels in the recognition areas A, B, C and D, respectively; e a 、f b , g c and h d They represent the pixel values ​​of the a, b, c and d pixels in the recognition areas A, B, C and D respectively; in the preprocessed image after grayscale, if the pixel value of the pixel is 0, the pixel is black, and if the pixel value of the pixel is 255, the pixel value of the pixel is white. The image of the corresponding square calibration plate is a black and white chessboard-like square, and the image of the dot calibration plate is a pattern of black dots and white background.

[0105] S33, according to the graphic shape and the sum of pixel values ​​F of the pre-processed image a 、F b , G c and H d Identify the target point coordinates (x a ,y d );

[0106] The preprocessed image is a grid image, and the recognition steps are:

[0107] If E a =G c =0 and F b =H d =255 or E a =G c=255 and F b =H d = 0, the center of the diamond window is determined as the target point coordinate (x a ,y d ) and ends; Since the calibration point in the square format is the intersection of four black and white squares, the sum of the pixel values ​​E a 、F b , G c and H d The pixel values ​​should be equally spaced to account for the exact black and white transitions.

[0108] If E a ≠F b ≠G c ≠H d or E a =G c =F b =H d , then move the diamond window with a step length R and return to step S31; if it is found that the center of the diamond window is not a calibration point, it is necessary to move the diamond window until all calibration points are found.

[0109] The preprocessed image is a dot image, and the recognition steps are:

[0110] If E a =G c =F b =H d , then determine the center of the diamond window as the target point coordinate (x a ,y d ) and ends; Due to the characteristic that the calibration point in the circular image is the center of the circle, if the center of the diamond window coincides with the center of the circle, then the sum of the pixel values ​​in the diamond window E a 、F b , G c and H d They must be equal.

[0111] If E a ≠F b ≠G c ≠H d , then move the diamond window with a step length R and return to step S31;

[0112] S34, repeat steps S31-S33 until multiple target point coordinates (x a ,y d ), where x a Indicates the horizontal coordinate of the ath target point, y dThe ordinate represents the coordinate of the dth target point. By using the diamond window to identify the calibration points, the calculation amount of pixel values ​​can be greatly reduced, the recognition efficiency of the calibration points can be improved, and the recognition time of the calibration points can be shortened.

[0113] S4, build a calibration model based on the camera calibration method, and convert the coordinates of multiple target points (x a ,y a ) into multiple world coordinates (x h ,y h , z h ); In order to avoid errors caused by using two-dimensional pixel coordinate calculation in the prior art, in step S4, the specific implementation steps are as follows:

[0114] S41. Obtain the rotation matrix R, translation vector t and intrinsic parameter matrix K of the camera through Zhang Zhengyou calibration method. The Zhang Zhengyou calibration method can directly obtain the desired result without other steps, and Zhang Zhengyou calibration method is a commonly used method in camera calibration, so it will not be repeated.

[0115] S42. Construct a camera calibration model according to the camera's rotation matrix R, translation vector t and intrinsic parameter matrix K. The calibration model is expressed as:

[0116]

[0117] Among them, x r ,y s 、z t are the world coordinates of the target point coordinates respectively;

[0118] S43, multiple target point coordinates (x a ,y d ) is converted into multiple primitive coordinates (x r ,y s , 1), according to the embryonic coordinates (x r ,y s , 1) Calculate the world coordinates (x h ,y h , z h ) and form a world coordinate set. The world coordinate calculation formula is as follows:

[0119]

[0120] Among them, x h ,y h 、z h The horizontal coordinates, vertical coordinates and depth coordinates represent the world coordinates respectively. By converting the two-dimensional coordinates into three-dimensional coordinates, the problem of deviation in the conversion from two-dimensional to three-dimensional can be prevented. Using the real world coordinates can also improve accuracy and increase the recognition accuracy.

[0121] S5, according to the world coordinates of the target point (x h ,y h , z h ) calculate the interval error N, and obtain the single-point evaluation result of the calibration model according to the interval error N; since the prior art uses two-dimensional coordinates in calculating the error, thereby producing inaccurate results, in step S5, the specific implementation steps are as follows:

[0122] S51, select any world coordinate in the world coordinate set as the reference point coordinate (x h,k ,y h,k , z h,k ), and calculate the horizontal prediction interval d of the reference point x and the vertical prediction interval d y , the calculation formula is:

[0123]

[0124] Among them, (x h,k ,y h,k , z h,k ) represents the coordinates of the reference point in the hth row and the kth column, (x h,k+1 ,y h,k+1 , z h,k+1 ) and (x h+1,k ,y h+1,k , z h+1,k ) represents two world coordinates adjacent to the reference point coordinates in the horizontal and vertical directions; the horizontal prediction interval d x and the vertical prediction interval d y It is the spatial distance between a fixed point in the world coordinate system and its adjacent points in the same direction. There are two directions: horizontal and vertical.

[0125] S52. Obtain the horizontal true interval Dx and the vertical true interval Dy based on the specification parameters of the calibration plate. The true interval generally does not need to be calculated. The true interval is a specification parameter of the calibration plate and will be directly provided by the calibration plate manufacturer.

[0126] S53, according to the horizontal prediction interval d x and the vertical prediction interval d y Calculate the interval error N. The calculation formula of the interval error N is:

[0127]

[0128] Among them, N represents the interval error, and M represents the number of reference point coordinates. Through this step, a single-point evaluation result for the error can be obtained. The single-point evaluation result can reflect the error size of the single point, and then further adjustment can be made according to the error size. The error calculation through single-point evaluation can give an error evaluation in the world coordinate system, which is more intuitive and reliable in scale, avoids the problem of calculating errors by projecting three-dimensional coordinates to two-dimensional pixel coordinates, and cannot describe the errors in the real world coordinate system, improves the accuracy of calibration point error calculation, and greatly improves the accuracy of camera calibration.

[0129] S6. Calculate the sample mean based on the world coordinates in the same direction in the world coordinate set and sample variance S; according to the interval between the world coordinates and the calibration points, the error range is calculated. In step S6, the specific implementation steps are as follows:

[0130] S61, selecting multiple world coordinates in the same direction from the world coordinate set, and calculating multiple distances d of each pair of adjacent world coordinates q , the spacing between adjacent coordinates is d q The calculation formula is:

[0131] d q =x h,k -x h,k+1

[0132] Among them, d q Indicates the spacing between adjacent coordinates in the same direction; in this step, the directions refer to the horizontal direction and the vertical direction. Taking the horizontal direction as an example, x h,k and x h,k+1 For two adjacent points in the same horizontal direction, multiple spacings d are calculated q .

[0133] S62, according to the spacing d of adjacent coordinates q Calculate the sample mean The calculation formula is:

[0134]

[0135] in, represents the sample mean, T represents the spacing d between adjacent coordinates q the number of

[0136] S63. According to the sample mean Calculate the sample variance S, the calculation formula is:

[0137]

[0138] Among them, S represents the sample variance, and the sample mean is calculated by The sample variance S can facilitate the further calculation of the error interval in subsequent steps. The sample variance S is a measure of the degree of discreteness of the sample. Using T-1 as the denominator is to obtain an unbiased estimate.

[0139] S7, based on sample mean The error confidence interval W of the calibration model is calculated by adding the sample variance S; since the error calculation method of the prior art is not intuitive enough, it only focuses on the projection error and does not fully utilize the real interval information between the calibration points on the calibration plate to perform accuracy evaluation and error estimation. In step S7, the specific implementation steps are as follows:

[0140] S71. According to the sample mean Calculate the population mean using the sample variance S The distribution of is expressed as:

[0141]

[0142] in, represents the overall mean, n-1 represents the overall mean degrees of freedom in the t distribution; population mean is the mean of the sample population in multiple measurements. Since the population variance is unknown, we cannot directly use the normal distribution As the standard error, the sample standard deviation itself is also a random variable, which increases the uncertainty of the estimate, which makes the distribution of the sample mean no longer a standard normal distribution. Therefore, it is necessary to construct a t distribution to eliminate the standard deviation σ in the formula.

[0143] S72, according to the overall mean In the case of t distribution, the population mean is obtained The error confidence interval W is expressed as:

[0144]

[0145] Where W represents the confidence interval, It means that t is distributed with (n-1) degrees of freedom. quantile, where if α is taken as 0.05, corresponding to the 95% confidence interval, the error calculation method of the prior art is not intuitive enough, only focusing on the projection error, and not making full use of the real interval information between the calibration points on the calibration plate for accuracy evaluation and error estimation, which may lead to the neglect of some key information when evaluating the calibration results, and the inability to fully reflect the calibration accuracy. The comprehensiveness and accuracy of camera calibration are greatly improved.

[0146] S8. Evaluate the calibration model error through single-point evaluation results and error confidence interval W, and obtain evaluation results. Evaluate the calibration error through two evaluation methods: single-point evaluation results and error confidence interval W. It is possible to conduct a more comprehensive evaluation of the calibration results. Not only can the error interval be obtained, but also the error size can be recorded and adjusted according to the evaluation results, which not only improves the accuracy but also improves the camera shooting quality.

[0147] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, so the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0148] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the methods and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for error interval estimation and accuracy evaluation of a camera calibration model, characterized in that: The method comprises the following steps: S1, obtaining a calibration image of a calibration plate, and preprocessing the calibration image to obtain a preprocessed image; S2, creating a two-dimensional rectangular coordinate system with the pixel point O at the center of the preprocessed image as the origin, and constructing a diamond window based on any pixel point of the preprocessed image; S3, identifying the type of graphics in the preprocessed image according to the shape of the gray value of the pixel point in the diamond window, and identifying the coordinates of multiple target points (x a ,y d ); S4, build a calibration model based on the camera calibration method, and convert the coordinates of multiple target points (x a ,y a ) into multiple world coordinates (x h ,y h , z h ); S5, according to the world coordinates of the target point (x h ,y h , z h ) calculate the interval error N, and obtain the single point evaluation result of the calibration model according to the interval error N; S6. Calculate the sample mean based on the world coordinates in the same direction in the world coordinate set and sample variance S; S7, based on sample mean Calculate the error confidence interval W of the calibration model using the sample variance S; S8. Perform error evaluation on the calibration model through the single-point evaluation result and the error confidence interval W, and obtain the evaluation result.

2. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S1, the specific implementation steps are as follows: S11, convert the calibration image into RGB channel and calculate the gray value Gr of the pixel in the calibration image a , the calculation formula is: Gr a =0.299×R ij +0.578×G ij +0.114×B ij Among them, Gr a Represents the gray value of the pixel in the ath calibration image, R ij , G ij and B ij Respectively represent the pixel value of pixel point (i, j) in RGB channel; S12, take any pixel point p a Create a square window Sq with a width of k for the center a , with a width of k as the step size, obtain each pixel point p in the window a Gray value Gr a ; S13, the square window Sq a The gray value Gr of the pixel within a Sort and get the pixel median Me a , the expression is: Me a =median{Gr a },Gr a ∈Sq a Among them, Me a Represents the pixel median, Sq a Represents a square window; S14, use pixel median Me a Replacement square window Sq a The inner center pixel p a The pixel value of S15, repeating steps S12-S14 until all pixels of the calibration image are replaced and a median image is obtained; S16. Perform edge detection on the median image using a Sobel operator method, and obtain a preprocessed image, the preprocessed image including a grid image and a dot image.

3. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S2, the specific implementation steps are as follows: S21, in the pre-processed image, taking the pixel point O located at the center as the origin, the horizontal line of the pixels as the X-axis, and the vertical line of the pixels as the Y-axis, to establish a two-dimensional rectangular coordinate system; S22. Taking any pixel point in the preprocessed image as the center point, construct a diamond window with diagonal lines e and f.

4. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S3, the specific implementation steps are as follows: S31, selecting an arbitrary position on the pre-processed image as the initial position of the diamond window, using the diagonal lines e and f in the diamond window as boundaries, and dividing the area within the diamond window into recognition areas A, B, C and D in sequence; S32, respectively obtain the sum E of the pixel values ​​of the pixels in the recognition areas A, B, C and D a 、F b , G c and H d , the calculation formula is: Among them, E a 、F b , G c and H d represents the sum of the pixel values ​​of each pixel in the recognition areas A, B, C and D, respectively; m, n, p and r represent the number of pixels in the recognition areas A, B, C and D, respectively; e a 、f b , g c and h d Respectively represent the pixel values ​​of the a, b, c and d pixels in the recognition areas A, B, C and D; S33, according to the graphic shape and the sum of pixel values ​​E of the pre-processed image a 、F b , G c and H d Identify the target point coordinates (x a ,y d ); The preprocessed image is a grid image, and the recognition steps are: If E a =G c =0 and F b =H d =255 or E a =G c =255 and F b =H d = 0, the center of the diamond window is determined as the target point coordinate (x a ,y d ) and ends; If E a ≠F b ≠G c ≠H d or E a =G c =F b =H d , then move the diamond window with a step length R and return to step S31; The preprocessed image is a dot image, and the recognition steps are: If E a =G c =F b =H d , then determine the center of the diamond window as the target point coordinate (x a ,y d ) and ends; If E a ≠F b ≠G c ≠H d , then move the diamond window with a step length R and return to step S31; S34, repeat steps S31-S33 until multiple target point coordinates (x a ,y d ), where x a Indicates the horizontal coordinate of the ath target point, y d Represents the ordinate of the dth target point.

5. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S4, the specific implementation steps are as follows: S41, obtaining the rotation matrix R, translation vector t and intrinsic parameter matrix K of the camera through Zhang Zhengyou calibration method; S42. Construct a camera calibration model according to the camera's rotation matrix R, translation vector t and intrinsic parameter matrix K. The calibration model is expressed as: Among them, x r ,y s 、z t are the world coordinates of the target point coordinates respectively; S43, multiple target point coordinates (x a ,y d ) is converted into multiple primitive coordinates (x r ,y s , 1), according to the embryonic coordinates (x r ,y s , 1) Calculate the world coordinates (x h ,y h , z h ) and form a world coordinate set. The world coordinate calculation formula is as follows: Among them, x h ,y h 、z h Represents the horizontal coordinate, vertical coordinate, and depth coordinate of the world coordinate respectively.

6. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S5, the specific implementation steps are as follows: S51, select any world coordinate in the world coordinate set as the reference point coordinate (x h,k ,y h,k , z h,k ), and calculate the horizontal prediction interval d of the reference point x and the vertical prediction interval d y , the calculation formula is: Among them, (x h,k ,y h,k , z h,k ) represents the coordinates of the reference point in the hth row and the kth column, (x h,k+1 ,y h,k+1 , z h,k+1 ) and (x h+1,k ,y h+1,k , z h+1,k ) represent two world coordinates adjacent to the reference point coordinates in the horizontal and vertical directions; S52, obtaining the horizontal true interval Dx and the vertical true interval Dy based on the specification parameters of the calibration plate; S53, according to the horizontal prediction interval d x and the vertical prediction interval d y Calculate the interval error N.

7. The interval estimation and accuracy evaluation method according to claim 6, characterized in that: The calculation formula of the interval error N is: Where N represents the interval error and M represents the number of reference point coordinates.

8. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S6, the specific implementation steps are as follows: S61, selecting multiple world coordinates in the same direction from the world coordinate set, and calculating multiple distances d of each pair of adjacent world coordinates q , the spacing between adjacent coordinates is d q The calculation formula is: d q =x h,k -x h,k+1 Among them, d q Indicates the distance between adjacent coordinates in the same direction; S62, according to the spacing d of adjacent coordinates q Calculate the sample mean The calculation formula is: in, represents the sample mean, T represents the spacing d between adjacent coordinates q the number of S63. According to the sample mean Calculate the sample variance S, the calculation formula is: Where S represents the sample variance.

9. The interval estimation and accuracy evaluation method according to claim 1, characterized in that: In step S7, the specific implementation steps are as follows: S71. According to the sample mean Calculate the population mean using the sample variance S The distribution of is expressed as: in, represents the overall mean, n-1 represents the overall mean degrees of freedom in the t distribution; S72, according to the overall mean In the case of t distribution, the population mean is obtained The error confidence interval W is expressed as: Where W represents the confidence interval, It means that t is distributed with (n-1) degrees of freedom. quantile of .