Camera internal reference calculation method and device, computer equipment and readable storage medium

By acquiring high-precision three-dimensional coordinates and pixel coordinates through a spatial coordinate measuring device, a virtual calibration grid is constructed, which solves the problem of inaccurate intrinsic parameters caused by errors in the checkerboard calibration paper, realizes high-precision camera intrinsic parameter calculation, and improves the accuracy and efficiency of the vision system.

CN121962279APending Publication Date: 2026-05-01NORTHWESTERN POLYTECHNICAL UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHWESTERN POLYTECHNICAL UNIV
Filing Date
2025-12-10
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing camera intrinsic parameter calculation methods based on checkerboard calibration paper suffer from inaccurate coordinates due to processing errors and deformation, failing to meet the requirements of high-precision visual measurement.

Method used

By using the probe of a spatial coordinate measuring device to obtain high-precision three-dimensional coordinates of the optical cooperation mark, and combining them with the pixel coordinates captured by the target camera, a spatial virtual calibration grid is constructed. The camera intrinsic parameters are calculated using a camera calibration algorithm, thus avoiding the processing errors and deformation problems of the checkerboard calibration plate.

Benefits of technology

It improves the accuracy and efficiency of camera intrinsic parameter calculation, ensures high-precision 2D-3D correspondence, and enhances the reliability of vision systems in applications such as industrial inspection and robot navigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962279A_ABST
    Figure CN121962279A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a camera internal reference calculation method and device, computer equipment and a readable storage medium. The method comprises the following steps: controlling a touch probe of the space coordinate measuring device to carry out movement detection on each preset detection position so as to obtain a plurality of three-dimensional coordinates corresponding to a plurality of optical cooperation marks on the touch probe at each preset detection position; when it is detected that the touch probe is located at each preset detection position, mark images shot by the target camera for the multiple optical cooperation marks are obtained, and multiple pixel coordinates of the multiple optical cooperation marks in the mark images are extracted respectively; constructing a corresponding space virtual calibration grid according to the plurality of three-dimensional coordinates and the plurality of pixel coordinates corresponding to each preset detection position; and calculating the camera internal reference of the target camera based on the plurality of space virtual calibration grids corresponding to the plurality of preset detection positions through a camera calibration algorithm. Therefore, the accuracy of internal reference calculation of the camera can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Camera intrinsic parameter calculation methods, apparatus, computer equipment, and readable storage media Technical Field

[0001] This application relates to the field of camera parameter calculation technology, and in particular to a method, apparatus, computer device, and readable storage medium for calculating camera intrinsic parameters. Background Technology

[0002] Visual measurement technology acquires and processes two-dimensional digital images to accurately model and reconstruct the geometric structure and spatial position of objects in the real world. Its measurement accuracy directly depends on the accuracy of the camera's intrinsic parameters. In order to convert the image pixel coordinates into world coordinates with physical units, high-precision camera intrinsic parameter calculations must be performed to ensure the reliability and accuracy of the vision system in high-precision applications such as industrial inspection and robot navigation.

[0003] In related technologies, camera intrinsic parameters are generally calculated based on printed checkerboard calibration paper. Specifically, this method involves placing pre-made checkerboard calibration paper at different positions and angles, taking multiple images with a camera, and then calculating camera intrinsic parameters based on the planar geometric properties of the checkerboard calibration images. However, while this method is simple to operate, processing errors and deformations of the checkerboard calibration paper (such as ink diffusion, paper expansion, etc.) directly lead to inaccurate coordinates, introducing calculation errors. This results in calibration accuracy failing to meet the requirements of high-precision visual measurement, ultimately leading to inaccurate calculated camera intrinsic parameters. Summary of the Invention

[0004] This application proposes a method, apparatus, computer device, and readable storage medium for calculating camera intrinsic parameters, which can improve the accuracy of camera intrinsic parameter calculation.

[0005] To achieve the above objectives, a first aspect of this application proposes a method for calculating camera intrinsic parameters. The method includes: controlling a probe of a spatial coordinate measuring device to perform motion detection at each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the probe at each preset detection position; when the probe is detected to be located at each preset detection position, acquiring a marker image captured by a target camera of the multiple optical cooperation marks, and extracting multiple pixel coordinates of the multiple optical cooperation marks in the marker image; constructing a corresponding spatial virtual calibration grid based on the multiple three-dimensional coordinates and the multiple pixel coordinates corresponding to each preset detection position; and calculating the camera intrinsic parameters of the target camera based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm.

[0006] Accordingly, a second aspect of this application proposes a camera intrinsic parameter calculation device, the device comprising: a control module, configured to control a probe of a spatial coordinate measuring device to perform motion detection at each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the probe at each preset detection position; an acquisition module, configured to acquire a marker image captured by a target camera of the multiple optical cooperation marks when the probe is detected to be located at each preset detection position, and extract multiple pixel coordinates of the multiple optical cooperation marks in the marker image respectively; a construction module, configured to construct a corresponding spatial virtual calibration grid based on the multiple three-dimensional coordinates and the multiple pixel coordinates corresponding to each preset detection position; and a calculation module, configured to calculate the camera intrinsic parameters of the target camera based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm.

[0007] In some implementations, the calculation module is further configured to: calculate the corresponding homography matrix based on the spatial virtual calibration grid corresponding to each preset detection position; construct the corresponding linear equation system through the vertical constraint relationship and length equality constraint relationship of each homography matrix; and perform joint calculation based on the multiple linear equation systems of the multiple homography matrices corresponding to the multiple preset detection positions to obtain the camera intrinsic parameters of the target camera.

[0008] In some embodiments, the calculation module is further configured to: perform planar projection transformation processing based on the spatial virtual calibration grid corresponding to each preset detection position to obtain a two-dimensional projection relationship model from the world coordinate system plane corresponding to each preset detection position to the image coordinate system plane corresponding to the target camera; calculate the planar projection transformation parameters in the two-dimensional projection relationship model using a least squares estimation algorithm to obtain a homography matrix characterizing the mapping relationship between the world coordinate system plane and the image coordinate system plane, wherein the homography matrix includes rotation parameters, translation parameters, and affine transformation parameters.

[0009] In some embodiments, the calculation module is further configured to: extract a first column vector and a second column vector from each homography matrix; construct a first linear equation based on the dot product relationship between the first column vector and the second column vector; construct a second linear equation based on the equality constraint relationship between the magnitudes of the first column vector and the second column vector; and combine the first linear equation and the second linear equation corresponding to each homography matrix to construct a system of linear equations for each homography matrix.

[0010] In some embodiments, the camera intrinsic parameter calculation device further includes an adjustment module, configured to: project each three-dimensional coordinate onto the image coordinate system plane corresponding to the target camera using the camera intrinsic parameters for multiple spatial virtual calibration grids to obtain theoretical pixel coordinates; calculate projection sub-errors based on the difference between each theoretical pixel coordinate and the pixel coordinates corresponding to each three-dimensional coordinate; calculate projection errors based on multiple projection sub-errors corresponding to multiple three-dimensional coordinates, and when the projection error is greater than a preset error threshold, construct an objective function based on the multiple three-dimensional coordinates, the camera intrinsic parameters, and the corresponding multiple pixel coordinates; and adjust the camera intrinsic parameters by minimizing the objective function to obtain the target camera intrinsic parameters of the target camera.

[0011] In some implementations, the adjustment module is further configured to: construct transformation description information based on the transformation relationship between each three-dimensional coordinate and the camera intrinsic parameters, and construct a relationship function based on the difference between the transformation description information corresponding to each three-dimensional coordinate and the pixel coordinate; obtain multiple ranges of variation of multiple parameters of the camera intrinsic parameters, and construct an adjustment constraint function based on the multiple ranges of variation; and construct a target function based on the relationship function and the adjustment constraint function.

[0012] In some embodiments, the control module is further configured to: control the touch head of the spatial coordinate measuring device to perform movement detection at each preset detection position, thereby obtaining the three-dimensional touch coordinates of the touch head at each preset detection position; acquire multiple offsets of multiple optical cooperation signs relative to the touch head of the spatial coordinate measuring device, and based on the three-dimensional touch coordinates and the corresponding offsets, acquire multiple three-dimensional coordinates of the multiple optical cooperation signs at each preset detection position.

[0013] Accordingly, a third aspect of the present application provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the camera intrinsic parameter calculation method of any one of the embodiments of the first aspect of the present application.

[0014] Accordingly, a fourth aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the camera intrinsic parameter calculation method of any one of the embodiments of the first aspect of this application.

[0015] This embodiment of the application controls the movement detection of the probe head of the spatial coordinate measuring device at each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the probe head at each preset detection position. When the probe head is detected to be at each preset detection position, a marker image of the multiple optical cooperation marks is acquired by the target camera, and multiple pixel coordinates of the multiple optical cooperation marks in the marker image are extracted respectively. A corresponding spatial virtual calibration grid is constructed based on the multiple three-dimensional coordinates and multiple pixel coordinates corresponding to each preset detection position. The camera intrinsic parameters of the target camera are calculated based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm. In this way, multiple optical cooperation marks can be fixed on the probe head, and high-precision three-dimensional coordinates can be directly obtained by using the spatial coordinate measuring device, avoiding the problem that the processing error and deformation of the checkerboard calibration plate directly introduce the 3D true value, and realizing high-precision camera intrinsic parameter calculation. Specifically, the three-dimensional coordinate accuracy provided by spatial coordinate measuring devices (such as coordinate measuring machines) is far higher than the manufacturing accuracy of checkerboard calibration plates, thereby ensuring the accuracy and reliability of 3D coordinates in the constructed spatial virtual calibration grid. This enables camera calibration algorithms to calculate intrinsic parameters based on more accurate 2D-3D correspondences, ultimately improving the accuracy of intrinsic parameter calculation. In summary, this application can improve the accuracy of camera intrinsic parameter calculation. Attached Figure Description

[0016] Figure 1 is a schematic diagram of the camera intrinsic parameter calculation system provided in an embodiment of this application; Figure 2 is a flowchart of the camera intrinsic parameter calculation method provided in an embodiment of this application; Figure 3 is a schematic diagram of the optical cooperation sign reflection principle provided in an embodiment of this application; Figure 4 is a schematic diagram of the functional modules of the camera intrinsic parameter calculation device provided in an embodiment of this application; Figure 5 is a schematic diagram of the hardware structure of the computer device provided in an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0018] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0020] Visual measurement technology acquires and processes two-dimensional digital images to accurately model and reconstruct the geometric structure and spatial position of objects in the real world. Its measurement accuracy directly depends on the accuracy of the camera's intrinsic parameters. In order to convert the image pixel coordinates into world coordinates with physical units, high-precision camera intrinsic parameter calculations must be performed to ensure the reliability and accuracy of the vision system in high-precision applications such as industrial inspection and robot navigation.

[0021] In related technologies, camera intrinsic parameters are generally calculated based on printed checkerboard calibration paper. Specifically, this method involves placing pre-made checkerboard calibration paper at different positions and angles, taking multiple images with a camera, and then calculating camera intrinsic parameters based on the planar geometric properties of the checkerboard calibration images. However, while this method is simple to operate, processing errors and deformations of the checkerboard calibration paper (such as ink diffusion, paper expansion, etc.) directly lead to inaccurate coordinates, introducing calculation errors. This results in calibration accuracy failing to meet the requirements of high-precision visual measurement, ultimately leading to inaccurate calculated camera intrinsic parameters.

[0022] Based on this, embodiments of this application provide a method, apparatus, computer device, and readable storage medium for calculating camera intrinsic parameters, which can improve the accuracy of camera intrinsic parameter calculation.

[0023] The camera intrinsic parameter calculation method, apparatus, computer equipment, and readable storage medium provided in this application are specifically described through the following embodiments. First, the camera intrinsic parameter calculation system in this application embodiment is described.

[0024] Referring to Figure 1, in some embodiments, this application provides a camera intrinsic parameter calculation system, including a terminal 11 and a server 12.

[0025] In some implementations, terminal 11 can be used to acquire camera image data and coordinate coordinate machine real-time coordinate data, and coordinate the operation of hardware devices. For example, it can be an embedded system, an industrial control computer, or a dedicated data acquisition terminal; terminal 11 can connect to the target camera and coordinate measuring machine to control the movement and image capture of the cooperative sign in real time to obtain high-precision pixel coordinates and spatial three-dimensional coordinate data; or, terminal 11 can be the target camera and the coordinate measuring machine.

[0026] In some implementations, the server 12 can be used to process the data transmitted by the terminal 11 and execute camera intrinsic parameter calibration algorithms. For example, it can be a cloud server, a local server, or a distributed computing platform. The server 12 can perform homography matrix calculation, linear initial value solution, and nonlinear optimization by receiving image and coordinate correspondence data sent by the terminal 11 to output high-precision camera intrinsic parameters and distortion coefficients.

[0027] Furthermore, the terminal 11 and the server 12 can interact with each other via wired or wireless network protocols. The terminal 11 is responsible for data acquisition and initial encapsulation, and transmits the data to the server 12 for analysis and calculation. After the server 12 completes the calibration, it can feed back the results to the terminal 11, realizing distributed collaboration of data acquisition and processing, and improving calibration efficiency and system flexibility.

[0028] In some implementations, server 12 may be equipped with computer equipment, which can send control commands to terminal 11 (such as a spatial coordinate measuring device and a target camera). The control commands may include adjusting the spatial distribution path of the cooperative markers, specifying the timing of image acquisition, or setting the sampling density of three-dimensional coordinates. Terminal 11 can coordinate the motion trajectory of the coordinate measuring machine and the shooting action of the camera in real time according to the received commands, so as to obtain images and coordinate data that are more in line with the requirements of the calibration algorithm in terms of spatial distribution, quantity, or perspective. This achieves closed-loop optimization of the data acquisition process and effectively improves the accuracy of the calibration results and the system's adaptive capability.

[0029] The camera intrinsic parameter calculation method in this application embodiment can be illustrated through the following examples.

[0030] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user will be obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent will the necessary user-related data for the normal operation of the embodiments of this application be obtained.

[0031] In this embodiment, the description will focus on the camera intrinsic parameter calculation device, which can be integrated into a computer device. Referring to Figure 2, which is a flowchart of the camera intrinsic parameter calculation method provided in this embodiment, this embodiment takes the camera intrinsic parameter calculation device being integrated into a terminal or server as an example. When the processor on the terminal or server executes the program instructions corresponding to the camera intrinsic parameter calculation method, the specific process is as follows: Step 101, control the touch head of the spatial coordinate measuring device to move and detect each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the touch head at each preset detection position.

[0032] In some implementations, in order to achieve high-precision camera intrinsic parameter calibration, the probe of the spatial coordinate measuring device can be controlled to move and detect at multiple preset detection positions, and the optical cooperative marks on the probe can be used to obtain the precise three-dimensional coordinates corresponding to each position, so as to avoid the introduction of 3D true value by processing errors and deformation, and improve calibration accuracy and automation.

[0033] Among them, the spatial coordinate measuring device can be a coordinate measuring machine or a total station; the spatial coordinate measuring device is a high-precision measuring device used to accurately measure the geometric dimensions and position of an object in three-dimensional space.

[0034] The probe head can be a probe or probe component on a coordinate measuring machine, used to fix and install the optical cooperation mark and perform movement detection. When it reaches a preset detection position, the spatial coordinate measuring device can directly acquire the three-dimensional coordinate data of the probe head, and calculate the three-dimensional coordinates of all optical cooperation marks by directly combining the three-dimensional coordinate data with the offset of the probe head from all optical cooperation marks.

[0035] The preset detection positions can be pre-defined spatial points or paths. These positions are distributed in a three-dimensional coordinate system and cover the X, Y, and Z directions to systematically control the movement of the probe head and ensure the diversity and comprehensiveness of the coordinate points of the cooperative markers.

[0036] Among them, the optical cooperation mark can be a visual measurement mark designed with a coating that has directional retroreflective properties (such as a coating containing glass microbeads, reflective film, etc.). It is fixed on the touch head and can be used to make the pixel coordinates clearly visible in the camera image and easy to extract.

[0037] Referring to Figure 3, in some embodiments, multiple optical cooperation markers can be multiple visual measurement marks bonded to a calibration plate via an adhesive layer, with the calibration plate fixed to the probe head. Each optical cooperation marker can be a high-refractive-index transparent glass microsphere that can refract and focus an incident light beam. Then, a reflective film behind the optical cooperation marker reflects the focused incident light beam back to the glass microsphere. The light is then refracted again on the front surface of the optical cooperation marker, making the direction of the outgoing beam almost opposite to that of the incident beam, achieving directional retroreflection and ensuring clear visibility in any lighting environment. This allows each optical cooperation marker to be quickly located and its corresponding pixel coordinates obtained after the calibration image is captured.

[0038] Among them, the three-dimensional coordinates can be the precise position data of the cooperation mark in the world coordinate system. They can be used as the real 3D reference value in the calibration process, replacing the estimated coordinates of the traditional chessboard grid, and improving the quality and accuracy of the basic data for internal parameter calculation.

[0039] In some implementations, the probe of the spatial coordinate measuring device can be controlled to move and detect each preset detection position via a preset motion path. Specifically, the motion controller of the coordinate measuring machine can be programmed to move the probe along a preset trajectory. During the movement of the probe carrying the optical cooperation mark (such as a reflective ball or a specific pattern mark), when the probe reaches each preset detection position, the measurement system of the coordinate measuring machine (such as a grating ruler or a laser interferometer) directly reads the spatial position of the probe. Combined with the fixed offset of the optical cooperation mark relative to the probe (obtained through pre-calibration), the precise three-dimensional coordinates of the optical cooperation mark are calculated. For example, the offset can be a three-dimensional vector representing the displacement relationship between the cooperation mark and the probe reference point. The coordinates of the cooperation mark are calculated using the following formula: ;in, Represents the three-dimensional coordinates of the cooperation symbol. This represents the three-dimensional touch coordinates of the touch sensor. This indicates the offset. This ensures the accuracy and consistency of the coordinate data.

[0040] For example, the preset detection position can be set as a spatial grid of points. The probe moves sequentially to each grid point, and the coordinate measuring machine can move using a contact or non-contact probe (such as an optical probe) to acquire the coordinates of the probe and multiple three-dimensional coordinates of all optical cooperative marks. This enables high-precision, automated three-dimensional coordinate acquisition, avoiding the inaccurate 3D true values ​​caused by processing errors and deformation in traditional checkerboard calibration plates, while improving calibration efficiency and repeatability.

[0041] In some implementations, the number of optical cooperation markers should be greater than or equal to four to ensure the calculation of the homography matrix during subsequent calculations of camera intrinsic parameters.

[0042] In some implementations, a preset detection position may not be set. Instead, the spatial coordinate measuring device drives the probe head to move randomly and obtains multiple three-dimensional coordinates of multiple optical cooperation marks in the manner described above.

[0043] In some implementations, a preliminary image of the cooperative marker can be captured in real time using a target camera. The system calculates the uniformity of feature point distribution in the marker image. If insufficient coordinate point coverage is detected in certain areas, the system automatically generates supplementary paths and controls the probe to move to these areas for additional measurements. This further optimizes the spatial distribution of coordinate points and improves the comprehensiveness and robustness of the calibration data.

[0044] In some implementations, a multi-probe parallel operation mode can be used to calculate coordinates. Specifically, the spatial coordinate measuring device can be improved by deploying multiple probes on the device, each probe fixed to a different optical cooperation marker. All optical cooperation markers are synchronously moved to their respective preset detection positions. The three-dimensional coordinates of the corresponding probe are directly used as the three-dimensional coordinates of the optical cooperation marker at each preset detection position. This yields multiple three-dimensional coordinates corresponding to multiple optical cooperation markers during a single movement to a preset detection position. Simultaneously, a target camera captures a calibration image corresponding to the multiple optical cooperation markers, and extracts multiple pixel coordinates corresponding to these markers. These pixel coordinates are then used to construct a spatial virtual calibration grid corresponding to the multiple three-dimensional coordinates. This eliminates the need for offset calculations, completely avoids the problem of checkerboard deformation, significantly shortens data acquisition time, and improves calibration efficiency.

[0045] The above methods can automatically and accurately obtain the three-dimensional coordinates of the cooperative markers, avoiding the 3D truth distortion problem caused by processing errors and deformation of traditional checkerboard calibration boards. This can improve the accuracy and efficiency of camera intrinsic parameter calibration, and thus provide a reliable data foundation for subsequent construction of spatial virtual calibration mesh and optimization of camera intrinsic parameter calculation.

[0046] In some implementations, to achieve high-precision camera intrinsic parameter calibration, the probe of the spatial coordinate measuring device can be moved and detected at a preset detection position to obtain three-dimensional probe coordinates. The precise three-dimensional coordinates of the cooperative sign are then calculated by combining the offset of the optical cooperative sign relative to the probe, replacing the traditional checkerboard calibration method. This eliminates the inaccuracy of 3D true values ​​introduced by processing errors and deformation, improving the accuracy and reliability of the calibration data. For example, step 101 may include: (101.1) controlling the probe of the spatial coordinate measuring device to move and detect at each preset detection position to obtain the three-dimensional probe coordinates at each preset detection position; (101.2) obtaining multiple offsets of multiple optical cooperative signs relative to the probe of the spatial coordinate measuring device, and based on the three-dimensional probe coordinates and the corresponding offsets, obtaining multiple three-dimensional coordinates corresponding to the multiple optical cooperative signs at each preset detection position.

[0047] Among them, the three-dimensional touch coordinates can be the spatial three-dimensional coordinate data of the touch head at the preset detection position, such as the coordinate value of the center point of the probe obtained directly by a coordinate measuring machine. It can be used as a basic coordinate reference and combined with the offset to accurately derive the actual three-dimensional coordinates of each optical cooperation mark.

[0048] The offset can be the fixed spatial position deviation of the optical cooperative mark relative to the probe head. For example, it can be a pre-calibrated three-dimensional vector used to represent the displacement relationship between the cooperative mark and the probe head reference point, so as to correct the probe head coordinates, obtain the accurate three-dimensional coordinates of the cooperative mark, and ensure the high accuracy and consistency of the calibration data.

[0049] In some implementations, the preset detection position can be a series of points or paths in three-dimensional space, which cover the X, Y, and Z directions to ensure the comprehensiveness of the spatial distribution. For example, the motion controller of the coordinate measuring machine is programmed (such as based on G-code or a custom path planning algorithm) to make the probe move along the preset trajectory. During the movement of the probe, its position is detected in real time by the high-precision sensors of the coordinate measuring machine (such as grating rulers, laser interferometers, or encoders), and three-dimensional touch coordinate data is output.

[0050] For example, the preset detection position can be set as a spatial grid of points. The probe moves sequentially to each grid point, and the coordinate measuring machine acquires the coordinates through a contact probe (such as a probe head) or a non-contact probe (such as an optical probe). The coordinate data is processed by built-in software (such as Metrology Suite) and stored as three-dimensional touch coordinates. In this way, high-precision, automated position detection can be achieved, avoiding human error and providing a reliable basis for subsequent coordinate calculations.

[0051] In some implementations, as the touch sensor moves to each preset detection position, the coordinate measuring machine's measurement system directly reads the spatial position of the touch sensor based on a world coordinate system (e.g., with the machine base as the origin). The coordinate data undergoes sensor signal conversion (e.g., analog-to-digital conversion) and filtering (e.g., Kalman filtering) to eliminate noise, resulting in stable three-dimensional touch coordinates. For example, the three-dimensional touch coordinates can be represented as... =(x,y,z), where x,y,z are the coordinates of the probe in the X, Y, and Z directions, respectively. Accuracy is ensured by using the resolution of the measuring machine's grating ruler (e.g., 0.1 micrometers). This guarantees the accuracy and repeatability of the coordinate data, meeting the requirements for high-precision calibration.

[0052] In some implementations, obtaining the offsets of multiple optical cooperative markers relative to the probe head can be achieved through a pre-calibration process. For example, with the probe head fixed, the relative positions between the cooperative markers and a reference point of the probe head (such as the center of the probe head sphere) can be measured using a high-precision measuring tool (such as a laser tracker or a two-dimensional measuring instrument) to obtain offset data; the offsets can be represented as three-dimensional vectors. ,in , , These represent the displacement values ​​in the X, Y, and Z directions, respectively. The pre-calibration process can be performed in a laboratory environment, reducing errors by averaging multiple measurements. The offset data is stored in the system for later retrieval. This ensures high accuracy and consistency of the offsets, providing reliable parameters for coordinate transformation.

[0053] In some implementations, the three-dimensional coordinates of the cooperative marker, based on the three-dimensional touch coordinates and offset, can be calculated using vector addition. Specifically, for each preset detection position, the three-dimensional touch coordinates of the touch head can be... Adding the offset of the corresponding optical cooperation symbol to obtain the three-dimensional coordinates of the optical cooperation symbol. The specific formula is as follows: Each optical cooperation mark has a different offset relative to the probe head.

[0054] The above methods can automatically and accurately derive the three-dimensional coordinates of the optical cooperation markers, avoiding the 3D truth distortion caused by processing errors and deformation of traditional checkerboard calibration plates. This can improve the accuracy and reliability of 3D reference data in camera intrinsic parameter calibration, thereby providing a solid data foundation for subsequent construction of spatial virtual calibration grids and optimization of camera intrinsic parameter calculations, ultimately improving the overall calibration accuracy.

[0055] Step 102: When the touch probe is detected to be located at each preset detection position, the target camera captures the marking images of the multiple optical cooperation marks, and the multiple pixel coordinates of the multiple optical cooperation marks in the marking images are extracted respectively.

[0056] In some implementations, in order to achieve high-precision 2D-3D correspondence establishment, the target camera can be used to capture the marked image of the optical cooperation mark and extract the pixel coordinates at each preset detection position of the probe head, so as to obtain synchronous and accurate image coordinate data, thereby providing reliable and high-precision input for camera intrinsic parameter calibration, avoiding the problem of inaccurate pixel coordinates caused by corner point extraction errors or environmental interference in the traditional checkerboard method.

[0057] The target camera can be a camera device in a calibrated vision measurement system, such as an industrial camera or a high-resolution digital camera, which is the object for which camera intrinsic parameters need to be calculated.

[0058] The marker image can be a digital image containing an optical cooperation mark captured by the target camera when the probe is in a preset detection position. For example, one or more grayscale or color images can be used to extract the precise pixel coordinates of the cooperation mark through image processing technology.

[0059] Among them, pixel coordinates can be two-dimensional image position data of optical cooperation markers in the marked image, such as coordinate values ​​calculated by sub-pixel corner detection algorithms. They can be used to establish a high-precision correspondence with three-dimensional coordinates in the world coordinate system, supporting the accurate calculation of camera intrinsic parameters.

[0060] In some implementations, as the probe moves to each preset detection position, the device's position sensor (such as an encoder or grating ruler) provides real-time coordinate data, which is compared with preset values. If the coordinates match (e.g., the error is less than a threshold such as 0.1 mm), the system generates a trigger signal (such as an electrical pulse or software interrupt) to control the target camera (such as an industrial CCD or CMOS camera) to simultaneously capture an image of the marker containing the optical cooperation symbol. For example, the trigger signal can be sent to the target camera via a wired connection (such as USB or Ethernet) or wirelessly (such as Wi-Fi) to ensure precise synchronization between image acquisition and position detection. This avoids manual operation delays, achieves highly timely and repeatable image acquisition, and provides a reliable data source for subsequent pixel coordinate extraction.

[0061] In some implementations, the marked image can be preprocessed, including grayscale conversion, filtering (such as Gaussian filtering), and contrast enhancement, to eliminate noise and illumination effects. Then, a feature point detection algorithm (such as subpixel corner detection or SIFT) is used to locate the position of the optical cooperation marker in the image, and pixel coordinates are output. For example, pixel coordinates can be represented as (u, v), where u and v are the horizontal and vertical coordinate values ​​in the image coordinate system, respectively. This ensures the accuracy and stability of the pixel coordinates.

[0062] By using the above methods, the precise pixel coordinates of the optical cooperation markers in the image can be obtained in real time and synchronously. This ensures the accuracy and consistency of 2D-3D point pair data, thereby providing a reliable and high-precision image data foundation for subsequent construction of spatial virtual calibration grids and optimization of camera intrinsic parameters, ultimately improving the overall accuracy and robustness of the calibration results.

[0063] Step 103: Construct a corresponding spatial virtual calibration grid based on multiple three-dimensional coordinates and multiple pixel coordinates corresponding to each preset detection position.

[0064] In some implementations, to achieve high-precision and flexible camera intrinsic parameter calibration, a spatial virtual calibration grid can be dynamically constructed by associating the three-dimensional coordinates of multiple optical cooperative markers obtained at each preset detection position with their corresponding pixel coordinates. This replaces the traditional fixed physical calibration board, thereby eliminating the processing errors, deformation, and environmental sensitivity of the physical calibration board.

[0065] Each spatial virtual calibration grid can be a data set formed by multiple optical cooperative markers at the same preset detection position, containing the correspondence between their precise three-dimensional world coordinates and corresponding two-dimensional pixel coordinates. Each preset detection position corresponds to one spatial virtual calibration grid.

[0066] In some implementations, for each preset detection location, the acquired 3D coordinates (from a coordinate measuring machine) and pixel coordinates (from a calibration image captured by a target camera) can be mapped one-to-one to form a set of 2D-3D point pairs. Then, using these point pairs, a virtual calibration grid is constructed through spatial interpolation or fitting methods (such as Delaunay triangulation or polynomial fitting). This grid defines a regular or irregular lattice structure in 3D space. For example, if each preset detection location provides 5 cooperative marker points, each corresponding spatial virtual calibration grid includes 5 sets of 2D-3D point pairs; if multiple preset detection locations correspond to one 2D-3D point pair, all 2D-3D point pairs corresponding to all preset detection locations can be aggregated to form a unified spatial virtual calibration grid. For example, the minimum number of point pairs for each spatial virtual calibration grid can be set to 12-15 pairs, forming a grid covering the X, Y, and Z directions. This allows for the creation of a high-precision virtual calibration field to replace the physical calibration plate, avoiding processing errors and deformation problems, while improving the flexibility and repeatability of calibration data.

[0067] For example, besides constructing a mesh using static point pairs, a dynamic mesh update method can also be employed. Specifically, environmental changes (such as temperature or vibration) can be detected in real time, and the mesh point positions can be adjusted based on sensor data. For instance, a temperature compensation algorithm can be integrated to dynamically correct the three-dimensional coordinates based on the coefficient of thermal expansion (CTE), thereby updating the corresponding spatial virtual calibration mesh. For example, when environmental temperature fluctuations cause deformation of the measuring machine structure or changes in workpiece dimensions, the server can call the material database to match the corresponding CTE and apply the formula... Calculate the compensation value, where, Original coordinates To account for temperature deviations, the corrected spatial coordinates are mapped onto a virtual spatial calibration grid, enabling dynamic updates of the measurement reference.

[0068] In some implementations, in addition to temperature compensation, a vibration compensation mechanism can be integrated. Specifically, vibration parameters (such as amplitude, frequency, and phase) of the measuring machine structure or workpiece surface can be monitored in real time by deploying triaxial accelerometers or laser displacement sensors. Combined with the material's elastic modulus and damping coefficient, the reference coordinates of the virtual mesh can be dynamically corrected. For example, when the measuring machine experiences micro-deformation due to external vibration sources (such as equipment operation or environmental vibration), vibration sensor data can be collected, and based on a preset vibration-deformation mapping model (such as finite element simulation results or a historical vibration compensation database), the displacement deviation value of each mesh node can be calculated using a formula. Generate compensation amount, where The material stiffness coefficient, For vibration amplitude, For frequency, This is for phase offset, and the corresponding three-dimensional coordinates in the spatial virtual calibration grid are updated synchronously.

[0069] By using the above methods, a virtual calibration field without physical deformation can be dynamically generated based on high-precision measured data. This provides the camera calibration algorithm with 2D-3D correspondence data that far exceeds the accuracy and reliability of traditional methods. This lays a solid data foundation for subsequent core calibration steps such as homography matrix calculation, linear initial value solution, and nonlinear optimization, ultimately significantly improving the overall accuracy and robustness of camera intrinsic parameter calibration.

[0070] Step 104: Calculate the camera intrinsic parameters of the target camera using a camera calibration algorithm based on multiple spatial virtual calibration grids corresponding to multiple preset detection positions.

[0071] In some implementations, in order to achieve the final determination of high-precision camera intrinsic parameters, a camera calibration algorithm can be used to calculate high-precision 2D-3D point pair data provided by multiple spatial virtual calibration grids corresponding to multiple preset detection positions. This results in the output of a parameter matrix that can accurately describe the internal geometry and optical characteristics of the camera, thereby providing a high-precision and reliable mathematical model foundation for the visual measurement system to convert image pixel coordinates into real-world coordinates.

[0072] Among them, camera intrinsic parameters can be a set of parameters describing the internal geometry and optical characteristics of the camera, such as intrinsic parameter matrices containing focal length, principal point, tilt factor, and distortion coefficients, which can be used to establish a precise projection mapping relationship from the three-dimensional world coordinate system to the two-dimensional image coordinate system.

[0073] In some implementations, the camera intrinsic parameters of the target camera are calculated based on multiple spatial virtual calibration grids corresponding to multiple preset detection positions using a camera calibration algorithm. This can be achieved through phased optimization, specifically including a linear initialization phase and a nonlinear optimization phase. In the linear initialization phase, for each spatial virtual calibration grid, a homography matrix is ​​calculated based on the 2D-3D point pairs it contains (i.e., point pairs consisting of 3D coordinates and corresponding pixel coordinates). This homography matrix represents the projection relationship from the world coordinate system plane to the image coordinate system.

[0074] For example, for a grid containing 15 point pairs, a 3×3 homography matrix H can be obtained by solving the overdetermined equations through SVD decomposition. This provides a stable initial estimate for camera intrinsic parameter calculation.

[0075] In some implementations, the linear equations of the homography matrix can be constructed and solved using the constraint properties of the rotation matrix. Specifically, the sum of the first two column vectors can be extracted from each homography matrix H, and linear equations can be constructed using the orthogonality and equal length properties of the rotation matrix. The constraint equations corresponding to multiple spatial virtual calibration meshes are combined to form a system of linear equations, and the initial values ​​of the matrix corresponding to the camera intrinsic parameters are solved using Cholesky decomposition. For example, when using five virtual meshes with five different poses, ten linear equations can be obtained to jointly solve for the five unknown parameters of the matrix corresponding to the camera intrinsic parameters. This allows for rapid linear initialization of the camera intrinsic parameters, thus obtaining the camera intrinsic parameters.

[0076] In some implementations, the initial intrinsic parameters can be refined using bundle adjustment during the nonlinear optimization stage. Specifically, the camera intrinsic parameters and pose obtained from the linear initialization described above can be used as initial values ​​to construct a reprojection error objective function for optimization. The optimization process can employ automatic differentiation techniques to calculate the Jacobian matrix, ensuring numerical stability and convergence efficiency, so as to accurately calculate the final camera intrinsic parameters of the target camera.

[0077] This embodiment of the application controls the movement detection of the probe head of the spatial coordinate measuring device at each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the probe head at each preset detection position. When the probe head is detected to be at each preset detection position, a marker image of the multiple optical cooperation marks is acquired by the target camera, and multiple pixel coordinates of the multiple optical cooperation marks in the marker image are extracted respectively. A corresponding spatial virtual calibration grid is constructed based on the multiple three-dimensional coordinates and multiple pixel coordinates corresponding to each preset detection position. The camera intrinsic parameters of the target camera are calculated based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm. In this way, multiple optical cooperation marks can be fixed on the probe head, and high-precision three-dimensional coordinates can be directly obtained by using the spatial coordinate measuring device, avoiding the problem that the processing error and deformation of the checkerboard calibration plate directly introduce the 3D true value, and realizing high-precision camera intrinsic parameter calculation. Specifically, the three-dimensional coordinate accuracy provided by spatial coordinate measuring devices (such as coordinate measuring machines) is far higher than the manufacturing accuracy of checkerboard calibration plates, thereby ensuring the accuracy and reliability of 3D coordinates in the constructed spatial virtual calibration grid. This enables camera calibration algorithms to calculate intrinsic parameters based on more accurate 2D-3D correspondences, ultimately improving the accuracy of intrinsic parameter calculation. In summary, this application can improve the accuracy of camera intrinsic parameter calculation.

[0078] In some implementations, to achieve a stable solution for the initial values ​​of camera intrinsic parameters, the homography matrix from the world coordinate system to the image coordinate system can be calculated for each spatial virtual calibration grid. A system of linear equations can be constructed for each homography matrix using the vertical constraint and length equality constraint derived from the rotation matrix property. The equations corresponding to multiple positions are then solved jointly to linearly, efficiently, and numerically stably calculate the initial estimate of the camera intrinsic parameters, providing a high-quality iterative starting point for subsequent nonlinear optimization. For example, step 104 may include: (104.1) calculating the corresponding homography matrix based on the spatial virtual calibration grid corresponding to each preset detection position; (104.2) constructing a corresponding system of linear equations based on the vertical constraint and length equality constraint of each homography matrix, and jointly calculating the camera intrinsic parameters of the target camera based on the multiple linear equations of multiple homography matrices corresponding to multiple preset detection positions.

[0079] The homography matrix can be a matrix that describes the projection transformation relationship of a plane between the world coordinate system and the camera image coordinate system, and can be used to establish a linear mapping between two coordinate planes.

[0080] The perpendicular constraint can be a mathematical constraint that the dot product between the column vectors of the rotation matrix is ​​zero. For example, it can be a condition derived from the homography matrix that the dot product of two column vectors must be zero, and it can be used to ensure that the solved parameters conform to the geometric properties of Euclidean transformation. The rotation matrix can be part of the camera extrinsic parameters, used to describe the rotation transformation from the world coordinate system to the camera coordinate system. It is a 3×3 orthogonal matrix, and its column vectors represent the three axial unit vectors of the world coordinate system in the camera coordinate system.

[0081] Among them, the length equality constraint can be a mathematical constraint that the column vectors of the rotation matrix have equal magnitudes. For example, the condition that two column vectors derived from the homography matrix should satisfy the equal magnitude condition can be used to construct another linear equation about the camera intrinsic parameters, which together with the vertical constraint provides sufficient constraints for solving the intrinsic parameters.

[0082] The linear equation system can be a set of multiple linear equations about the camera's intrinsic parameters, constructed by vertical constraints and equal length constraints. For example, the linear equation system can be obtained by combining the two constraint equations generated by each homography matrix.

[0083] In some implementations, the homography matrix corresponding to each preset detection position can be calculated using planar projection transformation and least squares estimation methods, based on the spatial virtual calibration grid. For example, if the calibration grid is approximately located in the Z=0 plane of the world coordinate system (confirmed through data fitting), the three-dimensional coordinates can be simplified to... The homography matrix is ​​then solved using the least squares method in homography form (X,Y,1). The homography matrix satisfies the projection equation ,in For homogeneous pixel coordinates, It is a 3×3 matrix. For example, for a spatial virtual calibration grid containing N point pairs (N≥4), this can be achieved by constructing an overdetermined system of equations. ,in It is a 2N×9 matrix composed of point pairs. Homography matrix The vectorized form is obtained and solved using singular value decomposition (SVD). This yields the optimal homography matrix in the least squares sense. This allows for an accurate description of the mapping relationship from the world coordinate system plane to the image coordinate system, providing a foundation for calculating camera intrinsic parameters.

[0084] In some implementations, a system of linear equations is constructed based on the perpendicular and length constraints of each homography matrix. This can be derived using the properties of rotation matrices. Specifically, it can be derived from each homography matrix... Extract the first two column vectors and This corresponds to the projection of the X and Y axes onto the image in the world coordinate system.

[0085] Furthermore, based on the orthogonality of the rotation matrix, the column vectors should satisfy the perpendicular constraint (dot product equals zero) and the equal length constraint (equal magnitudes), that is: Perpendicular constraint: Equal length constraint: ;in The camera intrinsic parameter matrix is ​​defined as follows: ; Including focal length , Main point , and tilt factor Through algebraic transformations, constraints can be transformed into linear equations about the intrinsic parameter matrix, for example, by defining... Given a symmetric matrix, the constraints are represented as follows: In the form of, etc.

[0086] For example, for a homography matrix, perpendicularity and equal length constraints can generate two linear equations; if there are K preset detection positions (K≥2), then 2K equations can be combined to form a system of linear equations. In this way, nonlinear problems can be transformed into linear solutions, simplifying computation and improving efficiency.

[0087] In some implementations, the camera intrinsic parameters can be calculated jointly from a system of linear equations based on multiple homography matrices, which can be achieved by solving a closed-form solution. Specifically, multiple linear equations can be combined into a single system. ,in The coefficient matrix, The above symmetric matrix B is represented by a vectorized form (containing 6 unknowns). The eigenvectors corresponding to the smallest eigenvalue are solved using SVD to obtain an estimate of b. Then, the intrinsic parameter matrix A is extracted using Cholesky decomposition and matrix inversion, and the camera intrinsic parameters are calculated accordingly. This allows for fast linear estimation of the camera intrinsic parameters, providing high-quality initial values ​​for subsequent nonlinear optimization and preventing the optimization from getting trapped in local minima.

[0088] By utilizing the geometric constraints inherent in multiple high-precision spatial virtual calibration grids, a system of linear equations concerning camera intrinsic parameters can be systematically constructed and solved. This allows for a high-precision initial estimate of the intrinsic parameters, laying a solid foundation for the subsequent nonlinear optimization and refinement process. It also avoids optimization failures or getting trapped in local optima due to improper initial value selection, ultimately ensuring the acquisition of the optimal camera intrinsic parameter calibration results.

[0089] In some implementations, to achieve accurate projection mapping from the world coordinate system to the image coordinate system to support high-precision camera intrinsic parameter calibration, a two-dimensional projection relationship model can be established by performing planar projection transformation processing based on the spatial virtual calibration grid corresponding to each preset detection position. The planar projection transformation parameters in this model are then calculated using a least squares estimation algorithm to obtain a homography matrix representing the mapping relationship between the two coordinate systems. This accurately describes the geometric transformation relationship and provides a high-precision and robust mathematical foundation for camera intrinsic parameter calculation. For example, (104.1) may include: (104.1.1) performing planar projection transformation processing based on the spatial virtual calibration grid corresponding to each preset detection position to obtain a two-dimensional projection relationship model from the world coordinate system plane corresponding to each preset detection position to the image coordinate system plane corresponding to the target camera; (104.1.2) calculating the planar projection transformation parameters in the two-dimensional projection relationship model using a least squares estimation algorithm to obtain a homography matrix representing the mapping relationship between the world coordinate system plane and the image coordinate system plane, wherein the homography matrix includes rotation parameters, translation parameters, and affine transformation parameters.

[0090] The world coordinate system plane can be a reference plane defined by the three-dimensional coordinates of the optical cooperation markers in the spatial virtual calibration grid, such as a virtual two-dimensional plane constructed based on coordinate measuring machine data. It can be used as a reference for projection transformation to ensure the accuracy and consistency of world coordinate data.

[0091] The image coordinate system plane can be a two-dimensional pixel array plane corresponding to the imaging sensor of the target camera, such as a pixel coordinate system with the upper left corner of the image as the origin, which can be used to provide the position information of the optical cooperation mark in the image.

[0092] The two-dimensional projection relationship model can be a mathematical model that describes the linear mapping of points on the world coordinate system plane to the image coordinate system plane. For example, it can be a projection transformation equation represented by a homography matrix, used to establish the geometric relationship between the two coordinate systems.

[0093] Among them, the plane projection transformation parameters can be the set of variables to be solved in the two-dimensional projection relationship model, such as the rotation, translation and affine parameters contained in the homography matrix.

[0094] The rotation parameters can be matrix elements that describe the rotation transformation from the world coordinate system to the camera coordinate system, such as the three angles or vector components in the rotation matrix, which can be used to characterize the camera's attitude change relative to the world coordinate system.

[0095] The translation parameter can be a vector component describing the translation transformation from the world coordinate system to the camera coordinate system. For example, the coordinate values ​​in the three-dimensional translation vector can be used to represent the positional offset between the camera optical center and the origin of the world coordinate system.

[0096] Among them, affine transformation parameters can be parameters that describe nonlinear effects such as scaling and shearing in the image coordinate system. For example, elements outside the main diagonal of the homography matrix can be used to correct affine distortion of the camera lens and improve the accuracy of the projection model.

[0097] In some implementations, the homography matrix corresponding to each preset detection position can be calculated using planar projection transformation and least squares estimation methods, based on the spatial virtual calibration grid. For example, if the grid points are approximately located in the Z=0 plane of the world coordinate system (verified through data fitting, e.g., calculating the plane equation residuals of the point cloud), the three-dimensional coordinates can be transformed... The homography matrix is ​​then solved using the least squares method in homography form (X,Y,1). The homography matrix satisfies the projection equation ,in Here are the homogeneous pixel coordinates, derived from the calibration image. For example, for a spatial virtual calibration grid, the two-dimensional projection relationship model can be represented by a system of equations:

[0098] in These are the elements of the homography matrix. Through a two-dimensional projection relationship model, the nonlinear projection problem can be transformed into a linearly solvable form. In this way, an accurate two-dimensional projection relationship can be constructed, ensuring that the model is consistent with the real spatial distribution.

[0099] In some implementations, the projection relationship model can be... Transform into linear form, eliminating the scale factor; for each pair of points, derive the following two linear equations:

[0100] Furthermore, the equations for all point pairs are combined into matrix form. ,in It is a 2N×9 coefficient matrix. The vectorized form of H Then, to solve the least squares problem, we can take... The right singular vector corresponding to the minimum singular value is used as For example, for a spatial virtual calibration grid with 15 point pairs, Given a 30×9 matrix, obtained via SVD. The homography matrix H is then reconstructed. This allows for efficient solution of the homography matrix, ensuring optimal estimation of the transformation parameters.

[0101] In some implementations, the parameter analysis of the homography matrix can be achieved through matrix decomposition. Specifically, the homography matrix H can be decomposed into... ,in For the camera intrinsic parameter matrix, and These are the first two columns of the rotation matrix (rotation parameters). The translation vector (translation parameters) and the matrix corresponding to the camera intrinsic parameters. Elements such as tilt factor These are affine transformation parameters. For example, these parameters can be extracted from H through QR decomposition or direct algebraic operations; for instance, rotation parameters satisfy... and Translation parameters Directly from The third column. This clarifies the physical meaning of the homography matrix, provides a decomposition basis for subsequent camera intrinsic parameter calibration, and enhances the interpretability of the model.

[0102] By using the above methods, a projection relationship model from the world coordinate system to the image coordinate system can be systematically established based on a high-precision spatial virtual calibration grid. The transformation parameters in the homography matrix can be robustly estimated using the least squares method. In this way, a homography matrix that accurately describes the geometric mapping can be obtained, which provides a reliable and high-precision input for solving the initial values ​​of camera intrinsic parameters using the vertical constraint and length equality constraint of the homography matrix. This ensures the convergence of the intrinsic parameter calibration process and the accuracy of the final result.

[0103] In some implementations, in order to achieve efficient linearization of camera intrinsic parameters, a first column vector and a second column vector can be extracted from each homography matrix. A first linear equation can be constructed based on the dot product relationship, and a second linear equation can be constructed based on the equal modulus constraint. The two can then be combined to form a complete set of linear equations corresponding to each homography matrix. This utilizes the geometric constraint characteristics of the rotation matrix to achieve stable and fast initial estimation of camera intrinsic parameters, avoiding convergence problems or excessive computational complexity that may result from direct nonlinear optimization. For example, "constructing a corresponding system of linear equations through the vertical constraint relationship and the length equality constraint relationship of each homography matrix" in (104.2) may include: (104.2.1) extracting a first column vector and a second column vector from each homography matrix; (104.2.2) constructing a first linear equation based on the dot product relationship between the first column vector and the second column vector; (104.2.3) constructing a second linear equation based on the equality constraint relationship between the magnitude of the first column vector and the magnitude of the second column vector; (104.2.4) combining the first linear equation and the second linear equation corresponding to each homography matrix to construct a system of linear equations for each homography matrix.

[0104] The first column vector can be a vector composed of the first column elements extracted from the homography matrix, such as the first column of a 3x3 homography matrix, which represents the projection mapping component of the X-axis direction of the world coordinate system in the image coordinate system.

[0105] The second column vector can be a vector composed of the second column elements extracted from the homography matrix, such as the second column of a 3x3 homography matrix, which represents the projection mapping component of the Y-axis direction of the world coordinate system in the image coordinate system.

[0106] The first linear equation can be a set of linear equations constructed by the zero dot product of the first column vector and the second column vector. For example, multiple linear equations derived based on vector orthogonality can be used to apply the vertical constraint of the rotation matrix to ensure that the solution of the camera intrinsic parameters conforms to Euclidean geometry.

[0107] The second linear equation can be a set of linear equations constructed by the constraint that the magnitudes of the first column vector and the second column vector are equal. For example, multiple linear equations derived based on the vector equal length can be used to apply the constraint of equal length of the rotation matrix, thereby enhancing the numerical stability and accuracy of the intrinsic parameter solution.

[0108] In some implementations, extracting the first and second column vectors from each homography matrix can be achieved through matrix decomposition and vector operations. Specifically, for each homography matrix corresponding to a preset detection position... (A 3×3 matrix), directly extract its first column vector. Second column vector ,in express The element in the i-th row and j-th column. These vectors originate from the construction of the homography matrix. The projection transformation from the world coordinate plane (Z=0) to the image coordinate system is described. The first and second column vectors correspond to the projection components of the X-axis and Y-axis directions in the world coordinate system onto the image, respectively. In this way, the approximate column vectors of the rotation matrix can be obtained, providing basic data for subsequent constraint construction.

[0109] In some implementations, a first linear equation can be constructed based on the dot product of the first and second column vectors, which can be derived using the orthogonality constraint of the rotation matrix. Specifically, from the theory of homography matrix decomposition, and They should satisfy the orthogonality relation, that is, the dot product is zero: ,in The matrix corresponding to the camera intrinsic parameters is defined as follows: ; Including focal length , Main point , and tilt factor .

[0110] Furthermore, a symmetric matrix can be defined. And expand the dot product constraint into a linear equation For example, a symmetric matrix can be vectorized into... Then the dot product constraint can be expressed as ,in These are vector components. For a single homography matrix, this equation generates a linear equation; if there are K homography matrices, then K equations are constructed to form the first linear equation. In this way, nonlinear orthogonal constraints can be transformed into a linearly solvable form, simplifying intrinsic parameter estimation.

[0111] In some implementations, the second linear equation is constructed based on the equality constraint between the magnitudes of the first and second column vectors. This can be derived using the equal-length constraint of the rotation matrix. Specifically, and The following conditions must be met: The modulus lengths must be equal. Similarly, practical symmetric matrices The constraints can be expanded into linear equations: For example, After the above vectorization, the vectors can be substituted into the linear equation to form the final second linear equation. K homography matrices construct K equations to form the second linear equation. This allows the introduction of additional geometric constraints, enhancing the determinism of the intrinsic parameter solution.

[0112] Furthermore, for each homography matrix, its first linear equation (from the dot product constraint) and second linear equation (from the equal modulus constraint) can be combined into a 2×6 subsystem. ,in It is a 2×6 coefficient matrix. This is the vectorized form of the aforementioned symmetric matrix B (containing 6 unknowns). Then, the subsystems of all K homography matrices are concatenated into a 2K×6 joint linear equation system. ,in This is the total coefficient matrix. Using the above method, key vectors can be systematically extracted from each homography matrix, and a system of linear equations with vertical and equal-length constraints can be constructed. This allows the geometric information of multiple spatial virtual calibration grids to be transformed into a unified linear solution framework, achieving efficient and robust initial estimation of camera intrinsic parameters. This provides high-quality iterative initial values ​​for subsequent nonlinear optimization and refinement processes, preventing optimization from getting trapped in local optima, and ultimately improving the accuracy and reliability of the overall calibration results.

[0113] In some implementations, in order to achieve fine optimization of camera intrinsics and ultimately improve accuracy, the theoretical pixel coordinates corresponding to each three-dimensional coordinate can be calculated based on multiple spatial virtual calibration grids, and the projection sub-error and projection error can be obtained by comparing them with the actual pixel coordinates. When the error exceeds a preset threshold, an objective function is constructed and the camera intrinsics are adjusted by minimizing the objective function to systematically reduce reprojection error, thereby ensuring the accuracy and robustness of the camera intrinsics and meeting the requirements of high-precision visual measurement. For example, after step 104, that is, after "calculating the camera intrinsic parameters of the target camera based on multiple spatial virtual calibration grids corresponding to multiple preset detection positions using a camera calibration algorithm", it may further include: (A.1) For multiple spatial virtual calibration grids, project each three-dimensional coordinate onto the image coordinate system plane corresponding to the target camera using the camera intrinsic parameters to obtain theoretical pixel coordinates; (A.2) Calculate the projection sub-error based on the difference between each theoretical pixel coordinate and the pixel coordinates corresponding to each three-dimensional coordinate; (A.3) Calculate the projection error based on the multiple projection sub-errors corresponding to multiple three-dimensional coordinates, and when the projection error is greater than a preset error threshold, construct an objective function based on multiple three-dimensional coordinates, camera intrinsic parameters, and corresponding multiple pixel coordinates; (A.4) Adjust the camera intrinsic parameters by minimizing the objective function to obtain the target camera intrinsic parameters of the target camera.

[0114] The theoretical pixel coordinates can be two-dimensional pixel position data calculated by projecting the three-dimensional world coordinates onto the image coordinate system plane using camera intrinsic parameters. For example, the coordinate values ​​obtained by projecting the three-dimensional points using the initial intrinsic parameter matrix and distortion coefficients can be used to compare with the actual extracted pixel coordinates to evaluate the accuracy of the calibration results.

[0115] Among them, the projection sub-error can be the difference between the theoretical pixel coordinates and the actual pixel coordinates corresponding to a single three-dimensional coordinate point, such as Euclidean distance or squared difference, which can be used to quantify the local deviation of the projection of each point and provide basic data for the calculation of the overall error.

[0116] Among them, the projection error can be an aggregated statistic of the projection sub-errors corresponding to multiple three-dimensional coordinate points, such as the root mean square error or average value of all sub-errors. It can be used to comprehensively evaluate the overall accuracy of the current camera intrinsic parameters on the entire calibration dataset and serve as an optimization trigger condition.

[0117] The error threshold can be a preset upper limit of projection error, such as a numerical threshold set according to the accuracy requirements of the application scenario. It can be used to determine whether the current camera intrinsic parameters meet the accuracy requirements and decide whether to start the nonlinear optimization process.

[0118] The objective function can be a mathematical function constructed to optimize camera intrinsic parameters, such as the sum of squares or weighted loss function based on reprojection error. This function can be used to adjust the intrinsic parameters by minimizing the function, so that the projection result is closer to the actual observation value.

[0119] The target camera intrinsic parameters can be the final set of camera intrinsic parameters obtained through nonlinear optimization, such as the optimized intrinsic parameter matrix and distortion coefficients, which can be used as accurate model parameters of the target camera vision system.

[0120] In some implementations, three-dimensional coordinates can be represented as =(x,y,z), pixel coordinates are used express, The matrix corresponding to the camera intrinsic parameters is defined as follows: The distortion coefficient is ,Will Points transformed to the camera coordinate system: ,in, and These are the camera extrinsic parameters (the rotation matrix and translation vector from the world coordinate system to the camera coordinate system, which can be obtained through initial calibration). Then, the normalized image coordinates are calculated using the projection equation. The distorted coordinates were obtained by applying distortion correction. Finally, by projecting the distorted coordinates onto the pixel coordinate system using the intrinsic parameter matrix, we can obtain the theoretical pixel coordinates after transforming the 3D coordinates using the current camera intrinsic parameters.

[0121] In some implementations, for each 3D coordinate, the corresponding projection sub-error can be calculated using the Euclidean distance between the theoretical pixel coordinate and the pixel coordinate captured by the target camera. For example, besides using Euclidean distance to calculate the projection sub-error, normalized cross-correlation or structural similarity measures can also be used to quantify the local projection deviation of each point and identify outliers in the calibration. This application does not limit the specific method for calculating the projection sub-error.

[0122] In some implementations, the projection sub-error can be calculated by weighting the confidence levels of different regions. For example, weights can be assigned to each pair of points in each spatial virtual calibration grid based on the extraction quality of feature points in the labeled image (such as corner response intensity), and the corresponding projection sub-error can be weighted accordingly. For example, the weight could be 0.2. This reduces the impact of low-quality points on error calculation and improves the robustness of error assessment.

[0123] In some implementations, all projector errors can be... Perform aggregate statistics to obtain the projection error, which can be the root mean square error. ,For example: ;in, It represents the total number of three-dimensional coordinates.

[0124] For example, the preset error threshold T can be set according to the application's accuracy requirements, such as T = 1.0 pixel (for high-precision measurements). If If the value is greater than T, then the objective function is constructed based on multiple 3D coordinates, camera intrinsic parameters, and the corresponding multiple pixel coordinates. The specific process is as follows: ;in This represents the camera parameters to be optimized (including camera intrinsics and distortion coefficients). Is using Three-dimensional coordinates The function that projects the image coordinates to obtain the theoretical pixel coordinates (transformation description information) is described above, and the projection transformation method is as described above. For example, if the projection error is calculated to be 1.2 pixels and the threshold T = 1.0 pixels, then the objective function construction is triggered, initializing with all point pairs. This allows for automatic detection of calibration quality and the initiation of an optimization process if the required accuracy is not met.

[0125] In some implementations, the objective function can be iteratively minimized using optimization algorithms such as the Levenberg-Marquardt (LM) method or the Gauss-Newton method, with the current camera intrinsic parameters as initial values. Then update The optimization process continues until convergence or the maximum number of iterations is reached. After optimization, the adjusted camera intrinsic parameters, i.e., the target camera intrinsic parameters, are obtained. This significantly reduces reprojection errors and improves the accuracy and reliability of the camera model.

[0126] By using the above methods, camera intrinsic parameters can be systematically evaluated and optimized. Based on high-precision spatial virtual calibration grid data, reprojection error can be minimized. This can significantly improve the accuracy of camera intrinsic parameters and model fit, thereby providing reliable and optimized camera model parameters for subsequent vision systems in high-precision measurement, positioning, and 3D reconstruction applications, ensuring overall system performance.

[0127] In some implementations, to achieve stable and accurate nonlinear optimization of camera intrinsic parameters, transformation description information can be constructed based on the transformation relationship between each 3D coordinate and the camera intrinsic parameters. A relationship function can be constructed based on the difference between the transformation description information and the pixel coordinates. Simultaneously, an adjustment constraint function can be constructed by combining the variation range of the camera intrinsic parameters. Finally, the two are combined into an objective function to minimize reprojection error while constraining reasonable parameter changes, avoiding overfitting or parameter drift during the optimization process, thereby improving the convergence and accuracy of intrinsic parameter optimization. For example, "constructing an objective function based on multiple 3D coordinates, camera intrinsic parameters, and corresponding multiple pixel coordinates" in (A.3) can include: (A.3.1) constructing transformation description information based on the transformation relationship between each 3D coordinate and the camera intrinsic parameters, and constructing a relationship function based on the difference between the transformation description information corresponding to each 3D coordinate and the pixel coordinates; (A.3.2) obtaining multiple variation ranges of multiple parameters of the camera intrinsic parameters, and constructing an adjustment constraint function based on these multiple variation ranges; (A.3.3) constructing the objective function based on the relationship function and the adjustment constraint function.

[0128] The transformation relationship can be a mathematical mapping relationship between three-dimensional coordinates projected onto the pixel coordinates of the calibration image through camera intrinsic parameters. For example, the perspective projection model defined by the intrinsic parameter matrix and distortion coefficients can be used to describe the geometric transformation process from three-dimensional space to two-dimensional image.

[0129] The transformation description information can be a transformation expression constructed through transformation relationships, specifically an expression that transforms the 3D coordinates using camera intrinsics to obtain the corresponding theoretical pixel coordinates.

[0130] The relational function can be a mathematical function constructed based on the difference between the transformation description information and the pixel coordinates, such as the sum of squares of the reprojection error or a weighted loss function, used to measure the accuracy of the current intrinsic parameters.

[0131] Among them, the range of variation can be the allowable adjustment range of each parameter of the camera intrinsic parameters during the optimization process. For example, the upper and lower limits of parameters set according to prior knowledge or physical constraints can be used to limit the parameter search space and prevent the optimization results from deviating from reasonable values.

[0132] Among them, the adjustment constraint function can be a mathematical constraint function constructed based on the range of change, such as parameter boundary constraints or regularization terms. It can be used to apply soft or hard restrictions during the optimization process to ensure the physical rationality and numerical stability of the intrinsic parameters.

[0133] In some implementations, for each 3D coordinate (from a spatial virtual calibration grid), a matrix corresponding to the camera intrinsics can be used. and distortion coefficient Combined with camera extrinsic parameters (rotation matrix) Translation vector This involves calculating intermediate results using a projection transformation (i.e., the rotation matrix and translation vector from the world coordinate system to the camera coordinate system). Points in the camera coordinate system are then obtained. Normalized image coordinates ,in, , , yes (components), and the distortion-corrected coordinates Ultimately, the theoretical pixel coordinates The following transformation description information can be represented: ; In other words, the transformed descriptive information can be... This allows for an accurate description of the mapping process from world coordinates to image coordinates, providing complete intermediate data for error calculation.

[0134] Furthermore, a relational function can be constructed by calculating the difference between the transformation description information and the pixel coordinates. This can be represented as the square of the Euclidean distance between multiple transformation descriptions corresponding to all 3D coordinates and multiple pixel coordinates. Specifically, it can be: ;in This represents the camera parameters to be optimized (including camera intrinsics and distortion coefficients). Is using Three-dimensional coordinates The function that projects onto the image coordinate system to obtain the theoretical pixel coordinates (that is, the function constructed through the transformation relationship described above), and the projection transformation method is described above.

[0135] In some implementations, the aforementioned relational functions can be directly applied. The objective function is minimized to obtain the intrinsic parameters of the target camera.

[0136] In some implementations, in addition to directly using relational functions... In addition to minimizing the objective function, we can also introduce adjustment constraint functions to ensure that the camera intrinsic parameters conform to physical reality and avoid overfitting during the optimization process. Specifically, after completing the relation function... After construction, the following operations can be performed: obtain multiple ranges of variation for multiple parameters of the camera intrinsics, and construct an adjustment constraint function based on these ranges. Specifically, the camera intrinsics... Including focal length , Main point , Inclination factor and distortion coefficient The range of variation for each parameter can be determined based on camera hardware specifications, historical calibration data, or prior knowledge. For example, focal length... and The interval can be set as ,in and It is a confidence range based on lens design parameters or initial calibration results; principal point and The range can be set as a percentage of the image size, such as [0.4×W, 0.6×W] and [0.4×H, 0.6×H], where W and H are the image width and height, respectively; distortion coefficient The interval can be set as [ [0.5, 0.5] (or other values) to cover the distortion range of common lenses, etc. Based on these ranges of variation, the constraint function can be adjusted. The design could be a penalty term for parameters deviating from the specified range, for example, using a quadratic penalty: ;in This represents the parameter of the j-th camera intrinsic parameter. Let it be the upper bound of its range of variation. Let it be the lower bound of its range of variation. These are the weighting coefficients for the corresponding parameters, used to control the constraint strength.

[0137] Furthermore, the relational function and constraint functions By combining these methods, a comprehensive objective function can be constructed: By minimizing the relational function in the objective function while satisfying the constraints of the adjustment constraint function, it is possible to ensure that the parameter values ​​are within a reasonable range when optimizing the camera intrinsic parameters, thereby improving the physical rationality and numerical stability of the calibration results.

[0138] Referring to Figure 4, this application embodiment also provides a camera intrinsic parameter calculation device, which can implement the above-described camera intrinsic parameter calculation method. The camera intrinsic parameter calculation device includes: a control module 41, used to control the probe of the spatial coordinate measuring device to move and detect each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the probe at each preset detection position; an acquisition module 42, used to acquire a marker image of the multiple optical cooperation marks captured by the target camera when the probe is detected to be located at each preset detection position, and extract multiple pixel coordinates of the multiple optical cooperation marks in the marker image respectively; a construction module 43, used to construct a corresponding spatial virtual calibration grid based on the multiple three-dimensional coordinates and multiple pixel coordinates corresponding to each preset detection position; and a calculation module 44, used to calculate the camera intrinsic parameters of the target camera based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm.

[0139] The specific implementation of the camera intrinsic parameter calculation device is basically the same as the specific embodiment of the camera intrinsic parameter calculation method described above, and will not be repeated here. Subject to meeting the requirements of the embodiments of this application, the camera intrinsic parameter calculation device may also be equipped with other functional modules to implement the camera intrinsic parameter calculation method in the above embodiments.

[0140] This application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described camera intrinsic parameter calculation method. This computer device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0141] Please refer to Figure 5, which illustrates the hardware structure of a computer device according to another embodiment. The computer device includes: a processor 51, which can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, for executing related programs to implement the technical solutions provided in the embodiments of this application; and a memory 52, which can be implemented using a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM), etc. The memory 52 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 52 and is called and executed by the processor 51 to execute the camera intrinsic parameter calculation method of the embodiments of this application. The input / output interface 53 is used to realize information input and output. The communication interface 54 is used to realize communication interaction between this device and other devices. Communication can be realized by wired means (such as USB, network cable, etc.) or by wireless means (such as mobile network, WIFI, Bluetooth, etc.). The bus 55 transmits information between the various components of the device (such as processor 51, memory 52, input / output interface 53 and communication interface 54). The processor 51, memory 52, input / output interface 53 and communication interface 54 realize communication connection between each other within the device through the bus 55.

[0142] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described camera intrinsic parameter calculation method.

[0143] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor 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.

[0144] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0145] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0146] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0147] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0148] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0149] It should be understood that in this application, "at least one" and "several" refer to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0150] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0151] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0152] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0153] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0154] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for calculating camera intrinsic parameters, characterized in that, The method includes: controlling the probe of a spatial coordinate measuring device to move and detect at each preset detection position to obtain multiple three-dimensional coordinates of multiple optical cooperation marks on the probe at each preset detection position; when the probe is detected to be at each preset detection position, acquiring a marker image of the multiple optical cooperation marks captured by a target camera, and extracting multiple pixel coordinates of the multiple optical cooperation marks in the marker image; constructing a corresponding spatial virtual calibration grid based on the multiple three-dimensional coordinates and the multiple pixel coordinates corresponding to each preset detection position; and calculating the camera intrinsic parameters of the target camera based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm.

2. The camera intrinsic parameter calculation method according to claim 1, characterized in that, The step of calculating the camera intrinsic parameters of the target camera using a camera calibration algorithm based on multiple spatial virtual calibration grids corresponding to multiple preset detection positions includes: calculating the corresponding homography matrix according to the spatial virtual calibration grid corresponding to each preset detection position; constructing a corresponding linear equation system through the vertical constraint relationship and length equality constraint relationship of each homography matrix; and performing joint calculation based on the multiple linear equation systems of the multiple homography matrices corresponding to the multiple preset detection positions to obtain the camera intrinsic parameters of the target camera.

3. The camera intrinsic parameter calculation method according to claim 2, characterized in that, The step of calculating the corresponding homography matrix based on the spatial virtual calibration grid corresponding to each preset detection position includes: performing planar projection transformation processing on the spatial virtual calibration grid corresponding to each preset detection position to obtain a two-dimensional projection relationship model from the world coordinate system plane corresponding to each preset detection position to the image coordinate system plane corresponding to the target camera; calculating the planar projection transformation parameters in the two-dimensional projection relationship model through a least squares estimation algorithm to obtain a homography matrix characterizing the mapping relationship between the world coordinate system plane and the image coordinate system plane, wherein the homography matrix includes rotation parameters, translation parameters, and affine transformation parameters.

4. The camera intrinsic parameter calculation method according to claim 2, characterized in that, The step of constructing a corresponding system of linear equations based on the vertical constraint and length equality constraint of each homography matrix includes: extracting a first column vector and a second column vector from each homography matrix; constructing a first linear equation based on the dot product relationship between the first column vector and the second column vector; constructing a second linear equation based on the equality constraint relationship between the magnitudes of the first column vector and the second column vector; and combining the first linear equation and the second linear equation corresponding to each homography matrix to construct a system of linear equations for each homography matrix.

5. The camera intrinsic parameter calculation method according to claim 1, characterized in that, After calculating the camera intrinsic parameters of the target camera using a camera calibration algorithm based on multiple spatial virtual calibration grids corresponding to multiple preset detection positions, the method further includes: for the multiple spatial virtual calibration grids, projecting each three-dimensional coordinate onto the image coordinate system plane corresponding to the target camera using the camera intrinsic parameters to obtain theoretical pixel coordinates; calculating projection sub-errors based on the difference between each theoretical pixel coordinate and the pixel coordinates corresponding to each three-dimensional coordinate; calculating projection errors based on the multiple projection sub-errors corresponding to multiple three-dimensional coordinates, and when the projection error is greater than a preset error threshold, constructing an objective function based on the multiple three-dimensional coordinates, the camera intrinsic parameters, and the corresponding multiple pixel coordinates; and adjusting the camera intrinsic parameters by minimizing the objective function to obtain the target camera intrinsic parameters of the target camera.

6. The camera intrinsic parameter calculation method according to claim 5, characterized in that, The step of constructing a target function based on the multiple three-dimensional coordinates, the camera intrinsic parameters, and the corresponding multiple pixel coordinates includes: constructing transformation description information based on the transformation relationship between each three-dimensional coordinate and the camera intrinsic parameters, and constructing a relationship function based on the difference between the transformation description information corresponding to each three-dimensional coordinate and the pixel coordinates; obtaining multiple ranges of variation of multiple parameters of the camera intrinsic parameters, and constructing an adjustment constraint function based on the multiple ranges of variation; and constructing the target function based on the relationship function and the adjustment constraint function.

7. The camera intrinsic parameter calculation method according to claim 1, characterized in that, The control spatial coordinate measuring device's touch head performs movement detection at each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the touch head at each preset detection position. This includes: controlling the touch head of the spatial coordinate measuring device to perform movement detection at each preset detection position to obtain the three-dimensional touch coordinates of the touch head at each preset detection position; obtaining multiple offsets of multiple optical cooperation marks relative to the touch head of the spatial coordinate measuring device, and obtaining multiple three-dimensional coordinates corresponding to multiple optical cooperation marks at each preset detection position based on the three-dimensional touch coordinates and the corresponding offsets.

8. A camera intrinsic parameter calculation device, characterized in that, The device includes: a control module for controlling the probe of the spatial coordinate measuring device to move and detect each preset detection position to obtain multiple three-dimensional coordinates corresponding to multiple optical cooperation marks on the probe at each preset detection position; an acquisition module for acquiring a marker image of the multiple optical cooperation marks captured by the target camera when the probe is detected to be at each preset detection position, and extracting multiple pixel coordinates of the multiple optical cooperation marks in the marker image; a construction module for constructing a corresponding spatial virtual calibration grid based on the multiple three-dimensional coordinates and the multiple pixel coordinates corresponding to each preset detection position; and a calculation module for calculating the camera intrinsic parameters of the target camera based on the multiple spatial virtual calibration grids corresponding to the multiple preset detection positions using a camera calibration algorithm.

9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the camera intrinsic parameter calculation method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the camera intrinsic parameter calculation method according to any one of claims 1 to 7.