A camera extrinsic parameter self-calibration method based on human skeleton point detection
By using a human skeleton point detection method, YOLOv7 and HRNet networks are used to detect human skeleton joints. Combined with ORB and Hungarian algorithms to calculate camera extrinsic parameters, the problem of insufficient robustness and accuracy in camera self-calibration is solved, and high-precision, real-time online camera calibration is achieved.
Patent Information
- Application Number
- CN202410781167.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-18
AI Technical Summary
Existing camera self-calibration methods are insufficient in terms of robustness and accuracy, especially under the influence of image noise, and are complex to operate, making it difficult to meet the needs of real-time online calibration.
A method based on human skeleton point detection is adopted. The human skeleton joints are detected by using the YOLOv7 human detection model and HRNet network. The perspective transformation matrix is calculated by combining ORB image matching and Hungarian algorithm to solve the camera extrinsic parameters. The camera extrinsic parameters are optimized by multi-frame video to improve calibration accuracy and robustness.
It achieves high-precision, real-time online camera external parameter calibration, improves the reliability and automation of camera calibration, and solves the problems of poor robustness and low accuracy in existing methods.
Smart Images

Figure SMS_3 
Figure QLYQS_3 
Figure QLYQS_5
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of camera calibration, and in particular to a camera external parameter self-calibration method based on human skeleton point detection. Background Art
[0002] Camera calibration is the reverse solution of camera imaging. It establishes the correspondence between three-dimensional space and pixel plane by solving the internal and external parameters of the camera. Camera calibration is a necessary prerequisite for three-dimensional reconstruction. The calibration effect directly affects the accuracy of object positioning and measurement. The imaging models of camera calibration include linear models and nonlinear models. Generally speaking, linear models are easy to calculate, fast in operation, and can obtain analytical solutions, but it is difficult to fully express the aberration of the lens and the complex imaging process of the camera. Nonlinear models can better simulate and compensate for various aberrations and improve the accuracy of the model, but the amount of calculation is large, and nonlinear optimization is often required, which reduces robustness.
[0003] Camera calibration includes traditional calibration methods and self-calibration methods. Traditional calibration methods, such as the calibration method using a plane template proposed by Zhang Zhengyou, only need to take several images of the template from different angles, and the camera intrinsic parameters can be calculated through the homography matrix of each image, and can be optimized and refined using the back-projection method. In recent years, self-calibration methods based on image sequences without the need for calibration objects have become an important direction in calibration research. Faugeras, Luong and Maybank et al. first proposed the concept of self-calibration, and proved from the perspective of projective geometry that there are two first-order constraints in the form of Kruppa equations between every two images, and the intrinsic parameters can be solved by directly solving the Kruppa equations.
[0004] Compared with traditional calibration methods, camera self-calibration methods have the advantages of simple operation, strong flexibility, and real-time online calibration. However, in the field of camera self-calibration, there are still common shortcomings such as poor robustness, low accuracy, and image noise will be magnified at the infinite plane. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the defects of the prior art. The present invention proposes a camera external parameter self-calibration method based on human skeleton point detection. The purpose is to improve the efficiency and automation of camera calibration. The calibration accuracy is basically consistent with that of the general camera calibration method, and the reliability is good, and the practicability is strong.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a camera external parameter self-calibration method based on human skeleton point detection, comprising the following steps:
[0007] S1, the yolov7 human body detection model detects the images taken by the left and right cameras, and then intercepts the corresponding human body area image and sends it to the hrnet network to detect the human skeleton joints;
[0008] S2, matching the human skeleton joints of the left and right cameras, as follows:
[0009] The ORB image matching method is used to obtain the projection matching points of the images taken by the left and right cameras, and the perspective transformation matrix is calculated.
[0010] The human body frame detected in the picture taken by the left camera is transformed to the corresponding pixel position of the right camera picture through perspective transformation.
[0011] The Hungarian algorithm is used to transform the human frame from the left camera image to the right camera image, and match it with the human frame of the image taken by the right camera.
[0012] The matching relationship between the human skeleton joint points corresponding to the images taken by the left and right cameras is determined based on the matching relationship of the human body frames;
[0013] S3, calculating the camera intrinsic matrix from the matched human skeleton joint points, and inversely solving the relative extrinsic parameters of the two cameras;
[0014] S4. Optimize camera extrinsics by matching human skeleton joints in multiple video frames.
[0015] Furthermore, in the specific calculation step of matching the human skeleton joint points of the left and right cameras in step S2,
[0016] The pixel values of the projection points on the image taken by the left camera obtained by the ORB image matching method are , the corresponding projected matching point pixel values on the image taken by the right camera are , i is the number of projection points, according to the perspective transformation principle,
[0017]
[0018] Among them, A is the 8-DOF perspective transformation matrix, Substitute the perspective transformation matrix parameters to be solved into 4 or more non-coplanar matching points ( ), solve the perspective transformation matrix A,
[0019] The human body frame detected in the left camera image is is the coordinate of the upper left corner of the human body frame in the left camera image, is the coordinate of the lower right corner of the human frame in the left camera image, and after perspective transformation to the right camera image, it is , Corresponding j human skeleton joints The pixel position after perspective transformation to the right camera image is ,The transformed human skeleton joints for , the human body frame detected in the right camera image is is the coordinate of the upper left corner of the human body frame in the right camera image, is the coordinate of the lower right corner of the human body frame in the right camera image, The corresponding j human skeleton joint points are , human skeleton joints for , k is the number of human frames detected, and the Hungarian algorithm is used to and Each human frame corresponds to j human skeleton joints. The matching relationship between the human frame and the human skeleton joints corresponding to the images taken by the left and right cameras is used to determine the matching relationship. When the Hungarian algorithm is used for matching, if the distance between the two frames exceeds a certain threshold, the two frames cannot be matched. The distance between the two frames is the Euclidean distance between the human skeleton joints corresponding to the frames, which is calculated as follows:
[0020]
[0021] in, is the pixel coordinate of the jth human skeleton joint point corresponding to the human frame in the left camera image to be matched, which is transmitted to the right camera image. is the pixel coordinate of the jth human skeleton joint point corresponding to the human frame of the right camera image to be matched. The matching process of the human frame Hungarian algorithm is as follows:
[0022]
[0023]
[0024] in, for A possible match result is for The Euclidean distance between the corresponding human skeleton joints, Represents the Hungarian algorithm matching solution process, The best matching result.
[0025] Furthermore, in step S3, the specific calculation steps of the essential matrix are as follows:
[0026] , , define the coordinates of the spatial point P in the left camera coordinate system as P, R, t is the relative rotation and translation matrix of the right camera coordinate system relative to the left camera coordinate system, then the coordinates of the spatial point P in the right camera coordinate system is RP+t, and its projection points in the left and right cameras are respectively , whose depth relative to the left and right cameras is , the spatial points are homogeneous, based on the conversion formula from the camera coordinate system to the pixel coordinate system, we can get
[0027]
[0028] Normalized to the Z=0 plane, we get
[0029]
[0030] make,
[0031]
[0032] but,
[0033]
[0034] The cross product is equivalent to the dot product with the antisymmetric matrix. is the t-antisymmetric matrix, for The transpose of
[0035]
[0036] The essential matrix , find the singular values of the essential matrix , SVD decomposition yields R and t.
[0037] Furthermore, the specific steps of the SVD decomposition are as follows:
[0038] Define the essential matrix SVD decomposition as , then there are 4 possible combinations of R and t.
[0039] .
[0040] Furthermore, a set of n pictures taken continuously at equal time intervals by the first camera is defined as , the second camera may be the nth picture in the first camera is a set of m pictures taken at the same time , is the nth picture in the first camera, For the second camera possible with is the mth picture taken at the same time The set of human skeleton joint points of k people detected in is , The j skeleton joint points of the kth person are , The pixel coordinates of the jth skeleton joint point of the kth person are , The human skeleton joint point set of k people detected in , The j skeleton joint points of the kth person are , The pixel coordinates of the jth skeleton joint point of the kth person are ,According to the projection relationship,
[0041]
[0042]
[0043] Optimal matching of human skeleton joints in video frames from the first camera and the second camera ,
[0044]
[0045]
[0046] in, , are the internal parameters of the first camera and the second camera respectively, are the relative rotation and translation matrices of the second camera and the first camera respectively, is the 3D point corresponding to the kth person’s jth human skeleton joint point, for Match to the first pictures, , It represents the process of finding the optimal matching process of the human skeleton joint points in the video frames of the first camera and the second camera. Indicates the matching degree of two images.
[0047] Furthermore, in step S3, the formula for jointly optimizing camera extrinsic parameters is as follows:
[0048]
[0049] in, for The coordinates of the joint point with the highest matching score in the right camera image.
[0050] Further, the specific steps of step S4 for optimizing camera extrinsic parameters by matching human skeleton joints in multiple video frames are as follows:
[0051] Continuously take pictures taken by the left camera at equal time intervals, and at the same time take a set of pictures that may be taken by the right camera at the same time;
[0052] The human body detection model and skeleton point detection model are used to extract the human body skeleton joint points of the pictures taken by the left and right cameras;
[0053] Optimally match the joint points of the human skeleton in the consecutive pictures taken by the left and right cameras, that is, find the picture with the highest joint point matching degree in the picture set that the right camera may have taken at the same time as the left camera, so as to minimize the projection error;
[0054] According to the optimal matching results of human skeleton joints, the camera extrinsic parameters are jointly optimized.
[0055] Compared with the prior art, the beneficial effects of the present invention include: by matching the human skeleton joint points of the left and right cameras, calculating the camera intrinsic matrix with the matched human skeleton joint points, and inversely solving the relative extrinsic parameters of the two cameras, and finally matching and optimizing the camera extrinsic parameters through the human skeleton joint points of multiple frames of video, the shortcomings of the existing camera posture self-calibration method, such as poor robustness, low precision, and image noise amplification at the infinite plane, are solved. The overall method is easy to operate, real-time online calibration, high calibration accuracy, and can be combined with actual engineering. DETAILED DESCRIPTION
[0056] It is easy to understand that according to the technical solution of the present invention, without changing the essential spirit of the present invention, a person skilled in the art can propose a variety of interchangeable structural modes and implementation modes. Therefore, the following specific implementation modes are only exemplary descriptions of the technical solution of the present invention, and should not be regarded as the whole of the present invention or as a limitation or restriction to the technical solution of the present invention.
[0057] The present invention proposes a camera extrinsic parameter self-calibration method based on human skeleton point detection, which can be mainly summarized as follows: first, the human skeleton joint points corresponding to the images taken by two cameras are extracted by a human detection model and a key point model; then, the camera intrinsic matrix is calculated by the matched human skeleton joint points, and the camera relative extrinsic parameters are inversely solved; finally, the camera extrinsic parameters are optimized by matching the human skeleton joint points of multiple frames of video.
[0058] In this embodiment, the above steps are specifically as follows:
[0059] Step 1
[0060] The yolov7 human body detection model detects the images taken by the left and right cameras, and then captures the corresponding human body area images and sends them to the hrnet network to detect the human skeleton joints.
[0061] Step 2
[0062] Match the human skeleton joint points of the left and right cameras as follows:
[0063] The ORB image matching method is used to obtain the projection matching points of the images taken by the left and right cameras, and the perspective transformation matrix is calculated.
[0064] The human body frame detected in the picture taken by the left camera is transformed to the corresponding pixel position of the right camera picture through perspective transformation.
[0065] The Hungarian algorithm is used to transform the human frame from the left camera image to the right camera image, and match it with the human frame of the image taken by the right camera.
[0066] The matching relationship between the human skeleton joint points corresponding to the images taken by the left and right cameras is determined by the matching relationship of the human body frame.
[0067] In this embodiment, the specific calculation steps for matching the human skeleton joint points of the left and right cameras are as follows:
[0068] The pixel values of the projection points on the image taken by the left camera obtained by the ORB image matching method are , the corresponding projected matching point pixel values on the image taken by the right camera are , i is the number of projection points, according to the perspective transformation principle,
[0069]
[0070]
[0071]
[0072] Among them, A is the 8-DOF perspective transformation matrix, Substitute the perspective transformation matrix parameters to be solved into 4 or more non-coplanar matching points ( ), solve the perspective transformation matrix A,
[0073] The human body frame detected in the left camera image is is the coordinate of the upper left corner of the human body frame in the left camera image, is the coordinate of the lower right corner of the human frame in the left camera image, and after perspective transformation to the right camera image, it is , Corresponding j human skeleton joints The pixel position after perspective transformation to the right camera image is ,The transformed human skeleton joints for , the human body frame detected in the right camera image is is the coordinate of the upper left corner of the human body frame in the right camera image, is the coordinate of the lower right corner of the human body frame in the right camera image, The corresponding j human skeleton joint points are , human skeleton joints for , k is the number of human frames detected, and the Hungarian algorithm is used to and Each human frame corresponds to j human skeleton joints. The matching relationship between the human frame and the human skeleton joints corresponding to the images taken by the left and right cameras is used to determine the matching relationship. When the Hungarian algorithm is used for matching, if the distance between the two frames exceeds a certain threshold, the two frames cannot be matched. The distance between the two frames is the Euclidean distance between the human skeleton joints corresponding to the frames, which is calculated as follows:
[0074]
[0075] in, is the pixel coordinate of the jth human skeleton joint point corresponding to the human frame in the left camera image to be matched, which is transmitted to the right camera image. is the pixel coordinate of the jth human skeleton joint point corresponding to the human frame of the right camera image to be matched. The matching process of the human frame Hungarian algorithm is as follows:
[0076]
[0077] in, for A possible match result is for The Euclidean distance between the corresponding human skeleton joints, Represents the Hungarian algorithm matching solution process, The best matching result.
[0078] Step 3
[0079] The camera intrinsic matrix is calculated from the matched human skeleton joints, and the relative extrinsic parameters of the two cameras are inversely solved.
[0080] In this embodiment, the specific calculation steps of the essential matrix are as follows:
[0081] , , define the coordinates of the spatial point P in the left camera coordinate system as P, R, t is the relative rotation and translation matrix of the right camera coordinate system relative to the left camera coordinate system, then the coordinates of the spatial point P in the right camera coordinate system is RP+t, and its projection points in the left and right cameras are respectively , whose depth relative to the left and right cameras is , the spatial points are homogeneous, based on the conversion formula from the camera coordinate system to the pixel coordinate system, we can get
[0082]
[0083] Normalized to the Z=0 plane, we get
[0084]
[0085] make,
[0086]
[0087] but,
[0088]
[0089] The cross product is equivalent to the dot product with the antisymmetric matrix. is the t-antisymmetric matrix, for The transpose of
[0090]
[0091] The essential matrix , find the singular values of the essential matrix , SVD decomposition yields R and t.
[0092] Furthermore, the specific steps of the SVD decomposition are as follows:
[0093] Define the essential matrix SVD decomposition as , then there are 4 possible combinations of R and t.
[0094] .
[0095] Furthermore, a set of n pictures taken continuously at equal time intervals by the first camera is defined as , the second camera may be the nth picture in the first camera is a set of m pictures taken at the same time , is the nth picture in the first camera, For the second camera possible with is the mth picture taken at the same time The set of human skeleton joint points of k people detected in is , The j skeleton joint points of the kth person are , The pixel coordinates of the jth skeleton joint point of the kth person are , The human skeleton joint point set of k people detected in , The j skeleton joint points of the kth person are , The pixel coordinates of the jth skeleton joint point of the kth person are ,According to the projection relationship,
[0096]
[0097]
[0098] Optimal matching of human skeleton joints in video frames from the first camera and the second camera ,
[0099]
[0100] in, are the internal parameters of the first camera and the second camera respectively, are the relative rotation and translation matrices of the second camera and the first camera respectively, is the 3D point corresponding to the kth person’s jth human skeleton joint point, for Match to the first pictures, It represents the process of finding the optimal matching process of the human skeleton joint points in the video frames of the first camera and the second camera. Indicates the matching degree of two images.
[0101] Furthermore, in step S3, the formula for jointly optimizing camera extrinsic parameters is as follows:
[0102]
[0103] in, for The coordinates of the joint point with the highest matching score in the right camera image.
[0104] Step 4
[0105] Optimize camera extrinsics by matching human skeleton joints from multiple video frames.
[0106] In this embodiment, the specific steps of optimizing camera extrinsic parameters by matching human skeleton joints in multiple video frames are as follows:
[0107] Continuously take pictures taken by the left camera at equal time intervals, and at the same time take a set of pictures that may be taken by the right camera at the same time;
[0108] The human body detection model and skeleton point detection model are used to extract the human body skeleton joint points of the pictures taken by the left and right cameras;
[0109] Optimally match the joint points of the human skeleton in the consecutive pictures taken by the left and right cameras, that is, find the picture with the highest joint point matching degree in the picture set that the right camera may have taken at the same time as the left camera, so as to minimize the projection error;
[0110] According to the optimal matching results of human skeleton joints, the camera extrinsic parameters are jointly optimized.
[0111] The technical scope of the present invention is not limited to the contents in the above description. Those skilled in the art can make various deformations and modifications to the above embodiments without departing from the technical idea of the present invention, and these deformations and modifications should all fall within the protection scope of the present invention.
Claims
1. A camera external parameter self-calibration method based on human skeleton point detection, characterized in that: The steps include: S1, the yolov7 human body detection model detects the images taken by the left and right cameras, and then intercepts the corresponding human body area image and sends it to the hrnet network to detect the human skeleton joints; S2, matching the human skeleton joints of the left and right cameras, as follows: The ORB image matching method is used to obtain the projection matching points of the images taken by the left and right cameras, and the perspective transformation matrix is calculated. The human body frame detected in the picture taken by the left camera is transformed to the corresponding pixel position of the right camera picture through perspective transformation. The Hungarian algorithm is used to transform the human frame from the left camera image to the right camera image, and match it with the human frame of the image taken by the right camera. The matching relationship between the human skeleton joints corresponding to the images taken by the left and right cameras is determined by the matching relationship between the human body frames. In the specific calculation steps of matching the human skeleton joint points of the left and right cameras in step S2, The pixel values of the projection points on the image taken by the left camera obtained by the ORB image matching method are , the corresponding projected matching point pixel values on the image taken by the right camera are , i is the number of projection points, according to the perspective transformation principle, , Among them, A is the 8-DOF perspective transformation matrix, Substitute the perspective transformation matrix parameters to be solved into 4 or more non-coplanar matching points ( ), solve the perspective transformation matrix A, The human body frame detected in the left camera image is , is the coordinate of the upper left corner of the human body frame in the left camera image, is the coordinate of the lower right corner of the human frame in the left camera image. After perspective transformation to the right camera image, it is , Corresponding j human skeleton joints The pixel position after perspective transformation to the right camera image is ,The transformed human skeleton joints for , the human body frame detected in the right camera image is , is the coordinate of the upper left corner of the human body frame in the right camera image, is the coordinate of the lower right corner of the human body frame in the right camera image, The corresponding j human skeleton joint points are , human skeleton joints for , k is the number of human frames detected, and the Hungarian algorithm is used to and For matching, each human frame pair corresponds to j human skeleton joints. The matching relationship between the human skeleton joints corresponding to the images taken by the left and right cameras is used to determine the matching relationship between the human skeleton joints. When the Hungarian algorithm is used for matching, if the distance between the two frames exceeds a certain threshold, the two frames cannot be matched. The distance between the two frames is the Euclidean distance between the human skeleton joints corresponding to the frames, which is calculated as follows: in, is the pixel coordinate of the jth human skeleton joint point corresponding to the human frame in the left camera image to be matched, which is transmitted to the right camera image. is the pixel coordinate of the jth human skeleton joint point corresponding to the human frame of the right camera image to be matched. The matching process of the human frame Hungarian algorithm is as follows: in, for A possible match result is for and The Euclidean distance between the corresponding human skeleton joint points, Represents the Hungarian algorithm matching solution process, is the best matching result; S3, calculating the camera intrinsic matrix from the matched human skeleton joint points, and inversely solving the relative extrinsic parameters of the two cameras; S4. Optimize camera extrinsics by matching human skeleton joints in multiple video frames.
2. The camera extrinsic parameter self-calibration method based on human skeleton point detection according to claim 1, characterized in that: In step S3, the specific steps of calculating the essential matrix are as follows: Internal reference evidence of left and right cameras , define the coordinates of the spatial point P in the left camera coordinate system as P, R, t is the relative rotation and translation matrix of the right camera coordinate system relative to the left camera coordinate system, then the coordinates of the spatial point P in the right camera coordinate system is RP+t, and its projection points in the left and right cameras are respectively , whose depth relative to the left and right cameras is , the spatial points are homogeneous, based on the conversion formula from the camera coordinate system to the pixel coordinate system, we can get Normalized to the Z=0 plane, we get make, but, The cross product is equivalent to the dot product with the antisymmetric matrix. is the t-antisymmetric matrix, for The transpose of , The essential matrix , find the singular values of the essential matrix , SVD decomposition yields R and t.
3. The camera extrinsic parameter self-calibration method based on human skeleton point detection according to claim 2, characterized in that: The specific steps of SVD decomposition are as follows: Define the essential matrix SVD decomposition as , then there are 4 possible combinations of R and t. 。 4. The camera extrinsic parameter self-calibration method based on human skeleton point detection according to claim 1, characterized in that: In step S4, the specific steps for optimally matching the continuous images taken by the left camera are as follows: Define the set of n pictures taken continuously by the first camera at equal time intervals as , the second camera may be the nth picture in the first camera is a set of m pictures taken at the same time , is the nth picture in the first camera, For the second camera possible with is the mth picture taken at the same time, The set of human skeleton joint points of k people detected in is , The j skeleton joint points of the kth person are , The pixel coordinates of the jth skeleton joint point of the kth person are , The human skeleton joint point set of k people detected in , The j skeleton joint points of the kth person are , The pixel coordinates of the jth skeleton joint point of the kth person are ,According to the projection relationship, Optimal matching of human skeleton joints in video frames from the first camera and the second camera , in, are the internal parameters of the first camera and the second camera respectively, are the relative rotation and translation matrices of the second camera and the first camera respectively, is the 3D point corresponding to the kth person’s jth human skeleton joint point, for Match to the first pictures, , It represents the process of finding the optimal matching process of the human skeleton joint points in the video frames of the first camera and the second camera. Indicates the matching degree of two images.
5. The camera extrinsic parameter self-calibration method based on human skeleton point detection according to claim 1, characterized in that: In step S3, the formula for jointly optimizing camera extrinsic parameters is as follows: , in, for The coordinates of the joint point with the highest match in the right camera image.
6. The camera extrinsic parameter self-calibration method based on human skeleton point detection according to claim 1, characterized in that: The specific steps of step S4 are as follows: Continuously take a set of pictures taken by the left camera at equal time intervals, and at the same time take a set of pictures that may be taken by the right camera at the same time; A human body detection model and a skeleton point detection model are used to extract the human body skeleton joint points of the pictures in the left and right picture sets; Optimally match the joint points of the human skeleton in the consecutive pictures taken by the left and right cameras, that is, find the picture with the highest joint point matching degree in the picture set that the right camera may have taken at the same time as the left camera, so as to minimize the projection error; According to the optimal matching results of human skeleton joints, the camera extrinsic parameters are jointly optimized.
