A method for extrinsic calibration of visual sensors for mobile devices

Obtaining historical positioning information data of mobile devices through pre-calibration solves the stability problems caused by temperature drift and repeated positioning errors in the external parameter calibration of the visual sensor, achieving fast and convenient external parameter calibration of the visual sensor, and is suitable for online detection.

CN115435814BActive Publication Date: 2024-10-15EASY THINKING HANGZHOU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211174664.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2024-10-15
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

In the existing technology, visual sensors are easily affected by temperature drift and repeated positioning errors of mobile devices during the external parameter calibration process, resulting in unstable positioning. Moreover, active positioning methods require pasting feature points and the process is cumbersome, making them unsuitable for online detection.

Method used

Through the pre-calibration process, the mobile device's positioning information historical data list is obtained, the measurement trajectory is simulated until it reaches a thermal stable state, the characteristic parameters and conversion relationships are stored, and the closest historical data is found and applied in real time for external parameter calibration, avoiding temperature drift and The influence of repeated positioning errors does not require pasting of feature points.

Benefits of technology

It achieves high-stability external parameter calibration of the visual sensor, reduces detection time, is suitable for online detection, avoids the need for manual operation and waiting for thermal stability, and improves measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115435814B_ABST
    Figure CN115435814B_ABST
Patent Text Reader

Abstract

The present invention provides an external parameter calibration method based on a mobile device visual sensor. First, through a pre-calibration process, the order of the mobile device's trajectory operation, characteristic parameters, and the conversion relationship at each measurement posture are recorded as a set of historical data; the mobile device repeatedly runs the measurement trajectory until the mobile device reaches thermal stability, and all historical data are summarized into a positioning information historical data list; when the visual measurement officially starts, the mobile device drives the visual sensor to run the measurement trajectory. During this process, the characteristic parameters are obtained and marked as A, and a group of characteristic parameters closest to A are searched in the positioning information historical data list; the conversion relationship corresponding to the characteristic parameters is recorded as a real-time conversion relationship to complete the positioning of the current flexible sensor. The global positioning accuracy of the visual sensor of this method will not be affected by the temperature drift of the mobile device and its own repeated positioning error, and has high stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of sensor positioning and calibration, and in particular to an external parameter calibration method based on a mobile device vision sensor. Background Art

[0002] At present, visual inspection technology has been widely used in various fields of intelligent manufacturing, especially the flexible measurement method combining mobile equipment (machine / guide rail) and visual sensor, which has attracted much attention because it can provide more comprehensive visual measurement of the surface of the object to be measured. As we all know, before the visual sensor is officially applied, it is necessary to first calibrate the relationship with the global coordinate system, that is, to perform global positioning / external parameter calibration on the visual sensor. Due to the repeated positioning error and temperature drift positioning error of the mobile equipment affected by temperature, the position of each time in the same measurement posture is different; for example, the robot will produce a very obvious temperature error during continuous high-speed movement, that is, after a period of continuous high-speed movement, the robot's end TCP (Tool Center Point) will have a very obvious position drift; taking an industrial robot with a 3m arm span as an example, after 100% continuous movement for 1 hour, for the same target point, the position change reached by the robot's end TCP can reach up to 0.5mm, that is, the robot's motion trajectory will have a large position or posture error. This robot temperature error is a dynamically generated error that changes continuously before reaching a thermal equilibrium state.

[0003] In the external parameter calibration, the direct impact of the error of the mobile device is that the position and posture of the visual sensor are constantly changing, that is, the external parameters of the sensor used when the object is first detected are inconsistent with the external parameters of the sensor when other objects are detected again. Therefore, the external parameters obtained last time cannot be directly used as the real-time external parameters of the visual sensor. Therefore, how to accurately position such flexible visual sensors has become a technical problem that needs to be solved urgently.

[0004] At present, the existing techniques for extrinsic calibration of such flexible sensors include the following two methods:

[0005] Passive positioning: The rotation and translation parameters recorded by the robot / guide rail during movement are directly converted into sensor external parameters. The calibration accuracy of this method is easily affected by the temperature drift of the robot end TCP and the positioning error of the robot / guide rail itself, and the calibration result accuracy is unstable.

[0006] In order to reduce the positioning error, the existing method is to preheat the mobile device (robot / guide rail) first, and then start the measurement after the mobile device reaches a thermally stable state. This method requires waiting for the robot to preheat, which usually takes several hours and does not meet the requirements of high-paced production rhythms. In addition, the mobile device that has reached a thermally stable state still has repeated positioning errors, which affects the accuracy of the external parameter solution.

[0007] Active positioning: This method requires pasting feature points on the surface of each object to be detected. The visual sensor calculates external parameters based on the feature point image to obtain the relationship between it and the global coordinate system. Although this method is not affected by the positioning error or position change of the mobile device, it has the following problems:

[0008] 1) Usually, feature points are fixed on the surface of the object by sticking / adsorption. After the object is inspected, the feature points need to be removed manually to restore the surface morphology of the object. In special inspection scenarios, the surface of the object is not allowed to be touched and the feature points cannot be fixed. At this time, the existing active measurement method cannot be implemented.

[0009] 2) To re-paste the feature points on the new surface of the object to be measured, it is necessary to use the photogrammetry system to obtain the standard coordinates of each feature point again. The sensor also needs to be moved to each measurement position again to perform measurement work and re-calibrate the process. The whole process is cumbersome and time-consuming, and is not suitable for online detection processes. Summary of the invention

[0010] In order to solve the above technical problems, the present invention provides an external parameter calibration method based on a mobile device visual sensor. The global positioning accuracy of the visual sensor of this method will not be affected by the temperature drift of the mobile device and its own repeated positioning error, and has high stability. It is suitable for global positioning of various types of visual sensors (as long as there is a camera), and has the characteristics of fast, convenient and accurate, especially suitable for online detection processes.

[0011] The technical solution is as follows:

[0012] An external parameter calibration method based on a visual sensor of a mobile device, wherein the visual sensor is installed on the mobile device and is used to collect images of an object to be measured;

[0013] First, go through the following pre-calibration process to obtain a list of historical positioning information data:

[0014] Before the visual measurement of the object to be measured is officially started, the mobile device starts from a cold state, simulates the actual visual measurement process, and drives the visual sensor to run the measurement trajectory. In this process, one or more characteristic parameters and the conversion relationship between the visual sensor coordinate system and the global coordinate system at each measurement position are obtained;

[0015] When the mobile device is a robot, the characteristic parameter is one or more of the robot posture, the landmark coordinates and the robot link error;

[0016] The coordinates of the marking points are: the coordinates of the geometric features whose positions remain unchanged in the detection station;

[0017] The robot link error is: the deviation between the corrected DH parameters when the robot is currently running and the corrected DH parameters when the robot is first running;

[0018] When the mobile device is a guide rail, the characteristic parameter is the coordinates of the marking point;

[0019] The sequence of trajectory movement of the mobile device, characteristic parameters, and conversion relationships at each measured position and posture are recorded as a set of historical data;

[0020] The mobile device repeatedly runs the measurement trajectory, and stores a set of historical data each time the trajectory is run; the mobile device stops running until it reaches a thermally stable state; all historical data are summarized into a list and stored as a positioning information historical data list;

[0021] The pre-calibration process is completed;

[0022] When the visual measurement officially begins, the following steps are performed to obtain the conversion relationship between the visual sensor coordinate system and the global coordinate system:

[0023] After the object to be measured is installed, the mobile device drives the visual sensor to run the measurement trajectory according to the set measurement trajectory. During this process, the characteristic parameter is obtained and marked as A, and a set of characteristic parameters closest to A is searched in the pre-stored positioning information historical data list;

[0024] The conversion relationship in a set of historical data corresponding to the characteristic parameter is recorded as the real-time conversion relationship between the visual sensor coordinate system and the global coordinate system, thereby completing the external parameter calibration of the current visual sensor.

[0025] Furthermore, when the characteristic parameters are robot postures, the characteristic parameters are obtained at a single or multiple measurement postures, and the characteristic parameters at a single measurement posture are the robot end position coordinates and Euler angles, which are obtained by reading data in the robot controller.

[0026] Furthermore, when the characteristic parameter is the coordinate of the landmark point, it is obtained in the following manner:

[0027] One or more marking points are set in advance in the inspection station;

[0028] Each time the robot / guide rail runs along a trajectory, it drives the visual sensor to collect images of the landmark points and calculate the coordinates of the landmark points;

[0029] The marking points are original geometric features in the detection station and artificially added geometric features, including characteristic holes, standard spheres and marking circles;

[0030] The marker point coordinates are the geometric center position coordinates of the marker point.

[0031] Further, when the characteristic parameter is the robot connecting rod error, a set of connecting rod error data is obtained before or after the robot runs the measurement track each time, which is obtained in the following way:

[0032] A temperature compensation device is pre-arranged in the detection station, the temperature compensation device comprising a base, a reference rod and a reference ball connected in sequence, the base and the robot are fixedly installed on the same foundation, and the height is consistent with the height of the robot base, the reference rod is a carbon fiber rod, at least four circular marks are arranged on the surface of the reference ball, the position of the circular marks is arranged as a plane, and the centers of the circular marks are located on the same spherical surface;

[0033] Before or after each measurement trajectory of the robot, the visual sensor is driven to collect images of each circular mark on the temperature compensation device from multiple positions and postures to obtain the coordinates of each circle center in the robot flange coordinate system;

[0034] The equation is constructed using the center coordinates of the circle detected in real time and the center coordinates of the circle obtained from the measurement trajectory of the robot's first operation to solve the robot's connecting rod error.

[0035] Furthermore, the following equation is constructed using the center coordinates detected in real time and the center coordinates obtained from the first measurement trajectory of the robot. The robot link error is solved by solving multiple simultaneous equations of the center coordinates:

[0036]

[0037] Among them, P flange冷 Represents the center coordinates of the circle obtained by the robot for the first time, P flange热 Represents the center coordinates of the circle detected in real time, α i ,c i ,d i ,β i Respectively represent the rod torsion angle, rod length, joint distance, and joint torsion angle of the i-th joint in the robot's modified DH parameters; θ ini is the angle of the robot’s i-th joint, θ 0_i represents the initial angle of the robot's i-th joint, i = 1, 2...N, N represents the total number of robot joints; Δα i ,Δa i ,Δd i ,Δθ i ,Δk,Δβ are the robot link errors to be solved.

[0038] Furthermore, when multiple characteristic parameters are obtained in a single trajectory operation, they are used as indexes to search for a set of characteristic parameters closest to the characteristic parameters in the pre-stored positioning information history data list; the specific method is:

[0039] Each characteristic parameter is used as an index, and each historical characteristic parameter closest to it is searched in the historical data;

[0040] Alternatively, the mean of each characteristic parameter is obtained, and at the same time, in the historical data, the average of multiple characteristic parameters in each group of data is also taken; when searching, the mean is used as an index to find the characteristic parameter in the historical data that is closest to the measured characteristic parameter.

[0041] Preferably, the method for judging whether the mobile device has reached the thermally stable state is: calculating the maximum value of the difference of the characteristic parameters in the most recently acquired 5 to 20 groups of characteristic parameters, and if the value is less than a preset threshold value A, judging that the mobile device has reached the thermally stable state, otherwise, the mobile device has not reached the thermally stable state;

[0042] The following processing is performed on the location information history data list:

[0043] If there are multiple sets of historical data with completely consistent data, only one set of historical data will be retained;

[0044] If the maximum difference value of the characteristic parameters in the adjacent 2 to 10 groups of characteristic parameters is less than the preset threshold value B, only the historical data corresponding to any one of the 2 to 10 groups of characteristic parameters is retained, and the other historical data is deleted;

[0045] The preset threshold value A≤the preset threshold value B.

[0046] Furthermore, in the pre-calibration process, the transformation relationship between the visual sensor coordinate system and the global coordinate system at each measurement pose is obtained by the following steps:

[0047] S1. Select one object to be tested from multiple objects of the same model and record it as a reference object to be tested;

[0048] The reference object to be tested is installed in a detection station, and a plurality of feature points are set in the peripheral area of ​​the reference object to be tested and on the surface of the reference object to be tested;

[0049] Use standard measuring equipment to collect coordinate information of each feature point in the global coordinate system and store them as standard coordinates;

[0050] S2, the mobile device drives the visual sensor to the measurement position according to the set measurement trajectory;

[0051] The visual sensor collects multiple feature point images;

[0052] The coordinate information of the feature points is calculated using the collected images and stored as measured coordinates;

[0053] S3, using the standard coordinates and the measured coordinates to solve the conversion relationship between the visual sensor coordinate system and the global coordinate system, and store it as the conversion relationship at the current measurement posture;

[0054] S4, determining whether there are other measurement postures whose conversion relationships have not been solved. If yes, the mobile device drives the visual sensor to another measurement posture and jumps to step S2; if no, directly proceed to step S5;

[0055] S5. Store the conversion relationship between the visual sensor and each measurement posture.

[0056] Preferably, in step S3, the method of solving the conversion relationship between the visual sensor coordinate system and the global coordinate system is:

[0057] The objective function g(R,T) is established using the standard coordinates and measured coordinates of the feature points, and then the optimization method is used to iteratively solve the corresponding transformation relationship when the objective function takes the minimum value, which is recorded as RT;

[0058] Wherein, when the visual sensor is a monocular sensor, the objective function g(R,T) is:

[0059]

[0060] Among them, m represents the total number of feature points collected by the camera, f(R,T,M,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is converted to the image plane, M represents the camera internal parameter, (u j ,v j ) represents the pixel coordinates of the jth feature point in the image, i.e., the measured coordinates;

[0061] When the visual sensor is a binocular sensor, the objective function g(R,T) is:

[0062]

[0063] Among them, f1(R,T,M1,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j) is converted to the left camera image plane, M1 represents the left camera internal parameter, (u 1j ,v 1j ) represents the pixel coordinates of the jth feature point in the left camera image; f2(R,T,R 12 ,T 12 ,M2,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is transformed to the right camera image plane, R 12 ,T 12 They represent the rotation matrix and translation rectangle between the two cameras, M2 represents the internal parameters of the right camera, (u 2j ,v 2j ) represents the pixel coordinates of the jth feature point in the right camera image, that is, the measured coordinates.

[0064] Preferably, in step S3, the method for calculating the conversion relationship RT between the visual sensor coordinate system and the global coordinate system is:

[0065] When the sensor is a two-dimensional sensor, the solution method is the PnP method;

[0066] When the sensor is a three-dimensional sensor, the solution method is the SVD decomposition method;

[0067] In step S1, the standard measuring equipment includes a photogrammetry system and a three-coordinate machine.

[0068] This method has the following characteristics:

[0069] 1) The real-time external parameters of the sensor obtained by this method will not be affected by the temperature drift of the mobile device and its own repeated positioning error, and the calibration result is highly stable.

[0070] 2) Before the formal detection begins, the method first performs a preliminary pre-calibration process to obtain the conversion relationship (steps S1 to S5) and characteristic parameters at each measurement position; this process only needs to be performed once, during which the mobile device (robot / guide rail) starts from a cold state, cyclically simulates the actual detection process, and runs the measurement trajectory until the mobile device reaches a thermal steady state; multiple sets of historical data are obtained to form a list and stored as positioning information historical data;

[0071] When the actual measurement process begins, the characteristic parameter is obtained again and used as an index to find a set of historical data closest to this characteristic parameter in the pre-stored list, and the historical external parameters in it can be used as real-time external parameters. The whole process is time-saving, efficient, and cleverly designed, which effectively improves the stability of external parameter calibration and improves the subsequent measurement accuracy.

[0072] 3) It is only necessary to fix feature points on the surface of one object to be tested during the pre-calibration process. In subsequent testing, there is no need to fix feature points on the surfaces of other objects to be tested, which does not occupy the production cycle, saves manpower and testing time; and does not cause any damage to the surface of the object to be tested.

[0073] In actual detection, this method does not need to wait for the mobile device to warm up, is time-saving, and can be used for online detection.

[0074] 4) In addition to the SVD decomposition method or PnP method mentioned in the prior art, the calculation method of the transformation relationship between the visual sensor coordinate system and the global coordinate system can also use the optimization method to iteratively solve and obtain a more accurate transformation matrix. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 Schematic diagram of a temperature compensation device in a specific implementation manner. DETAILED DESCRIPTION

[0076] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0077] An external parameter calibration method based on a mobile device visual sensor, the visual sensor is installed on the mobile device (robot / guide rail) and is used to collect images of the object to be measured;

[0078] First, go through the following pre-calibration process to obtain a list of historical positioning information data:

[0079] Before the visual measurement of the object to be measured is officially started, the mobile device starts from a cold state, simulates the actual visual measurement process, and drives the visual sensor to run the measurement trajectory. In this process, one or more characteristic parameters and the conversion relationship between the visual sensor coordinate system and the global coordinate system at each measurement position are obtained;

[0080] When the mobile device is a robot, the characteristic parameter is one or more of the robot posture, the landmark coordinates, and the robot link error;

[0081] The coordinates of the marking points are: the coordinates of the geometric features whose positions remain unchanged in the inspection station;

[0082] The robot link error is: the deviation between the corrected DH parameters when the robot is currently running and the corrected DH parameters when the robot is first running;

[0083] When the mobile device is a guide rail, the characteristic parameter is the coordinates of the marker point;

[0084] The sequence of trajectory movement of the mobile device, characteristic parameters, and conversion relationships at each measured position and posture are recorded as a set of historical data;

[0085] The mobile device repeatedly runs the measurement trajectory, and stores a set of historical data each time the trajectory is run; the mobile device stops running until it reaches a thermally stable state; all historical data are summarized into a list and stored as a positioning information historical data list;

[0086] The pre-calibration process is completed;

[0087] Taking a 6-axis robot with a single measurement trajectory containing 24 measurement poses as an example, it takes 6 hours for the robot to reach a thermal steady state from a cold state, and the pre-calibration process takes 6 hours.

[0088] The above pre-calibration process only needs to be performed once during the inspection of a single model of workpiece. As long as the robot trajectory and measurement posture do not change, the positioning information historical data list can be used cyclically.

[0089] When the visual measurement officially begins, the following steps are performed to obtain the conversion relationship between the visual sensor coordinate system and the global coordinate system:

[0090] After the object to be measured is installed, the mobile device drives the visual sensor to run the measurement trajectory according to the set measurement trajectory. During this process, the characteristic parameter is obtained and marked as A, and a set of characteristic parameters closest to A is searched in the pre-stored positioning information historical data list;

[0091] The conversion relationship in a set of historical data corresponding to the characteristic parameter is recorded as the real-time conversion relationship between the visual sensor coordinate system and the global coordinate system, thereby completing the external parameter calibration of the current visual sensor.

[0092] The following is an exemplary description of different situations of characteristic parameters:

[0093] Case 1: When the characteristic parameters are the robot posture, the characteristic parameters are obtained at a single or multiple measurement postures. The characteristic parameters at a single measurement posture are the robot end position coordinates (X, Y, Z) and Euler angles (α, β, γ), which are obtained by reading the data in the robot controller.

[0094] Case 2: When the feature parameter is the coordinate of the landmark point, it is obtained in the following way:

[0095] One or more marking points are set in advance in the inspection station;

[0096] Each time the robot / guide rail runs along a trajectory, it drives the visual sensor to collect images of the landmark points and calculate the coordinates of the landmark points;

[0097] The landmark points are the original geometric features in the inspection station and the artificially added geometric features, including characteristic holes, standard balls and marking circles;

[0098] The coordinates of the marker point are the coordinates of the geometric center position of the marker point.

[0099] Case 3: When the characteristic parameter is the robot link error, a set of link error data is obtained before or after each measurement trajectory of the robot, which is obtained in the following way:

[0100] Set up a temperature compensation device in the detection station in advance, such as Figure 1 As shown, the temperature compensation device includes a base 1, a reference rod 2 and a reference ball 3 connected in sequence. The base 1 and the robot are fixedly installed on the same foundation, and the height is consistent with the height of the robot base. The reference rod 2 is a carbon fiber rod. At least four circular marks are set on the surface of the reference ball 3. The position of the circular marks is a plane, and the centers of the circular marks are located on the same spherical surface.

[0101] Before or after each measurement trajectory of the robot, the visual sensor is driven to collect images of each circular mark on the temperature compensation device from multiple positions and postures to obtain the coordinates of each circle center in the robot flange coordinate system;

[0102] The equation is constructed using the center coordinates of the circle detected in real time and the center coordinates of the circle obtained from the measurement trajectory of the robot's first operation to solve the robot's connecting rod error.

[0103] The specific solution formula is as follows: Use the center coordinates of the circle detected in real time and the center coordinates of the circle obtained by the robot's first running measurement trajectory to construct the following equation, and solve the robot link error through multiple center coordinates simultaneous equations:

[0104]

[0105] Among them, P flange冷 Represents the center coordinates of the circle obtained by the robot for the first time, P flange热 Represents the center coordinates of the circle detected in real time, α i ,c i ,d i ,β i Respectively represent the rod torsion angle, rod length, joint distance, and joint torsion angle of the i-th joint in the robot's modified DH parameters; θ ini is the angle of the robot’s i-th joint, θ 0_i represents the initial angle of the robot's i-th joint, i = 1, 2...N, N represents the total number of robot joints; Δα i ,Δai ,Δd i ,Δθ i ,Δk,Δβ are the robot link errors to be solved.

[0106] Combining cases 1 to 3, it can be seen that when the characteristic parameter is the robot posture or the coordinates of the landmark point, the robot runs a trajectory and can obtain one or more characteristic parameters (robot posture, landmark point coordinates); and when the robot link error is the robot link error, the robot runs a trajectory and can obtain a set of link errors;

[0107] The following is a partial list of data to illustrate the location information history data list:

[0108] Table 1:

[0109]

[0110] Table 1 shows the historical data list of 4 sets (running 4 trajectories) of positioning information obtained during the pre-calibration process when the feature parameter is the robot posture:

[0111] A single measurement trajectory contains 5 measurement poses and the characteristic parameters are 2 robot poses. These two robot poses can be obtained in the following ways: read and obtain the robot pose at two of the measurement poses, or obtain the robot end pose when the robot moves to other poses (for example, obtain the end pose at the beginning and end of the detection trajectory and record it as a characteristic parameter);

[0112] Taking the first running trajectory as an example, the characteristic parameters are recorded as A1 and B1, and the transformation relationship between the visual sensor coordinate system and the global coordinate system at the five measurement positions is recorded as RT11 to RT15; the naming rules for other positions are the same.

[0113] Table 2:

[0114]

[0115] Table 2 shows the historical data list of 4 sets (running 4 trajectories) of positioning information obtained during the pre-calibration process when the feature parameter is the robot posture:

[0116] A single measurement trajectory contains 5 measurement poses and the characteristic parameters are 5 robot poses: the robot pose is obtained as the characteristic parameter at each measurement pose, and the conversion relationship between the visual sensor coordinate system and the global coordinate system at the measurement pose is solved and recorded as RT;

[0117] Taking the measurement pose 1 in the first running trajectory as an example, the characteristic parameter is recorded as A11, and the transformation relationship between the visual sensor coordinate system and the global coordinate system is recorded as RT11; the naming rules for other positions are the same.

[0118] A set of historical data includes the order of robot trajectory operation, characteristic parameters A, and transformation relations RT at each measured posture;

[0119] Table 3:

[0120]

[0121] Table 3 shows a list of historical data of 4 sets (running 4 trajectories) of positioning information obtained during the pre-calibration process when the feature parameters are the coordinates of the landmark points:

[0122] A single measurement trajectory contains 5 measurement poses, and the characteristic parameters are the coordinates of 3 landmark points:

[0123] Select three locations in the inspection station and set up markers in advance. Each time the robot runs to the inspection track, it obtains the coordinates of these three markers as feature parameters;

[0124] In actual application, the number of marker points can be set according to the actual situation. For example, only one can be set. In this case, the characteristic parameter is the coordinate of 1 marker point.

[0125] In addition, in a single detection trajectory, the transformation relationship between the visual sensor coordinate system and the global coordinate system is solved at each measurement pose.

[0126] Taking the first running trajectory as an example, the characteristic parameters are recorded as A1, B1, and C1, and the transformation relationship between the visual sensor coordinate system and the global coordinate system at the five measurement positions is recorded as RT11 to RT15; the naming rules for other positions are the same.

[0127] Table 4:

[0128]

[0129] Table 4 shows the historical data list of 4 groups (running 4 trajectories) of positioning information obtained during the pre-calibration process when the characteristic parameter is the robot link error:

[0130] A single measurement trajectory contains 5 measurement poses, and the characteristic parameters are a set of robot link errors:

[0131] After each measurement trajectory, the robot uses the temperature compensation device to calculate a set of robot link errors (Δα i ,Δa i ,Δd i ,Δθ i ,Δk,Δβ), denoted as A1, A2, A3, A4.

[0132] The following is a specific description. For the situations in Table 1, Table 2, and Table 3, when multiple characteristic parameters are obtained in a single trajectory operation, they are used as indexes to search for a set of characteristic parameters closest to the characteristic parameters in the pre-stored positioning information historical data list; the specific method is:

[0133] Method 1: Use each feature parameter as an index and search for the closest historical feature parameters in the historical data.

[0134] As shown in Table 2, at the measurement posture 1, the real-time characteristic parameter obtained is recorded as A. When looking up Table 1, the characteristic parameter closest to it can be searched in the various historical characteristic parameters (A11, A21, A31, A41) of the measurement posture 1. If the search result is A11, RT11 corresponding to the characteristic number A11 is recorded as the real-time conversion relationship between the visual sensor coordinate system and the global coordinate system; if the search result is A21, RT2 corresponding to the characteristic number A21 is recorded as the real-time conversion relationship between the visual sensor coordinate system and the global coordinate system;

[0135] Similarly, at the measurement posture 2, the real-time characteristic parameter obtained is recorded as A. When looking up Table 1, the characteristic parameter closest to it can be searched in the various historical characteristic parameters (A12, A22, A32, A42) of the measurement posture 1, such as A32, and the RT32 corresponding to the characteristic number A32 is recorded as the real-time conversion relationship between the visual sensor coordinate system and the global coordinate system; the subsequent measurement posture lookup method is the same as above;

[0136] Table 2 can also be looked up in another way: match the 5 feature parameters in a single detection trajectory with the 5 feature parameters in trajectory 1, trajectory 2, trajectory 3, and trajectory 4, respectively, to obtain the matching results (4 groups) corresponding to each trajectory, and record the group with the smallest error mean in the matching results as the best matching result, and use the conversion relationship at each posture in the corresponding trajectory as the real-time conversion relationship at each measurement posture during the current detection. If the best matching result corresponds to trajectory 2, RT21~RT25 are used as the real-time conversion relationship at each measurement posture.

[0137] Method 2: Calculate the mean of each characteristic parameter. At the same time, in the historical data, the multiple characteristic parameters in each group of data are also averaged. When searching, use the mean as an index to find the characteristic parameter in the historical data that is closest to the measured characteristic parameter.

[0138] For example, take the average of A1 and B1 in Table 1, take the average of A2 and B2, take the average of A3 and B3, and take the average of A4 and B4; take the average of the five measured characteristic parameters obtained when the visual measurement officially starts, record it as A, and use it as an index to search in the historical data.

[0139] Take the average of A11, A12, A13, A14, and A15 in Table 2, take the average of A21, A22, A23, A24, and A25, take the average of A31-A35, and take the average of A41-A45; also take the average of the five measured characteristic parameters obtained when the visual measurement officially starts, record it as A, and use it as an index to search in the historical data.

[0140] As shown in Table 3, A11, A13, and A15 are averaged, A21, A23, and A25 are averaged, A31, A33, and A35 are averaged, and A41, A43, and A45 are averaged; the three measured characteristic parameters obtained when the visual measurement officially starts are also averaged, recorded as A, and used as an index to search in the historical data.

[0141] Specifically, the present embodiment further provides a method for determining whether the mobile device has reached a thermally stable state: calculating the maximum difference value of the characteristic parameters in the most recently acquired 5 to 20 groups of characteristic parameters, and if the value is less than a preset threshold value A, it is determined that the mobile device has reached a thermally stable state, otherwise, it has not reached a thermally stable state;

[0142] In order to delete redundant information and simplify the list information, the following processing is performed on the location information historical data list:

[0143] If there are multiple sets of historical data with completely consistent data, only one set of historical data will be retained;

[0144] If the maximum difference value of the characteristic parameters in the adjacent 2 to 10 groups of characteristic parameters is less than the preset threshold value B, only the historical data corresponding to any one of the 2 to 10 groups of characteristic parameters is retained, and the other historical data is deleted;

[0145] The preset threshold value A≤the preset threshold value B.

[0146] For example, when the feature parameter is the coordinate information of a landmark point, the preset threshold A includes the X coordinate difference, the Y coordinate difference, and the Z coordinate difference, and the value range of the preset threshold of the difference of a single coordinate component is 0.5 to 1;

[0147] The preset threshold value B is also the X coordinate difference, the Y coordinate difference, and the Z coordinate difference. The value range of the preset threshold value of the difference of a single coordinate component is 1 to 3;

[0148] During specific implementation, the preset threshold A and the preset threshold B can be reasonably set according to the specific circumstances of the characteristic parameters.

[0149] As a preferred implementation, this embodiment shows a method for obtaining external parameters of a visual sensor;

[0150] During the pre-calibration process, the transformation relationship between the visual sensor coordinate system and the global coordinate system at each measurement pose is obtained through the following steps:

[0151] S1. Select one object to be tested from multiple objects of the same model and record it as a reference object to be tested;

[0152] The reference object to be tested is installed in the testing station, and a plurality of feature points are set in the peripheral area of ​​the reference object to be tested and on the surface of the reference object to be tested;

[0153] Use standard measuring equipment (photogrammetry system / three-coordinate machine) to collect the coordinate information of each feature point in the global coordinate system and store it as standard coordinates;

[0154] S2, the mobile device drives the visual sensor to the measurement position according to the set measurement trajectory;

[0155] The visual sensor collects multiple feature point images;

[0156] The coordinate information of the feature points is calculated using the collected images and stored as measured coordinates;

[0157] S3, using the standard coordinates and the measured coordinates to solve the conversion relationship between the visual sensor coordinate system and the global coordinate system, and store it as the conversion relationship at the current measurement posture;

[0158] S4, determining whether there are other measurement postures whose conversion relationships have not been solved. If yes, the mobile device drives the visual sensor to another measurement posture and jumps to step S2; if no, directly proceed to step S5;

[0159] S5. Store the conversion relationship between the visual sensor and each measurement posture.

[0160] Among them, in step S3, the methods for solving the conversion relationship between the visual sensor coordinate system and the global coordinate system include the following:

[0161] Method 1: Based on the PnP principle, the standard coordinates and measured coordinates of the feature points are used to establish the objective function g(R, T), and then the optimization method is used to iteratively solve the corresponding transformation relationship when the objective function takes the minimum value, which is recorded as RT;

[0162] Among them, when the visual sensor is a monocular sensor, the objective function g(R,T) is:

[0163]

[0164] Among them, m represents the total number of feature points collected by the camera, f(R,T,M,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,zj ) is converted to the image plane, M represents the camera internal parameter, (u j ,v j ) represents the pixel coordinates of the jth feature point in the image, i.e., the measured coordinates;

[0165] When the visual sensor is a binocular sensor, the objective function g(R,T) is:

[0166]

[0167] Among them, f1(R,T,M1,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is converted to the left camera image plane, M1 represents the left camera internal parameter, (u 1j ,v 1j ) represents the pixel coordinates of the jth feature point in the left camera image; f2(R,T,R 12 ,T 12 ,M2,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is transformed to the right camera image plane, R 12 ,T 12 They represent the rotation matrix and translation rectangle between the two cameras, M2 represents the internal parameters of the right camera, (u 2j ,v 2j ) represents the pixel coordinates of the jth feature point in the right camera image, that is, the measured coordinates.

[0168] Method 2: When the sensor is a two-dimensional sensor, the solution method is the PnP method;

[0169] Method 3: When the sensor is a three-dimensional sensor, the solution method is the SVD decomposition method;

[0170] That is, the objective function is directly constructed by the least squares method according to the rigid transformation of the source point cloud and the target point cloud in different coordinate systems, and then solved by SVD:

[0171]

[0172] where p i is the measured three-dimensional coordinate of the i-th feature point, q i is the standard three-dimensional coordinate of the i-th feature point, wi represents the scale factor, and n represents the number of feature points.

[0173] Before the formal detection begins, the method first performs a preliminary calibration process to obtain the conversion relationship (steps S1 to S5) and characteristic parameters at each measurement posture; this process only needs to be performed once to obtain multiple groups of historical data to form a list and store it as positioning information historical data; during actual detection, the characteristic parameter index and table lookup are used to obtain the real-time external parameters of the sensor without being affected by the temperature drift of the mobile device and its own repeated positioning error, and the calibration result has high stability.

[0174] The foregoing description of the specific exemplary embodiments of the present invention is presented for the purpose of illustration and description. The foregoing description is not intended to be exhaustive, nor is it intended to limit the present invention to the precise form disclosed, and it is apparent that many changes and variations are possible in light of the above teachings. The exemplary embodiments are selected and described to explain the specific principles of the present invention and its practical application, so that other technicians in the field can realize and utilize the various exemplary embodiments of the present invention and its different selected forms and modified forms. The scope of the present invention is intended to be limited by the appended claims and their equivalents.

Claims

1. A method for calibrating external parameters based on a visual sensor of a mobile device, wherein the visual sensor is installed on the mobile device and is used to collect images of an object to be measured; characterized in that: First, go through the following pre-calibration process to obtain a list of historical positioning information data: Before the visual measurement of the object to be measured is officially started, the mobile device starts from a cold state, simulates the actual visual measurement process, and drives the visual sensor to run the measurement trajectory. In this process, one or more characteristic parameters and the conversion relationship between the visual sensor coordinate system and the global coordinate system at each measurement position are obtained; When the mobile device is a robot, the characteristic parameter is one or more of the robot posture, the landmark coordinates and the robot link error; The coordinates of the marking points are: the coordinates of the geometric features whose positions remain unchanged in the detection station; The robot link error is: the deviation between the corrected DH parameters when the robot is currently running and the corrected DH parameters when the robot is first running; When the mobile device is a guide rail, the characteristic parameter is the coordinates of the marking point; The sequence of trajectory movement of the mobile device, characteristic parameters, and conversion relationships at each measured position and posture are recorded as a set of historical data; The mobile device repeatedly runs the measurement trajectory, and stores a set of historical data each time the trajectory is run; the mobile device stops running until it reaches a thermally stable state; all historical data are summarized into a list and stored as a positioning information historical data list; The pre-calibration process is completed; When the visual measurement officially begins, the following steps are performed to obtain the conversion relationship between the visual sensor coordinate system and the global coordinate system: After the object to be measured is installed, the mobile device drives the visual sensor to run the measurement trajectory according to the set measurement trajectory. During this process, the characteristic parameter is obtained and marked as A, and a set of characteristic parameters closest to A is searched in the pre-stored positioning information historical data list; The conversion relationship in a set of historical data corresponding to the characteristic parameter is recorded as the real-time conversion relationship between the visual sensor coordinate system and the global coordinate system, thereby completing the external parameter calibration of the current visual sensor.

2. The external parameter calibration method based on the mobile device visual sensor according to claim 1, characterized in that: When the characteristic parameter is the robot posture, the characteristic parameters are obtained at a single or multiple measurement postures respectively, and the characteristic parameters at a single measurement posture are the robot end position coordinates and Euler angles, which are obtained by reading data in the robot controller.

3. The external parameter calibration method based on the mobile device visual sensor according to claim 1, characterized in that: When the characteristic parameters are the coordinates of the landmark points, they are obtained in the following manner: One or more marking points are set in advance in the inspection station; Each time the robot / guide rail runs along a trajectory, it drives the visual sensor to collect images of the landmark points and calculate the coordinates of the landmark points; The marking points are original geometric features in the detection station and artificially added geometric features, including characteristic holes, standard spheres and marking circles; The marker point coordinates are the geometric center position coordinates of the marker point.

4. The external parameter calibration method based on the mobile device visual sensor according to claim 1, characterized in that: When the characteristic parameter is the robot connecting rod error, a set of connecting rod error data is obtained before or after the robot runs the measurement track each time, which is obtained in the following way: A temperature compensation device is pre-arranged in the detection station, the temperature compensation device comprising a base, a reference rod and a reference ball connected in sequence, the base and the robot are fixedly installed on the same foundation, and the height is consistent with the height of the robot base, the reference rod is a carbon fiber rod, at least four circular marks are arranged on the surface of the reference ball, the position of the circular marks is arranged as a plane, and the centers of the circular marks are located on the same spherical surface; Before or after each measurement trajectory of the robot, the visual sensor is driven to collect images of each circular mark on the temperature compensation device from multiple positions and postures to obtain the coordinates of each circle center in the robot flange coordinate system; The equation is constructed using the center coordinates of the circle detected in real time and the center coordinates of the circle obtained from the measurement trajectory of the robot's first operation to solve the robot's connecting rod error.

5. The external parameter calibration method based on the mobile device visual sensor according to claim 4, characterized in that: The following equation is constructed using the center coordinates detected in real time and the center coordinates obtained from the robot's first running measurement trajectory. The robot link error is solved by solving multiple simultaneous equations of the center coordinates: Among them, P flange冷 Represents the center coordinates of the circle obtained by the robot for the first time, P flange热 Represents the center coordinates of the circle detected in real time, α i ,c i ,d i ,β i Respectively represent the rod torsion angle, rod length, joint distance, and joint torsion angle of the i-th joint in the robot's modified DH parameters; θ in_i is the angle of the robot’s i-th joint, θ 0_i represents the initial angle of the robot's i-th joint, i = 1, 2...N, N represents the total number of robot joints; Δα i ,Δa i ,Δd i ,Δθ i ,Δk,Δβ are the robot link errors to be solved.

6. The external parameter calibration method based on the mobile device visual sensor according to claim 1, characterized in that: When multiple characteristic parameters are obtained in a single trajectory operation, they are used as indexes to search for a set of characteristic parameters closest to the characteristic parameters in the pre-stored positioning information history data list; the specific method is: Each characteristic parameter is used as an index, and each historical characteristic parameter closest to it is searched in the historical data; Alternatively, the mean of each characteristic parameter is obtained, and at the same time, in the historical data, the average of multiple characteristic parameters in each group of data is also taken; when searching, the mean is used as an index to find the characteristic parameter in the historical data that is closest to the measured characteristic parameter.

7. The external parameter calibration method based on the mobile device visual sensor according to claim 1, characterized in that: The method of judging whether the mobile device has reached the thermally stable state is as follows: calculating the maximum difference value of the characteristic parameters among the most recently acquired 5 to 20 groups of characteristic parameters; if the maximum difference value is less than a preset threshold value A, the mobile device is judged to have reached the thermally stable state; otherwise, the mobile device has not reached the thermally stable state; The following processing is performed on the location information history data list: If there are multiple sets of historical data with completely consistent data, only one set of historical data will be retained; If the maximum difference value of the characteristic parameters in the adjacent 2 to 10 groups of characteristic parameters is less than the preset threshold value B, only the historical data corresponding to any one of the 2 to 10 groups of characteristic parameters is retained, and the other historical data is deleted; The preset threshold value A≤the preset threshold value B.

8. The external parameter calibration method based on the mobile device visual sensor according to claim 1, characterized in that: During the pre-calibration process, the transformation relationship between the visual sensor coordinate system and the global coordinate system at each measurement pose is obtained through the following steps: S1. Select one object to be tested from multiple objects of the same model and record it as a reference object to be tested; The reference object to be tested is installed in a detection station, and a plurality of feature points are set in the peripheral area of ​​the reference object to be tested and on the surface of the reference object to be tested; Use standard measuring equipment to collect coordinate information of each feature point in the global coordinate system and store them as standard coordinates; S2, the mobile device drives the visual sensor to the measurement position according to the set measurement trajectory; The visual sensor collects multiple feature point images; The coordinate information of the feature points is calculated using the collected images and stored as measured coordinates; S3, using the standard coordinates and the measured coordinates to solve the conversion relationship between the visual sensor coordinate system and the global coordinate system, and store it as the conversion relationship at the current measurement posture; S4, determining whether there are other measurement postures whose conversion relationships have not been solved. If yes, the mobile device drives the visual sensor to another measurement posture and jumps to step S2; if no, directly proceed to step S5; S5. Store the conversion relationship between the visual sensor and each measurement posture.

9. The external parameter calibration method based on the mobile device visual sensor according to claim 8, characterized in that: In step S3, the conversion relationship between the visual sensor coordinate system and the global coordinate system is solved as follows: The objective function g(R,T) is established using the standard coordinates and measured coordinates of the feature points, and then the optimization method is used to iteratively solve the corresponding transformation relationship when the objective function takes the minimum value, which is recorded as RT; Wherein, when the visual sensor is a monocular sensor, the objective function g(R,T) is: Among them, m represents the total number of feature points collected by the camera, f(R,T,M,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is converted to the image plane, M represents the camera internal parameter, (u j ,v j ) represents the pixel coordinates of the jth feature point in the image, i.e., the measured coordinates; When the visual sensor is a binocular sensor, the objective function g(R,T) is: Among them, f1(R,T,M1,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is converted to the left camera image plane, M1 represents the left camera internal parameter, (u 1j ,v 1j ) represents the pixel coordinates of the jth feature point in the left camera image; f2(R,T,R 12 ,T 12 ,M2,x j ,y j ,z j ) represents the standard coordinates (x j ,y j ,z j ) is transformed to the right camera image plane, R 12 ,T 12 They represent the rotation matrix and translation rectangle between the two cameras, M2 represents the internal parameters of the right camera, (u 2j ,v 2j ) represents the pixel coordinates of the jth feature point in the right camera image, that is, the measured coordinates.

10. The external parameter calibration method based on the mobile device visual sensor according to claim 8, characterized in that: In step S3, the method for solving the transformation relationship RT between the visual sensor coordinate system and the global coordinate system is: When the sensor is a two-dimensional sensor, the solution method is the PnP method; When the sensor is a three-dimensional sensor, the solution method is the SVD decomposition method; In step S1, the standard measuring equipment includes a photogrammetry system and a three-coordinate machine.