Search

CN-121999060-A - Camera calibration method, device, equipment and medium based on three-dimensional model

CN121999060ACN 121999060 ACN121999060 ACN 121999060ACN-121999060-A

Abstract

The invention discloses a camera calibration method, device, equipment and medium based on a three-dimensional model. The method comprises the steps of obtaining a target image through a target camera, extracting feature points of the target image to obtain at least one feature point and feature point coordinates matched with the feature points, obtaining an initial calibration parameter of the target camera and a pre-built target three-dimensional model, obtaining mapping coordinates matched with the feature points based on the target three-dimensional model, the initial calibration parameter and the feature points, and calibrating the target camera based on the feature point coordinates and the mapping coordinates. According to the technical scheme, the camera calibration operation can be realized based on the preset three-dimensional model, the camera calibration operation flow is simplified, and the stability and accuracy of the camera calibration result are improved.

Inventors

  • ZHENG JINSONG
  • LI RUPENG
  • XING HONGWEN
  • LU GU
  • WANG ZHIQING
  • WANG SIZHI
  • YAO JIAJIE
  • WANG PING
  • JI YUQI
  • CAO YUE
  • ZHAO KAI
  • MA ZHENG

Assignees

  • 上海飞机制造有限公司

Dates

Publication Date
20260508
Application Date
20260130

Claims (10)

  1. 1. A camera calibration method based on a three-dimensional model is characterized by comprising the following steps: Obtaining a target image through a target camera, and carrying out feature point extraction processing on the target image to obtain at least one feature point and feature point coordinates respectively matched with the feature points; Acquiring a pre-constructed target three-dimensional model and initial calibration parameters of the target camera, and acquiring mapping coordinates respectively matched with each characteristic point based on the target three-dimensional model, the initial calibration parameters and each characteristic point; And calibrating the target camera based on the feature point coordinates and the mapping coordinates.
  2. 2. The method according to claim 1, wherein performing feature point extraction processing on the target image to obtain at least one feature point and feature point coordinates respectively matched with the feature points, includes: detecting target objects in the target image by using a pre-trained object detection algorithm, and positioning each target object in a detection frame mode; Establishing a camera coordinate system based on the target camera, and performing circle fitting processing on target objects in each detection frame based on the camera coordinate system to obtain a central point coordinate value of each target object as a characteristic point coordinate matched with each target object; and performing point location marking operation in the camera coordinate system based on the coordinates of each feature point to obtain each feature point.
  3. 3. The method of claim 2, wherein the target object comprises at least one of a hole, a rivet, or a bolt in the target image.
  4. 4. The method of claim 1, wherein obtaining mapping coordinates respectively matched with each feature point based on the target three-dimensional model, the initial calibration parameters, and each feature point comprises: Performing point marking operation in the target three-dimensional model based on each characteristic point of the target image to obtain model point positions respectively matched with each characteristic point; establishing a world coordinate system based on a preset rule, and acquiring point position coordinates of each model point position according to the world coordinate system; the method comprises the steps of obtaining initial calibration parameters of a target camera, and carrying out mapping operation on each point position coordinate based on the initial calibration parameters to obtain mapping coordinates matched with each model point, wherein the initial calibration parameters comprise camera internal parameters, distortion coefficients, a rotation matrix and a translation matrix of the target camera.
  5. 5. The method of claim 4, wherein obtaining initial calibration parameters of the target camera, mapping coordinates of each point based on the initial calibration parameters to obtain mapped coordinates matching each model point, comprises: Acquiring internal parameters, distortion coefficients, a rotation matrix R and a translation matrix T of each camera of the target camera, and acquiring point location coordinates (x, y and z) of the model point location; Obtaining an internal reference matrix K of the target camera according to the internal reference of each camera; Based on the formula: Calculating to obtain ideal image coordinates (u 0 ,v 0 ) of the model point positions; And correcting the ideal image coordinate through the distortion coefficient to obtain a mapping coordinate matched with the model point.
  6. 6. The method of claim 1, wherein calibrating the target camera based on the feature point coordinates and the mapping coordinates comprises: calculating errors between the coordinates of each feature point and each mapping coordinate, and judging whether the errors are smaller than a preset threshold value or not; After judging that the error is not smaller than a preset threshold, generating a calibration suggestion based on the error and outputting the calibration suggestion to a user, so that the user adjusts the camera internal parameters, the distortion coefficients, the rotation matrix and the translation matrix of the target camera based on the calibration suggestion; Updating the initial calibration parameters according to the adjustment operation of a user, and returning to execute the operation of obtaining mapping coordinates respectively matched with each characteristic point based on the target three-dimensional model, the initial calibration parameters and each characteristic point based on the updated initial calibration parameters until the error is smaller than the preset threshold value; and outputting the current initial calibration parameters as the calibration result of the target camera.
  7. 7. The method of claim 6, wherein after determining whether the error is less than a preset threshold, further comprising: And if the error is smaller than the preset threshold, generating a calibration success prompt based on the initial calibration parameters and sending the calibration success prompt to a user.
  8. 8. A camera calibration device based on a three-dimensional model, comprising: The characteristic point coordinate acquisition module is used for acquiring a target image through a target camera, and carrying out characteristic point extraction processing on the target image to obtain at least one characteristic point and characteristic point coordinates respectively matched with the characteristic points; The mapping coordinate acquisition module is used for acquiring a pre-constructed target three-dimensional model and initial calibration parameters of the target camera, and acquiring mapping coordinates respectively matched with each characteristic point based on the target three-dimensional model, the initial calibration parameters and each characteristic point; And the calibration parameter calculation module is used for carrying out calibration operation on the target camera based on the coordinates of each characteristic point and each mapping coordinate.
  9. 9. An electronic device, the electronic device comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a three-dimensional model-based camera calibration method of any one of claims 1-7.
  10. 10. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement a three-dimensional model-based camera calibration method according to any one of claims 1-7 when executed.

Description

Camera calibration method, device, equipment and medium based on three-dimensional model Technical Field The present invention relates to the field of equipment calibration, and in particular, to a method, an apparatus, a device, and a medium for calibrating a camera based on a three-dimensional model. Background In the field of industrial inspection, particularly in visual inspection applications for large structural members such as aircraft panels, the precise positioning and measurement capabilities of the camera system are critical. In order to ensure the reliability of visual detection results, the existing detection system is highly dependent on accurate calibration of internal and external parameters of a camera. However, the dynamic change of the distance and angle in the actual shooting process may cause the difference of the incident angles of the light rays, so that a significant deviation occurs between the actual imaging and the theoretical projection model. In order to overcome distortion differences under different working conditions, the traditional method generally adopts a standard checkerboard calibration plate, acquires calibration image data of multiple distances and multiple postures, solves internal parameters, external parameters and distortion coefficients of cameras at different positions through mathematical fitting, and finally inversely calculates the spatial posture of a measured object. Although the method can reach higher precision in a controlled laboratory environment, the practical industrial application is obviously limited in that firstly, the operation flow is complex, the equipment is required to be moved away from a production line for offline calibration, and then is redeployed to a detection site after the equipment is completed, repeated positioning and adjustment are involved, the operation efficiency is low, secondly, the scene adaptability is poor, the camera inner parameter drifts along with the change of a working distance and a shooting angle, the traditional calibration cannot respond to the on-site changeable working condition in real time, the calibration is required to be repeated for each specific distance, time and labor are consumed, thirdly, the measurement precision is unstable, the checkerboard calibration is based on an ideal plane assumption, complex factors such as uneven illumination, background interference, three-dimensional structure depth change and the like in the real industrial scene are not fully considered, the robustness is insufficient when the calibration parameters are extrapolated to the actual detection task, and the measurement stability and accuracy under long distance and large vision fields are obviously reduced due to the accumulation of system errors, and the requirement of high-precision batch detection is difficult to be met. In summary, the existing camera calibration method has the problems of complex flow of camera calibration operation and poor stability and accuracy of camera calibration results. Disclosure of Invention The invention provides a camera calibration method, device, equipment and medium based on a three-dimensional model, which can solve the problems of complex flow of camera calibration operation and poor stability and accuracy of a camera calibration result in the existing camera calibration method. In a first aspect, an embodiment of the present invention provides a camera calibration method based on a three-dimensional model, where the method includes: Obtaining a target image through a target camera, and carrying out feature point extraction processing on the target image to obtain at least one feature point and feature point coordinates respectively matched with the feature points; Acquiring a pre-constructed target three-dimensional model and initial calibration parameters of the target camera, and acquiring mapping coordinates respectively matched with each characteristic point based on the target three-dimensional model, the initial calibration parameters and each characteristic point; And calibrating the target camera based on the feature point coordinates and the mapping coordinates. In a second aspect, an embodiment of the present invention provides a camera calibration apparatus based on a three-dimensional model, including: The characteristic point coordinate acquisition module is used for acquiring a target image through a target camera, and carrying out characteristic point extraction processing on the target image to obtain at least one characteristic point and characteristic point coordinates respectively matched with the characteristic points; The mapping coordinate acquisition module is used for acquiring a pre-constructed target three-dimensional model and initial calibration parameters of the target camera, and acquiring mapping coordinates respectively matched with each characteristic point based on the target three-dimensional model, the initial calibration parameters and each char