Camera intrinsic parameter calibration method, device, computer equipment and storage medium

Through the automated camera internal parameter calibration method, video collection and clustering technology are used to solve the existing problem of low calibration efficiency, achieve more efficient and accurate internal parameter calibration, and reduce the difficulty of manual operation.

CN117710488BActive Publication Date: 2024-09-24SUZHOU OUYEEL SEMICON CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410067702.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-17
Publication Date
2024-09-24
Estimated Expiration
2044-01-17

AI Technical Summary

Technical Problem

The existing camera internal parameter calibration method is inefficient and requires humans to ensure the diversity and distribution of calibration data. The operation is cumbersome, resulting in low calibration efficiency.

Method used

By obtaining the calibration video captured by the camera to be calibrated, extract multiple calibration images, detect the corner points and perform clustering processing to obtain the target cluster cluster. Select a preset number of corner points from each cluster for calibration to ensure uniform corner points. Distribution, automation reduces manual operations.

Benefits of technology

It improves the efficiency and accuracy of camera internal parameter calibration, reduces the workload of calibration personnel, and ensures the accuracy of calibration results without increasing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117710488B
    Figure CN117710488B
Patent Text Reader

Abstract

The present application relates to a camera intrinsic parameter calibration method, device, computer equipment and storage medium, the method comprising: obtaining a calibration video captured by a camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles; extracting multiple calibration images from the calibration video, and detecting corner points in each calibration image; clustering all corner points in each calibration image to obtain multiple target clusters; selecting a preset number of corner points from each target cluster, and calibrating the intrinsic parameters of the camera to be calibrated based on the selected corner points. The method can select the same number of corner points from each target cluster, ensuring a uniform distribution of the selected corner points, so that when the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points, the accuracy of the calibration result can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a camera intrinsic parameter calibration method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] Camera intrinsic parameters are parameters that describe the internal properties of the camera, including focal length, principal point (optical center) coordinates, distortion coefficients, etc. Camera intrinsic parameters are the basis for correcting the distortion of images taken by the camera. Especially in the application of Advanced Driver Assistance System (ADAS), the accuracy of camera intrinsic parameters will have a great impact on the safety of the final application and user experience.

[0003] In the related art, the calibration method of the camera intrinsic parameters is that the calibrator collects a certain number of images containing calibration patterns, identifies all credible corner points on all images through the calibration algorithm, and finally converges on a set of parameters so that the error between the actual 3D position of the calibration pattern mapped to the 2D position of the image through the intrinsic parameters and the position on the actual collected 2D image is minimized.

[0004] However, the current process of calibrating internal parameters requires manual efforts to ensure the diversity of calibration data and the size and position distribution of the calibration pattern in the image. The operation is cumbersome and the workload of the calibration process is large, resulting in low calibration efficiency. Summary of the invention

[0005] Based on this, it is necessary to provide a camera intrinsic parameter calibration method, apparatus, computer equipment, computer readable storage medium and computer program product to address the technical problem of low calibration efficiency of the above-mentioned intrinsic parameter calibration method.

[0006] In a first aspect, the present application provides a camera intrinsic parameter calibration method. The method comprises:

[0007] Obtaining a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles;

[0008] Extracting multiple calibration images from the calibration video, and detecting corner points in each calibration image;

[0009] Performing clustering processing on all corner points in each of the calibration images to obtain multiple target clusters;

[0010] A preset number of corner points are selected from each target cluster respectively, and the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points.

[0011] In one embodiment, clustering all corner points in each calibration image to obtain multiple target clusters further includes:

[0012] For each calibration image, determine the distance and posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and at least one feature of the center point coordinates of the calibration pattern contained in the calibration image; the center point coordinates are the coordinates of the center point of the calibration pattern in the pixel coordinate system corresponding to the calibration image;

[0013] According to at least one feature of the distance, posture information and center point coordinates corresponding to each calibration image, clustering processing is performed on all corner points in each calibration image to obtain multiple target clusters.

[0014] In one embodiment, the method further comprises:

[0015] When clustering is performed on all corner points in each calibration image according to the distance corresponding to each calibration image, multiple preset target distances are used as clustering centers, and clustering is performed on all corner points in each calibration image according to the distance corresponding to each calibration image to obtain multiple target cluster clusters.

[0016] In one embodiment, the method further comprises:

[0017] When clustering all corner points in each calibration image according to the coordinates of the center point corresponding to each calibration image, a plurality of target pixel points are uniformly selected from each calibration image according to the coordinates of the center point corresponding to each calibration image;

[0018] Taking each target pixel point as the cluster center, clustering is performed on all corner points in each calibration image to obtain multiple target clusters.

[0019] In one embodiment, the method further comprises:

[0020] When clustering is performed on all corner points in each calibration image according to the posture information corresponding to each calibration image, multiple preset target postures are used as clustering centers, and clustering is performed on all corner points in each calibration image according to the posture information corresponding to each calibration image to obtain multiple target cluster clusters.

[0021] In one embodiment, the method further comprises:

[0022] When all corner points in the calibration images are clustered together according to the distance, posture information and center point coordinates corresponding to each calibration image, all corner points in the calibration images are clustered according to the distance to obtain a plurality of first clusters;

[0023] According to the coordinates of the center point, clustering is performed on the corner points in each first cluster respectively to obtain a plurality of second clusters;

[0024] According to the posture information, clustering processing is performed on the corner points in each second cluster respectively to obtain the multiple target clusters.

[0025] In one embodiment, the method further comprises:

[0026] When there is no corner point in any target cluster or the number of corner points is less than a threshold, reshooting the video based on information of any target cluster;

[0027] Calibrate the internal parameters of the camera to be calibrated according to the retaken video and the calibration video;

[0028] The information of any one of the target clusters includes at least one of the distance of the calibration pattern to which the corner points in the target cluster belong relative to the camera coordinate system, the posture information and the coordinates of the center point of the calibration pattern.

[0029] In a second aspect, the present application also provides a camera intrinsic parameter calibration device. The device comprises:

[0030] An acquisition module is used to acquire a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles;

[0031] A detection module, used to extract multiple calibration images from the calibration video and detect corner points in each calibration image;

[0032] A clustering module, used for clustering all corner points in each calibration image to obtain multiple target clusters;

[0033] The calibration module is used to select a preset number of corner points from each target cluster, and calibrate the internal parameters of the camera to be calibrated based on the selected corner points.

[0034] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0035] Obtaining a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles;

[0036] Extracting multiple calibration images from the calibration video, and detecting corner points in each calibration image;

[0037] Performing clustering processing on all corner points in each of the calibration images to obtain multiple target clusters;

[0038] A preset number of corner points are selected from each target cluster respectively, and the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0040] Obtaining a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles;

[0041] Extracting multiple calibration images from the calibration video, and detecting corner points in each calibration image;

[0042] Performing clustering processing on all corner points in each of the calibration images to obtain multiple target clusters;

[0043] A preset number of corner points are selected from each target cluster respectively, and the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points.

[0044] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0045] Obtaining a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles;

[0046] Extracting multiple calibration images from the calibration video, and detecting corner points in each calibration image;

[0047] Performing clustering processing on all corner points in each of the calibration images to obtain multiple target clusters;

[0048] A preset number of corner points are selected from each target cluster respectively, and the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points.

[0049] The above-mentioned camera intrinsic parameter calibration method, device, computer equipment, storage medium and computer program product collect a calibration video through the camera to be calibrated, and then automatically extract multiple calibration images from the calibration video, instead of collecting images at a specified position and a specified angle, which can reduce the workload of the calibration personnel. After detecting the corner points in each calibration image, all corner points in each calibration image are clustered to obtain multiple target clusters. A preset number of corner points are selected from each target cluster respectively, so that the number of corner points selected from each target cluster is the same, ensuring the uniform distribution of the selected corner points, so that when the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points, the accuracy of the calibration result can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] FIG1 is a schematic diagram of uniform distribution and non-uniform distribution of corner points in one embodiment;

[0051] FIG2 is a schematic diagram of a flow chart of a camera intrinsic parameter calibration method in one embodiment;

[0052] FIG3 is a schematic diagram of clustering corner points based on the distance between a calibration pattern contained in a calibration image and a camera coordinate system corresponding to a camera to be calibrated in one embodiment;

[0053] FIG4 is a schematic diagram of clustering corner points based on the center point coordinates of a calibration pattern included in a calibration image in one embodiment;

[0054] FIG5 is a schematic diagram of clustering corner points based on the posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated in one embodiment;

[0055] FIG6 is a schematic flow chart of a camera intrinsic parameter calibration method in another embodiment;

[0056] FIG7 is a structural block diagram of a camera intrinsic parameter calibration device in one embodiment;

[0057] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0060] It can be understood that the camera intrinsic parameters require the calibrator to collect a certain number of images containing the calibration pattern. The calibration algorithm identifies all credible corner points on all images (the number is n), and finally converges to a set of parameters so that the error (denoted by E) between the actual 3D position of the calibration pattern (denoted by P) mapped to the 2D position of the image (denoted by p) through the intrinsic parameters (K and distortion coefficient coef) and the position on the actual collected 2D image (p') is minimized.

[0061]

[0062]

[0063] It can be seen from the above formula that K and coef corresponding to the minimum projection error of n corner points are used as the final output of the calibration algorithm. Therefore, the distribution of n corner points in the image will have a great influence on the final values ​​of K and coef.

[0064] For example, as shown in Figure 1, it is a schematic diagram of uniform and non-uniform distribution of corner points. The corner points in Figure 1 (a) are in an ideal uniform distribution, and the final calibrated internal parameters are applicable to all positions of the image. Assuming that the uniform distribution includes different distances, the internal parameters are also applicable to different distances. At this time, the comprehensive performance of the calibrated internal parameters in the final application stage will be better. However, the corner points in Figure 1 (b) are in a non-uniform distribution, so the final calibrated internal parameters are better in the right angle clustering area and the specified distance, while in other areas and other distances of the image position, the accuracy of the internal parameters will be greatly reduced. At this time, the internal parameters will cause unstable performance in the application stage, so it is not a usable internal parameter.

[0065] Therefore, in response to the above problems, this application proposes a camera intrinsic parameter calibration method that automatically balances the viewing angle. The calibration personnel do not need to perform complicated operations. They only need to use the camera to shoot a video of a calibration pattern (covering common calibration positions). The program can automatically filter images that can be used for intrinsic parameter calibration, and finally use the traditional calibration method for calibration. In addition, this method can meet the intrinsic parameter calibration in different application scenarios of ADAS by configuring different screening strategies. Compared with traditional calibration methods, this method reduces the operating difficulty of calibration personnel, can ensure that the intrinsic parameter calibration has a certain accuracy, and does not increase any hardware costs.

[0066] 2 is a flow chart of a camera intrinsic parameter calibration method according to an embodiment. This embodiment is described by taking the method applied to a server as an example, and includes the following steps:

[0067] Step S210, obtaining a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles.

[0068] In a specific implementation, when the calibration video is collected by the camera to be calibrated, the range of the distance between the calibration pattern and the camera to be calibrated can be determined first [d min , d max ], select the shooting position within this range, such as d0, d1, ..., d n-1 . Afterwards, the calibration pattern is translated at each fixed distance captured by the camera to be calibrated so that the captured calibration video can cover different areas. At the same time, in the process of translating the calibration pattern at each fixed distance, the posture of the calibration pattern can be continuously adjusted so that the captured calibration video can contain calibration patterns at different positions and angles. Afterwards, the calibration video captured by the camera to be calibrated can be sent to the server through wired or wireless communication, and the server processes the calibration video to complete the calibration of the camera's intrinsic parameters.

[0069] In this step, by modifying the traditional method of collecting calibration images to collecting calibration videos, the calibration images can be automatically screened by the server later. There is no need to shoot images at specific positions and angles, and there is no need to consider the distribution requirements of different positions and angles, thereby reducing the workload of calibration personnel.

[0070] Step S220: extract multiple calibration images from the calibration video, and detect corner points in each calibration image.

[0071] Corner points are points with obvious changes in camera images, usually edge intersections or places with large texture changes in the image. In camera intrinsic calibration, corner points are used for camera calibration and correction to determine the internal parameters of the camera.

[0072] In a specific implementation, since the frame rate of the calibration video is high, it is easy to cause the similarity of adjacent frame images to be high. Therefore, the captured calibration video can be subjected to frame extraction processing, and a part of the video frames can be extracted from it as calibration images to improve the calibration efficiency of the camera to be calibrated. Frame extraction can be performed at fixed intervals.

[0073] After extracting each calibration image, the corner points in each calibration image can be further detected. When performing corner point detection, the frame skipping method can also be used to speed up the detection process. Specifically, the corner points can be detected every several frames, for example, every 30 frames or 60 frames, and the skipped frames do not need to be processed for corner point detection, thereby improving the detection efficiency.

[0074] Step S230 , clustering is performed on all corner points in each calibration image to obtain a plurality of target clusters.

[0075] In a specific implementation, after determining the corner points of each calibration image, the distance and attitude information of the calibration pattern contained in each calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, as well as the center point coordinates of the calibration pattern contained in the calibration image can be determined respectively. Using at least one of the distance, attitude information and center point coordinates as a clustering feature, clustering is performed on all corner points in each calibration image to obtain multiple target clusters.

[0076] Step S240 , selecting a preset number of corner points from each target cluster, and calibrating the intrinsic parameters of the camera to be calibrated based on the selected corner points.

[0077] In a specific implementation, a preset number of corner points can be selected from each target cluster respectively, so that the number of corner points selected from each target cluster is the same, ensuring uniform distribution of the selected corner points. Then, the corner points of the unselected calibration pattern are deleted, and the camera intrinsic parameters are calibrated based on the remaining corner points of the calibration pattern, thereby achieving the calibration of the intrinsic parameters of the camera to be calibrated through uniformly distributed corner points.

[0078] In the above-mentioned camera intrinsic parameter calibration method, a calibration video is collected by the camera to be calibrated, and then multiple calibration images are automatically extracted from the calibration video, instead of collecting images at specified positions and specified angles, which can reduce the workload of the calibration personnel. After detecting the corner points in each calibration image, all corner points in each calibration image are clustered to obtain multiple target clusters. A preset number of corner points are selected from each target cluster respectively, so that the number of corner points selected from each target cluster is the same, ensuring the uniform distribution of the selected corner points, so that when the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points, the accuracy of the calibration result can be guaranteed.

[0079] In an exemplary embodiment, the above step S230, clustering all corner points in each calibration image to obtain multiple target clusters, specifically includes:

[0080] Step S231, for each calibration image, determine the distance and posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and at least one feature of the center point coordinates of the calibration pattern contained in the calibration image; the center point coordinates are the coordinates of the center point of the calibration pattern in the pixel coordinate system corresponding to the calibration image.

[0081] Step S232: cluster all corner points in each calibration image according to at least one feature of the distance, posture information and center point coordinates corresponding to each calibration image to obtain multiple target clusters.

[0082] In a specific implementation, the basis for clustering all corner points in each calibration image can be: the distance and posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and the center point coordinates of the calibration pattern contained in the calibration image. For each calibration image, three features can be determined: distance, posture information and center point coordinates.

[0083] The distance of each calibration image to the camera coordinate system can be determined based on the distance d when the calibration video is collected. The center point coordinates (center-u, center-v) corresponding to each calibration image can be obtained based on the set of corner points in the calibration image. The posture information represents the information of the calibration pattern in three directions: roll, pitch, and yaw relative to the camera coordinate system, which can be determined based on the principle of intrinsic calibration.

[0084] Clustering of all corner points in each calibration image can be achieved based on one or more of the distance of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, the posture information, and the center point coordinates of the calibration pattern contained in the calibration image.

[0085] When more than two features of distance, posture information, and center point coordinates are used for clustering, hierarchical clustering is required. That is, after clustering all corner points with one feature, multiple first clusters are obtained, and then in each first cluster, the second feature is used for clustering, and so on, to obtain multiple target clusters.

[0086] In this embodiment, all corner points in each calibration image are clustered through one or more of the distance of the calibration pattern contained in each calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, the posture information, and the center point coordinates of the calibration pattern contained in the calibration image. This can achieve subsequent corner point selection from multiple dimensions, ensure the uniformity of the selected corner points in multiple dimensions, and thus improve the accuracy of subsequent camera intrinsic parameter calibration.

[0087] In an exemplary embodiment, the above-mentioned step S232 also includes: when clustering all corner points in each calibrated image according to the distance corresponding to each calibrated image, taking the preset multiple target distances as the clustering center, clustering all corner points in each calibrated image according to the distance corresponding to each calibrated image to obtain multiple target cluster clusters.

[0088] In a specific implementation, clustering of all corner points in each calibration image can be achieved based only on the distance of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated. Specifically, multiple target distances can be preset as cluster centers. For example, the distances d0, d1, ..., d n-1 As the cluster center, after respectively determining the distances of the calibration patterns contained in each calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, the corner points are clustered according to the distances corresponding to each calibration image.

[0089] 3, which is a schematic diagram of clustering corner points based on the distance of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated according to an embodiment. n-1 As the cluster center, when clustering, each calibration image is clustered to each cluster center according to the distance corresponding to each calibration image. For example, for the cluster center with a distance of d0, first determine the calibration images with a corresponding distance near d0, and cluster these calibration images to the cluster center d0. Similarly, the calibration images with a corresponding distance near d1 can be clustered to the cluster center d1. By analogy, it is possible to cluster each calibration image to d0, d1, ..., d n-1 The clustering centers are equal, and then the corner points of each calibration image are clustered, thereby obtaining N target clusters.

[0090] In this embodiment, all corner points in each calibration image are clustered according to the distance between the calibration pattern contained in each calibration image and the camera coordinate system corresponding to the camera to be calibrated, so that the subsequent corner point selection from the position distribution dimension of the corner points can be achieved to ensure the uniformity of the distance of the selected corner points relative to the camera coordinate system.

[0091] In an exemplary embodiment, the above-mentioned step S232 also includes: when clustering all corner points in each calibrated image according to the center point coordinates corresponding to each calibrated image, a plurality of target pixel points are uniformly selected from each calibrated image according to the center point coordinates corresponding to each calibrated image; clustering all corner points in each calibrated image with each target pixel point as the clustering center to obtain a plurality of target cluster clusters.

[0092] In a specific implementation, clustering of all corner points in each calibration image can also be implemented based only on the distribution of the corner points in the calibration image. Specifically, multiple target pixel points can be uniformly selected from each calibration image as cluster centers according to the center point coordinates of the calibration pattern contained in each calibration image, and clustering processing is performed on all corner points in each calibration image with each target pixel point as the cluster center to obtain multiple target clusters.

[0093] More specifically, for each calibration image, the calibration image can be evenly divided into multiple regions according to the coordinates of the center point corresponding to the calibration image, and the center pixel point in each region is used as the target pixel point. For example, after the calibration image is divided into 4, 9, and 16 equal parts, the center pixel point in each divided region is used as the cluster center to cluster the corner points. Among them, the method and number of target pixel points selected from each calibration image are the same, that is, the way of dividing each calibration image into equal parts is the same, so that the corner points clustered to the target pixel points at the same position in each calibration image can be used as a cluster cluster.

[0094] Referring to FIG4 , a schematic diagram of clustering corner points based on the center point coordinates of the calibration pattern contained in the calibration image is shown in an embodiment. Taking the calibration image divided into 9 equal parts as an example, for each calibration image, the calibration image is divided into 9 equal parts according to the center point coordinates of the calibration pattern contained therein, and the center pixel point in each area obtained after the 9 equal parts is used as the clustering center, and the corner points in the calibration image are clustered to the center pixel points in each area, thereby obtaining 9 clusters in each calibration image. Afterwards, for each area obtained by the 9 equal parts, the corner points clustered to the area in all calibration images are summarized to obtain 9 target clusters.

[0095] In this embodiment, multiple target pixel points uniformly selected from the calibration image are used as clustering centers to cluster all corner points in each calibration image, so that corner points can be subsequently selected from the dimension of the distribution of the corner points in the calibration image to ensure the uniformity of the distribution of the selected corner points in the calibration image.

[0096] In an exemplary embodiment, the above-mentioned step S232 also includes: when clustering all corner points in each calibration image according to the posture information corresponding to each calibration image, taking the preset multiple target postures as the clustering centers, clustering all corner points in each calibration image according to the posture information corresponding to each calibration image to obtain multiple target cluster clusters.

[0097] In a specific implementation, clustering of all corner points in each calibration image can also be implemented based only on the posture of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated. Specifically, multiple target postures can be preset as clustering centers, and after respectively determining the posture information of the calibration pattern contained in each calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, each corner point is clustered according to the posture information corresponding to each calibration image.

[0098] For example, seven target postures, namely [0, 0, 0], [-π / 4, 0, 0], [π / 4, 0, 0], [0, -π / 4, 0], [0,π / 4, 0], [0, 0, -π / 4], and [0, 0, π / 4], can be selected as clustering centers. When clustering, the corner points in each calibration image are clustered into each posture area according to the posture information corresponding to each calibration image, and seven target clustering clusters are obtained. For example, for the cluster center of the target posture [0, 0, 0], first determine the calibration images whose corresponding posture information is located near [0,0, 0], and cluster the corner points in these calibration images to the target posture [0, 0, 0] to obtain one target cluster. Similarly, the corner points in the calibration images whose corresponding posture information is located near [-π / 4, 0, 0] can be clustered to [-π / 4, 0, 0]. By analogy, all corner points in each calibration image can be clustered to cluster centers such as [0, 0, 0], [-π / 4,0, 0], [π / 4, 0, 0], [0, -π / 4, 0], [0, π / 4, 0], [0, 0, -π / 4], and [0, 0, π / 4] to obtain 7 target clusters. Referring to FIG5 , a schematic diagram of clustering corner points based on the posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated is shown in an embodiment. FIG5 is a description diagram of a two-dimensional plane, which only represents the pitch and yaw planes, and has five regions, namely, the square in the middle, the inverted trapezoid on the top, the regular trapezoid on the bottom, two rotated trapezoids on the left and right sides, plus two regions of the roll plane that are not drawn, a total of 7 regions.

[0099] In this embodiment, all corner points in each calibration image are clustered through the posture information of the calibration pattern contained in each calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, so that subsequent corner point selection from the posture information dimension can be achieved to ensure the uniformity of the angles of the selected corner points relative to the camera coordinate system.

[0100] In an exemplary embodiment, the above-mentioned step S232 also includes: when all corner points in each calibrated image are clustered together according to the distance, posture information and center point coordinates corresponding to each calibrated image, all corner points in each calibrated image are clustered according to the distance to obtain multiple first cluster clusters; according to the center point coordinates, the corner points in each first cluster are clustered separately to obtain multiple second cluster clusters; according to the posture information, the corner points in each second cluster are clustered separately to obtain multiple target cluster clusters.

[0101] In the specific implementation, when all the corner points in each calibration image are clustered together according to the distance, posture information and center point coordinates corresponding to each calibration image, all the corner points in each calibration image can be hierarchically clustered according to the distance, center point coordinates and posture information to obtain multiple target clusters.

[0102] More specifically, as shown in FIG3 , after determining the preset target distances d0, d1, ..., d n-1 After the cluster centers are equal, all the corner points of all the calibration images can be clustered to each cluster center according to the distance corresponding to each calibration image, and N first clusters can be obtained. For the corner points of each first cluster, as shown in Figure 4, they are clustered according to the uniformly selected target pixel points. Assuming that there are M selected target pixel points, N×M second clusters can be obtained. Further, as shown in Figure 5, 7 target postures can be determined. In each second cluster, the 7 target postures are used as 7 cluster centers. The corner points in each second cluster are clustered based on the posture information to obtain N×M×7 target clusters.

[0103] It should be noted that when the distance, posture information and center point coordinates corresponding to each calibration image are used as clustering features, the order of hierarchical clustering can be adjusted, that is, clustering can be performed in sequence according to distance, center point coordinates, and posture information, or in sequence according to center point coordinates, distance, and posture information. There are 6 sorting methods for the three features, and any one of them can be selected for hierarchical clustering.

[0104] In this embodiment, the distance of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, the posture information, and the center point coordinates of the calibration pattern contained in the calibration image are used as clustering features to perform hierarchical clustering on all corner points in each calibration image. This fully considers the multi-dimensional distribution uniformity and can achieve perspective balance, so as to facilitate the distribution uniformity of the subsequently selected corner points, thereby improving the accuracy of the camera intrinsic parameters calibrated based on the selected corner points.

[0105] In an exemplary embodiment, the above method also includes: when there are no corner points in any target cluster or the number of corner points is less than a threshold, reshooting the video based on the information of any target cluster; calibrating the internal parameters of the camera to be calibrated based on the reshoot video and the calibration video.

[0106] The information of any target cluster includes at least one of the distance of the calibration pattern to which the corner point in the target cluster belongs relative to the camera coordinate system, the posture information and the center point coordinates of the calibration pattern.

[0107] In the specific implementation, when each target cluster is determined and a preset number of corner points are selected, if there is no corner point in a certain target cluster or the number of corner points is less than the threshold, that is, the corner points in each target cluster meet the requirements, the corner points can be directly selected, and the camera intrinsic parameters are calibrated according to the selected corner points. If there is no corner point in a certain target posture cluster, or the number of corner points is less than the threshold, it indicates that the collected calibration image is not comprehensive enough, then the information of the target cluster is recorded, including: the distance of the calibration pattern to which the corner point in the target cluster belongs relative to the camera coordinate system corresponding to the camera to be calibrated, the posture information and the center point coordinates of the calibration pattern. According to the information of the target cluster, the video is retaken. The intrinsic parameters of the camera to be calibrated are calibrated according to the retaken video and the calibration video collected initially.

[0108] In this embodiment, the number of corner points in the cluster center and each target cluster is checked to determine whether the feature distribution of each cluster center is reasonable and whether the number of each category is sufficient. If the requirements are not met, the video is retaken and the camera intrinsic parameters are calibrated based on the retaken video and the calibration video to ensure the uniformity of the distribution of corner points used for intrinsic parameter calibration.

[0109] In one embodiment, in order to facilitate those skilled in the art to understand the embodiments of the present application, the following will be described with reference to the specific examples of the accompanying drawings. Referring to FIG6 , a flow chart of a camera intrinsic parameter calibration method is shown, which includes the following steps:

[0110] (1) Use the camera to be calibrated to shoot the process of placing the calibration pattern at different positions and angles to obtain the calibration video.

[0111] (2) Extract frames from the calibration video to obtain multiple calibration images. The series of calibration images obtained by extracting frames can be used as an image sequence, recorded as image_list.

[0112] (3) Detect the corner points of each calibration image and determine the clustering features of each calibration image.

[0113] The clustering features include: the distance and attitude information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and the center point coordinates of the calibration pattern contained in the calibration image. The distance can be recorded as d, the attitude information can be recorded as (roll, pitch, yaw), and the center point coordinates can be recorded as (center_u, center_v). Then, clustering features can be extracted from each image: [center_u, center_v, Z, roll, pitch, yaw].

[0114] After detecting the corner points of each calibration image, the corner point set corners_list of each calibration image can be recorded separately, and its structure can be expressed as: {"image_name":{"corner":[(x0, y0), (x1, y1), ...,(xn-1, yn-1)], "transform": [X, Y, Z, roll, pitch, yaw]}}.

[0115] Among them, (x0, y0), (x1, y1), ..., (xn-1, yn-1) represent the corner points in the corner point set respectively.

[0116] Among them, X, Y, and Z represent the distances of the calibration pattern in the three coordinate axis directions of the camera coordinate system, and together describe the position of the calibration pattern in the camera coordinate system.

[0117] (4) Based on the clustering features, the corner points of each calibration image are hierarchically clustered.

[0118] Specifically, all corner points in each calibration image may be clustered according to the distance to obtain a plurality of first clusters.

[0119] Then, according to the coordinates of the center point, clustering is performed on the corner points in each first cluster respectively to obtain a plurality of second clusters.

[0120] Finally, according to the posture information, the corner points in each second cluster are clustered respectively to obtain multiple target clusters.

[0121] (5) Select corner points based on the principle of perspective balance.

[0122] (6) If the selection result meets the requirements, the intrinsic parameters of the camera to be calibrated can be calibrated by the traditional intrinsic parameter calibration algorithm. The screening result meets the requirements, that is, the number of corner points in each target cluster is greater than or equal to the threshold, and a preset number of corner points are selected from each target cluster, and the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points; wherein the preset number is not greater than the threshold.

[0123] (7) If the selection result does not meet the requirements, the video is retaken. That is, if there are clusters without corner points or the number of corner points is less than the threshold, the information of the cluster is recorded and the video is retaken. Based on the retaken video and the calibration video collected in (1), the process of calibrating the internal parameters of the camera to be calibrated is executed again.

[0124] In the camera intrinsic parameter calibration method provided in the present embodiment, a calibration video is collected by the camera to be calibrated, and then multiple calibration images are automatically extracted from the calibration video, instead of collecting images at a specified position and a specified angle, which can reduce the workload of the calibration personnel. After detecting the corner points in each calibration image, the distance of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, the posture information and the center point coordinates of the calibration pattern contained in the calibration image are used as clustering features to perform hierarchical clustering on all corner points in each calibration image, fully considering the multi-dimensional distribution uniformity, and achieving perspective balance, so as to facilitate the distribution uniformity of the corner points selected subsequently, so that when the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points, the accuracy of the calibration result can be guaranteed.

[0125] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0126] Based on the same inventive concept, the embodiment of the present application also provides a camera intrinsic parameter calibration device for implementing the camera intrinsic parameter calibration method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more camera intrinsic parameter calibration device embodiments provided below can refer to the limitations of the camera intrinsic parameter calibration method above, and will not be repeated here.

[0127] In one embodiment, as shown in FIG. 7 , a camera intrinsic parameter calibration device is provided, including: an acquisition module 710, a detection module 720, a clustering module 730 and a calibration module 740, wherein:

[0128] The acquisition module 710 is used to acquire the calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles;

[0129] The detection module 720 is used to extract multiple calibration images from the calibration video and detect corner points in each calibration image;

[0130] A clustering module 730 is used to perform clustering processing on all corner points in each calibration image to obtain multiple target clusters;

[0131] The calibration module 740 is used to select a preset number of corner points from each target cluster, and calibrate the intrinsic parameters of the camera to be calibrated based on the selected corner points.

[0132] In one of the embodiments, the clustering module 730 is further used to determine, for each calibration image, the distance and posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and at least one feature in the center point coordinates of the calibration pattern contained in the calibration image; the center point coordinates are the coordinates of the center point of the calibration pattern in the pixel coordinate system corresponding to the calibration image; and cluster all corner points in each calibration image according to at least one feature in the distance, posture information and center point coordinates corresponding to each calibration image to obtain multiple target clusters.

[0133] In one embodiment, the clustering module 730 is also used to cluster all corner points in each calibration image according to the distance corresponding to each calibration image, using multiple preset target distances as clustering centers, and clustering all corner points in each calibration image according to the distance corresponding to each calibration image to obtain multiple target cluster clusters.

[0134] In one of the embodiments, the clustering module 730 is also used to evenly select multiple target pixel points from each calibrated image according to the center point coordinates corresponding to each calibrated image when clustering all corner points in each calibrated image according to the center point coordinates corresponding to each calibrated image; cluster all corner points in each calibrated image with each target pixel point as the clustering center to obtain multiple target cluster clusters.

[0135] In one embodiment, the clustering module 730 is also used to cluster all corner points in each calibration image according to the posture information corresponding to each calibration image, with multiple preset target postures as clustering centers, and cluster all corner points in each calibration image according to the posture information corresponding to each calibration image to obtain multiple target cluster clusters.

[0136] In one embodiment, the clustering module 730 is also used to cluster all corner points in each calibration image according to the distance, posture information and center point coordinates corresponding to each calibration image, and obtain multiple first clusters according to the distance; cluster the corner points in each first cluster according to the center point coordinates to obtain multiple second clusters; and cluster the corner points in each second cluster according to the posture information to obtain multiple target clusters.

[0137] In one of the embodiments, the calibration module 740 is further used to reshoot the video based on the information of any target cluster when there are no corner points in any target cluster or the number of corner points is less than a threshold; calibrate the internal parameters of the camera to be calibrated based on the reshot video and the calibration video; wherein the information of any target cluster includes at least one of the distance of the calibration pattern to which the corner points in the target cluster belong relative to the camera coordinate system, the posture information and the center point coordinates of the calibration pattern.

[0138] Each module in the above-mentioned camera intrinsic parameter calibration device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0139] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in FIG8. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data during the camera intrinsic parameter calibration process. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a camera intrinsic parameter calibration method is implemented.

[0140] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0141] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0143] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0145] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0146] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0147] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A camera intrinsic parameter calibration method, characterized in that: The method comprises: Obtaining a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles; Extracting multiple calibration images from the calibration video, and detecting corner points in each calibration image; For each calibration image, determine the distance and posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and at least one feature of the center point coordinates of the calibration pattern contained in the calibration image; the center point coordinates are the coordinates of the center point of the calibration pattern in the pixel coordinate system corresponding to the calibration image; According to at least one feature of the distance, posture information and center point coordinates corresponding to each calibration image, clustering is performed on all corner points in each calibration image to obtain multiple target clusters; A preset number of corner points are selected from each target cluster respectively, and the intrinsic parameters of the camera to be calibrated are calibrated based on the selected corner points.

2. The method according to claim 1, characterized in that: The method further comprises: When clustering is performed on all corner points in each calibration image according to the distance corresponding to each calibration image, multiple preset target distances are used as clustering centers, and clustering is performed on all corner points in each calibration image according to the distance corresponding to each calibration image to obtain multiple target cluster clusters.

3. The method according to claim 1, characterized in that The method further comprises: When clustering all corner points in each calibration image according to the coordinates of the center point corresponding to each calibration image, a plurality of target pixel points are uniformly selected from each calibration image according to the coordinates of the center point corresponding to each calibration image; Taking each target pixel point as the cluster center, clustering is performed on all corner points in each calibration image to obtain multiple target clusters.

4. The method according to claim 1, characterized in that: The method further comprises: When clustering is performed on all corner points in each calibration image according to the posture information corresponding to each calibration image, multiple preset target postures are used as clustering centers, and clustering is performed on all corner points in each calibration image according to the posture information corresponding to each calibration image to obtain multiple target cluster clusters.

5. The method according to claim 1, characterized in that The method further comprises: When all corner points in the calibration images are clustered together according to the distance, posture information and center point coordinates corresponding to each calibration image, all corner points in the calibration images are clustered according to the distance to obtain a plurality of first clusters; According to the coordinates of the center point, clustering is performed on the corner points in each first cluster respectively to obtain a plurality of second clusters; According to the posture information, clustering processing is performed on the corner points in each second cluster respectively to obtain the multiple target clusters.

6. The method according to claim 1, characterized in that The method further comprises: When there is no corner point in any target cluster or the number of corner points is less than a threshold, reshooting the video based on information of any target cluster; Calibrate the internal parameters of the camera to be calibrated according to the retaken video and the calibration video; The information of any one of the target clusters includes at least one of the distance of the calibration pattern to which the corner points in the target cluster belong relative to the camera coordinate system, the posture information and the coordinates of the center point of the calibration pattern.

7. The method according to claim 1, characterized in that The detecting of corner points in each calibration image comprises: The frame skipping method is used to detect the corner points in each calibration image.

8. A camera intrinsic parameter calibration device, characterized in that: The device comprises: An acquisition module is used to acquire a calibration video captured by the camera to be calibrated; the calibration video is a video shot when the calibration pattern is located at different positions and angles; A detection module, used to extract multiple calibration images from the calibration video and detect corner points in each calibration image; A clustering module, for determining, for each calibration image, the distance and posture information of the calibration pattern contained in the calibration image relative to the camera coordinate system corresponding to the camera to be calibrated, and at least one feature of the center point coordinates of the calibration pattern contained in the calibration image; clustering all corner points in the calibration images according to at least one feature of the distance, posture information and center point coordinates corresponding to each calibration image to obtain a plurality of target clusters; the center point coordinates are the coordinates of the center point of the calibration pattern in the pixel coordinate system corresponding to the calibration image; The calibration module is used to select a preset number of corner points from each target cluster, and calibrate the internal parameters of the camera to be calibrated based on the selected corner points.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the camera intrinsic parameter calibration method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the camera intrinsic parameter calibration method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Fully automatic calibration method for high performance camera under complicated background

    CN105096317A

  • Parameter calibrating method and apparatus, server and readable storage medium

    CN107680035A

  • Binocular camera calibration method and device, electronic equipment, and readable storage medium

    CN108122259A

  • Calibration method, device and system of image acquisition equipment, equipment and storage medium

    CN112907675A

  • Binocular camera calibration method and device, equipment and medium

    CN114049401A