Image global automatic calibration method, device and related equipment

By using a standard calibration plate with 7×7 specification and image processing technology, combined with the nine-point calibration algorithm, the camera is efficient, accurate and automatic calibration, and the problems of cumbersome and unstable traditional calibration methods are solved.

CN114943775BActive Publication Date: 2025-05-13HONGSUN LASER TECH (FOSHAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210563766.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2025-05-13
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

Traditional camera calibration methods are cumbersome and time-consuming, and the self-calibration algorithm based on feature points is unstable to identify feature points, resulting in calibration failure.

Method used

The preset standard calibration plate with 7×7 specification is adopted to detect the radius and center distance of black dots, and the edge edge detection algorithm is used to extract the calibration point edges, and the affine transformation matrix is ​​obtained by combining the nine-point calibration algorithm to achieve global automatic calibration of the image.

Benefits of technology

It improves the efficiency and accuracy of global image calibration, simplifies calibration steps, is stable and easy to use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114943775B_ABST
    Figure CN114943775B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and related equipment for global automatic calibration of an image, comprising the steps of: preselecting a calibration plate of preset standard specifications; detecting the radius and center distance of a black dot according to the calibration plate of preset standard specifications; obtaining a calibration area of ​​calibration point distribution according to the calibration plate; extracting the edges of the calibration points by using image Blob analysis and Canany edge detection algorithm in the calibration area, and finally obtaining the image center coordinates of 49 calibration points; extracting the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system; obtaining the affine transformation matrix from the image coordinate system to the world coordinate system by a nine-point calibration algorithm according to the coordinates of the extracted calibration points; and obtaining the result according to the affine transformation matrix and then multiplying it by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value. The present invention has high global calibration accuracy, high efficiency and wide application range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic image calibration, and in particular to a method, device, computer equipment and computer-readable storage medium for global automatic image calibration. Background Art

[0002] As people's living standards continue to improve, people's demands on the existing society are also increasing. A camera is a device that uses the principle of optical imaging to form images and uses film to record images. It is an optical instrument used for photography. In modern society, there are many devices that can record images, and they all have the characteristics of cameras, such as medical imaging equipment, astronomical observation equipment, etc. In the field of camera calibration, there are currently two main methods for camera calibration. The first method uses a camera to take multiple images of a scene with a known structure, and calculates the camera's geometric parameters through an algorithm. The other method does not require a specific scene, but only requires the camera to move in a certain pattern and take several images, and calculate the camera's geometric parameters through an algorithm, that is, self-calibration.

[0003] The traditional camera calibration algorithm requires the camera to take multiple images based on the calibration plate (usually 5 to 10 images) and the quality requirements of these images are high. The brightness must be appropriate, the image grayscale must be uniform, there must not be too much noise, it must not be overexposed, it must not be too dark, the calibration plate cannot be placed randomly, and the image field of view must completely cover the calibration area of ​​the calibration plate. It is also necessary to set the initialization parameters of the camera in advance, such as pixel size, image width and height, etc. Therefore, the above calibration steps are cumbersome and time-consuming; and the self-calibration algorithm based on feature points has the defect of unstable recognition of feature points, which leads to calibration failure. Summary of the invention

[0004] In view of the deficiencies of the above related technologies, the present invention proposes a method, device, computer equipment and computer-readable storage medium for global automatic image calibration with high image clarity, accurate calibration and high efficiency.

[0005] In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a method for global automatic calibration of an image, comprising the steps of:

[0006] Preselect a calibration plate of preset standard specifications, wherein the calibration plate is 7×7;

[0007] Detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications;

[0008] Obtaining a calibration area where calibration points are distributed according to the calibration plate, and obtaining coordinates of the centers of 49 points;

[0009] A calibration plate image is captured by a camera, and the image is corrected by rotation. The calibration area is analyzed by image Blob and the edges of the calibration points are extracted by the Canany edge detection algorithm. Finally, the image center coordinates of 49 calibration points are calculated.

[0010] Extracting the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system;

[0011] According to the extracted coordinates of the calibration points, an affine transformation matrix from the image coordinate system to the world coordinate system is calculated by a nine-point calibration algorithm;

[0012] The result obtained according to the affine transformation matrix is ​​then multiplied by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value.

[0013] Preferably, the radius of the black dots is 12.5 m, and the center distance is 25 mm.

[0014] Preferably, the step of obtaining the calibration area of ​​the calibration point distribution according to the calibration plate and obtaining the coordinates of the centers of 49 points includes the following sub-steps:

[0015] The 49 calibration points of the 7×7 calibration plate are evenly distributed in the calibration area. The center of the first black dot in the upper left corner is used as the origin of the coordinate system, the right square is used as the positive direction of the X axis, and the lower square is used as the positive direction of the Y axis to establish a world coordinate system. The center distance is used to calculate the coordinates of the centers of the 49 dots in the world coordinate system. Preferably, extracting the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system includes the following sub-steps:

[0016] The coordinates of the upper left corner calibration point in the image coordinate system and the world coordinate system are extracted using a data arrangement algorithm;

[0017] Extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system;

[0018] Extract the coordinates of the calibration point in the middle of the left side in the image coordinate system and the coordinates in the world coordinate system;

[0019] Extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system;

[0020] Extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the coordinates in the world coordinate system;

[0021] Extract the coordinates of the calibration point in the middle on the right in the image coordinate system and the coordinates in the world coordinate system.

[0022] Preferably, the step of obtaining the affine transformation matrix from the image coordinate system to the world coordinate system by a nine-point calibration algorithm according to the extracted coordinates of the calibration points comprises the following sub-steps:

[0023] Define a point that is [x, y, 1] before transformation and [x', y', 1] after transformation, where x and y represent the coordinates of the point before transformation and x', y' represent the coordinates of the point after transformation. Then fullAffine is expressed as follows:

[0024]

[0025] TX = Y;

[0026]

[0027] After expansion, it satisfies the following relation (3):

[0028] ax+by+c=x′

[0029] dx+ey+f=y′…(3);

[0030] If we need to find the 6 equations needed for the 6 variables a to f, there are 3 sets of points;

[0031] If there are more than 3 groups of points, the minimum square error is used to find the minimum square error, which satisfies the following relationship (4):

[0032]

[0033] In a second aspect, an embodiment of the present invention further provides an image global automatic calibration device, comprising:

[0034] A pre-selection module is used to pre-select a calibration plate of preset standard specifications, wherein the calibration plate is 7×7;

[0035] A detection module, used to detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications;

[0036] An area acquisition module, used to obtain a calibration area of ​​calibration point distribution according to the calibration plate, and obtain the coordinates of the centers of 49 points;

[0037] The first extraction module is used to capture a calibration plate image through a camera, and correct the image by rotation. The calibration area uses image Blob analysis and the Canany edge detection algorithm to extract the edges of the calibration points, and finally calculate the image center coordinates of 49 calibration points;

[0038] A second extraction module is used to extract the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system;

[0039] A calculation module, used for obtaining an affine transformation matrix from the image coordinate system to the world coordinate system through a nine-point calibration algorithm according to the extracted coordinates of the calibration points;

[0040] The coordinate acquisition module is used to obtain the result according to the affine transformation matrix and then multiply it by the coordinate of the starting target pixel point to obtain the coordinate of the starting actual target point, the coordinate of the actual end point and the actual distance value.

[0041] Preferably, the area acquisition module is specifically used to evenly distribute the 49 calibration points of the 7×7 calibration plate in the calibration area, take the center of the first black dot in the upper left corner as the origin of the coordinate system, establish a world coordinate system with the right square as the positive direction of the X-axis and the lower square as the positive direction of the Y-axis, and use the center distance to calculate the coordinates of the centers of the 49 dots in the world coordinate system.

[0042] Preferably, the first extraction module includes:

[0043] A first extraction unit is used to extract the coordinates of the calibration point in the upper left corner in the image coordinate system and the coordinates in the world coordinate system by using a data arrangement algorithm;

[0044] A second extraction unit is used to extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system;

[0045] A third extraction unit is used to extract the coordinates of the calibration point in the middle of the left side in the image coordinate system and the coordinates in the world coordinate system;

[0046] A fourth extraction unit, used to extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system;

[0047] A fifth extraction unit, used to extract the coordinates of the calibration point at the lower right corner in the image coordinate system and the coordinates in the world coordinate system;

[0048] The sixth extraction unit is used to extract the coordinates of the calibration point in the middle of the right side in the image coordinate system and the coordinates in the world coordinate system.

[0049] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned methods for global automatic calibration of images when executing the computer program.

[0050] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in any one of the above-mentioned methods for global automatic calibration of images are implemented.

[0051] Compared with the prior art, the present invention selects a calibration plate of preset standard specifications in advance, wherein the calibration plate is 7×7; detects the radius and center distance of black dots according to the calibration plate of preset standard specifications; obtains a calibration area of ​​calibration point distribution according to the calibration plate, and obtains the coordinates of the centers of 49 dots; collects a calibration plate image through a camera, and corrects the image by rotation, extracts the edges of the calibration points in the calibration area by image Blob analysis and Canany edge detection algorithm, and finally obtains the image center coordinates of 49 calibration points; extracts the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system; obtains the affine transformation matrix from the image coordinate system to the world coordinate system through a nine-point calibration algorithm according to the extracted coordinates of the calibration points; obtains the result according to the affine transformation matrix and then multiplies it by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value; improves the efficiency of image global calibration, has good calibration effect, good stability and is easy to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The present invention will be described in detail below in conjunction with the accompanying drawings. The above and other aspects of the present invention will become clearer and easier to understand through the detailed description made in conjunction with the following drawings. In the accompanying drawings:

[0053] Figure 1 It is a flow chart of the global automatic calibration method of an image of the present invention;

[0054] Figure 2 This is a flow chart of step S05 of the method for global automatic calibration of an image according to the present invention;

[0055] Figure 3 It is a module diagram of the global automatic calibration device of an image according to the present invention;

[0056] Figure 4 It is a module diagram of the first extraction module of the global automatic calibration device for images of the present invention;

[0057] Figure 5 It is a module diagram of the computer device of the present invention.

[0058] In the figure, 200, image global automatic calibration device; 201, pre-selection module; 202, detection module; 203, area acquisition module; 204, first extraction module; 2041, first extraction unit; 2042, second extraction unit; 2043, third extraction unit; 2044, fourth extraction unit; 2045, fifth extraction unit; 2046, sixth extraction unit; 205, second extraction module; 206, calculation module; 207, coordinate acquisition module; 300, computer equipment; 301, memory; 302, processor. DETAILED DESCRIPTION

[0059] The specific implementation of the present invention will be described in detail below with reference to the accompanying drawings.

[0060] The specific implementation modes / embodiments recorded herein are specific implementation modes of the present invention, which are used to illustrate the concept of the present invention, are explanatory and exemplary, and should not be interpreted as limiting the implementation modes of the present invention and the scope of the present invention. In addition to the embodiments recorded herein, those skilled in the art can also adopt other obvious technical solutions based on the contents disclosed in the claims and the specification of this application, and these technical solutions include any obvious replacement and modification of the embodiments recorded herein, which are within the protection scope of the present invention.

[0061] Embodiment 1

[0062] Please refer to Figure 1 As shown, Figure 1 The figure is a flow chart of the global automatic calibration method of an image according to the present invention.

[0063] The embodiment of the present invention provides a method for global automatic calibration of an image, comprising the steps of:

[0064] S01. Preselect a calibration plate of preset standard specifications, wherein the calibration plate is 7×7.

[0065] Specifically, a calibration plate of a preset standard specification may be a commonly used standard calibration plate or a special standard calibration plate designed according to the requirements, wherein the calibration plate is 7×7, and the calibration information on the calibration plate is obtained by first selecting the calibration plate. The calibration information may be spatial information, time sequence information, position information, etc.

[0066] Optionally, the standard calibration plate may also be in the specification of 7×7-40×40, etc., and the specific selection needs to be made according to the actual situation.

[0067] S02. Detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications.

[0068] S03, obtaining a calibration area of ​​calibration point distribution according to the calibration plate, and obtaining the coordinates of the centers of the 49 dots. The 7×7 calibration points of the calibration plate are evenly distributed in the calibration area, and the coordinates of the centers of the 49 dots in the world coordinate system are obtained through the world coordinate system and the center distance.

[0069] S04, capturing a calibration plate image through a camera, and correcting the image by rotation, extracting the edges of the calibration points by image Blob analysis and Canany edge detection algorithm in the calibration area, and finally calculating the image center coordinates of 49 calibration points.

[0070] Among them, image blob analysis is a basic algorithm widely used in image processing. The so-called blob refers to a connected area. The area composed of the same pixel or similar pixels or similar textures is called a blob. The whole process of blob analysis is: select a threshold for binarization (you can perform histogram statistics and find the lowest value between two peaks), then calculate the connected domain (, and then count the center, centroid, shape, area, perimeter and other parameters of different connected domains (that is, blobs).

[0071] Among them, the steps of Canany edge detection algorithm include 1) filtering: the edge detection algorithm is mainly based on the first and second order derivatives of image intensity, but the derivatives are usually very sensitive to noise. Therefore, filters must be used to improve the performance of edge detectors related to noise. Common filtering methods mainly include Gaussian filtering, mean filtering, etc.

[0072] 2) Enhancement: The basis of edge enhancement is to determine the change value of the neighborhood intensity of each point in the image. The enhancement algorithm can highlight the points where the neighborhood intensity value of the grayscale point in the image has a significant change. In the specific programming implementation, it can be determined by calculating the gradient amplitude.

[0073] 3) Detection: After the enhancement, there are often many points in the neighborhood with large gradient values. In certain applications, these points are not the edge points we are looking for, so some method should be used to select these points. In actual engineering, the commonly used method is to detect through the threshold method. Thin the edge to find the real edge.

[0074] Specifically, the interference on the image is filtered out by using image Blob analysis in the calibration area and the edges of the calibration points are extracted by the Canany edge detection algorithm, so that the obtained edge points are accurate. Finally, the image center coordinates of 49 calibration points are calculated. The image center coordinates are accurately calibrated, the calibration steps are simple, and the stability is high.

[0075] S05. Extracting the coordinates of the 49 calibration points in the image coordinate system and the world coordinate system.

[0076] Among them, camera calibration generally requires a special calibration reference object placed in front of the camera. The camera obtains the image of the object and calculates the internal and external parameters of the camera. The position of each feature point on the calibration reference object relative to the world coordinate system should be accurately measured during production. The world coordinate system can be selected as the object coordinate system of the reference object. After obtaining the projection position of these known points on the image, the internal and external parameters of the camera can be calculated.

[0077] The image coordinate system is a coordinate system established with the camera lens as the origin. The world coordinate system is the absolute coordinate system of the system. Before the user coordinate system is established, the coordinates of all points on the screen are determined by the origin of the center of the black circle. The image coordinate system coordinates and the world coordinate system coordinates are obtained. By extracting the coordinates of the 9 calibration points in the image coordinate system and the coordinates in the world coordinate system, the position of the calibration point is determined according to the coordinates, with high accuracy.

[0078] S06. According to the extracted coordinates of the calibration points, the affine transformation matrix from the image coordinate system to the world coordinate system is calculated by a nine-point calibration algorithm. The affine transformation matrix from the image coordinate system to the world coordinate system is calculated by a nine-point calibration algorithm, which has high calculation efficiency, high accuracy and is easy to use.

[0079] Among them, the affine transformation matrix, also known as affine mapping, refers to a vector space that undergoes a linear transformation followed by a translation to transform into another vector space in geometry. Affine transformation is geometrically defined as an affine transformation between two vector spaces or an affine mapping consisting of a non-singular linear transformation followed by a translation transformation.

[0080] S07. After obtaining the result according to the affine transformation matrix, multiply it by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value.

[0081] The coordinates of the starting actual target point are the coordinates of the starting calibrated target point, the coordinates of the actual end point are the coordinates of the actual end point, and the actual distance value is the distance between the starting coordinates and the end point coordinates.

[0082] Specifically, a calibration plate of preset standard specifications is selected in advance, and the radius and center distance of black dots are detected according to the calibration plate of preset standard specifications; ROI following is performed according to the radius of the black dots; a calibration area of ​​calibration point distribution is obtained according to the RIO following; interference on the image is filtered out through the calibration area by image Blob analysis, and the edges of the calibration points are extracted by the Canany edge detection algorithm, and finally the image center coordinates of 9 calibration points are calculated; the coordinates of the 9 calibration points in the image coordinate system and the coordinates in the world coordinate system are extracted; according to the extracted coordinates of the calibration points, the affine transformation matrix from the image coordinate system to the world coordinate system is calculated by the nine-point calibration algorithm; after the result is calculated according to the affine transformation matrix, it is multiplied by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value; the efficiency of global image calibration is improved, and the calibration effect is good, the stability is good, and it is easy to use.

[0083] In this embodiment, the radius of the black dots is 12.5 mm, and the center distance is 25 mm. The radius and center distance of the black dots are moderate, and the calibration points on the calibration plate are accurately calibrated with good results.

[0084] In this embodiment, step S03 includes the following sub-steps: the 49 calibration points of the 7×7 calibration plate are evenly distributed in the calibration area, the center of the first black dot in the upper left corner is used as the origin of the coordinate system, the right square is used as the positive direction of the X-axis, and the lower square is used as the positive direction of the Y-axis to establish a world coordinate system, and the center distance is used to calculate the coordinates of the centers of the 49 dots in the world coordinate system.

[0085] In this embodiment, please refer to Figure 2 As shown, Figure 2 This is a flow chart of step S05 of the global automatic calibration method of an image according to the present invention. Step S05 specifically includes the following sub-steps:

[0086] S051. Using a data arrangement algorithm, extract the coordinates of the calibration point in the upper left corner in the image coordinate system and the coordinates in the world coordinate system.

[0087] S052. Extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system.

[0088] S053. Extract the coordinates of the calibration point in the middle of the left side in the image coordinate system and the coordinates in the world coordinate system.

[0089] S054. Extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system.

[0090] S055. Extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the coordinates in the world coordinate system.

[0091] S056. Extract the coordinates of the calibration point in the middle on the right side in the image coordinate system and the coordinates in the world coordinate system.

[0092] Specifically, because the 49 calibration points of the 7×7 calibration plate are evenly distributed in the calibration area, the coordinates of the calibration point in the upper left corner in the image coordinate system and the coordinates in the world coordinate system are extracted using the data arrangement algorithm. Extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system. Extract the coordinates of the calibration point in the middle of the left corner in the image coordinate system and the coordinates in the world coordinate system. Extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system. Extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the coordinates in the world coordinate system. Extract the coordinates of the calibration point in the middle of the right corner in the image coordinate system and the coordinates in the world coordinate system. By extracting the coordinates of the calibration points in the lower left corner, the upper left corner, the middle of the left, the upper right corner, the lower right corner, and the middle of the right corner in the image coordinate system and the coordinates in the world coordinate system, they can be stored according to the coordinate information, which is convenient for extracting the coordinates of the calibration points, with high accuracy and easy use.

[0093] In this embodiment, the step of obtaining the affine transformation matrix from the image coordinate system to the world coordinate system by a nine-point calibration algorithm according to the extracted coordinates of the calibration points includes the following sub-steps:

[0094] Define a point that is [x, y, 1] before transformation and [x', y', 1] after transformation, where x and y represent the coordinates of the point before transformation and x', y' represent the coordinates of the point after transformation. Then fullAffine is expressed as follows:

[0095]

[0096] TX = Y;

[0097]

[0098] After expansion, it satisfies the following relation (3):

[0099] ax+by+c=x′

[0100] dx+ey+f=y′…(3);

[0101] If we need to find the 6 equations needed for the 6 variables a to f, there are 3 sets of points;

[0102] If there are more than 3 groups of points, the minimum square error is used to find the minimum square error, which satisfies the following relationship (4):

[0103]

[0104] The nine-point calibration algorithm principle is used to improve the automatic calibration effect on the calibration board and the efficiency of global image calibration. The calibration effect is good, the stability is good, and the use is convenient.

[0105] Embodiment 2

[0106] Please refer to Figure 3 As shown, Figure 3 The present invention also provides a global automatic image calibration device 200, comprising:

[0107] The pre-selection module 201 is used to pre-select a calibration plate of a preset standard specification, wherein the calibration plate is 7×7.

[0108] The detection module 202 is used to detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications.

[0109] The area acquisition module 203 is used to obtain the calibration area of ​​the calibration point distribution according to the calibration plate, and obtain the coordinates of the centers of the 49 points.

[0110] The first extraction module 204 is used to capture a calibration plate image through a camera, and correct the image by rotation. The calibration area uses image Blob analysis and Canany edge detection algorithm to extract the edges of the calibration points, and finally calculates the image center coordinates of 49 calibration points.

[0111] The second extraction module 205 is used to extract the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system.

[0112] The calculation module 206 is used to calculate the affine transformation matrix from the image coordinate system to the world coordinate system through a nine-point calibration algorithm according to the extracted coordinates of the calibration points.

[0113] The coordinate obtaining module 207 is used to obtain the result obtained according to the affine transformation matrix and then multiply it by the coordinate of the starting target pixel point to obtain the coordinate of the starting actual target point, the coordinate of the actual end point and the actual distance value.

[0114] Specifically, the preselection module 201 is used to preselect a calibration plate of preset standard specifications, wherein the calibration plate is 7×7. The detection module 202 is used to detect the radius and center distance of the black dots according to the calibration plate of preset standard specifications. The area acquisition module 203 is used to obtain the calibration area of ​​the calibration point distribution according to the calibration plate, and obtain the coordinates of the centers of 49 dots. The first extraction module 204 is used to capture a calibration plate image through a camera, and correct the image by rotation. The calibration area uses image Blob analysis and the Canany edge detection algorithm to extract the edges of the calibration points, and finally calculate the image center coordinates of the 49 calibration points. The second extraction module 205 is used to extract the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system. The calculation module 206 is used to calculate the affine transformation matrix from the image coordinate system to the world coordinate system through the nine-point calibration algorithm according to the extracted coordinates of the calibration points. The coordinate acquisition module 207 is used to obtain the result obtained according to the affine transformation matrix and then multiply it by the coordinate of the starting target pixel point to obtain the coordinate of the starting actual target point, the coordinate of the actual end point and the actual distance value.

[0115] In this embodiment, the area acquisition module is specifically used to evenly distribute the 49 calibration points of the 7×7 calibration plate in the calibration area, take the center of the first black dot in the upper left corner as the origin of the coordinate system, establish a world coordinate system with the right square as the positive direction of the X-axis and the lower square as the positive direction of the Y-axis, and use the center distance to calculate the coordinates of the centers of the 49 dots in the world coordinate system.

[0116] In this example, see Figure 4 , Figure 4 204 is a block diagram of the first extraction module of the image global automatic calibration device of the present invention. The first extraction module 204 includes:

[0117] The first extraction unit 2041 is used to extract the coordinates of the upper left corner calibration point in the image coordinate system and the coordinates in the world coordinate system by using a data arrangement algorithm.

[0118] The second extraction unit 2042 is used to extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system.

[0119] The third extraction unit 2043 is used to extract the coordinates of the left middle calibration point in the image coordinate system and the coordinates in the world coordinate system.

[0120] The fourth extraction unit 2044 is used to extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system.

[0121] The fifth extraction unit 2045 is used to extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the coordinates in the world coordinate system.

[0122] The sixth extraction unit 2046 is used to extract the coordinates of the right middle calibration point in the image coordinate system and the coordinates in the world coordinate system.

[0123] Specifically, the first extraction unit 2041 is used to extract the coordinates of the calibration point in the upper left corner in the image coordinate system and the coordinates of the world coordinate system by using the data arrangement algorithm. The second extraction unit 2042 is used to extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates of the world coordinate system. The third extraction unit 2043 is used to extract the coordinates of the calibration point in the middle of the left corner in the image coordinate system and the coordinates of the world coordinate system. The fourth extraction unit 2044 is used to extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates of the world coordinate system. The fifth extraction unit 2045 is used to extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the coordinates of the world coordinate system. The sixth extraction unit 2046 is used to extract the coordinates of the calibration point in the middle of the right corner in the image coordinate system and the coordinates of the world coordinate system.

[0124] Optionally, the specific implementation of Example 2 is the same as that of Example 1 described above, and will not be described one by one here.

[0125] Embodiment 3

[0126] Please refer to Figure 5 As shown, Figure 5 The embodiment of the present invention further provides a computer device 300, comprising a memory 301, a processor 302, and a computer program stored in the memory 301 and executable on the processor, wherein the processor 302 implements the steps of the global automatic calibration method of the image described in the first embodiment when executing the computer program.

[0127] Embodiment 4

[0128] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method for global automatic calibration of an image described in the first embodiment are implemented.

[0129] Compared with the prior art, the present invention selects a calibration plate of preset standard specifications in advance, wherein the calibration plate is 7×7; detects the radius and center distance of black dots according to the calibration plate of preset standard specifications; obtains a calibration area of ​​calibration point distribution according to the calibration plate, and obtains the coordinates of the centers of 49 dots; collects a calibration plate image through a camera, and corrects the image by rotation, extracts the edges of the calibration points in the calibration area by image Blob analysis and Canany edge detection algorithm, and finally obtains the image center coordinates of 49 calibration points; extracts the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system; obtains the affine transformation matrix from the image coordinate system to the world coordinate system through a nine-point calibration algorithm according to the extracted coordinates of the calibration points; obtains the result according to the affine transformation matrix and then multiplies it by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value; improves the efficiency of image global calibration, has good calibration effect, good stability and is easy to use.

Claims

1. A global automatic image calibration method, characterized in that: Includes steps: Preselect a calibration plate of preset standard specifications, wherein the calibration plate is 7×7; Detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications; Obtaining a calibration area where calibration points are distributed according to the calibration plate, and obtaining coordinates of the centers of 49 points; A calibration plate image is captured by a camera, and the image is corrected by rotation. The calibration area is analyzed by image Blob and the edges of the calibration points are extracted by the Canany edge detection algorithm. Finally, the image center coordinates of 49 calibration points are calculated. Extracting the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system; According to the extracted coordinates of the calibration points, an affine transformation matrix from the image coordinate system to the world coordinate system is calculated by a nine-point calibration algorithm; The result obtained according to the affine transformation matrix is ​​then multiplied by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the coordinates of the actual end point and the actual distance value.

2. The method for global automatic image calibration according to claim 1, characterized in that: The radius of the black dots is 12.5m, and the center distance is 25mm.

3. The method for global automatic image calibration according to claim 1, characterized in that: The step of obtaining the calibration area of ​​the calibration point distribution according to the calibration plate and obtaining the coordinates of the centers of the 49 points includes the following sub-steps: The 49 calibration points of the 7×7 calibration plate are evenly distributed in the calibration area. The center of the first black dot in the upper left corner is taken as the origin of the coordinate system. The world coordinate system is established with the right square as the positive direction of the X-axis and the bottom square as the positive direction of the Y-axis. The center distance is used to calculate the coordinates of the centers of the 49 dots in the world coordinate system.

4. The method for global automatic image calibration according to claim 3, characterized in that: The step of extracting the coordinates of the 49 calibration points in the image coordinate system and the coordinates of the 49 calibration points in the world coordinate system comprises the following sub-steps: The coordinates of the upper left corner calibration point in the image coordinate system and the world coordinate system are extracted using a data arrangement algorithm; Extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system; Extract the coordinates of the calibration point in the middle of the left side in the image coordinate system and the coordinates in the world coordinate system; Extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system; Extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the coordinates in the world coordinate system; Extract the coordinates of the calibration point in the middle on the right in the image coordinate system and the coordinates in the world coordinate system.

5. The method for global automatic image calibration according to claim 1, characterized in that: The step of obtaining the affine transformation matrix from the image coordinate system to the world coordinate system by a nine-point calibration algorithm according to the extracted coordinates of the calibration points comprises the following sub-steps: Define a point that is [x, y, 1] before transformation and [x', y', 1] after transformation, where x and y represent the coordinates of the point before transformation and x', y' represent the coordinates of the point after transformation. Then fullAffine is expressed as follows: TX = Y; After expansion, it is shown that the following relationship (3) is satisfied: ax+by+c=x′ dx+ey+f=y′…(3); If we need to solve the 6 equations required for the 6 variables a to f, there are 3 sets of points; If there are more than 3 groups of points, the minimum square error is used to find the minimum square error, which satisfies the following relationship (4):

6. An image global automatic calibration device, characterized in that: include: A pre-selection module is used to pre-select a calibration plate of preset standard specifications, wherein the calibration plate is 7×7; A detection module, used to detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications; An area acquisition module, used to obtain a calibration area of ​​calibration point distribution according to the calibration plate, and obtain the coordinates of the centers of 49 points; The first extraction module is used to capture a calibration plate image through a camera, and correct the image by rotation. The calibration area uses image Blob analysis and the Canany edge detection algorithm to extract the edges of the calibration points, and finally calculate the image center coordinates of 49 calibration points; A second extraction module is used to extract the coordinates of the 49 calibration points in the image coordinate system and the coordinates in the world coordinate system; A calculation module, used for obtaining an affine transformation matrix from the image coordinate system to the world coordinate system through a nine-point calibration algorithm according to the extracted coordinates of the calibration points; The coordinate acquisition module is used to obtain the result according to the affine transformation matrix and then multiply it by the coordinate of the starting target pixel point to obtain the coordinate of the starting actual target point, the coordinate of the actual end point and the actual distance value.

7. The image global automatic calibration device according to claim 6, characterized in that: The area acquisition module is specifically used to evenly distribute the 49 calibration points of the 7×7 calibration plate in the calibration area, take the center of the first black dot in the upper left corner as the origin of the coordinate system, establish a world coordinate system with the right square as the positive direction of the X-axis and the lower square as the positive direction of the Y-axis, and use the center distance to calculate the coordinates of the centers of the 49 dots in the world coordinate system.

8. The image global automatic calibration device according to claim 7, characterized in that: The first extraction module comprises: A first extraction unit is used to extract the coordinates of the calibration point in the upper left corner in the image coordinate system and the coordinates in the world coordinate system by using a data arrangement algorithm; A second extraction unit is used to extract the coordinates of the calibration point in the lower left corner in the image coordinate system and the coordinates in the world coordinate system; A third extraction unit is used to extract the coordinates of the calibration point in the middle of the left side in the image coordinate system and the coordinates in the world coordinate system; A fourth extraction unit, used to extract the coordinates of the calibration point in the upper right corner in the image coordinate system and the coordinates in the world coordinate system; A fifth extraction unit, used to extract the coordinates of the calibration point of the lower right corner in the image coordinate system and the coordinates in the world coordinate system; The sixth extraction unit is used to extract the coordinates of the calibration point in the middle of the right side in the image coordinate system and the coordinates in the world coordinate system.

9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for global automatic calibration of an image as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for global automatic calibration of an image as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Calibration method and system for three-dimensional imaging system based on rotating shaft and binocular camera

    CN109118545A

  • Method for improving camera calibration accuracy by using multi-plane calibration board

    CN111429532A