CN118247356A - Camera external parameter calibration method, device, computer equipment and storage medium - Google Patents

Camera external parameter calibration method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN118247356A
CN118247356A CN202410257288.4A CN202410257288A CN118247356A CN 118247356 A CN118247356 A CN 118247356A CN 202410257288 A CN202410257288 A CN 202410257288A CN 118247356 A CN118247356 A CN 118247356A
Authority
CN
China
Prior art keywords
camera
scene image
point
dimensional coordinates
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410257288.4A
Other languages
Chinese (zh)
Inventor
王柏润
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou Shanwei Zhixing Technology Co ltd
Original Assignee
Fuzhou Shanwei Zhixing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou Shanwei Zhixing Technology Co ltd filed Critical Fuzhou Shanwei Zhixing Technology Co ltd
Priority to CN202410257288.4A priority Critical patent/CN118247356A/en
Publication of CN118247356A publication Critical patent/CN118247356A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The application relates to the technical field of computer vision and discloses a camera external parameter calibration method, a camera external parameter calibration device, computer equipment and a storage medium, wherein the method comprises the steps of obtaining a scene image of a target area shot by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system and reference identification information of each reference point in the target area; inputting a scene image into a pre-trained key point detection model, and identifying two-dimensional coordinates and identification information of a plurality of key points in the scene image; selecting a plurality of key point sets from all key points; for each key point set, determining a group of external parameters of the camera based on a camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point and the internal parameters of the camera; and selecting the external parameter with the smallest mapping error from all the external parameters as an external parameter calibration result of the camera. The external parameter calibration precision and efficiency are improved without manual participation.

Description

Camera external parameter calibration method, device, computer equipment and storage medium
Technical Field
The application relates to the technical field of computer vision, in particular to a camera external parameter calibration method, a camera external parameter calibration device, computer equipment and a storage medium.
Background
In order to analyze athletic data of an athlete on a playing field, currently commonly used schemes include a wearable sensor scheme, a computer vision scheme, and the like. In the computer vision scheme, the camera is required to shoot data on the sports field, but the scheme is required to map the data shot in the camera into a three-dimensional coordinate system, which requires calibration of camera external parameters.
At present, the calibration method for the camera external parameters in the sports field generally needs to use props, such as black and white checkerboards, and the like, so that the checkerboards are required to be manually placed and the coordinates of the checkerboards on the court are measured, so that time and labor are consumed, and a certain error is brought to camera calibration. If the camera is moved, it takes extra time and effort to reposition the checkerboard to recalibrate the external parameters.
Therefore, how to improve the efficiency and accuracy of the calibration of the external parameters of the camera in the sports field has become a technical problem to be solved.
Disclosure of Invention
In view of the above, the present application provides an off-machine parameter calibration method, apparatus, computer device and storage medium, so as to solve the problem of how to improve the efficiency and accuracy of camera off-machine parameter calibration in sports fields.
In a first aspect, the present application provides a camera external parameter calibration method, which includes:
Acquiring a scene image of a target area shot by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system and reference identification information of each reference point in the target area, wherein the reference points are intersection points among original straight lines in the scene of the target area;
Inputting a scene image into a pre-trained key point detection model, and identifying two-dimensional coordinates and identification information of a plurality of key points in the scene image, wherein the key points are intersection points among original straight lines in the scene image; for each key point, taking a reference point with the same reference identification information as the reference point corresponding to the key point;
Selecting a plurality of key point sets from all key points, wherein at least three key points exist in each key point set and are positioned on one side, close to a camera, of a scene image;
For each key point set, determining a group of external parameters of the camera based on a camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point and the internal parameters of the camera;
And selecting the external parameter with the smallest mapping error from all the external parameters as an external parameter calibration result of the camera.
According to the technical scheme, the pre-trained key point detection model is utilized to identify the two-dimensional coordinates of the key points of the original straight lines in the target area in the scene image shot by the camera, the manual placement of props and the manual labeling of the angular points in the props are not needed, and the identification efficiency and the accuracy of the key points in the external parameter calibration are improved. And the intersection point between the original straight lines in the target area is determined as the reference point to acquire the three-dimensional coordinate of the reference point, the three-dimensional coordinate of the reference point is not required to be calculated manually based on the placement position of the prop, the precision of the three-dimensional coordinate of the reference point is improved, the reference point corresponding to the key point can be directly determined based on the reference identification information of the reference point in the target area and the identification information of the identified key point, the determination method is simple, the complex image matching algorithm is not required to be executed, and the calibration efficiency of the camera external parameters is further improved. When the camera external parameters are calibrated, the key point set is obtained by enumerating the key points meeting the conditions, the external parameters corresponding to the key point set are determined later, and the external parameters meeting the conditions are selected from all the external parameters to serve as final calibration results, so that manual intervention is not needed in the whole process, the situation that errors caused by calculating the external parameters according to one group of data are large can be avoided, and the accuracy of external parameter calibration is improved.
In some alternative embodiments, selecting the external parameter with the smallest mapping error from all external parameters as the external parameter calibration result of the camera comprises:
For each group of external parameters, mapping each reference point to a scene image based on the external parameters to obtain an external parameter corresponding mapping point set;
for each group of external parameters, determining the number of key points matched with mapping points in a mapping point set corresponding to the external parameters in the scene image to obtain the corresponding matching number of the external parameters;
If the corresponding matching number is larger than or equal to the first threshold value, determining the external parameter with the largest corresponding matching number as the external parameter with the smallest mapping error, and determining the external parameter with the smallest mapping error as the external parameter calibration result of the camera.
In the technical scheme, after a plurality of groups of external parameters are obtained, each reference point is mapped back to the scene image for each group of external parameters, so that the number of matching of each key point in the scene image with each mapping point is calculated, the external parameters with the largest corresponding number and exceeding a second threshold value are determined as the final external parameter calibration result of the camera, the process of optimizing the camera external parameters based on a complex optimization algorithm is avoided, the correct external parameters can be obtained only through simple mapping, and the calibration efficiency of the external parameters is improved.
In some alternative embodiments, if the number of matches for each set of external parameters is less than the first threshold, the method further comprises:
acquiring a new scene image of a target area shot by a camera;
And determining the new scene image as the scene image, and returning to the step of inputting the scene image into the key point detection model to identify the two-dimensional coordinates and the identification information of a plurality of key points in the scene image.
In some alternative embodiments, the method further comprises:
Responding to an external parameter detection instruction of a camera, and acquiring a current scene image of a target area shot by the camera and a current external parameter;
inputting the current scene image into a pre-constructed key point detection model, and identifying two-dimensional coordinates of a plurality of key points in the current scene image;
mapping each reference point to the current scene image based on the current external parameters to obtain reference two-dimensional coordinates of each reference point in the current scene image;
Determining the total number of key points in the current scene image, wherein the two-dimensional coordinates of the key points are matched with the reference two-dimensional coordinates of the reference points;
If the total number of the key points is greater than or equal to a first threshold value, determining that the current external parameters of the camera are correct external parameters;
if the total number of the key points is smaller than the first threshold value, determining that the current external parameters of the camera are wrong external parameters.
According to the technical scheme, when the current external parameters of the camera are detected, new external parameters are not required to be calculated, the reference points are only required to be mapped into the current scene image based on the current external parameters, so that the total number of key points, of which the two-dimensional coordinates in the current scene image are matched with the reference two-dimensional coordinates of the reference points, is determined, whether the current is correct or not can be determined based on the size relation between the total number and the first threshold value, the detection of the external parameters of the camera can be completed through a simple flow, and the detection efficiency of the external parameters of the camera is greatly improved.
In some alternative embodiments, inputting the scene image into a pre-trained keypoint detection model, identifying two-dimensional coordinates of a plurality of keypoints in the scene image along with identification information, comprising:
Inputting a scene image into a key point detection model, and identifying the confidence coefficient, the two-dimensional coordinates and the identification information of the intersection point between straight lines of preset colors in a target area in the scene image;
and determining the intersection point with each confidence coefficient being greater than or equal to the second threshold value as a key point, and obtaining the two-dimensional coordinates and the identification information of a plurality of key points in the scene image.
In the technical scheme, the intersection points among the straight lines of the preset color in the target area in the scene image are identified by utilizing the key point detection model, so that the key point detection model can be ensured to only identify the intersection points among specific straight lines, and the identification of the intersection points among other straight lines possibly interfering with the identification result in the scene image is avoided. And after the intersection point is identified, the confidence coefficient of the intersection point is predicted, the intersection point with the confidence coefficient being greater than or equal to a second threshold value is determined as a key point, the low-confidence intersection point is further filtered, the reliability of the key point is improved, and the accuracy of the subsequent camera external parameter calibration is further improved.
In some alternative embodiments, prior to inputting the scene image into the pre-trained keypoint detection model, identifying the two-dimensional coordinates of the plurality of keypoints in the scene image along with the identification information, the method further comprises:
acquiring a training scene image set shot by a camera, wherein the intersection point between straight lines marked with preset colors in a target area in each training scene image in the training scene image set;
Inputting each training scene image in the training scene image set into a pre-constructed neural network model, identifying the marked intersection point in each training scene image by using the training neural network model until the neural network model meets the training stop condition, and taking the neural network model meeting the training stop condition as a key point detection model.
In the technical scheme, the pre-constructed neural network model is trained to ensure the precision of the model when the key point detection model is used for identifying the key point later.
In some alternative embodiments, before acquiring the scene image of the target area captured by the camera, the method further comprises:
Acquiring an internal reference calibration image of a target area, wherein the internal reference calibration image comprises at least four preset calibration angular points;
Acquiring three-dimensional coordinates of each preset calibration corner point in a preset world coordinate system;
and carrying out internal reference calibration on the camera according to the two-dimensional coordinates of each preset calibration corner point in the internal reference calibration image and the three-dimensional coordinates of each preset calibration corner point.
According to the technical scheme, before the camera external parameters are calibrated, the camera internal parameters are calibrated based on the two-dimensional coordinates and the three-dimensional coordinates of the preset calibration angular points in the internal parameter calibration image of the target area, so that the camera external parameters can be conveniently calculated by using calibrated reliable internal parameters when the camera external parameters are calibrated later, and the accuracy of the camera external parameter calibration is further improved.
In a second aspect, the present application provides a camera external parameter calibration device, including:
The acquisition module is used for acquiring a scene image of a target area shot by the camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system and reference identification information of each reference point in the target area, wherein the reference points are intersection points among original straight lines in the scene of the target area;
the recognition module is used for inputting the scene image into the pre-trained key point detection model, and recognizing two-dimensional coordinates and identification information of a plurality of key points in the scene image, wherein the key points are intersection points among original straight lines in the scene image; for each key point, taking a reference point with the same reference identification information as the reference point corresponding to the key point;
The first selecting module is used for selecting a plurality of key point sets from all the key points, wherein at least three key points exist in each key point set and are positioned on one side, close to the camera, of the scene image;
The determining module is used for determining a group of external parameters of the camera based on the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point and the internal parameters of the camera according to the camera external parameter calibration algorithm;
And the second selecting module is used for selecting the external parameter with the smallest mapping error from all the external parameters as an external parameter calibration result of the camera.
In a third aspect, the present application provides a computer device comprising: the camera external parameter calibration method comprises the steps of storing computer instructions in a memory, and executing the computer instructions by the processor, wherein the memory and the processor are in communication connection, and the processor executes the camera external parameter calibration method according to any embodiment of the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon computer instructions for causing a computer to execute the camera exogenous calibration method according to any one of the embodiments of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an image for extrinsic calibration in a conventional camera extrinsic calibration method;
FIG. 2 is a flow chart of a camera extrinsic calibration method according to an embodiment of the application;
FIG. 3 is a schematic diagram of a reference calibration image in a preset world coordinate system in an application scene;
FIG. 4 is a scene image obtained after a scene keypoint detection model is applied to identify keypoints;
FIG. 5 is a schematic diagram of a camera mounting scheme according to an embodiment of the present application;
FIG. 6 is a flow chart of a still another camera external parameter calibration method according to an embodiment of the application
FIG. 7 is a block diagram of a camera extrinsic calibration apparatus according to an embodiment of the present application;
Fig. 8 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Conventional methods of calibrating camera external parameters typically require the use of props, such as black and white checkerboards or Aruco code (a Lu Ke coded) marking plates, to calibrate the camera external parameters. In the scene of a badminton court, the camera needs to cover the whole court, so that a Aruco code marking plate with a large area is usually needed to finish the calibration. It is usually necessary to manually mark different corner points on Aruco code marking plates and place different Aruco code marking plates in the positions specified by the badminton court, place Aruco code marking plates numbered 1 to 12 in the scene shown in fig. 1 in the positions shown in fig. 1, then establish a world coordinate system and calculate Aruco code the three-dimensional coordinates of each corner point on the marking plates based on the specification dimensions of the badminton court and each Aruco code marking plate. The camera shoots an image for external reference marking as shown in fig. 1, two-dimensional coordinates of marked corner points on each Aruco code marking plate are identified in the image, and then external reference calibration is carried out on the camera according to the two-dimensional coordinates and corresponding three-dimensional coordinates of each marking corner point.
However, this calibration process is extremely labor-intensive and requires the manual measurement Aruco code of the coordinates of the marked corner points in the marking panel on the course. These factors can bring certain errors to camera calibration, and the calibration process is also very time-consuming. If the camera moves, extra time and labor are required to be spent for recalibrating the external parameters, and the calibration efficiency and precision of the external parameters of the camera are greatly reduced. Therefore, the application provides a calibration method of camera external parameters, which is characterized in that key points in a scene image of a target area are automatically identified by a key point detection model, and meanwhile, the intersection points among all original straight lines in the scene of the target area are used as reference points, so that the calibration of the camera external parameters is carried out, the human intervention and the use of props in the calibration process are avoided, the calibration efficiency is greatly improved, the calibration error is reduced, and the calibration precision is improved. The camera external parameter calibration method of the present application is described in detail below.
In accordance with an embodiment of the present application, there is provided an embodiment of a camera exogenous calibration method, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer-executable instructions, and, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than what is shown or described herein.
In the embodiment of the application, a camera external parameter calibration method is provided, and a computer device, such as a notebook computer, a desktop computer, a tablet computer or a server, etc., fig. 2 is a flowchart of a camera external parameter calibration method according to an embodiment of the application, and as shown in fig. 2, the flowchart includes the following steps:
step S201, acquiring a scene image of a target area captured by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system, and reference identification information of each reference point in the target area.
The reference point is an intersection point between original straight lines in the scene of the target area, and the reference identification information can be information such as a serial number or a name of the reference point. The target area may be a field having at least five intersecting lines, where at least three intersecting points are not on the same line, for example, a badminton field, a basketball field, and a tennis field, and in the embodiment of the present application, taking the target area as an example of the badminton field, each original line in the scene of the target area is each white line in the badminton field, for example, each white line on the ground where each Aruco code marker plate is located in fig. 1. The preset world coordinate system may be set by itself, for example, as shown in fig. 3, the corner point of the upper right corner of the badminton court may be used as the coordinate origin, the longer straight line passing through the coordinate origin in the rectangle is the X-axis, the horizontal left direction of the coordinate origin in the straight line is the positive direction of the X-axis, the shorter straight line passing through the coordinate origin is the Y-axis, the horizontal downward direction of the coordinate origin in the straight line is the positive direction of the Y-axis, the straight line perpendicular to the plane where the rectangle is located and passing through the coordinate origin is the Z-axis (not shown in the figure), and the vertical upward direction of the coordinate origin in the straight line is the positive direction of the Z-axis.
The camera erected in the target area is an internal reference mark-marked camera, the camera can shoot an image of a scene where the target area with distortion removed is located and send the image to the computer equipment, and the computer equipment can obtain the scene image of the target area. A preset world coordinate system is established in a scene of the target area in advance, identification information is distributed to intersection points among all original straight lines in the scene of the target area, and three-dimensional coordinates of the intersection points among all the original straight lines can be calculated based on a rule size corresponding to each original straight line in the scene of the target area, so that three-dimensional coordinates of all the reference points are obtained.
Step S202, inputting the scene image into a pre-trained key point detection model, and identifying two-dimensional coordinates and identification information of a plurality of key points in the scene image.
Wherein, the key points are the intersection points among the original straight lines in the scene image; for each key point, a reference point, at which the reference identification information coincides with the identification information of the key point, is taken as a reference point corresponding to the key point. The keypoint detection model may be any neural network model with an image recognition function, for example, a HRNet model (High-Resolution Network, a deep learning model for image segmentation), a YOLO model (You Only Look Once, object detection model) or a RCNN model (Region-based Convolutional Neural Network ), and the HRNet model is taken as an example in the embodiment of the present application.
The scene image is input into a pre-trained key point detection model corresponding to a camera shooting the scene image, and the key point detection model can sequentially mark identification information and two-dimensional coordinates of intersection points between straight lines matched with all original straight lines in a scene of a target area in the scene image, so that the two-dimensional coordinates and the identification information of a plurality of key points are obtained.
The order in which the key points are marked by the key point detection model is consistent with the marking order of the reference points in the scene of the target area, for example, the marking order of the key points and the marking order of the reference points may be a direction away from the camera starting with a line closest to the camera with a slope less than or equal to zero or a line closest to the camera with a slope greater than zero, and marking identification information on each line from one end close to the camera to one end far from the camera. Taking the identification information as a serial number for example, the number can be started from 1, specifically, as shown in fig. 4, key points in the diagram are numbered from 1 to 30, and key points of 1,2 and 4 to 7 are not shown in the diagram.
Step S203, selecting a plurality of key point sets from all the key points.
Wherein there are at least three keypoints in each set of keypoints that are located on the side of the scene image that is closer to the camera. Whether each key point is located on a side close to the camera in the scene image can be determined by comparing the distances between each key point and the camera, and in particular, the smaller the distance from the camera, the closer the key point is to the camera. And enumerating a group of key point combinations with at least three key points positioned on one side close to the camera in the scene image from any key point, wherein the enumerated key point combinations are a key point set until all the key points are enumerated, and a plurality of key point sets are obtained. It can be understood that in order to facilitate the subsequent calibration of the camera external parameters, at least three non-collinear key points exist in the enumerated key point combinations.
Step S204, for each key point set, a set of external parameters of the camera is determined based on the camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point and the internal parameters of the camera.
The camera external parameter calibration algorithm can be a perspective n-Point (PERSPECTIVE-n-Point, pnP) algorithm, a DLT (DIRECT LINEAR Transform) algorithm, a DLT-Radial (DIRECT LINEAR Transform WITH RADIAL display) algorithm, or the like, and can be an algorithm for calculating camera external parameters based on internal parameters of the camera, two-dimensional coordinates of each Point in an image, and three-dimensional coordinates in a world coordinate system. Taking a PnP algorithm as an example, the embodiment of the application can determine a group of external parameters of the camera based on the PnP algorithm according to the internal parameters of the camera, the two-dimensional coordinates of each key point in the key point set and the three-dimensional coordinates of the corresponding reference intersection point of each key point, and the external parameters of a plurality of groups of cameras can be obtained after the calculation of all the key point sets is completed.
Step S205, selecting the external parameter with the smallest mapping error from all the external parameters as the external parameter calibration result of the camera.
The reference intersection points within the target region in the known three-dimensional space can be mapped back into the region image using the camera's internal and external parameters. If a set of outliers is reasonable, then most of the points in the set of outliers can be found in the keypoints after all the reference points are remapped back to the scene image. According to the principle, the computer equipment can find out the external parameters with the minimum mapping error from all the reference points to obtain the external parameter calibration result of the camera, and the specific implementation mode is described in the following embodiments.
In order to improve the reliability of the external parameter calibration of the camera, it is necessary to ensure that the camera can shoot a target area as large as possible, so as to identify as many points as possible and improve the accuracy of the subsequent external parameter calibration. Therefore, key points can be detected as much as possible during external parameter calibration, and multiple groups of external parameters are obtained to select the external parameters with high reliability as external parameter calibration results of the camera. The numbers 22'/6.71m, 6 '/1.98 m, 13'/396m, etc. in FIG. 5 represent the gauge size of the illustrated badminton court.
In the embodiment of the application, the pre-trained key point detection model is utilized to identify the two-dimensional coordinates of the key points of each original straight line in the scene image shot by the camera in the target area, so that the manual placement of props and the manual labeling of the angular points in the props are not needed, and the identification efficiency and the accuracy of the key points in the external parameter calibration are accelerated. And the intersection point between the original straight lines in the target area is determined as the reference point to acquire the three-dimensional coordinate of the reference point, the three-dimensional coordinate of the reference point is not required to be calculated manually based on the placement position of the prop, the precision of the three-dimensional coordinate of the reference point is improved, the reference point corresponding to the key point can be directly determined based on the reference identification information of the reference point in the target area and the identification information of the identified key point, the determination method is simple, the complex image matching algorithm is not required to be executed, and the calibration efficiency of the camera external parameters is further improved. When the camera external parameters are calibrated, the key point set is obtained by enumerating the key points meeting the conditions, the external parameters corresponding to the key point set are determined later, and the external parameters meeting the conditions are selected from all the external parameters to serve as final calibration results, so that manual intervention is not needed in the whole process, the situation that errors caused by calculating the external parameters according to one group of data are large can be avoided, and the accuracy of external parameter calibration is improved.
In order to further improve the accuracy of calibration of the external parameters of the camera, the points identified by the key point detection model can be screened and the external parameters with the minimum mapping error can be defined in consideration of the fact that the whole target area can not be shot by the angle of camera erection or the situation that a shielding object exists in a shot scene image so as to influence the key point identification of the key point detection model. Specifically, as shown in a schematic flow chart of another camera external parameter calibration method in fig. 6, the method can be used for a computer device, for example, a notebook computer, a desktop computer, a tablet computer or a server, and the flow chart includes the following steps:
in step S601, a scene image of a target area captured by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system, and reference identification information of each reference point in the target area are obtained.
Step S601 is detailed with reference to step S201 in the embodiment shown in fig. 2, and will not be described herein.
Optionally, in order to acquire the scene image with distortion removed to improve the accuracy of the external acquisition calibration of the subsequent camera, the internal parameters of the camera need to be calibrated. Generally speaking, the calibration of the internal parameters of the camera is often completed when leaving the factory, but in order to improve the accuracy of the calibration of the external parameters of the subsequent camera, the internal parameters of the camera may be calibrated by using a Zhang Youzheng calibration method when the external parameters of the camera are first used or before the external parameters of the camera need to be calibrated, that is, before step S601, the method may further include the following steps to calibrate the internal memory of the camera:
(1) And acquiring an internal reference calibration image of the target area.
The internal reference calibration image comprises at least four preset calibration corner points. The internal reference calibration image may be an image including the target area and Aruco code marker plates, and the preset calibration corner points are corner points preset in Aruco code marker plates. Aruco code marking plates with the number of 1 to 12 and known dimensions can be placed at specified positions in a badminton court as shown in particular in fig. 3.
(2) And acquiring three-dimensional coordinates of each preset calibration corner point in a preset world coordinate system.
The three-dimensional coordinates of each preset calibration corner point in each Aruco code marker plate in a preset world coordinate system can be calculated according to the specification and the size of the target area and the size of each Aruco code marker plate.
(3) And carrying out internal reference calibration on the camera according to the two-dimensional coordinates of each preset calibration corner point in the internal reference calibration image and the three-dimensional coordinates of each preset calibration corner point.
A coordinate system may be established in the reference calibration image so as to obtain two-dimensional coordinates of each preset calibration corner in the reference calibration image. And calculating the camera internal parameters according to the two-dimensional coordinates and the three-dimensional coordinates of each preset calibration corner point based on Zhang Youzheng calibration method so as to calibrate the camera internal parameters.
Before the camera external parameters are calibrated, the camera internal parameters are calibrated based on the two-dimensional coordinates and the three-dimensional coordinates of the preset calibration angular points in the internal parameter calibration image of the target area, so that the camera external parameters can be conveniently calculated by using calibrated reliable internal parameters when the camera external parameters are calibrated later, and the accuracy of the camera external parameter calibration is further improved.
In step S602, the scene image is input into the pre-trained keypoint detection model, and two-dimensional coordinates and identification information of a plurality of keypoints in the scene image are identified.
Step S602 is detailed with reference to step S202 in the embodiment shown in fig. 2, and will not be described herein.
Optionally, in order to further improve the accuracy of the camera external parameter calibration, step S602 may include the following steps S6021 to S6022:
In step S6021, the scene image is input to the keypoint detection model, and the confidence level, the two-dimensional coordinates and the identification information of the intersection point between the straight lines of the preset color in the target area in the scene image are identified.
The preset color can be set by oneself, and in the embodiment of the application, the target area is taken as a badminton court as an example, and the original straight line color in the badminton court is generally white, so that the preset color is taken as the example. After inputting the scene image into the key point detection model, the key point detection model can output the confidence coefficient, the two-dimensional coordinates and the identification information of each identified intersection point.
And step S6022, determining the intersection point with each confidence coefficient being greater than or equal to the second threshold value as a key point, and obtaining the two-dimensional coordinates and the identification information of a plurality of key points in the scene image.
And traversing each intersection point output by the key point detection model, determining the intersection point with the confidence coefficient larger than or equal to a second threshold value as a key point, and taking the two-dimensional coordinate and the identification information of the intersection point as the two-dimensional coordinate and the identification information of the key point.
The intersection points among the straight lines of the preset colors in the target area in the scene image are identified by utilizing the key point detection model, so that the key point detection model can be ensured to only identify the intersection points among specific straight lines, and the identification of the intersection points among other straight lines possibly interfering with the identification result in the scene image is avoided. And after the intersection point is identified, the confidence coefficient of the intersection point is predicted, the intersection point with the confidence coefficient being greater than or equal to a second threshold value is determined as a key point, the low-confidence intersection point is further filtered, the reliability of the key point is improved, and the accuracy of the subsequent camera external parameter calibration is further improved.
Optionally, a trained keypoint detection model needs to be obtained before step S602, and a specific training process may be to obtain a training scene image set captured by a camera; inputting each training scene image in the training scene image set into a pre-constructed neural network model, identifying the marked intersection point in each training scene image by using the training neural network model until the neural network model meets the training stop condition, and taking the neural network model meeting the training stop condition as a key point detection model.
The method comprises the steps of marking the intersection point between straight lines with preset colors in a target area in each training scene image in a training scene image set. In order to improve the accuracy of the keypoint detection model in identifying keypoints, the training scene image set may include scene images with occlusions in the target area and without occlusions in the target area in different time periods, different shooting angles, different illumination conditions, different target areas. The neural network module may be HRNet model, YOLO model or RCNN model, etc., and the embodiment of the application takes HRNet model as an example. It can be appreciated that the training scene image sets of different cameras should be independent of each other, with different cameras having respective corresponding neural network models.
Inputting each training scene image in the training scene image set into a pre-constructed neural network model, marking the confidence coefficient, the identification information and the two-dimensional coordinates of the intersection points among the straight lines with preset colors in the target area in the training scene image according to the sequence, adjusting the parameters of the training scene image based on the marking result or the intersection points originally marked in the training scene image, and returning to the step of marking the confidence coefficient, the identification information and the two-dimensional coordinates of the intersection points among the straight lines with preset colors in the target area in the training scene image according to the sequence until the adjusted neural network model meets the training stop condition, so that the key point detection model is obtained. The training stopping condition can be a condition that the accuracy of the neural network model reaches a threshold value or a loss function is minimum, and the like, and can be specifically set by oneself.
Step S603, selecting a plurality of key point sets from all the key points.
Step S604, for each key point set, determining a set of external parameters of the camera based on the camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point, and the internal parameters of the camera.
Step S605, selecting the external parameter with the smallest mapping error from all the external parameters as the external parameter calibration result of the camera.
Step S603 to step S605 refer to step S203 to step S205 in the embodiment shown in fig. 2 in detail, and are not described herein.
Optionally, in order to improve the efficiency and accuracy of the camera external parameter calibration, step S605 may include the following steps S6051 to S6055:
step S6051, for each group of external parameters, mapping each reference point to the scene image based on the external parameters, and obtaining a set of external parameter corresponding mapping points.
For each group of external parameters, the three-dimensional coordinates of each reference point in a preset world coordinate system can be mapped back into the region image based on the internal parameters of the camera and the group of external parameters to obtain the corresponding two-dimensional coordinates of each reference point in the region image, namely the two-dimensional coordinates of each mapping point, so as to obtain the external parameter corresponding mapping point set.
Step S6052, for each group of external parameters, determining the number of key points matched with the mapping points in the mapping point set corresponding to the external parameters in the scene image, and obtaining the corresponding matching number of the external parameters.
For each group of external parameters, the number of key points with the same two-dimensional coordinates in the regional image as the two-dimensional coordinates of the mapping points in the mapping point set corresponding to the group of external parameters can be determined, and the matching number of the group of external parameters is obtained.
In step S6053, if there are parameters whose number of matches is greater than or equal to the first threshold, the parameter with the largest number of matches is determined as the parameter with the smallest mapping error, and the parameter with the smallest mapping error is determined as the parameter calibration result of the camera.
The first threshold may be set by itself based on the number of reference points. If the corresponding matching number is larger than or equal to the first threshold value, determining the external parameter with the largest corresponding matching number in the external parameters as the external parameter with the smallest mapping error, and determining the external parameter with the smallest mapping error as the external parameter calibration result of the camera.
In step S6054, if the number of matching matches of each group of external parameters is smaller than the first threshold, a new scene image of the target area captured by the camera is obtained.
Step S6055, the new scene image is determined as the scene image, and the step of inputting the scene image into the key point detection model, and identifying the two-dimensional coordinates and the identification information of the plurality of key points in the scene image is performed.
If the number of matching matches of each group of external parameters is smaller than the first threshold, the camera may re-capture the scene image of the target area, and determine the re-captured scene image as the scene image, and return to step S602. The embodiment of the application does not particularly limit the specific time for specifically acquiring the re-shot scene image, and the scene image can be acquired after a preset time period or immediately acquired.
Optionally, the method for calibrating the camera external parameters in the embodiment of the present application further provides a service for detecting the camera external parameters, which specifically includes the following steps:
(1) And responding to the external parameter detection instruction of the camera, and acquiring the current scene image of the target area shot by the camera and the current external parameter.
When the external parameters of the camera are required to be detected, an external parameter detection instruction of the camera can be input into the computer equipment, and the computer equipment can read the current external parameters of the camera and the shot current scene image.
(2) And inputting the current scene image into a pre-constructed key point detection model, and identifying the two-dimensional coordinates of a plurality of key points in the current scene image. This step is similar to step S602, and will not be described here.
(3) And mapping each reference point to the current scene image based on the current external parameters to obtain the reference two-dimensional coordinates of each reference point in the current scene image. This step is similar to step S6051 and will not be described here.
(4) And determining the total number of key points in the current scene image, wherein the two-dimensional coordinates of the key points are matched with the reference two-dimensional coordinates of the reference points. This step is similar to step S6052 and will not be described here.
(5) And if the total number of the key points is greater than or equal to the first threshold value, determining that the current external parameters of the camera are correct external parameters.
(6) If the total number of the key points is smaller than the first threshold value, determining that the current external parameters of the camera are wrong external parameters. After determining that the current external parameter of the camera is the wrong external parameter, a new scene image of the target area shot by the camera can be acquired to determine the new scene image as the scene image, and the step S602 is executed to calibrate the external parameter of the camera, so as to acquire the correct external parameter of the camera.
It will be appreciated that the camera's external parameters may be detected periodically in addition to detecting the camera's external parameters in response to external parameter detection instructions to the camera.
When the current external parameters of the camera are detected, the reference points are only required to be mapped into the current scene image based on the current external parameters, so that the total number of key points, of which the two-dimensional coordinates in the current scene image are matched with the reference two-dimensional coordinates of the reference points, is determined, whether the current is correct or not can be determined based on the size relation between the total number and the first threshold value, the detection of the external parameters of the camera can be completed through a simple flow, and the detection efficiency of the external parameters of the camera is greatly improved.
In an application scene, taking identification information as a serial number, a target area as a badminton court, 30 intersection points among white straight lines in the badminton court as reference points, and a camera external parameter calibration algorithm as a PnP algorithm as an example, a camera can be erected according to a schematic diagram shown in fig. 5, as shown in fig. 3, a Aruco code marker plate with numbers 1-12 is placed at a specified position, the upper right corner of the court is used as the origin of a world coordinate system, the long side is used as an X axis, the short side is used as a Y axis, and the space height is used as a Z axis (not shown in the figure), and a preset world coordinate system is established, so that the three-dimensional coordinates of the preset calibration corner points in the plate are determined according to the size of the Aruco code marker plate and the specification of the badminton court, and after calibration is completed, the internal parameters are recorded for repeated call of subsequent steps.
And inputting the obtained scene image into a key point detection model, and labeling the sequence numbers, the confidence degrees and the two-dimensional coordinates of the intersections between the white colors on the badminton court in the graph. And taking the intersection points with the confidence coefficient larger than or equal to the second threshold value in the marked intersection points as key points to obtain the scene image shown in fig. 4.
Enumerating all possible four points in all the keypoints, since the coordinates of the points in the 3D space corresponding to each keypoint number (i.e. the three-dimensional coordinates of the reference point) are already known, a set of external parameters can be calculated for each combination (i.e. the set of keypoints) using the PnP algorithm. In order to ensure that the four points selected can give as high a precision as possible, we require that at least three of the four points are located in the near-end half-field (i.e. at least three key points are located on the side of the scene image that is closer to the camera), considering that the key point error in the far-end course is large. After obtaining a set of outliers, we project 30 points (i.e. reference points) in 3D space back into the picture and compare them with the keypoints predicted by the keypoint detection model, counting the number of matched points. We select a set of outliers with the highest number of matching points as the final result of the algorithm.
If the number of the matching points finally calculated in the last step is lower than a certain threshold value, the calculated external parameters are considered to be unreliable. We also use this logic to determine if the picture taken by the current camera matches an existing external parameter. If we find that the current foreign parameters are not trusted in the regular course key point detection or in the previous step, the above procedure is re-performed after a period of time until a set of trusted foreign parameters is obtained.
In the embodiment of the application, the pre-constructed neural network model is trained to ensure the precision of the model when the key point detection model is used for identifying the key point in the follow-up process, the intersection point with the confidence coefficient larger than or equal to the second threshold value in the intersection point identified by the key point detection model is determined as the key point, the reliability of the key point is improved by filtering the intersection point with the low confidence coefficient, and the precision of the external parameter calibration of the follow-up camera is further improved. After obtaining a plurality of groups of external parameters, mapping each reference point back to the scene image for each group of external parameters, calculating the number of matching each key point in the scene image with each mapping point, determining the external parameters with the largest corresponding number and exceeding a second threshold value as a final external parameter calibration result of the camera, avoiding the process of optimizing the external parameters of the camera based on a complex optimization algorithm, obtaining correct external parameters only through simple mapping, and improving the calibration efficiency of the external parameters. And the external parameter with the minimum mapping error can be calibrated again when the external parameter with the minimum mapping error is not found in the calibration, and the efficiency and the accuracy of the external parameter calibration are greatly improved without manual participation in the whole calibration process.
The embodiment also provides a camera external parameter calibration device, which is used for realizing the embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
An embodiment of the present application provides a camera external parameter calibration device, as shown in fig. 7, including:
The acquiring module 710 is configured to acquire a scene image of a target area captured by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system, and reference identification information of each reference point in the target area, where the reference point is an intersection point between original straight lines in the scene of the target area;
The recognition module 720 is configured to input a scene image into a pre-trained key point detection model, and recognize two-dimensional coordinates and identification information of a plurality of key points in the scene image, where the key points are intersections between original straight lines in the scene image; for each key point, taking a reference point with the same reference identification information as the reference point corresponding to the key point;
a first selecting module 730, configured to select a plurality of keypoint sets from all keypoints, where at least three keypoints exist in each keypoint set on a side, close to the camera, in the scene image;
The determining module 740 is configured to determine, for each set of key points, a set of external parameters of the camera based on the camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the set of key points, the three-dimensional coordinates of the reference point corresponding to each key point, and the internal parameters of the camera;
The second selecting module 750 is configured to select, from all the external parameters, the external parameter with the smallest mapping error as the external parameter calibration result of the camera.
In some alternative embodiments, the second selection module includes:
the mapping unit is used for mapping each reference point to the scene image based on the external parameters for each group of external parameters to obtain an external parameter corresponding mapping point set;
the first determining unit is used for determining the number of key points matched with the mapping points in the mapping point set corresponding to the external parameters in the scene image for each group of external parameters to obtain the corresponding matching number of the external parameters;
The first determining unit is further configured to determine, if there are external parameters with the number of corresponding matches greater than or equal to the first threshold, the external parameter with the largest number of corresponding matches as the external parameter with the smallest mapping error, and determine the external parameter with the smallest mapping error as the external parameter calibration result of the camera.
In some optional embodiments, if the number of matches corresponding to each group of external parameters is smaller than the first threshold, the obtaining module is further configured to obtain a new scene image of the target area captured by the camera;
And the identification module is also used for determining the new scene image as the scene image, and returning to execute the step of inputting the scene image into the key point detection model to identify the two-dimensional coordinates and the identification information of a plurality of key points in the scene image.
In some alternative embodiments, the apparatus further comprises:
The acquisition module is also used for responding to an external parameter detection instruction of the camera and acquiring a current scene image of a target area shot by the camera and a current external parameter;
The identification module is also used for inputting the current scene image into a pre-constructed key point detection model and identifying the two-dimensional coordinates of a plurality of key points in the current scene image;
The mapping module is used for mapping each reference point to the current scene image based on the current external parameters to obtain a reference two-dimensional coordinate of each reference point in the current scene image;
The second selecting module is also used for determining the total number of key points in the current scene image, wherein the two-dimensional coordinates of the key points are matched with the reference two-dimensional coordinates of the reference point;
The second selecting module is further configured to determine that the current external parameter of the camera is a correct external parameter if the total number of the key points is greater than or equal to the first threshold;
The second selecting module is further configured to determine that the current external parameter of the camera is an erroneous external parameter if the total number of the key points is smaller than the first threshold.
In some alternative embodiments, the identification module includes:
The identification unit is used for inputting the scene image into the key point detection model and identifying the confidence coefficient, the two-dimensional coordinates and the identification information of the intersection point between the straight lines with preset colors in the target area in the scene image;
And the second determining unit is used for determining the intersection point with each confidence coefficient being greater than or equal to the second threshold value as a key point to obtain two-dimensional coordinates and identification information of a plurality of key points in the scene image.
In some alternative embodiments, the apparatus further comprises:
The acquisition module is also used for acquiring a training scene image set of the target image shot by the camera, and the intersection point between straight lines marked with preset colors in the target area in each training scene image in the training scene image set;
The training module is used for inputting each training scene image in the training scene image set into a pre-constructed neural network model, identifying the intersection point marked in each training scene image by the training neural network model until the neural network model meets the training stop condition, and taking the neural network model meeting the training stop condition as a key point detection model.
In some alternative embodiments, the apparatus further comprises:
the acquisition module is also used for acquiring an internal reference calibration image of the target area, wherein the internal reference calibration image comprises at least four preset calibration angular points;
the acquisition module is also used for acquiring three-dimensional coordinates of each preset calibration corner point in a preset world coordinate system;
the calibration module is used for performing internal reference calibration on the camera according to the two-dimensional coordinates of each preset calibration corner point in the internal reference calibration image and the three-dimensional coordinates of each preset calibration corner point.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The camera external parameter calibration device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application SPECIFIC INTEGRATED Circuit) Circuit, a processor and a memory that execute one or more software or firmware programs, and/or other devices that can provide the above functions.
The embodiment of the application also provides computer equipment, which is provided with the camera external parameter calibration device shown in the figure 7.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a computer device according to an alternative embodiment of the present application, as shown in fig. 8, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 8.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present application also provide a computer readable storage medium, and the method according to the embodiments of the present application described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present application have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the application, and such modifications and variations fall within the scope of the application as defined by the appended claims.

Claims (10)

1. A camera exogenous calibration method, the method comprising:
acquiring a scene image of a target area shot by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system and reference identification information of each reference point in the target area, wherein the reference points are intersection points among original straight lines in the scene of the target area;
inputting the scene image into a pre-trained key point detection model, and identifying two-dimensional coordinates and identification information of a plurality of key points in the scene image, wherein the key points are intersection points among original straight lines in the scene image; for each key point, taking a reference point with the reference identification information consistent with the identification information of the key point as a reference point corresponding to the key point;
Selecting a plurality of key point sets from all the key points, wherein at least three key points exist in each key point set and are positioned at one side close to the camera in the scene image;
for each key point set, determining a group of external parameters of the camera based on a camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point and the internal parameters of the camera;
And selecting the external parameters with the minimum mapping error from all the external parameters as external parameter calibration results of the camera.
2. The method according to claim 1, wherein selecting the external parameter with the smallest mapping error from all the external parameters as the external parameter calibration result of the camera comprises:
For each group of the external parameters, mapping each reference point to the scene image based on the external parameters to obtain a mapping point set corresponding to the external parameters;
for each group of the external parameters, determining the number of key points matched with mapping points in the external parameter corresponding mapping point set in the scene image, and obtaining the external parameter corresponding matching number;
If the corresponding matching number is larger than or equal to the first threshold value, determining the external parameter with the largest corresponding matching number as the external parameter with the smallest mapping error, and determining the external parameter with the smallest mapping error as the external parameter calibration result of the camera.
3. The method of claim 2, wherein if the number of matches for each set of outlier matches is less than the first threshold, the method further comprises:
acquiring a new scene image of the target area shot by the camera;
and determining the new scene image as the scene image, and returning to the step of inputting the scene image into a key point detection model and identifying two-dimensional coordinates and identification information of a plurality of key points in the scene image.
4. A method according to any one of claims 1 to 3, further comprising:
Responding to an external parameter detection instruction of the camera, and acquiring a current scene image of the target area and a current external parameter shot by the camera;
Inputting the current scene image into the pre-constructed key point detection model, and identifying two-dimensional coordinates of a plurality of key points in the current scene image;
mapping each reference point to the current scene image based on the current external parameters to obtain reference two-dimensional coordinates of each reference point in the current scene image;
determining the total number of key points in the current scene image, wherein the two-dimensional coordinates of the key points are matched with the reference two-dimensional coordinates of the reference points;
If the total number of the key points is greater than or equal to a first threshold value, determining that the current external parameters of the camera are correct external parameters;
And if the total number of the key points is smaller than the first threshold value, determining that the current external parameters of the camera are wrong external parameters.
5. The method of claim 4, wherein the inputting the scene image into a pre-trained keypoint detection model identifies two-dimensional coordinates and identification information of a plurality of keypoints in the scene image, comprising:
Inputting the scene image into the key point detection model, and identifying the confidence coefficient, the two-dimensional coordinates and the identification information of the intersection point between the straight lines with preset colors in the target area in the scene image;
and determining the intersection point with each confidence coefficient being greater than or equal to a second threshold value as a key point, and obtaining two-dimensional coordinates and identification information of a plurality of key points in the scene image.
6. The method of claim 5, wherein prior to inputting the scene image into a pre-trained keypoint detection model, identifying two-dimensional coordinates and identification information of a plurality of keypoints in the scene image, the method further comprises:
Acquiring a training scene image set shot by the camera, wherein each training scene image in the training scene image set is marked with an intersection point between straight lines with preset colors in the target area;
Inputting each training scene image in the training scene image set into a pre-constructed neural network model, so as to train the neural network model to identify the intersection point marked in each training scene image until the neural network model meets the training stop condition, and taking the neural network model meeting the training stop condition as the key point detection model.
7. The method of claim 6, wherein prior to acquiring the scene image of the target area captured by the camera, the method further comprises:
Acquiring an internal reference calibration image of the target area, wherein the internal reference calibration image comprises at least four preset calibration angular points;
acquiring three-dimensional coordinates of each preset calibration corner point in the preset world coordinate system;
and performing internal reference calibration on the camera according to the two-dimensional coordinates of each preset calibration angular point in the internal reference calibration image and the three-dimensional coordinates of each preset calibration angular point.
8. A camera exogenous calibration device, the device comprising:
The acquisition module is used for acquiring a scene image of a target area shot by a camera, three-dimensional coordinates of each reference point in the target area under a preset world coordinate system and reference identification information of each reference point in the target area, wherein the reference points are intersection points among original straight lines in the scene of the target area;
The identification module is used for inputting the scene image into a pre-trained key point detection model, and identifying two-dimensional coordinates and identification information of a plurality of key points in the scene image, wherein the key points are intersection points among original straight lines in the scene image; for each key point, taking a reference point with the reference identification information consistent with the identification information of the key point as a reference point corresponding to the key point;
the first selecting module is used for selecting a plurality of key point sets from all the key points, wherein at least three key points exist in each key point set and are positioned at one side close to the camera in the scene image;
the determining module is used for determining a group of external parameters of the camera based on a camera external parameter calibration algorithm according to the two-dimensional coordinates of each key point in the key point set, the three-dimensional coordinates of the reference point corresponding to each key point and the internal parameters of the camera;
and the second selecting module is used for selecting the external parameter with the smallest mapping error from all the external parameters as an external parameter calibration result of the camera.
9. A computer device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the camera exogenous calibration method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer instructions that are loaded and executed by a processor to implement the camera exogenous calibration method of any of claims 1-7.
CN202410257288.4A 2024-03-06 2024-03-06 Camera external parameter calibration method, device, computer equipment and storage medium Pending CN118247356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410257288.4A CN118247356A (en) 2024-03-06 2024-03-06 Camera external parameter calibration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410257288.4A CN118247356A (en) 2024-03-06 2024-03-06 Camera external parameter calibration method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118247356A true CN118247356A (en) 2024-06-25

Family

ID=91550097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410257288.4A Pending CN118247356A (en) 2024-03-06 2024-03-06 Camera external parameter calibration method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118247356A (en)

Similar Documents

Publication Publication Date Title
CN110458898B (en) Camera calibration board, calibration data acquisition method, distortion correction method and device
CN110568447B (en) Visual positioning method, device and computer readable medium
CN110659636B (en) Pointer instrument reading identification method based on deep learning
CN111179358A (en) Calibration method, device, equipment and storage medium
CN110580724A (en) method and device for calibrating binocular camera set and storage medium
CN111444781B (en) Water meter reading identification method, device and storage medium
US20220284630A1 (en) Calibration board and calibration method and system
CN108871185A (en) Method, apparatus, equipment and the computer readable storage medium of piece test
CN113658279B (en) Camera internal reference and external reference estimation method, device, computer equipment and storage medium
CN113763466B (en) Loop detection method and device, electronic equipment and storage medium
CN113099116A (en) Equipment information collection method and device, robot and computer equipment
CN116563391B (en) Automatic laser structure calibration method based on machine vision
CN110288655B (en) Method and device for automatically identifying position of test pattern in chart picture
CN118247356A (en) Camera external parameter calibration method, device, computer equipment and storage medium
CN113538590B (en) Calibration method and device of zoom camera, terminal equipment and storage medium
CN115719387A (en) 3D camera calibration method, point cloud image acquisition method and camera calibration system
CN115187769A (en) Positioning method and device
CN114494316A (en) Corner marking method, parameter calibration method, medium, and electronic device
WO2017107564A1 (en) Board image acquisition method and system
CN111145674B (en) Display panel detection method, electronic device and storage medium
CN114170319A (en) Method and device for adjusting test target
CN118247355A (en) Camera external parameter calibration method, device, computer equipment and storage medium
CN114549653A (en) Camera calibration method, system, computer equipment and storage medium
CN113689397A (en) Workpiece circular hole feature detection method and workpiece circular hole feature detection device
CN112686962A (en) Indoor visual positioning method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination