Image local automatic calibration method, device and related equipment

By using 3×3 calibration plates and image processing algorithms with preset standard specifications, the problems of cumbersome and time-consuming traditional camera calibration methods and unstable self-calibration algorithms are solved, and efficient and accurate local automatic calibration of images are achieved.

CN114882122BActive Publication Date: 2025-08-15FOSHAN CONGYU PHOTOELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing camera calibration methods are cumbersome and time-consuming, and the self-calibration algorithm is not stable. The traditional methods require high image quality and are susceptible to noise.

Method used

The 3×3 calibration plate with preset standard specifications is used to detect the radius and center distance of black dots, the edges of the calibration points are extracted using ROI follow-up, image Blob analysis and Canany edge detection algorithm, and the affine transformation matrix is calculated in combination with the nine-point calibration algorithm to obtain the correspondence between the image and the world coordinate system.

Benefits of technology

It improves the efficiency and stability of local image calibration, simplifies the calibration steps, and ensures the accuracy of calibration effects and the convenience of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114882122B_ABST
    Figure CN114882122B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, and related equipment for local automatic image calibration, comprising the following steps: preselecting a calibration plate of preset standard specifications; detecting the radius and center distance of black dots based on the calibration plate; performing ROI tracking based on the radius of the black dots; obtaining a calibration area where calibration points are distributed based on the ROI tracking; extracting the edges of the calibration points using image Blob analysis and a Canany edge detection algorithm in the calibration area and calculating the image center coordinates of each calibration point; extracting the coordinates of nine calibration points in the image coordinate system and in the world coordinate system; calculating an affine transformation matrix from the image coordinate system to the world coordinate system using a nine-point calibration algorithm; and multiplying the result obtained based on the affine transformation matrix by the coordinates of the starting target pixel point to obtain the coordinates of the starting actual target point, the actual coordinates of the end point, and the actual distance value. The present invention has high calibration accuracy, high efficiency, and a wide range of applications.
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 automatic local image calibration. Background Art

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

[0003] Traditional camera calibration algorithms require the camera to capture multiple images (typically 5 to 10) based on a calibration plate. These images must meet high quality requirements, including appropriate brightness, uniform grayscale, and no excessive noise, overexposure, or darkness. The calibration plate cannot be randomly placed, and the image field of view must completely cover the calibration area of the plate. Camera initialization parameters, such as pixel size and image width and height, must also be set in advance. Consequently, the aforementioned calibration steps are tedious and time-consuming. Furthermore, feature point-based self-calibration algorithms suffer from unstable feature point recognition, leading to calibration failures. Summary of the Invention

[0004] In view of the deficiencies of the above related technologies, the present invention proposes a method, apparatus, computer device and computer-readable storage medium for automatic local 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 automatic local calibration of an image, comprising the steps of:

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

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

[0008] Perform ROI tracking according to the black dot radius;

[0009] The method further comprises following the ROI to obtain a calibration area where calibration points are distributed, and obtaining the coordinates of the centers of the nine points;

[0010] The image Blob analysis is used to filter out the interference on the image through the calibration area and the edges of the calibration points are extracted by the Canany edge detection algorithm, and finally the image center coordinates of the 9 calibration points are obtained;

[0011] Extracting the coordinates of the nine calibration points in the image coordinate system and the world coordinate system;

[0012] 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 using a nine-point calibration algorithm;

[0013] The result obtained according to the affine transformation matrix 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.

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

[0015] Preferably, performing ROI tracking according to the black dot radius includes the following sub-steps:

[0016] Place the calibration plate in the field of view of the camera to obtain an image;

[0017] The image is used as a template image, and an ROI is drawn on the template image as a template ROI;

[0018] According to the template ROI area, the area near the black missing triangle of the calibration plate is used as a reference, covering nine calibrated point areas;

[0019] Using the black missing triangle of the calibration plate as a template, template matching is performed on the new calibration plate image to obtain the position of the black missing triangle on the new calibration plate image;

[0020] The position of the template ROI on the new calibration plate image is obtained according to the relative position of the black missing triangle and the template ROI, which is recorded as the real-time ROI.

[0021] Preferably, the step of obtaining a calibration area of calibration point distribution according to the ROI and obtaining the coordinates of the centers of the nine points includes the following sub-steps:

[0022] Only 3×3 calibration points are evenly distributed in the calibration area on the instant ROI. 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 bottom 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 9 dots in the world coordinate system.

[0023] Preferably, filtering out interference on the image by using image Blob analysis in the calibration area and extracting the edges of the calibration points by using the Canany edge detection algorithm, and finally obtaining the image center coordinates of the nine calibration points specifically comprises the following steps:

[0024] On the instant ROI image, correcting the instant ROI image by rotating;

[0025] The image is obtained by detecting the calibration plate area through Blob analysis;

[0026] Using the image Blob analysis to filter out the interference on the image in the calibration area and extracting the edges of the calibration points by using the Canany edge detection algorithm;

[0027] Finally, the image center coordinates of the 9 calibration points are obtained through calculation.

[0028] Preferably, extracting the coordinates of the nine calibration points in the image coordinate system and the world coordinate system includes the following sub-steps:

[0029] 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;

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

[0031] 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;

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

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

[0034] 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.

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

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

[0037]

[0038] TX=Y;

[0039]

[0040] After expansion, it is shown that the following relationship (3) is satisfied:

[0041] ax+by+c=x′

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

[0043] If we need to solve the 6 equations required for the 6 variables a to f, there are 3 sets of points;

[0044] If there are more than 3 groups of points, the minimum variance is used to find the value, which satisfies the following equation (4):

[0045]

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

[0047] A preselection module is used to preselect a calibration plate of preset standard specifications, wherein the calibration plate is 3×3;

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

[0049] A following module, configured to perform ROI following according to the radius of the black dot;

[0050] An area acquisition module is used to obtain a calibration area where calibration points are distributed according to the ROI and obtain the coordinates of the centers of the nine points;

[0051] The first extraction module is used to filter out interference on the image by using image Blob analysis in the calibration area and extract the edges of the calibration points by using the Canany edge detection algorithm, and finally calculate the image center coordinates of the nine calibration points;

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

[0053] A calculation module, configured to calculate an affine transformation matrix from the image coordinate system to the world coordinate system using a nine-point calibration algorithm according to the extracted coordinates of the calibration points;

[0054] The coordinate acquisition module is used to obtain the result obtained according to the affine transformation matrix and then 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.

[0055] 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 on the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned methods for local automatic calibration of an image when executing the computer program.

[0056] 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 automatic local calibration of an image are implemented.

[0057] Compared with the prior art, the present invention pre-selects a calibration plate of preset standard specifications, detects the radius and center distance of the black dots according to the calibration plate of preset standard specifications; performs ROI tracking according to the radius of the black dots; obtains a calibration area of calibration point distribution according to the ROI tracking; filters out interference on the image through the calibration area by image Blob analysis and extracts the edges of the calibration points by the Canany edge detection algorithm, and finally calculates the image center coordinates of 9 calibration points; extracts the coordinates of the 9 calibration points in the image coordinate system and the coordinates in the world coordinate system; calculates the affine transformation matrix from the image coordinate system to the world coordinate system by the nine-point calibration algorithm according to the extracted coordinates of the calibration points; multiplies the result obtained according to the affine transformation matrix 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 local image calibration, has good calibration effect, good stability and is easy to use. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0059] Figure 1 This is a flow chart of the method for automatic local calibration of an image according to the present invention;

[0060] Figure 2 This is a flow chart of step S03 of the method for automatic local image calibration of the present invention;

[0061] Figure 3 This is a flow chart of step S05 of the method for automatic local image calibration of the present invention;

[0062] Figure 4 This is a flow chart of step S06 of the method for automatic local image calibration of the present invention;

[0063] Figure 5 This is a module diagram of the device for automatic local image calibration of the present invention;

[0064] Figure 6 It is a module diagram of the computer device of the present invention.

[0065] In the figure, 200 is an image local automatic calibration device; 201 is a preselection module; 202 is a detection module; 203 is a following module; 204 is a region acquisition module; 205 is a first extraction module; 206 is a second extraction module; 207 is a calculation module; 208 is a coordinate acquisition module; 300 is a computer device; 301 is a memory; and 302 is a processor. DETAILED DESCRIPTION

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

[0067] The specific embodiments / examples described herein are specific embodiments of the present invention and are used to illustrate the concept of the present invention. They are illustrative and exemplary and should not be construed as limiting the embodiments of the present invention or the scope of the present invention. In addition to the examples described herein, those skilled in the art can also adopt other obvious technical solutions based on the claims and the disclosure of the specification. These technical solutions, including any obvious replacements and modifications of the embodiments described herein, are all within the scope of protection of the present invention.

[0068] Example 1

[0069] Please refer to Figure 1 As shown, Figure 1 This is a flow chart of the method for local automatic calibration of an image according to the present invention.

[0070] An embodiment of the present invention provides a method for automatic local calibration of an image, comprising the steps of:

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

[0072] Specifically, a standard calibration plate is preset. This can be a commonly used standard calibration plate or a custom-designed standard calibration plate. The calibration plate is 3×3. The calibration information on the plate is obtained by first selecting the calibration plate. The calibration information can include spatial information, temporal information, position information, etc.

[0073] Optionally, the standard calibration plate can also be in specifications of 7×7-40×40, etc., and the specific selection needs to be made according to actual conditions.

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

[0075] S03. Perform ROI tracking according to the radius of the black dot.

[0076] Specifically, position the calibration plate as straight as possible within the camera's field of view and capture an image, which serves as the template image. The template ROI (Restricted Area of Interest) is based on the area around the black missing triangle on the calibration plate and covers the nine calibrated points. Using the missing triangle as a template, template matching is performed on the new calibration plate image to determine the location of the missing triangle on the new calibration plate image. The relative position of the missing triangle and the template ROI determines the position of the template ROI on the new calibration plate image.

[0077] S04. Obtain a calibration area for the calibration point distribution based on the ROI tracking, and obtain the coordinates of the centers of the nine points. ROI tracking is used to evenly distribute the 3×3 calibration points within the calibration area. The coordinates of the centers of the nine points in the world coordinate system are calculated using the world coordinate system and the center distance.

[0078] S05. Using the image Blob analysis in the calibration area to filter out interference on the image and using the Canany edge detection algorithm to extract the edges of the calibration points, and finally calculating the image center coordinates of the nine calibration points.

[0079] Image blob analysis is a widely used fundamental algorithm in image processing. A blob is a connected region consisting of the same pixel, adjacent pixels, or similar textures. The entire blob analysis process involves selecting a threshold for binarization (this can be done by performing a histogram analysis to find the lowest value between two peaks), calculating connected regions, and then analyzing parameters such as center, centroid, shape, area, and perimeter for each connected region (i.e., a blob).

[0080] The Canany edge detection algorithm includes the following steps: 1) Filtering: Edge detection algorithms are primarily based on the first- and second-order derivatives of image intensity, but these derivatives are often sensitive to noise. Therefore, filters must be used to improve the performance of edge detectors related to noise. Common filtering methods include Gaussian filtering and mean filtering.

[0081] 2) Enhancement: Edge enhancement is based on determining the intensity change of each image point's neighborhood. The enhancement algorithm highlights points where the intensity of their grayscale neighbors changes significantly. This can be determined by calculating the gradient amplitude in a specific implementation.

[0082] 3) Detection: After an enhancement, many points in the neighborhood often have large gradient values. However, in certain applications, these points are not the edge points we are looking for, so a method should be used to select and reject these points. In practical applications, a common method is thresholding, which refines the edges and ultimately finds the true edges.

[0083] 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 through the Canany edge detection algorithm, so that the obtained edge points are accurate. Finally, the image center coordinates of the 9 calibration points are calculated. The image center coordinates are calibrated accurately, the calibration steps are simple, and the stability is high.

[0084] S06: Extracting the coordinates of the nine calibration points in the image coordinate system and the world coordinate system.

[0085] Camera calibration typically requires a specially designed calibration reference object placed in front of the camera. The camera captures an image of the object and uses this image to calculate the camera's intrinsic and extrinsic parameters. The position of each feature point on the calibration reference object relative to the world coordinate system (which can be the object coordinate system of the reference object) must be precisely determined during production. Once the projected positions of these known points on the image are determined, the camera's intrinsic and extrinsic parameters can be calculated.

[0086] 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 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 positions of the calibration points are determined according to the coordinates, which has high accuracy.

[0087] S07. Based on the extracted coordinates of the calibration points, calculate the affine transformation matrix from the image coordinate system to the world coordinate system using a nine-point calibration algorithm. Using a nine-point calibration algorithm to calculate the affine transformation matrix from the image coordinate system to the world coordinate system is efficient, accurate, and easy to use.

[0088] An affine transformation matrix, also known as an affine mapping, is a transformation of a vector space into another vector space by performing a linear transformation followed by a translation. An 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.

[0089] S08. 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.

[0090] The coordinates of the actual starting target point are the coordinates of the starting calibration 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.

[0091] Specifically, a calibration plate of preset standard specifications is selected in advance, and the radius and center distance of the black dots are detected according to the calibration plate of preset standard specifications; ROI tracking is performed according to the radius of the black dots; a calibration area of the calibration point distribution is obtained according to the ROI tracking; 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 the 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 coordinates of the extracted calibration points, the affine transformation matrix from the image coordinate system to the world coordinate system is calculated by the nine-point calibration algorithm; the result calculated according to the affine transformation matrix 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 local image calibration is improved, the calibration effect is good, the stability is good, and it is easy to use.

[0092] 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.

[0093] In this embodiment, please refer to Figure 2 As shown, Figure 2 This is a flowchart of step S03 of the method for local automatic calibration of an image according to the present invention. The ROI tracking according to the radius of the black dot includes the following sub-steps:

[0094] S031. Align the calibration plate and place it in the camera's field of view to obtain an image. By placing a standard calibration plate in the camera's field of view, the camera captures image information of the calibration plate. The image information may include calibration points, calibration areas, etc. on the calibration plate.

[0095] Furthermore, after the camera acquires image data, it can undergo image preprocessing to ensure image clarity. Image preprocessing involves separating each text image and handing it off to the recognition module for recognition. This process is called image preprocessing. In image analysis, this is the processing performed on the input image before feature extraction, segmentation, and matching. The main purpose of image preprocessing is to eliminate irrelevant information from the image, restore useful real-world information, enhance the detectability of relevant information, and minimize data simplification, thereby improving the reliability of feature extraction, image segmentation, matching, and recognition. This, in turn, enhances image processing effectiveness and facilitates its use in the next step.

[0096] S032: Use the image as a template image, and draw a ROI on the template image as a template ROI.

[0097] ROI (region of interest) is a term used in machine vision and image processing to delineate the area of interest within an image using a box, circle, ellipse, or irregular polygon. Machine vision software such as Halcon, OpenCV, and Matlab often use various operators and functions to determine the ROI and perform further image processing, thereby improving the accuracy of the image template.

[0098] S033. The template ROI area is based on the area near the black missing triangle of the calibration plate and covers nine calibrated point areas.

[0099] S034: Using the black missing triangle of the calibration plate as a template, perform template matching on the new calibration plate image to obtain the position of the black missing triangle on the new calibration plate image.

[0100] S035. The position of the template ROI on the new calibration plate image is obtained according to the relative position of the black missing triangle and the template ROI, and recorded as the real-time ROI.

[0101] Specifically, position the calibration plate as straight as possible within the camera's field of view, capture an image, and use this image as the template image. Draw a ROI on the template image as the template ROI. The template ROI area is based on the area near the black missing triangle on the calibration plate and covers the nine calibrated points. Using the black missing triangle on the calibration plate as a template, perform template matching on the new calibration plate image to determine the position of the black missing triangle on the new calibration plate image. Based on the relative position of the black missing triangle and the template ROI, determine the position of the template ROI on the new calibration plate image. This is recorded as the instantaneous ROI. This improves the calibration efficiency of the calibration plate.

[0102] In this embodiment, step S04 includes the following sub-steps: by evenly distributing only 3×3 calibration points in the calibration area on the instant ROI, establishing a world coordinate system with the center of the first black dot in the upper left corner as the origin of the coordinate system, with the rightward square as the positive direction of the X-axis and the downward square as the positive direction of the Y-axis, and using the center distance to calculate the coordinates of the centers of the 9 dots in the world coordinate system.

[0103] In this embodiment, please refer to Figure 3 As shown, Figure 3 This is a flow chart of step S05 of the method for automatic local image calibration of the present invention. Step S05 specifically includes the following steps:

[0104] S051 . Correct the real-time ROI image by rotating it.

[0105] S052. Obtain an image of the calibration plate area through Blob analysis and detection.

[0106] S053: Using the image Blob analysis in the calibration area to filter out interference on the image and using the Canany edge detection algorithm to extract the edges of the calibration points.

[0107] S054. Finally, the image center coordinates of the nine calibration points are obtained through calculation.

[0108] Specifically, the live ROI image is rotated and rectified. Blob analysis is used to determine the calibration plate area. Image blob analysis is then used to filter out image interference within the calibration plate area. The Canany edge detection algorithm is then used to extract the edges of the calibration points (black origins). Finally, the image center coordinates of each calibration point are calculated.

[0109] In this embodiment, please refer to Figure 4 As shown, Figure 4 This is a flow chart of step S06 of the method for automatic local image calibration of the present invention. Step S06 specifically includes the following sub-steps:

[0110] S061. Use a data arrangement algorithm 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.

[0111] S062. 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.

[0112] S063. Extract the coordinates of the left middle calibration point in the image coordinate system and the coordinates in the world coordinate system.

[0113] S064. 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.

[0114] S065. 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.

[0115] S066. 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.

[0116] Specifically, because the nine calibration points of the 3×3 calibration plate are evenly distributed across the calibration area, a data arrangement algorithm is used to extract the image coordinate system and world coordinate system coordinates of the calibration point in the upper left corner. The image coordinate system and world coordinate system coordinates of the calibration point in the lower left corner are extracted. The image coordinate system and world coordinate system coordinates of the calibration point in the middle left corner are extracted. The image coordinate system and world coordinate system coordinates of the calibration point in the upper right corner are extracted. The image coordinate system and world coordinate system coordinates of the calibration point in the lower right corner are extracted. The image coordinate system and world coordinate system coordinates of the calibration point in the middle right corner are extracted. By extracting the image coordinate system and world coordinate system coordinates of the calibration points in the lower left corner, upper left corner, left middle corner, upper right corner, lower right corner, and right middle corner, the coordinates can be stored according to the respective information, making it easy to extract the coordinates of the calibration points with high accuracy and ease of use.

[0117] In this embodiment, the step of calculating the affine transformation matrix from the image coordinate system to the world coordinate system using a nine-point calibration algorithm based on the extracted coordinates of the calibration points includes the following sub-steps:

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

[0119]

[0120] TX=Y;

[0121]

[0122] After expansion, it is shown that the following relationship (3) is satisfied:

[0123] ax+by+c=x′

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

[0125] If we need to solve the 6 equations required for the 6 variables a to f, there are 3 sets of points;

[0126] If there are more than 3 groups of points, the minimum variance is used to find the value, which satisfies the following equation (4):

[0127]

[0128] The nine-point calibration algorithm principle is used to improve the automatic calibration effect on the calibration plate and the efficiency of local image calibration. The calibration effect is good, the stability is good, and it is easy to use.

[0129] Example 2

[0130] Please refer to Figure 5 As shown, Figure 5 The embodiment of the present invention further provides a device 200 for automatically calibrating a local image, comprising:

[0131] The preselection module 201 is used to preselect a calibration plate of preset standard specifications, wherein the calibration plate is 3×3.

[0132] 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.

[0133] The following module 203 is configured to perform ROI following according to the radius of the black dot.

[0134] The region obtaining module 204 is configured to obtain a calibration region where calibration points are distributed according to the ROI.

[0135] The first extraction module 205 is used to filter out interference on the image by using image Blob analysis in the calibration area and extract the edges of the calibration points by using the Canany edge detection algorithm, and finally calculate the image center coordinates of the 9 calibration points.

[0136] The second extraction module 206 is configured to extract the coordinates of the nine calibration points in the image coordinate system and the world coordinate system.

[0137] The calculation module 207 is configured to calculate the affine transformation matrix from the image coordinate system to the world coordinate system using a nine-point calibration algorithm according to the extracted coordinates of the calibration points.

[0138] The coordinate obtaining module 208 is used to obtain the coordinates of the starting target pixel point, the coordinates of the actual starting target point, the actual end point and the actual distance value by multiplying the result obtained by the affine transformation matrix.

[0139] Specifically, the preselection module 201 is used to preselect a calibration plate of preset standard specifications, wherein the calibration plate is 3×3. 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; the following module 203 is used to perform ROI tracking according to the radius of the black dots; the area acquisition module 204 is used to obtain the calibration area of the calibration point distribution according to the ROI tracking; the first extraction module 205 is used to filter out the interference on the image by image Blob analysis through the calibration area and extract the edges of the calibration points through the Canany edge detection algorithm, and finally calculate the image center coordinates of the 9 calibration points; the second extraction module 206 is used to extract the coordinates of the 9 calibration points in the image coordinate system and the world coordinate system; the calculation module 207 is used to calculate the affine transformation matrix from the image coordinate system to the world coordinate system through the nine-point calibration algorithm based on the extracted coordinates of the calibration points; the coordinate acquisition module 208 is used to calculate the result according to the affine transformation matrix and then 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.

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

[0141] Example 3

[0142] Please refer to Figure 6 As shown, Figure 6 This is a block diagram of a computer device according to the present invention. Another embodiment of the present invention 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. When the processor 302 executes the computer program, the steps of the method for local automatic calibration of an image described in the first embodiment are implemented.

[0143] Example 4

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

[0145] Compared with the prior art, the present invention pre-selects a calibration plate of preset standard specifications, detects the radius and center distance of the black dots according to the calibration plate of preset standard specifications; performs ROI tracking according to the radius of the black dots; obtains a calibration area of calibration point distribution according to the ROI tracking; filters out interference on the image through the calibration area by image Blob analysis and extracts the edges of the calibration points by the Canany edge detection algorithm, and finally calculates the image center coordinates of 9 calibration points; extracts the coordinates of the 9 calibration points in the image coordinate system and the coordinates in the world coordinate system; calculates the affine transformation matrix from the image coordinate system to the world coordinate system by the nine-point calibration algorithm according to the extracted coordinates of the calibration points; multiplies the result obtained according to the affine transformation matrix 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 local image calibration, has good calibration effect, good stability and is easy to use.

Claims

1. A method for automatic local calibration of an image, characterized in that: Including steps: Preselect a calibration plate of preset standard specifications, wherein the calibration plate is 3×3; Detecting the radius and center distance of the black dots according to the calibration plate of the preset standard specifications; Perform ROI tracking according to the black dot radius; Obtain a calibration area where calibration points are distributed according to the ROI, and obtain the coordinates of the centers of the nine points; The image Blob analysis is used to filter out the interference on the image through the calibration area and the edges of the calibration points are extracted by the Canany edge detection algorithm, and finally the image center coordinates of the 9 calibration points are obtained; Extracting the coordinates of the nine calibration points in the image coordinate system and 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 using 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; The ROI tracking according to the black dot radius includes the following sub-steps: Place the calibration plate in the field of view of the camera to obtain an image; The image is used as a template image, and an ROI is drawn on the template image as a template ROI; According to the template ROI area, the area near the black missing triangle of the calibration plate is used as a reference, covering nine calibrated point areas; Using the black missing triangle of the calibration plate as a template, template matching is performed on the new calibration plate image to obtain the position of the black missing triangle on the new calibration plate image; The position of the template ROI on the new calibration plate image is obtained according to the relative position of the black missing triangle and the template ROI, which is recorded as the real-time ROI.

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

3. The method for local automatic calibration of an image according to claim 1, wherein: The step of obtaining a calibration area of calibration point distribution according to the ROI and obtaining the coordinates of the centers of the nine points includes the following sub-steps: Only 3×3 calibration points are evenly distributed in the calibration area on the instant ROI. 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 bottom 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 9 dots in the world coordinate system.

4. The method for automatic local image calibration according to claim 3, wherein: The method of filtering out interference on the image by using the image Blob analysis in the calibration area and extracting the edges of the calibration points by using the Canany edge detection algorithm, and finally obtaining the image center coordinates of the nine calibration points specifically includes the following steps: On the instant ROI image, correcting the instant ROI image by rotating; The image is obtained by detecting the calibration plate area through Blob analysis; Using the image Blob analysis to filter out the interference on the image in the calibration area and extracting the edges of the calibration points by using the Canany edge detection algorithm; Finally, the image center coordinates of the 9 calibration points are obtained through calculation.

5. The method for automatic local image calibration according to claim 3, wherein: Extracting the coordinates of the nine calibration points in the image coordinate system and the world coordinate system includes 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 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 world coordinate system; Extract the coordinates of the calibration point in the lower right corner in the image coordinate system and the world coordinate system; 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.

6. The method for automatic local image calibration according to claim 1, wherein: The step of calculating the affine transformation matrix from the image coordinate system to the world coordinate system by using a nine-point calibration algorithm based on 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 before transformation and x', y' represent the coordinates after transformation. Then fullAffine is expressed as follows: …(1); TX=Y; …(2); After expansion, it satisfies the following relationship (3): …(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 variance is used to find the minimum variance, which satisfies the following relationship (4): …(4)。 7. An automatic local image calibration device, characterized in that: include: A preselection module is used to preselect a calibration plate of preset standard specifications, wherein the calibration plate is 3×3; A detection module, configured to detect the radius and center distance of the black dots according to the calibration plate of the preset standard specifications; A following module, configured to perform ROI following according to the radius of the black dot; An area acquisition module is used to obtain a calibration area where calibration points are distributed according to the ROI and obtain the coordinates of the centers of the nine points; The first extraction module is used to filter out interference on the image by using image Blob analysis in the calibration area and extract the edges of the calibration points by using the Canany edge detection algorithm, and finally calculate the image center coordinates of the nine calibration points; A second extraction module is used to extract the coordinates of the 9 calibration points in the image coordinate system and the world coordinate system; A calculation module, configured to calculate an affine transformation matrix from the image coordinate system to the world coordinate system using a nine-point calibration algorithm according to the extracted coordinates of the calibration points; A coordinate acquisition module is used to obtain the coordinates of the starting target pixel point, the actual end point coordinates and the actual distance value by multiplying the result obtained by the affine transformation matrix; The performing ROI tracking according to the black dot radius includes: Place the calibration plate in the field of view of the camera to obtain an image; The image is used as a template image, and an ROI is drawn on the template image as a template ROI; According to the template ROI area, the area near the black missing triangle of the calibration plate is used as a reference, covering nine calibrated point areas; Using the black missing triangle of the calibration plate as a template, template matching is performed on the new calibration plate image to obtain the position of the black missing triangle on the new calibration plate image; The position of the template ROI on the new calibration plate image is obtained according to the relative position of the black missing triangle and the template ROI, which is recorded as the real-time ROI.

8. 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 local automatic calibration of an image according to any one of claims 1 to 6 when executing the computer program.

9. 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 automatic local image calibration according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Control device, robot, and robot system

    US20180161983A1

  • Method and system for extrinsic camera calibration

    US20220108476A1