Position determination method of point to be detected, optical detection system and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-27
Smart Images

Figure CN121746485A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of semiconductor measurement, and in particular to a method for determining the location of a point to be measured, an optical detection system, and a storage medium. Background Technology
[0002] Currently, optical measurement technology dominates non-contact measurement, and non-contact sensors mainly include wired laser sensors, confocal probe sensors, and sensors based on optical interference fringe reconstruction. Image vision CMOS sensors are also widely used in machine vision measurement.
[0003] In industrial settings, when measuring the shape distortion of a product under test, it is usually necessary to monitor whether the dimensions of a specific location on the product under test meet the specifications. Often, it is not necessary to perform a complete 3D reconstruction of the entire product under test; data can be collected and measured only for a local part of the product under test.
[0004] In related technologies, when using optical sensors for automated measurement, the light received by the sensor varies at different angles. For example, the feedback signal from a confocal probe is strongest along the direction of the light's normal vector to the object's surface; when capturing images of curved objects, the signal reflected to the sensor also varies greatly depending on the angle at which light illuminates the object. Therefore, simply placing the object to be measured on a turntable built on a rotating axis and collecting data by rotating it at a specific angle is insufficient to solve the problem of obtaining the appropriate signal. It is also necessary to determine the position information of the point to be measured at a specific angle so that a specific angle measurement can be performed based on the position information. Therefore, how to accurately determine the position of the point to be measured after rotation has become an urgent technical problem to be solved. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a method for determining the position of a point to be measured, an optical detection system, and a storage medium, so as to achieve precise position control of the point to be measured and meet the requirements of high-precision local detection by sensors. The specific solution is as follows:
[0006] Firstly, this application provides a method for determining the location of a point to be measured, including:
[0007] Determine the initial normal vector of the test point located on the product under test. The product under test is placed on a turntable composed of the X-axis, Y-axis and Z-axis. The turntable is used to drive the product under test to rotate in three dimensions.
[0008] Based on the spatial normal vector, the first initial angle of the first rotation axis, and the second initial angle of the second rotation axis, the first angle of the first rotation axis and the second angle of the second rotation axis corresponding to the target normal vector are calculated. The first rotation axis is the Z rotation axis, and the second rotation axis is the X rotation axis or the Y rotation axis. The first angle and the second angle are used to make the point to be measured reach the target normal vector under the drive of the turntable.
[0009] Based on the spatial transformation relationship between the first angle and the first rotation axis at various angles, the first spatial transformation relationship corresponding to the first angle is obtained through interpolation; and based on the spatial transformation relationship between the second angle and the second rotation axis at various angles, the second spatial transformation relationship corresponding to the second angle is obtained through interpolation.
[0010] Based on the theoretical position of the test point on the virtual model of the product under test, the coordinate system matrix used to identify the pose of the product under test on the turntable, the first spatial transformation relationship and the second spatial transformation relationship, the target position of the test point on the turntable is calculated.
[0011] In one possible implementation, obtaining the first spatial transformation relationship corresponding to the first angle through interpolation processing based on the spatial transformation relationship between the first angle and the first rotation axis at various angles includes:
[0012] Obtain a first angle list and a corresponding spatial transformation relationship list for the first rotation axis. The first angle list includes multiple angles, and the spatial transformation relationship list includes spatial transformation relationships corresponding to each angle. Each spatial transformation relationship includes a rotation matrix and a translation matrix.
[0013] Each spatial transformation relationship is decomposed into the rotation matrix and the translation matrix to obtain a rotation list and a translation list;
[0014] Interpolation is performed based on the rotation list to obtain the interpolation rotation matrix corresponding to the first angle, and interpolation is performed based on the translation list to obtain the interpolation translation matrix corresponding to the first angle.
[0015] The first spatial transformation relationship is constructed based on the interpolation translation matrix and the interpolation rotation matrix.
[0016] In one possible implementation, the interpolation process based on the rotation list to obtain the interpolation rotation matrix corresponding to the first angle includes:
[0017] Perform a quaternion transformation on each rotation matrix in the rotation list to obtain a list of quaternions;
[0018] Based on the first adjacent angle, the second adjacent angle, the first quaternion corresponding to the first adjacent angle, and the second quaternion corresponding to the second adjacent angle, the interpolation rotation matrix corresponding to the first angle is obtained through quaternion spherical linear interpolation. The first adjacent angle and the second adjacent angle are two angles adjacent to the first angle in the first angle list.
[0019] In one possible implementation, the interpolation process based on the translation list to obtain the interpolation translation matrix corresponding to the first angle includes:
[0020] Based on the first angle list and the translation list, the interpolation function corresponding to each rotation axis is obtained by cubic spline interpolation algorithm;
[0021] The interpolation translation matrix corresponding to the first angle is determined by the first angle and the three interpolation functions.
[0022] In one possible implementation, obtaining the first angle list and the corresponding spatial transformation relationship list of the first rotating axis includes:
[0023] Obtain N first position information of N feature points at an angle of 0 degrees, and N second position information of the N feature points at each angle in the first angle list, where N>2;
[0024] Based on the N first location information and the N second location information, N pairs of location points are constructed;
[0025] For each of the N pairs of position points corresponding to each angle in the first angle list, the N pairs of position points are solved to obtain the spatial transformation relationship corresponding to each angle, so as to obtain the list of spatial transformation relationships and the first angle list.
[0026] In one possible implementation, the quaternion spherical linear interpolation process is expressed by the following formula:
[0027] ;
[0028] ;
[0029] ;
[0030] Among them, the For the first adjacent angle, the The second adjacent angle, For the first angle, the For the first quaternion, the The second quaternion is Slerp(), which is the spherical linear interpolation function.
[0031] Based on the interpolation result corresponding to the first angle Obtain the interpolation rotation matrix corresponding to the first angle and represent it as follows: .
[0032] In one possible implementation, determining the initial normal vector of the test point located on the product under test includes:
[0033] Obtain the coordinate system matrix;
[0034] Based on the coordinate system matrix and the theoretical normal vector of the point to be measured on the virtual model, the initial normal vector of the point to be measured is determined.
[0035] In one possible implementation, obtaining the coordinate system matrix includes:
[0036] The product under test is scanned to obtain the first point cloud coordinate data of the product under test;
[0037] The coordinate system matrix is obtained by performing point cloud matching between the first point cloud coordinate data and the second point cloud coordinate data corresponding to the virtual model.
[0038] In one possible implementation, when the second axis of rotation is the Y-axis, determining the first angle of the first axis of rotation and the second angle of the second axis of rotation corresponding to the target normal vector, based on the initial normal vector, the first initial angle of the first axis of rotation, and the second initial angle of the second axis of rotation, includes:
[0039] Based on the y-direction component and x-direction component of the initial normal vector, the first rotation angle of the first axis of rotation is determined.
[0040] Based on the first rotation angle and the initial normal vector, determine the second rotation angle of the second axis;
[0041] The first angle is determined based on the first initial angle and the first rotation angle, and the second angle is determined based on the second initial angle and the second rotation angle.
[0042] In one possible implementation, the target location is determined in the following way:
[0043] ;
[0044] Among them, the The theoretical location of the test point on the virtual model of the product under test, the The coordinate system matrix is the matrix of the coordinate system. For the first spatial transformation relationship, the This is the second spatial transformation relationship.
[0045] Secondly, this application also provides an optical detection system, characterized in that it includes:
[0046] A turntable is provided with an X-axis, a Y-axis and a Z-axis. The turntable is used to drive the product under test to rotate in three dimensions. The product under test has test points distributed on it.
[0047] A position determination unit is used to obtain the target position of the point to be measured on the turntable by the position determination method described in any one of the second aspects above.
[0048] An optical sensor is used to acquire an optical image of the point to be measured at the target position on the turntable;
[0049] The processing unit is used to analyze the optical image and obtain the detection result of the point to be tested.
[0050] Thirdly, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the methods described above.
[0051] This application provides a method for determining the position of a test point, an optical detection system, and a storage medium. The method determines the initial normal vector of the test point located on a product under test. The product under test is placed on a turntable formed by an X-axis, Y-axis, and Z-axis, which drives the product under test to rotate in three dimensions. Based on the initial normal vector, a first initial angle of a first axis, and a second initial angle of a second axis, the method determines the first angle of the first axis and the second angle of the second axis corresponding to the target normal vector. The first axis is the Z-axis, and the second axis is either the X-axis or the Y-axis. The first and second angles are used to ensure that the test point reaches the target normal vector under the influence of the turntable. Based on the spatial transformation relationship between the first angle and the first axis at various angles, an interpolation process is used to obtain the first spatial transformation relationship corresponding to the first angle. Similarly, based on the spatial transformation relationship between the second angle and the second axis at various angles, an interpolation process is used to obtain the second spatial transformation relationship corresponding to the second angle. Based on the theoretical position of the test point on the virtual model of the product under test, the coordinate system matrix used to identify the pose of the product under test on the turntable, the first spatial transformation relationship, and the second spatial transformation relationship, the method determines the target position of the test point on the turntable.
[0052] In order to accurately determine the position of the test point when it reaches the specific angle required by the target normal vector, this application uses a first angle and a second angle to rotate the test point to satisfy the target normal vector. Then, by interpolating the existing spatial transformation relationship, the spatial transformation relationship corresponding to any angle can be determined. The spatial transformation relationship can show how the axis of rotation needs to be rotated to make the test point satisfy a certain angle. Thus, the target position of the test point can be accurately determined by combining the spatial transformation relationship, realizing precise position control of the test point, meeting the measurement requirements of high-precision local measurement, expanding the application scenarios of high-precision local sensors, and accurately acquiring the surface data of the test point at a specific angle. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 A flowchart illustrating a method for determining the location of a point to be measured, according to an embodiment of this application, is shown.
[0055] Figure 2 A schematic diagram of a turntable provided in an embodiment of this application is shown;
[0056] Figure 3 This illustration shows a spline curve diagram of a translation matrix provided in an embodiment of this application;
[0057] Figure 4 This illustration shows a schematic diagram of a product under test provided in an embodiment of this application;
[0058] Figure 5 A structural block diagram of a device for determining the position of a point to be measured, provided in an embodiment of this application;
[0059] Figure 6 This is a structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0060] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0061] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0062] Secondly, this application provides a detailed description in conjunction with schematic diagrams. When detailing the embodiments of this application, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not limit the scope of protection of this application. In addition, actual fabrication should include three-dimensional spatial dimensions of length, width, and depth.
[0063] The method for determining the location of a test point provided in this application can be implemented using a computer device, which can be a terminal device or a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and vehicle terminals. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions in this regard.
[0064] For ease of understanding, the following detailed description, in conjunction with the accompanying drawings, provides a method for determining the location of a test point, an optical detection system, and a storage medium.
[0065] refer to Figure 1 The diagram shown is a flowchart illustrating a method for determining the location of a point to be measured according to an embodiment of this application. The method may include the following steps.
[0066] Step S101: Determine the initial normal vector of the test point located on the product under test. The product under test is placed on a turntable composed of the X-axis, Y-axis and Z-axis. The turntable is used to drive the product under test to rotate in three dimensions.
[0067] The product under test (DUT) is the product that needs to be measured, such as a chip under test. The test point Pn is the point on the DUT that needs to be measured, such as a point located at a specific position on the DUT. When the DUT is placed on a turntable, the three axes of the turntable can rotate the DUT in three-dimensional space, causing the angle and position of the test point to change. The angle of the test point can be the angle between the initial normal vector of the test point and the normal vector corresponding to the vertical direction.
[0068] As an example, see reference Figure 2The diagram shown is a schematic of a turntable provided in an embodiment of this application, illustrating the V rotating shaft, U rotating shaft, and Z-spindle. Figure 2 The diagram illustrates the rotation directions of each axis. The black coordinate system represents the world coordinate system, while the green coordinate system represents the product coordinate system. The U-axis rotates about the x-direction in the world coordinate system and can be considered the X-axis. The V-axis rotates about the y-direction in the world coordinate system and can be considered the Y-axis. The Z-axis rotates about the z-direction and is called the Z-axis. The product under test is placed above the Z-axis. In other words, this application names the axes based on the axis of rotation of the turntable around the world coordinate system. For example, the Z-axis corresponds to rotation about the z-direction, the X-axis to rotation about the x-direction, and the Y-axis to rotation about the y-direction.
[0069] The initial normal vector of the test point refers to the normal vector of the test point in the world coordinate system. The initial normal vector can be obtained in several ways. One way is to collect the data using a probe located above the product under test. Another way is to calculate it based on the coordinate system matrix. Please refer to the following explanation for details.
[0070] In one possible implementation, S101 determines the initial normal vector of the test point located on the product under test, which may include: obtaining the coordinate system matrix; and determining the initial normal vector of the test point based on the coordinate system matrix and the theoretical normal vector of the test point on the virtual model.
[0071] The coordinate system matrix is the coordinate system matrix in the product space coordinate system, used to identify the pose (i.e., position and orientation) of the product under test on the turntable. In other words, a product space coordinate system is established, and the corresponding coordinate system matrix is obtained. As an example, the coordinate system matrix... It can be represented as:
[0072] ;
[0073] in, The rotation matrix in the coordinate system matrix. It is the translation matrix in the coordinate system matrix.
[0074] Based on the coordinate system matrix and the theoretical normal vector of the point to be measured, the initial normal vector of the point to be measured can be determined. The theoretical normal vector refers to the normal vector of the point to be measured Pn on the virtual model, such as a CAD model. The theoretical normal vector can be represented by N0. It can be represented as: .
[0075] In this way, the initial normal vector of any test point on the product under test can be determined by using the theoretical normal vector and the coordinate system matrix, which improves the accuracy and efficiency of determining the initial normal vector.
[0076] In one possible implementation, obtaining the coordinate system matrix may include: scanning the product under test to obtain the first point cloud coordinate data of the product under test; and performing point cloud matching between the first point cloud coordinate data and the second point cloud coordinate data corresponding to the virtual model to obtain the coordinate system matrix.
[0077] In other words, the product under test can be scanned to obtain its point cloud coordinate data, denoted as the first point cloud coordinate data. The point cloud coordinate data corresponding to the virtual model of the product under test, denoted as the second point cloud coordinate data, can then be obtained. Matching these two types of point cloud coordinate data yields a coordinate system matrix. This matrix can then be used to convert the theoretical normal vectors on the virtual model into the initial normal vectors of the product under test in the world coordinate system. The point cloud matching algorithm can be, for example, the ICP point cloud registration algorithm, but other algorithms are also possible. This point cloud matching algorithm allows for the acquisition of a more accurate coordinate system matrix, meeting the requirements for precise measurement.
[0078] In other possible implementations, for mobile phone glass with linear characteristics, the coordinate system matrix can be obtained by constructing feature vectors, which will not be elaborated further.
[0079] Step S102: Based on the initial normal vector, the first initial angle of the first rotation axis, and the second initial angle of the second rotation axis, calculate the first angle of the first rotation axis and the second angle of the second rotation axis corresponding to the target normal vector. The first rotation axis is the Z-axis, and the second rotation axis is the X-axis or Y-axis. The first angle and the second angle are used to make the point to be measured reach the target normal vector under the drive of the turntable.
[0080] The first axis of rotation refers to the Z-axis, and the second axis of rotation refers to either the X-axis or the Y-axis. That is, rotating the Z-axis and the Y-axis can make the point to be measured at a suitable angle, or rotating the Z-axis and the X-axis can make the point to be measured at a suitable angle.
[0081] For ease of description, the following explanation will primarily use the Y-axis as the second axis of rotation as an example. First initial angle The second initial angle is the angle at which the Z-axis was positioned before rotation. The angle of the Y-axis before rotation is given, i.e., the angles of the Y-axis and Z-axis of the current machine tool's data acquisition reference are respectively... and Furthermore, when the product space coordinate system is established in a state space where both the Y-axis and Z-axis are 0 degrees, it means that both the first initial angle and the second initial angle are 0 degrees.
[0082] Since the initial normal vector can express the pose of the point to be measured in the world coordinate system, the first angle corresponding to the point to be measured when it reaches the target normal vector can be determined based on the initial normal vector and the first initial angle. The first angle is the angle of the first rotation axis when the point to be measured has the target normal vector. Similarly, the second angle corresponding to the point to be measured when it reaches the target normal vector can be determined based on the initial normal vector and the second initial angle. The second angle is the angle of the second rotation axis when the point to be measured has the target normal vector. Both the initial normal vector and the target normal vector are spatial normal vectors.
[0083] In one possible implementation, when the second axis of rotation is the Y-axis, step S102, based on the initial normal vector, the first initial angle of the first axis of rotation, and the second initial angle of the second axis of rotation, calculates the first angle of the first axis of rotation and the second angle of the second axis of rotation corresponding to the target normal vector. This may include: determining the first rotation angle of the first axis of rotation based on the y-direction component and the x-direction component of the initial normal vector; determining the second rotation angle of the second axis of rotation based on the first rotation angle and the initial normal vector; determining the first angle based on the first initial angle and the first rotation angle; and determining the second angle based on the second initial angle and the second rotation angle.
[0084] The initial normal vector N can be represented as N{nx, ny.nz}. Taking the target normal vector as {0, 0, 1} as an example, the normal vector of the point to be measured needs to be parallel to the Z-axis so that the point to be measured can be detected perpendicularly. The confocal probe sensor can obtain better signal quality at this angle. The calculation objective is to rotate the initial normal vector N{nx, ny.nz} to {0, 0, 1}.
[0085] Based on the y-direction component ny and the x-direction component nx of the initial normal vector, the first rotation angle of the first axis of rotation is determined. The first rotation angle (angleZ) can be expressed as:
[0086] ;
[0087] Next, based on the first rotation angle and the initial normal vector, the second rotation angle of the second axis can be determined. The second rotation angle (angleY) is the rotation angle of the second axis and can be calculated using the following formula:
[0088] ;
[0089] in, N Zy =0;
[0090] );
[0091] in, This refers to the rotation of the first axis. Then, the normal vector of the point to be measured can be considered as an intermediate variable. In addition, the angles angleZ and angleY actually contain positive and negative signs, based on the defined direction of the machine's axis of rotation.
[0092] It is understandable that when both the first and second initial angles are 0 degrees, the first angle is... The second angle is The following can be directly used and Use it in the interpolation formula.
[0093] Step S103: Based on the spatial transformation relationship of the first angle and the first rotation axis at various angles, the first spatial transformation relationship corresponding to the first angle is obtained by interpolation, and based on the spatial transformation relationship of the second angle and the second rotation axis at various angles, the second spatial transformation relationship corresponding to the second angle is obtained by interpolation.
[0094] For each axis of rotation, there is a corresponding spatial transformation relationship. This spatial transformation relationship characterizes the process of spatial transformation and is used to calculate the coordinates of the axis after its motion. The spatial transformation relationship TM of the rotation axis can be represented by a 4x4 matrix:
[0095] ;
[0096] Where R is the rotation matrix, which is a 3x3 matrix, and T is the translation matrix, which is a 3x1 matrix.
[0097] Each axis of rotation has spatial transformation relationships at multiple angles. These spatial transformation relationships (TMs) at different angles can be represented by a series of axis matrices, as follows:
[0098] TMs = {TM0,TM1,TM2,TM3,...,TMn};
[0099] Where TM0 is the angle. The corresponding spatial transformation relationship, where TMn is the angle. The corresponding spatial transformation relationship is that when the axis of rotation is 0 degrees, the matrix is an identity matrix.
[0100] For the Z-axis, based on the first angle and the spatial transformation relationship of the Z-axis at various angles, interpolation can be used to obtain the first spatial transformation relationship corresponding to the first angle. This first spatial transformation relationship is used to enable the Z-axis to rotate to the first angle. Similarly, for the second axis, based on the second angle and the spatial transformation relationship of the second axis at various angles, interpolation can be used to obtain the second spatial transformation relationship corresponding to the second angle. This second spatial transformation relationship is used to enable the second axis to rotate to the second angle.
[0101] The interpolation process for each axis is basically the same. The following uses the first axis as an example to illustrate the interpolation process. In one possible implementation, step S103 obtains the first spatial transformation relationship corresponding to the first angle through interpolation based on the first angle and the spatial transformation relationship corresponding to the first axis at each angle. This may include steps S1031-S1034.
[0102] Step S1031: Obtain the first angle list and the corresponding spatial transformation relationship list of the first rotation axis. The first angle list includes multiple angles, and the spatial transformation relationship list includes the spatial transformation relationship corresponding to each angle. Each spatial transformation relationship includes a rotation matrix and a translation matrix.
[0103] The first angle list includes multiple angles of the first rotation axis, and the first angle list can be represented as Angles{ , , , ......, The list of spatial transformation relationships can be as follows: TMs = {TM0,TM1,TM2,TM3,......,TMn}. Each spatial transformation relationship in the list corresponds one-to-one with each angle in the first angle list.
[0104] Each matrix in the spatial transformation relationship list can be obtained through calibration. In one possible implementation, obtaining the first angle list and the corresponding spatial transformation relationship list of the first rotation axis in step S1031 may include: obtaining N first position information of N feature points at an angle of 0 degrees, and N second position information of N feature points at each angle in the first angle list, where N>2; constructing N pairs of position points based on the N first position information and the N second position information; solving for the N pairs of position points corresponding to each angle in the first angle list to obtain the spatial transformation relationship corresponding to each angle, so as to obtain the spatial transformation relationship list and the first angle list.
[0105] In other words, N feature points on the product under test can be obtained. The position information of the feature points when the rotation axis angle is 0 degrees is the first position information. The first position information is, for example, the three-dimensional coordinates of the feature point. The feature points at other rotation axis angles (e.g., The position information at that time is the second position information. The number of feature points can be at least three, thus forming at least three position point pairs. Each position point pair includes one first position information and one second position information. By solving multiple pairs of position point pairs, the corresponding rigid transformation matrix (i.e., spatial transformation relationship) at each angle can be obtained, for example, obtaining... The spatial transformation relationship TM0 corresponds to the angle. Furthermore, when there are more than 3 pairs of position points, the least squares solution can be calculated to obtain the rigid transformation matrix with the smallest error (ICP algorithm).
[0106] In this way, by calibrating the spatial transformation relationship corresponding to several angles, it is easier to calculate the spatial transformation relationship corresponding to any angle through interpolation, thereby improving the accuracy of determining the position of the point to be measured.
[0107] Step S1032: Decompose each spatial transformation relationship into a rotation matrix and a translation matrix to obtain a rotation list and a translation list.
[0108] Specifically, for each spatial transformation relation TM, it can be decomposed into a rotation matrix R and a translation matrix T, and then a rotation list Rs{ consisting of rotation matrices corresponding to each angle. , , , ...... }, and the translation list Ts{ consisting of translation matrices corresponding to each angle. , , , ...... }
[0109] Step S1033: Perform interpolation based on the rotation list to obtain the interpolation rotation matrix corresponding to the first angle, and perform interpolation based on the translation list to obtain the interpolation translation matrix corresponding to the first angle.
[0110] Specifically, the interpolation rotation matrix can be obtained by interpolation based on the rotation list, and the interpolation translation matrix can be obtained by interpolation through the translation list.
[0111] Step S1034: Construct the first spatial transformation relationship based on the interpolation translation matrix and the interpolation rotation matrix.
[0112] In this way, by performing interpolation on the rotation list and translation list respectively, the corresponding interpolation translation matrix and interpolation rotation matrix are obtained, ensuring that the first spatial transformation relationship can be accurately obtained.
[0113] In one possible implementation, step S1033 performs interpolation based on the rotation list to obtain the interpolation rotation matrix corresponding to the first angle, which may include steps S10331-S10332, which will be explained in detail here.
[0114] Step S10331: Perform quaternion transformation on each rotation matrix in the rotation list to obtain a quaternion list.
[0115] Specifically, since interpolation cannot be directly performed on the matrix, it is necessary to first transform the 3*3 rotation matrix into a unit quaternion q = w + xi + yj + zk. The unit quaternion has 3 degrees of freedom. After transforming each rotation matrix in the rotation list, a quaternion list qs{ is obtained. , , , ...... }
[0116] Step S10332: Based on the first adjacent angle, the second adjacent angle, the first quaternion corresponding to the first adjacent angle, and the second quaternion corresponding to the second adjacent angle, the interpolation rotation matrix corresponding to the first angle is obtained through quaternion spherical linear interpolation. The first adjacent angle and the second adjacent angle are two angles adjacent to the first angle in the first angle list.
[0117] Specifically, depending on the input angle (i.e., the first angle or the second angle), search within the ordered list of the first angle or the second angle. Within the given interval, obtain the two nearest angle variables. (i.e., the first adjacent angle) and (Second adjacent angle), and the corresponding quaternion. (i.e., the first quaternion) and (i.e., the second quaternion).
[0118] Then, quaternion spherical linear interpolation is performed between the first quaternion and the second quaternion to obtain the interpolation rotation matrix corresponding to the first angle located between the first and second adjacent angles. In this way, the interpolation rotation matrix corresponding to the first angle can be obtained quickly and accurately through interpolation, so that the position of the point to be measured can be determined based on the interpolation rotation matrix.
[0119] In one possible implementation, the quaternion spherical linear interpolation process is determined as follows:
[0120] ;
[0121] ;
[0122] ;
[0123] in, The first adjacent angle, The second adjacent angle, From the first angle, It is the first quaternion. is the second quaternion, and Slerp() is the spherical linear interpolation function.
[0124] It is understandable that the interpolation result is based on the first angle. The interpolation rotation matrix corresponding to the first angle can then be obtained and expressed as follows: .
[0125] In addition, in order to select the shortest rotation path, it is necessary to consider when When, reverse quaternion , get new That is, determining the direction of the sign to select the shortest path; geometrically, this means selecting the path with the acute angle, and then calculating... The interpolation rotation matrix can then be obtained by converting the quaternion into a rotation matrix. .
[0126] In this way, by first converting to quaternions and then processing them through quaternion spherical linear interpolation, a more accurate interpolation rotation matrix can be obtained.
[0127] In one possible implementation, step S1033 involves interpolation based on a translation list to obtain the interpolation translation matrix corresponding to the first angle, which may include steps S10333-S1034.
[0128] Step S10333: Based on the first angle list and translation list, obtain the interpolation function corresponding to each rotation axis through the cubic spline interpolation algorithm.
[0129] Specifically, each translation matrix T in the translation list has three variables Tx, Ty, and Tz. The angles in the first angle list can be used as independent variables, and the three variables Tx, Ty, and Tz can be used as dependent variables. The three interpolation functions Fx, Fy, and Fz can be obtained by using the cubic spline interpolation algorithm.
[0130] For example, dependent variable Tx { , , , ......}, independent variable Angles { , , , ......, The cubic spline interpolation algorithm calculates the interpolation function Fx, where for each... The interpolation result can be calculated. The same applies to Ty and Tz.
[0131] Step S10334: Determine the interpolation translation matrix corresponding to the first angle using the first angle and three interpolation functions, and construct the first spatial transformation relationship based on the interpolation translation matrix and the interpolation rotation matrix.
[0132] In other words, based on the input angle (At this point, it's the first angle), the interpolation translation matrix is calculated using the total interpolation function composed of three interpolation functions. The interpolation translation matrix and interpolation rotation matrix This can form the first spatial transformation relationship TMZ res .
[0133] As an example, see reference Figure 3 The diagram shown is a schematic representation of a spline curve for a translation matrix provided in an embodiment of this application. The spline curve is approximately circular, and the interpolation coordinates (vectors) of the green dots represent the input angles. The corresponding output translation matrix Additionally, the Z-axis translation vector sequence Ts{ , , , ...... In the vector, the Z component is close to 0, and the Y component of the translation vector along the Y-axis is close to 0. Figure 3 The image shown is a side view.
[0134] Thus, by employing a cubic spline interpolation algorithm, an accurate interpolation translation matrix can be obtained. By interpolating the spatial transformation relationship of a single rotation axis, the corresponding spatial transformation relationship at a specific angle can be obtained, thereby determining the specific position of the measured point at that angle, significantly improving positional accuracy. Furthermore, the more angles specified in the spatial transformation relationship list, the more accurate the interpolated spatial transformation relationship and the smaller the measurement error.
[0135] Step S104: Based on the theoretical position of the test point on the virtual model of the product under test, the coordinate system matrix used to identify the pose of the product under test on the turntable, the first spatial transformation relationship, and the second spatial transformation relationship, the target position of the test point on the turntable is calculated.
[0136] Specifically, the theoretical position reflects the position of the test point on a virtual model, such as a CAD model. This position is the known theoretical measurement coordinates that need to be controlled. Since the coordinate system matrix can represent the position and attitude of the test product on the turntable or in the world coordinate system, the two spatial transformation relationships can express the position transformation of the test point in the world coordinate system. Therefore, based on these four parameters, the true position of the test point on the turntable, i.e., the target position, can be determined.
[0137] In other words, given the theoretical position of the test point on the virtual model, the pose of the test point on the turntable can be obtained under the influence of the coordinate system matrix. Then, considering the influence of the two spatial transformation relationships, the specific position of the test point on the turntable can be obtained. That is, based on the theoretical position, considering the pose of the product under test, and iterating the rotation and translation relationships of the rotation axis, the specific position of the test point on the platform can be obtained.
[0138] In order to accurately determine the position of the test point when it reaches the specific angle required by the target normal vector, this application uses a first angle and a second angle to rotate the test point to satisfy the target normal vector. Then, by interpolating the existing spatial transformation relationship, the spatial transformation relationship corresponding to any angle can be determined. The spatial transformation relationship can reflect how the axis of rotation needs to be rotated and translated to make the test point satisfy a certain angle. Thus, the target position of the test point can be accurately determined by combining the spatial transformation relationship, realizing precise position control of the test point, meeting the measurement requirements of high-precision local measurement, expanding the application scenarios of high-precision local sensors, and accurately acquiring the surface data of the test point at a specific angle.
[0139] Furthermore, in measurement applications, the rotating shaft can rotate the product under test at any angle, allowing the product to be rotated and translated to a precise uncalibrated position and orientation. This application enables the sensor to accurately collect and measure product data in this spatial position. Compared to area array sensors, it does not require complete reconstruction of the controlled position and can still accurately measure measurement data, improving measurement efficiency and accuracy. This addresses the application requirement of high-precision sensors to measure at specific angles. Moreover, in scenarios where measurement results are affected by angle, a transformation relationship interpolation method can be used to obtain the spatial transformation relationship at a specific angle. This allows for more accurate measurement results when the product under test is measured in the corresponding position and orientation, broadening the application scenarios of such high-precision probes. This application is not limited to any particular measurement sensor and is applicable to confocal optical point probes, confocal line probes, laser point probes, and line probes, etc.
[0140] For the measurement and testing process, the measurement and testing requirements of products are diverse. The data obtained by the sensor will be different when it collects data from the sample at different angles. This solves the need for the sensor to collect high-quality data at specific angles, and can accurately calculate the coordinates of the test point at different rotation angles, thus improving the measurement accuracy.
[0141] In one possible implementation, the target location is determined in the following way:
[0142] ;
[0143] in, This represents the theoretical location of the test point on the virtual model of the product under test. The coordinate system matrix, This represents the first spatial transformation relationship. This represents the second spatial transformation relationship.
[0144] Next, using VR measurement of the cutting process edge to the lift-up position as an example, we will illustrate the application scenario. (Reference) Figure 4 The diagram shown is a schematic of a product under test provided in an embodiment of this application. The orange line represents the film on the product under test, and the dark blue line represents the VR glass. The measurement target is to measure the distance D between the lift-up position and the edge vertex of the mold.
[0145] The die-cutting process and the machining of the lifting position result in a relatively rough surface on both the lifting position and the film-coated surface, making them unsuitable for establishing a reference. Therefore, the side reference position of the product is used as the alignment reference. After the product under test is aligned, D is measured. After the product under test is aligned, the lifting position is vertically upward. The initial normal vector N{nx,ny,nz} of the product side reference is obtained through the probe. Based on the initial normal vector, the corresponding second rotation angle angleY and first rotation angle Z of the machine tool need to be rotated and corrected are determined. The angles of the Y-axis and Z-axis of the reference acquired by the current machine tool are the second initial angles. and the first initial angle The first angle required for acquiring the vertical position can be calculated. , =angleZ+ (angleZ and) (with signs, combined with hardware orientation definition), and a second angle. , =angleY+ The interpolation algorithm is used to accurately calculate the target position coordinates of the point to be measured at this angle, collect the surface data of the point and calculate the height difference with the side as the reference, that is, the distance to be measured D.
[0146] Using the side as a reference, N needs to be rotated to {1,0,0}, at which point the corresponding lift position faces upwards. The Y-axis correction angle is as follows:
[0147] .
[0148] The correction angle of angleZ is calculated using the following formula. The angle actually includes a positive or negative sign and is based on the defined direction of the machine tool axis, which is ignored here.
[0149] ;
[0150] , ;
[0151] .
[0152] Based on the rotation angle and the initial angle, calculate the angle that needs to be acquired for the vertical position:
[0153] ;
[0154] .
[0155] Will and Substitute these values into the interpolation formula above to obtain the transformation relationship that needs to be collected. Then, the actual position of the point to be measured can be calculated. :
[0156] .
[0157] in It detects the theoretical position of the helicopter, that is, its position in the virtual model. It is the product's coordinate system matrix. Once the angle to be collected is calculated, the collection position is recalculated using the above method, and the probe can accurately move to the point to be measured.
[0158] Unlike conventional measurement scenarios where there is no corresponding angle conversion relationship, the measurement position will be lost after the angle is corrected. High-precision point probes and line probes, due to their limited angle range, cannot quickly and completely acquire overall surface data. They are often used for high-precision measurement of a limited number of test points on a product. This method broadens the application range of high-precision probes such as point probes and narrow line width probes, and can accurately acquire the surface data of the test point at a specific angle.
[0159] In summary, this application only requires calibrating a certain number of angles to obtain the transformation relationships of all angles within a given range. For example, for the Z-axis rotation of 0-360 degrees, by calibrating the transformation relationship matrix every 10 degrees, all angle transformation relationships within the 0-360 degree range can be calculated. It also facilitates the collection of optical 3D sensor data, enabling the probe to acquire data perpendicular to the surface method direction, thus improving the stability of optical data acquisition. It can be used to achieve precise measurement of the target point at specific measurement angles, broadening the application scenarios of probes that acquire local high-precision data.
[0160] Based on the above method for determining the location of the point to be measured, this application also provides an optical detection system, referencing... Figure 5 The diagram shown is a schematic of an optical detection system provided in an embodiment of this application. The optical detection system includes a turntable 501, a position determination unit 502, an optical sensor 503, and a processing unit 504.
[0161] The turntable 501 is equipped with an X-axis, a Y-axis and a Z-axis. The turntable 501 is used to drive the product under test to rotate in three dimensions. The product under test has test points distributed on it.
[0162] The position determination unit 502 is used to obtain the target position of the point to be measured on the turntable 501 according to the position determination method.
[0163] The optical sensor 503 is used to acquire optical signals from the target point on the turntable 501.
[0164] The processing unit 504 is used to analyze the optical signal to obtain the detection result of the point to be measured.
[0165] The specific type of optical sensor 503 is not limited here, but can be, for example, a discrete photomultiplier tube (PMT), a charge-coupled device (CCD), a time delay integration (TDI), a complementary metal-oxide-semiconductor (CMOS) sensor, a PMT array, an electron bombardment CCD (EB-CCD), an electron-multiplying CCD (EM-CCD), an enhancement-mode photodiode, or an avalanche photodiode (APD) array.
[0166] The processing unit 504 can employ existing optical signal processing methods to analyze the optical signal in order to obtain the detection result of the point to be measured. Examples of optical signal processing methods include template matching-based image feature detection methods or neural network-based image feature detection methods to identify physical defects at the point to be measured. Other examples include obtaining the physical dimensions and spatial coordinates of the point to be measured based on laser ranging, triangulation ranging, or interferometric ranging.
[0167] Optionally, the position determination unit 502 is configured to: obtain a first angle list and a corresponding spatial transformation relationship list for the first rotation axis, wherein the first angle list includes multiple angles and the spatial transformation relationship list includes spatial transformation relationships corresponding to each angle, and each spatial transformation relationship includes a rotation matrix and a translation matrix; decompose each spatial transformation relationship into a rotation matrix and a translation matrix to obtain a rotation list and a translation list; perform interpolation processing based on the rotation list to obtain an interpolated rotation matrix corresponding to the first angle, and perform interpolation processing based on the translation list to obtain an interpolated translation matrix corresponding to the first angle; and construct a first spatial transformation relationship based on the interpolated translation matrix and the interpolated rotation matrix.
[0168] Optionally, the position determination unit 502 is used to: perform quaternion transformation on each rotation matrix in the rotation list to obtain a quaternion list; based on the first adjacent angle, the second adjacent angle, the first quaternion corresponding to the first adjacent angle, and the second quaternion corresponding to the second adjacent angle, obtain the interpolation rotation matrix corresponding to the first angle through quaternion spherical linear interpolation, wherein the first adjacent angle and the second adjacent angle are two angles adjacent to the first angle in the first angle list.
[0169] Optionally, the position determination unit 502 is used to: obtain the interpolation function corresponding to each rotation axis based on the first angle list and translation list through a cubic spline interpolation algorithm; and determine the interpolation translation matrix corresponding to the first angle through the first angle and the three interpolation functions.
[0170] Optionally, the interpolation unit is used to: obtain N first position information of N feature points at an angle of 0 degrees, and N second position information of N feature points at each angle in the first angle list, where N>2; construct N pairs of position point pairs based on the N first position information and the N second position information; solve for the N pairs of position point pairs corresponding to each angle in the first angle list to obtain the spatial transformation relationship corresponding to each angle, so as to obtain the spatial transformation relationship list and the first angle list.
[0171] Optionally, in obtaining the interpolation rotation matrix for the first angle, the quaternion spherical linear interpolation process is represented by the following formula:
[0172] ;
[0173] ;
[0174] .
[0175] in, The first adjacent angle, The second adjacent angle, From the first angle, It is the first quaternion. Given a second quaternion, and Slerp() as the spherical linear interpolation function; thus, the interpolation result corresponding to the first angle can be used. Obtain the interpolation rotation matrix corresponding to the first angle and represent it as follows: .
[0176] Optionally, the position determination unit 502 is used to: obtain the coordinate system matrix; and determine the initial normal vector of the point to be measured based on the coordinate system matrix and the theoretical normal vector of the point to be measured on the virtual model.
[0177] Optionally, the position determination unit 502 is used to: scan the product under test to obtain the first point cloud coordinate data of the product under test; and perform point cloud matching between the first point cloud coordinate data and the second point cloud coordinate data corresponding to the virtual model to obtain a coordinate system matrix.
[0178] Optionally, when the second axis of rotation is the Y-axis, the position determination unit 502 is used to: determine a first rotation angle of the first axis of rotation based on the y-direction component and the x-direction component of the initial normal vector; determine a second rotation angle of the second axis of rotation based on the first rotation angle and the initial normal vector; determine a first angle based on the first initial angle and the first rotation angle; and determine a second angle based on the second initial angle and the second rotation angle.
[0179] Optionally, the target location is determined in the following ways:
[0180] ;
[0181] in, This represents the theoretical location of the test point on the virtual model of the product under test. The coordinate system matrix, This represents the first spatial transformation relationship. This represents the second spatial transformation relationship.
[0182] In another aspect, embodiments of this application provide a computer device, with reference to Figure 6 The diagram shown is a structural diagram of a computer device provided in an embodiment of this application. The computer device includes a processor 310 and a memory 320.
[0183] The memory 320 is used to store program code and transfer program code to the processor 310.
[0184] The processor 310 is used to execute the method provided in the above embodiments according to the instructions in the program code.
[0185] The computer device may include a terminal device or a server, and the aforementioned apparatus may be configured in the computer device.
[0186] In another aspect, embodiments of this application also provide a storage medium for storing a computer program for executing the methods provided in the above embodiments.
[0187] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by program instructions in hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disk, etc., and other media capable of storing program code.
[0188] 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, for example, 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.
[0189] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0190] The above description is merely a preferred embodiment of this application. Although this application has disclosed preferred embodiments above, it is not intended to limit this application. Any person skilled in the art can make many possible variations and modifications to the technical solutions of this application using the methods and techniques disclosed above, or modify them into equivalent embodiments with equivalent changes, without departing from the scope of the technical solutions of this application. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of this application without departing from the content of the technical solutions of this application shall still fall within the protection scope of the technical solutions of this application.
Claims
1. A method for determining the location of a point to be measured, characterized in that, include: Determine the initial normal vector of the test point located on the product under test. The product under test is placed on a turntable composed of the X-axis, Y-axis and Z-axis. The turntable is used to drive the product under test to rotate in three dimensions. Based on the spatial normal vector, the first initial angle of the first rotation axis, and the second initial angle of the second rotation axis, the first angle of the first rotation axis and the second angle of the second rotation axis corresponding to the target normal vector are calculated. The first rotation axis is the Z rotation axis, and the second rotation axis is the X rotation axis or the Y rotation axis. The first angle and the second angle are used to make the point to be measured reach the target normal vector under the drive of the turntable. Based on the spatial transformation relationship between the first angle and the first rotation axis at various angles, the first spatial transformation relationship corresponding to the first angle is obtained through interpolation; and based on the spatial transformation relationship between the second angle and the second rotation axis at various angles, the second spatial transformation relationship corresponding to the second angle is obtained through interpolation. Based on the theoretical position of the test point on the virtual model of the product under test, the coordinate system matrix used to identify the pose of the product under test on the turntable, the first spatial transformation relationship and the second spatial transformation relationship, the target position of the test point on the turntable is calculated.
2. The location determination method according to claim 1, characterized in that, The step of obtaining the first spatial transformation relationship corresponding to the first angle through interpolation processing based on the spatial transformation relationship between the first angle and the first rotation axis at various angles includes: Obtain a first angle list and a corresponding spatial transformation relationship list for the first rotation axis. The first angle list includes multiple angles, and the spatial transformation relationship list includes spatial transformation relationships corresponding to each angle. Each spatial transformation relationship includes a rotation matrix and a translation matrix. Each spatial transformation relationship is decomposed into the rotation matrix and the translation matrix to obtain a rotation list and a translation list; Interpolation is performed based on the rotation list to obtain the interpolation rotation matrix corresponding to the first angle, and interpolation is performed based on the translation list to obtain the interpolation translation matrix corresponding to the first angle. The first spatial transformation relationship is constructed based on the interpolation translation matrix and the interpolation rotation matrix.
3. The location determination method according to claim 2, characterized in that, The interpolation process based on the rotation list to obtain the interpolation rotation matrix corresponding to the first angle includes: Perform a quaternion transformation on each rotation matrix in the rotation list to obtain a list of quaternions; Based on the first adjacent angle, the second adjacent angle, the first quaternion corresponding to the first adjacent angle, and the second quaternion corresponding to the second adjacent angle, the interpolation rotation matrix corresponding to the first angle is obtained through quaternion spherical linear interpolation. The first adjacent angle and the second adjacent angle are two angles adjacent to the first angle in the first angle list.
4. The location determination method according to claim 2, characterized in that, The interpolation process based on the translation list to obtain the interpolation translation matrix corresponding to the first angle includes: Based on the first angle list and the translation list, the interpolation function corresponding to each rotation axis is obtained by the cubic spline interpolation algorithm; The interpolation translation matrix corresponding to the first angle is determined by the first angle and the three interpolation functions.
5. The location determination method according to claim 2, characterized in that, The step of obtaining the first angle list and the corresponding spatial transformation relationship list of the first rotating axis includes: Obtain N first position information of N feature points at an angle of 0 degrees, and N second position information of the N feature points at each angle in the first angle list, where N>2; Based on the N first location information and the N second location information, N pairs of location points are constructed; For each of the N pairs of position points corresponding to each angle in the first angle list, the N pairs of position points are solved to obtain the spatial transformation relationship corresponding to each angle, so as to obtain the list of spatial transformation relationships and the first angle list.
6. The location determination method according to claim 3, characterized in that, The quaternion spherical linear interpolation process is represented by the following formula: ; ; ; in, For the first adjacent angle, The second adjacent angle, For the first angle, For the first quaternion, The second quaternion is Slerp(), which is the spherical linear interpolation function. Based on the interpolation result corresponding to the first angle Obtain the interpolation rotation matrix corresponding to the first angle and represent it as follows: .
7. The location determination method according to claim 1, characterized in that, Determining the initial normal vector of the test point located on the product under test includes: Obtain the coordinate system matrix; Based on the coordinate system matrix and the theoretical normal vector of the point to be measured on the virtual model, the initial normal vector of the point to be measured is determined.
8. The location determination method according to claim 7, characterized in that, Obtaining the coordinate system matrix includes: The product under test is scanned to obtain the first point cloud coordinate data of the product under test; The coordinate system matrix is obtained by performing point cloud matching between the first point cloud coordinate data and the second point cloud coordinate data corresponding to the virtual model.
9. The location determination method according to claim 1, characterized in that, When the second axis of rotation is the Y-axis, the step of calculating the first angle of the first axis of rotation and the second angle of the second axis of rotation corresponding to the target normal vector based on the initial normal vector, the first initial angle of the first axis of rotation, and the second initial angle of the second axis of rotation includes: Based on the y-direction component and x-direction component of the initial normal vector, the first rotation angle of the first axis of rotation is determined. Based on the first rotation angle and the initial normal vector, determine the second rotation angle of the second axis; The first angle is determined based on the first initial angle and the first rotation angle, and the second angle is determined based on the second initial angle and the second rotation angle.
10. The location determination method according to claim 1, characterized in that, The target location is determined in the following way: ; Among them, the The theoretical location of the test point on the virtual model of the product under test, the The coordinate system matrix is the matrix of the coordinate system. For the first spatial transformation relationship, the This is the second spatial transformation relationship.
11. An optical detection system, characterized in that, include: A turntable is provided with an X-axis, a Y-axis and a Z-axis. The turntable is used to drive the product under test to rotate in three dimensions. The product under test has test points distributed on it. A position determination unit is used to obtain the target position of the point to be measured on the turntable by the position determination method according to any one of claims 1-10; An optical sensor is used to acquire optical signals from the point to be measured at the target position on the turntable. The processing unit is used to analyze the optical signal and obtain the detection result of the test point.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-10.