A measuring instrument stage perpendicularity calculation method, a terminal device, and a storage medium

By acquiring a chessboard image and calculating the element values ​​of the rotation matrix R, the problem of stage verticality calculation error in the prior art is solved, and higher precision verticality adjustment is achieved.

CN115470451BActive Publication Date: 2026-01-20XIAMEN BOSHIYUAN MASCH VISION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211126289.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2026-01-20
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing technology measures the angle between the camera and the vertical direction and the stage and the horizontal plane using angle measuring instruments, which leads to calculation errors and makes it impossible to accurately adjust the verticality of the stage.

Method used

The image acquisition module acquires a checkerboard image on the platform, establishes a world coordinate system, calculates the element values ​​of the rotation matrix R, and uses the Levenberg-Marquardt algorithm to optimize the verticality calculation and reduce mechanical installation errors.

Benefits of technology

Accurate calculation of the verticality of the stage reduces calculation errors caused by mechanical installation errors and improves the accuracy of the measuring instrument.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115470451B_ABST
    Figure CN115470451B_ABST
Patent Text Reader

Abstract

This invention relates to a method for calculating the verticality of a measuring instrument stage, a terminal device, and a storage medium. The method includes: S1: acquiring a checkerboard image corresponding to a checkerboard pattern image placed on the stage using an image acquisition module; S2: using the corner points of the checkerboard pattern in the checkerboard image as pixel coordinate points, and obtaining the coordinates of each pixel coordinate point in the camera coordinate system; S3: establishing a world coordinate system based on the horizontal and vertical directions of the checkerboard pattern, and calculating the coordinates of each pixel coordinate point in the world coordinate system according to the size of the checkerboard pattern; S4: constructing a mathematical model and calculating R... 11 and R 22 Value: S5: Calculate verticality. This invention reduces calculation errors caused by mechanical installation errors by directly acquiring images of objects on the platform and calculating the corresponding verticality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of measuring instrument technology, and in particular to a method for calculating the verticality of a measuring instrument stage, a terminal device, and a storage medium. Background Technology

[0002] like Figure 1 The measuring instrument shown consists of an image acquisition module and a stage. The image acquisition module comprises a camera and dual telecentric lenses, while the stage is used to place the object to be measured. Existing technology measures the installation angle between the camera and the vertical direction using an angle measuring instrument, and the horizontal angle between the stage and the horizontal plane. The angle of the stage is then adjusted based on the relationship between these two angles to ensure the perpendicularity of the camera's optical axis to the stage plane. This method uses the installation direction of the camera's outer surface as the direction of the camera's optical axis, which can introduce certain calculation errors. Summary of the Invention

[0003] To address the aforementioned problems, this invention proposes a method for calculating the verticality of a measuring instrument's stage, a terminal device, and a storage medium.

[0004] The specific plan is as follows:

[0005] A method for calculating the verticality of a measuring instrument stage includes the following steps:

[0006] S1: Acquire the chessboard image corresponding to the chessboard image placed on the platform through the image acquisition module;

[0007] S2: Use the corner points of the checkerboard in the checkerboard image as pixel coordinate points, and obtain the coordinates of each pixel coordinate point in the camera coordinate system;

[0008] S3: Establish a world coordinate system based on the horizontal and vertical directions of the checkerboard grid, and calculate the coordinates of each pixel point in the world coordinate system according to the size of the checkerboard grid;

[0009] S4: Construct the following mathematical model and calculate R. 11 and R 22 Value:

[0010]

[0011] Among them, (u i ,v i (x) represents the coordinates of the i-th pixel in the camera coordinate system; wi ,y wi ) represents the coordinates of the i-th pixel in the world coordinate system; xu i yv represents the distance from the i-th pixel coordinate point in the camera coordinate system along the u-axis to the image center; ir represents the distance from the i-th pixel in the camera coordinate system along the v-axis to the image center; 2 =xu i 2 +yv i 2 r represents the distance from the i-th pixel coordinate point in the camera coordinate system to the image center; R 11 ,R 12 ,R 13 Let R represent the values ​​of the elements in the first, second, and third columns of the first row of the rotation matrix R; 21 ,R 22 ,R 23 represents the values ​​of the elements in the first, second, and third columns of the second row of the rotation matrix R, respectively; k1, h1, h2, s1, and s2 are all distortion coefficients; T represents the transpose of the matrix;

[0012] S5: Calculate the verticality h according to the following formula:

[0013]

[0014] Furthermore, the coordinate transformation formula from the camera coordinate system to the world coordinate system is:

[0015]

[0016] Where (u,v) represents the coordinates in the camera coordinate system; (x) represents the coordinates in the camera coordinate system. w ,y w ) represents the coordinates in the world coordinate system; R represents the 3*3 rotation matrix.

[0017] Furthermore, the formula for calculating the rotation matrix R is:

[0018]

[0019] Where m represents the scaling factor from the world coordinate system to the camera coordinate system; θ, α, and β represent the rotation angles of the plane containing the stage along the z-axis, x-axis, and y-axis of the camera coordinate system, respectively; t x t y These represent the translation amounts from the world coordinate system to the camera coordinate system along the x-axis and y-axis, respectively.

[0020] Furthermore, the acquired checkerboard images need to cover the entire field of view of the camera.

[0021] Furthermore, in step S3, a world coordinate system is established with the first pixel coordinate point as the origin and the horizontal or vertical direction of the chessboard grid as the x-axis.

[0022] A measuring instrument stage verticality calculation terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described above in the embodiments of the present invention.

[0023] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above in the embodiments of the present invention.

[0024] The present invention adopts the above technical solution, which can reduce the calculation error caused by mechanical installation error by directly acquiring the image of the object on the platform and calculating the corresponding verticality. Attached Figure Description

[0025] Figure 1 The diagram shown is a schematic of the measuring instrument.

[0026] Figure 2 The diagram shown is a flowchart of Embodiment 1 of the present invention.

[0027] Figure 3 The image shown is a schematic diagram of a chessboard pattern captured in Embodiment 1 of the present invention. Detailed Implementation

[0028] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention.

[0029] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.

[0030] Example 1:

[0031] The measurement principle of the image acquisition module is as follows:

[0032]

[0033] Where (u,v) represents the coordinates in the camera coordinate system; (x) represents the coordinates in the camera coordinate system. w ,y w () represents coordinates in the world coordinate system;

[0034] R is a 3x3 rotation matrix, and its calculation formula is as follows:

[0035]

[0036] Where m represents the scaling factor of the dual telecentric lens from the world coordinate system to the camera coordinate system; θ, α, β represent the rotation angles of the plane containing the stage along the z-axis, x-axis, and y-axis of the camera coordinate system, respectively; t x t y These represent the translation amounts from the world coordinate system to the camera coordinate system along the x-axis and y-axis, respectively.

[0037] When (α,β)=(0,0), it indicates that the camera's optical axis (i.e., the z-axis) is perpendicular to the plane containing the stage, therefore R 11 With R 22 A higher value indicates higher verticality. 11 This represents the value of the element in the first row and first column of the rotation matrix R. 22 Let h represent the value of the element in the second row and second column of the rotation matrix R. Therefore, the perpendicularity h can be expressed by the following formula:

[0038]

[0039] (du,dv) represents the lens distortion error, and its calculation formula is as follows:

[0040] du=k1*xu*(xu 2 +yv 2 )+h1*(3*xu 2 +yv 2 )+2*h2*xu*yv+s1*(xu 2 +yv 2 (4)

[0041] dv=k1*yv*(xu 2 +yv 2 )+h2*(xu 2 +3*yv 2 )+2*h1*xu*yv+s2*(xu 2 +yv 2 (5)

[0042] Where (xu,yv)=(u-u0,v-v0), (u0,v0) represents the coordinates of the image center in the camera coordinate system; xu represents the distance from the pixel (u,v) in the camera coordinate system along the u-axis to the image center; yv represents the distance from the pixel (u,v) in the camera coordinate system along the v-axis to the image center; k1,h1,h2,s1,s2 are all distortion coefficients.

[0043] Based on the above measurement principle, this invention provides a method for calculating the verticality of the measuring instrument's stage, such as... Figure 2 As shown, the method includes the following steps:

[0044] S1: Acquire the chessboard image corresponding to the chessboard pattern image placed on the platform using the image acquisition module, such as... Figure 3 As shown.

[0045] It should be noted that the captured checkerboard image should cover the entire field of view of the camera.

[0046] S2: Using the corner points of the checkerboard image (the intersection of four adjacent squares) as pixel coordinate points, obtain the coordinates (u) of each pixel point in the camera coordinate system. i ,v i ).

[0047] S3: Establish a world coordinate system based on the horizontal and vertical directions of the checkerboard grid, and calculate the coordinates of each pixel point in the world coordinate system according to the size of the checkerboard grid.

[0048] In this embodiment, it is preferable to set the first (first row, first column) pixel coordinate point as the origin and establish a world coordinate system with the horizontal or vertical direction of the chessboard (i.e., the horizontal or vertical lines in the chessboard) as the x-axis.

[0049] S4: Based on formulas (1), (4), and (5), establish the following mathematical model and use the Levenberg-Marquardt algorithm to calculate R. 11 and R 22 Value:

[0050]

[0051]

[0052] Among them, (u i ,v i (x) represents the coordinates of the i-th pixel in the camera coordinate system; wi ,y wi ) represents the coordinates of the i-th pixel in the world coordinate system; xu i yv represents the distance from the i-th pixel coordinate point in the camera coordinate system along the u-axis to the image center; i r represents the distance from the i-th pixel in the camera coordinate system along the v-axis to the image center; 2 =xu i 2 +yv i 2 r represents the distance from the i-th pixel coordinate point in the camera coordinate system to the image center; R 11 ,R 12 ,R 13 Let R represent the values ​​of the elements in the first, second, and third columns of the first row of the rotation matrix R; 21 ,R22 ,R 23 Let represent the values ​​of the elements in the first, second, and third columns of the second row of the rotation matrix R, respectively, and let T represent the transpose of the matrix.

[0053] S5: Calculate the verticality h according to the following formula.

[0054]

[0055] When a measuring instrument is required, first adjust the angle between the plane of the stage and the optical axis of the camera so that they are close to being perpendicular to each other; then calculate the perpendicularity at this time through the above steps. If the perpendicularity does not meet the requirements, adjust the angle of the stage and recalculate.

[0056] The embodiments of the present invention can reduce calculation errors caused by mechanical installation errors by directly acquiring images of objects on the platform and calculating the corresponding verticality.

[0057] Example 2:

[0058] The present invention also provides a measuring instrument stage verticality calculation terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the method embodiment described above in Embodiment 1 of the present invention.

[0059] Furthermore, as an executable solution, the measuring instrument stage verticality calculation terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The measuring instrument stage verticality calculation terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described composition of the measuring instrument stage verticality calculation terminal device is merely an example and does not constitute a limitation on the measuring instrument stage verticality calculation terminal device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the measuring instrument stage verticality calculation terminal device may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.

[0060] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the measuring instrument's verticality calculation terminal equipment, connecting all parts of the measuring instrument's verticality calculation terminal equipment via various interfaces and lines.

[0061] The memory can be used to store the computer programs and / or modules. The processor, by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory, realizes various functions of the measuring instrument stage verticality calculation terminal device. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0062] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the methods described in the embodiments of the present invention.

[0063] If the modules / units integrated in the verticality calculation terminal device of the measuring instrument platform are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.

[0064] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.

Claims

1. A method for calculating the verticality of a measuring instrument stage, characterized in that, Includes the following steps: S1: Acquire the chessboard image corresponding to the chessboard image placed on the platform through the image acquisition module; S2: Use the corner points of the checkerboard in the checkerboard image as pixel coordinate points, and obtain the coordinates of each pixel coordinate point in the camera coordinate system; S3: Establish a world coordinate system based on the horizontal and vertical directions of the checkerboard grid, and calculate the coordinates of each pixel point in the world coordinate system according to the size of the checkerboard grid; S4: Construct the following mathematical model and calculate R. 11 and R 22 Value: Among them, (u i ,v i () represents the coordinates of the i-th pixel in the camera coordinate system; () represents the coordinates of the i-th pixel in the world coordinate system; This represents the distance from the i-th pixel coordinate point in the camera coordinate system along the u-axis to the image center; r represents the distance from the i-th pixel in the camera coordinate system along the v-axis to the image center; 2 = 2 + 2 r represents the distance from the i-th pixel coordinate point in the camera coordinate system to the center of the image; These represent the values ​​of the elements in the first, second, and third columns of the first row of the rotation matrix R, respectively. represents the values ​​of the elements in the first, second, and third columns of the second row of the rotation matrix R, respectively; k1, h1, h2, s1, and s2 are all distortion coefficients; T represents the transpose of the matrix; S5: Calculate verticality using the following formula : ; The coordinate transformation formula from the camera coordinate system to the world coordinate system is as follows: Where (u,v) represents the coordinates in the camera coordinate system; (x w ,y w () represents coordinates in the world coordinate system; This represents a 3x3 rotation matrix; Where (du,dv) represents the lens distortion error, and its calculation formula is as follows: in, , This represents the coordinates of the image center in the camera coordinate system; This represents the distance from the pixel (u,v) in the camera coordinate system to the image center along the u-axis. This represents the distance from the pixel (u,v) in the camera coordinate system along the v-axis to the image center; k1, h1, h2, s1, and s2 are all distortion coefficients. The formula for calculating the rotation matrix R is as follows: Where m represents the scaling factor from the world coordinate system to the camera coordinate system; θ, α, β represent the rotation angles of the plane where the stage is located along the z-axis, x-axis, and y-axis of the camera coordinate system, respectively. , These represent the translation amounts from the world coordinate system to the camera coordinate system along the x-axis and y-axis, respectively.

2. The method for calculating the verticality of the measuring instrument stage according to claim 1, characterized in that: The captured chessboard image needs to cover the entire field of view of the camera.

3. The method for calculating the verticality of the measuring instrument stage according to claim 1, characterized in that: In step S3, a world coordinate system is established with the first pixel coordinate point as the origin and the horizontal or vertical direction of the chessboard grid as the x-axis.

4. A terminal device for calculating the verticality of a measuring instrument stage, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 3.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 3.