Calibration method, calibration system and calibration target for line structured light imaging and measurement system using the same
By moving the image of the calibration target in the Z-axis direction of the imaging sensor, and calculating the world coordinates using the homography matrix, the problems of low calibration accuracy and cumbersome operation in the prior art are solved, and efficient and accurate line structure cursor calibration is achieved.
Patent Information
- Application Number
- CN202111599517.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-12-24
AI Technical Summary
The existing linear structure cursor calibration method cannot accurately obtain the world coordinates corresponding to pixel points. Especially in welding application scenarios, the errors are large when there are many moving joints and degrees of freedom, and the calibration process is cumbersome.
By moving the imaging sensor in one direction, obtaining images of adjacent calibration teeth on the calibration target, calculating pixel coordinates and world coordinates, and using a homography matrix to achieve calibration, simplifying the calculation process, ignoring vertical coordinates, and improving accuracy.
Fast and accurate calibration is achieved, calibration accuracy and speed is improved, random errors are reduced, and operational process is simplified.
Smart Images

Figure CN114241061B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vision measurement, and more particularly to a calibration method, a calibration system, a calibration target for line structured light imaging, and a measurement system using the same. Background Art
[0002] The vision measurement technology based on line structured light is a non-contact measurement technology for three-dimensional information based on the laser triangulation measurement principle. Due to its advantages such as non-contact, low cost, small size, moderate accuracy, and simple operation, it has broad application prospects in machine vision, reverse engineering, dimensional inspection, etc. When measuring the three-dimensional information of an object using this technology, a line structured light is projected onto the surface of the object to generate a structured light contour representing the shape of the object, and an imaging system (for example, a camera) acquires image information containing the structured light contour from a certain angle. If the relative position relationship (for example, a homography matrix) between the image information and the structured light contour is known, the three-dimensional information of the object surface can be calculated from the image information, and the process of obtaining this relative position relationship is called calibration. Calibration is the most critical step for the line structured light vision measurement technology to achieve three-dimensional information measurement, and the accuracy of calibration will directly affect the accuracy of the measurement result.
[0003] In general scene camera calibration, the Zhang Zhengyou calibration method is used, and a black and white checkerboard is used as a marker for image shooting. The required specific pixel coordinates can be conveniently obtained from the image for the subsequent solution of the homography matrix and the decomposition of the internal and external parameter matrices, and finally the relationship between pixel coordinates and camera coordinates (internal parameter matrix) and the relationship between camera coordinates and world coordinates (external parameter matrix) are determined, so as to obtain the relationship between pixel coordinates and world coordinates.
[0004] However, in the scene of using line structured light, since a black and white camera is generally used and there is no other light source except the line structured light, it is impossible to clearly obtain the checkerboard picture. Therefore, the structured light is usually projected onto a toothed calibration target, and an image of the structured light contour formed by the reflection of the structured light from the target surface is obtained, so as to use image processing technology to obtain the corner points of the calibration target from the image and perform calibration calculations.
[0005] However, the existing line structured light calibration methods cannot accurately obtain the world coordinates corresponding to the pixel points. Especially in the welding application scenario, the more moving joints and degrees of freedom there are, the greater the error of the obtained world coordinates. The calibration teeth on the existing calibration target are continuously arranged, so there will be many unnecessary corner points when processing the structured light contour image, which undoubtedly increases the recognition difficulty and also reduces the recognition accuracy, thus being disadvantageous for calibration calculations. In addition, in the calibration process of the existing method, when the sensor is moved to different positions each time to measure the pixel coordinates of the target point and the corresponding world coordinates, multiple parameters need to be measured and recorded before calibration can be performed, and the operation process is relatively cumbersome.
[0006] Therefore, there is an urgent need for a new technology that can accurately, conveniently and quickly calibrate line structured light imaging. Summary of the Invention
[0007] The present invention aims to overcome the above and / or other problems in the prior art. Through the calibration method and calibration system for line structured light imaging provided by the present invention, calibration can be conveniently, quickly and accurately achieved by only moving the imaging sensor in one direction. Using the calibration target provided by the present invention for calibration can further improve the accuracy and speed of calibration. The measurement system provided by the present invention can greatly improve the measurement accuracy and speed because the above calibration system is adopted.
[0008] According to a first aspect of the present invention, there is provided a calibration method for line structured light imaging, including the following steps: a. Place a calibration target so that the arrangement direction of the calibration teeth on the calibration target is parallel to the line structured light; b. Select any adjacent pair of calibration teeth on the calibration target; c. Obtain an image of the pair of calibration teeth through an imaging sensor, and record the height of the imaging sensor in the Z-axis direction, where the Z-axis direction is the direction perpendicular to the placement plane of the calibration target, and the image includes a pair of corner points of the selected pair of calibration teeth irradiated by the line structured light, and use this pair of corner points as a pair of target points; d. Calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image, the actual distance between the pair of target points, and the recorded height; e. Move the imaging sensor to different heights N times along the Z-axis direction, and repeat steps c and d after each movement, where N≥3; and f. Calculate a homography matrix for calibrating the position relationship between the world coordinates and the pixel coordinates based on the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates obtained in steps c to e.
[0009] According to a second aspect of the present invention, there is provided a calibration system for line structured light imaging, including: a calibration target, on which a plurality of calibration teeth are provided, and the calibration target is arranged such that the arrangement direction of the plurality of calibration teeth is parallel to the line structured light; an imaging sensor, which can move in the Z-axis direction and is used to acquire an image of a selected pair of calibration teeth on the calibration target, the image includes a pair of corner points of the selected pair of calibration teeth irradiated by the line structured light, and this pair of corner points is used as a pair of target points, and the Z-axis direction is the direction perpendicular to the placement plane of the calibration target; and a calculation device, which is used to calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image, the actual distance between the pair of target points, and the height of the imaging sensor in the Z-axis direction, wherein the imaging sensor is moved to (N + 1) different heights in the Z-axis direction, and the same selected pair of calibration teeth on the calibration target is imaged after each movement to obtain (N + 1) pairs of pixel coordinates of the pair of target points, N ≥ 3, and wherein the calculation device respectively calculates (N + 1) pairs of world coordinates of the pair of target points based on the (N + 1) pairs of pixel coordinates, the actual distance between the pair of target points, and the (N + 1) different heights, and obtains a homography matrix for calibrating the position relationship between the world coordinates and the pixel coordinates based on the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
[0010] The above method and system adopt a completely new inventive concept for calibration. The data used in the calibration calculation can be easily obtained or known and fixed, so the measurement data can be obtained very conveniently, quickly and accurately, thereby greatly improving the efficiency and accuracy of calibration. At the same time, when calculating the world coordinates, the Y-axis perpendicular to the line connecting the target points can be ignored, which can simplify the calculation and reduce the introduction of random errors, further improving the efficiency and accuracy of calibration.
[0011] Preferably, the process of calculating the homography matrix based on the pixel coordinates and the corresponding world coordinates may further include: forming n combinations with the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates, Under each combination, calculating the grouped homography matrix H based on the four pairs of pixel coordinates and the corresponding four pairs of world coordinates corresponding to this combination, i = 1 to n; and averaging all the grouped homography matrices H1 to H i , i = 1 to n; and averaging all the grouped homography matrices H1 to H n to obtain the homography matrix.
[0012] Since a unique homography matrix can be calculated for each combination of 4 pairs of pixel coordinates and the corresponding 4 pairs of world coordinates (i.e., each 4 groups of measurement data), a total of A unique homography matrix. The influence of random errors on the calibration accuracy can be reduced by averaging all these homography matrices, so as to obtain a homography matrix with higher accuracy.
[0013] Preferably, the above calibration process may further include verifying the accuracy of the homography matrix and correcting it by expanding the measurement data, specifically including: comparing the world coordinates obtained through the homography matrix with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements; if the homography matrix does not meet the accuracy requirements, moving the imaging sensor to different heights along the Z-axis direction M times and performing steps c and d after each movement to obtain M pairs of new pixel coordinates and corresponding M pairs of new world coordinates, where M≥1; and calculating a new homography matrix based on the obtained M pairs of new pixel coordinates and corresponding M pairs of new world coordinates, and the original (N + 1) pairs of pixel coordinates and corresponding (N + 1) pairs of world coordinates.
[0014] The brand-new pixel coordinates can be substituted into the homography matrix to calculate the world coordinates, and compare them with the actual world coordinates corresponding to the brand-new pixel coordinates to verify the accuracy of the homography matrix. It is also possible to substitute the pixel coordinates used when previously calculating the homography matrix into the homography matrix to calculate the world coordinates, and compare them with the actual world coordinates corresponding to the pixel coordinates to verify the accuracy of the homography matrix. When the homography matrix does not meet the accuracy requirements, the amount of measurement data can be expanded, that is, obtaining one or more groups of new measurement data, and jointly calculating the homography matrix based on the new measurement data and the previously obtained measurement data to further reduce random errors, so as to obtain a homography matrix with higher accuracy.
[0015] Preferably, the above calibration process may further include verifying the accuracy of the homography matrix and correcting it by reselecting the calibration teeth, specifically including: comparing the world coordinates obtained through the homography matrix with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements; and if the homography matrix does not meet the accuracy requirements, reselecting a pair of adjacent calibration teeth on the calibration target, and performing the calibration calculation again in the same manner as before.
[0016] If the pixel distances of the corner points of the selected pair of calibration teeth in the images obtained by the imaging sensor are all very small, the differences of the obtained multiple pairs of pixel coordinates are also relatively small. When the differences between multiple groups of measurement data are relatively low, the calculated homography matrix may have poor accuracy. Therefore, when the homography matrix does not meet the accuracy requirements, a pair of adjacent calibration teeth can be reselected to make the differences between the obtained multiple pairs of pixel coordinates obvious, so as to obtain a homography matrix with higher accuracy.
[0017] Preferably, when correcting by reselecting the calibration teeth, the distance between the reselected pair of calibration teeth is greater than the distance between the previously selected pair of calibration teeth. Since the distance between the reselected calibration teeth is greater, the corresponding corner points of the calibration teeth will present a greater pixel distance in the image, making the differences between the obtained multiple sets of measurement data more obvious, so that a higher-precision homography matrix can be obtained.
[0018] The acquired image can be processed by edge point detection to extract the line structured light contour therefrom, and then the pair of corner points can be identified, specifically including: target edge point detection, outlier screening, line fitting, and corner point fitting to obtain the pair of corner points.
[0019] The acquired image can be processed by contour extraction to extract the line structured light contour therefrom, and then the pair of corner points can be identified, specifically including: contour extraction, contour point screening, line fitting, and corner point fitting to obtain the pair of corner points.
[0020] The accuracy of the identified corner points can also be verified to ensure the accuracy of the identification, specifically including: verifying whether the obtained pair of corner points meet the accuracy requirements based on empirical values. If the verification result indicates that the obtained pair of corner points do not meet the accuracy requirements, the same or another method can be used to re-screen and fit until the verification result indicates that the obtained pair of corner points meet the accuracy requirements.
[0021] The pair of corner points can also be selected from the image manually as a supplement to the above automatic acquisition of corner points.
[0022] In the above calibration system, the imaging sensor may include a camera, wherein the lens of the camera can be at an angle with the imaging plane to increase the inherent depth of field of the camera by using the Scheimpflug law, so that the camera can obtain clear images within a larger imaging distance range.
[0023] According to the third aspect of the present invention, a calibration target for line structured light imaging is further provided, including: a plurality of calibration teeth arranged in parallel on a plane, the bottom of the calibration teeth being a plane and the shape of the calibration teeth being a horizontally placed triangular prism; and a step portion between the bottoms of the respective calibration teeth, wherein the heights of the triangular cross-sections of the triangular prisms of the respective calibration teeth are all equal.
[0024] The unique design adopted by the above calibration target enables the calibration target to reflect a clearer and more easily recognizable pattern under line structured light irradiation compared with the existing calibration target, which is conducive to more quickly and accurately realizing calibration calculation in line structured light imaging.
[0025] Preferably, the distances between the upper vertices of the triangular cross-sections of the triangular prisms of every two adjacent calibration teeth of the calibration target can be different from each other, making it possible to obtain different calibration tooth spacings by selecting different adjacent calibration teeth.
[0026] According to a fourth aspect of the present invention, there is also provided a system for measurement using line structured light imaging, which includes the calibration system as described above in the present invention. Since this measurement system uses the above-mentioned calibration system to calibrate the line structured light imaging, it can accurately, conveniently, and quickly obtain the actual size and position of the target object based on the size and position of the target object in the image through the homography matrix.
[0027] According to a fifth aspect of the present invention, there is also provided a computer-readable storage medium, on which encoded instructions are recorded, and when the instructions are executed, the method according to the present invention as described above is implemented.
[0028] Through the following detailed description in conjunction with the accompanying drawings, other features and aspects of the present invention will become clearer. Description of the Drawings
[0029] By describing the exemplary embodiments of the present invention in conjunction with the accompanying drawings, the present invention can be better understood. In the drawings:
[0030] Figure 1 A flowchart showing a calibration method for line structured light imaging according to the present invention is shown;
[0031] Figure 2 The positional relationship between the calibration target and the line structured light is shown;
[0032] Figure 3 The line structured light profile formed by projecting the line structured light onto the calibration target is shown;
[0033] Figure 4 A schematic diagram showing a calibration system for line structured light imaging according to the present invention is shown;
[0034] Figure 5 A flowchart showing an implementation manner of the homography matrix calculation step in the calibration method for line structured light imaging according to the present invention is shown;
[0035] Figure 6 A flowchart showing a variant embodiment of the calibration method for line structured light imaging according to the present invention is shown;
[0036] Figure 7 A flowchart showing a variant embodiment of the calibration method for line structured light imaging according to the present invention is shown;
[0037] Figures 8a - 8cStereoscopic view, front view, and top view of an exemplary calibration target for line structured light imaging according to the present invention are respectively shown;
[0038] Figure 9 An exemplary image of the calibration target according to the present invention under line structured light irradiation parallel to the arrangement direction of the calibration teeth on the calibration target is shown; Detailed implementation manners
[0039] The present invention will be further described below in conjunction with specific embodiments and the accompanying drawings. More details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention is clearly capable of being implemented in many other ways different from this description. Those skilled in the art can make similar generalizations and deductions according to the actual application situation without departing from the spirit of the present invention. Therefore, the scope of protection of the present invention should not be limited by the content of this specific embodiment.
[0040] Unless otherwise defined, technical terms or scientific terms used in the claims and the specification should have the ordinary meaning understood by those of ordinary skill in the technical field to which the present invention pertains. The "first", "second", and similar terms used in the specification and claims of this application do not denote any order, quantity, or importance, but are only used to distinguish different components. The term "a" or "an" and the like do not denote a quantity limitation, but mean that there is at least one. The terms "comprising" or "including" and the like are intended to indicate that the elements or items appearing before "comprising" or "including" cover the elements or items listed after "comprising" or "including" and their equivalent elements, and do not exclude other elements or items.
[0041] According to an embodiment of the present invention, a calibration method for line structured light imaging is provided.
[0042] Refer to Figure 1 , which shows a flowchart of a calibration method 100 for line structured light imaging according to the present invention. The calibration method 100 includes steps 110 to 160. In step 110, a calibration target is placed such that the arrangement direction of the calibration teeth on the calibration target is parallel to the line structured light. As Figure 2As shown, there are multiple calibration teeth on the calibration target that are arranged in parallel (the arrangement direction is as shown in the figure). Since the cross-section of the calibration teeth (for example, S in the figure) is usually required, and the extension thickness of each calibration tooth itself (such as the extension thickness in the figure) does not need to be very large, generally the calibration target has a greater length in the arrangement direction of the calibration teeth, and the arrangement direction of the calibration teeth is also called the length direction of the calibration target. Because calibration needs to calculate the homography matrix that reflects the position relationship between the actual three-dimensional world coordinates and the two-dimensional pixel coordinates in the line-structured light profile image based on the positions of the target points on the calibration teeth and the corresponding points in the line-structured light profile image, it is desired that the line-structured light profile can directly reflect the actual distance between the calibration teeth, that is, the distance between the corner points A of the calibration teeth in the figure.
[0043] If there is an inclination angle α between the line-structured light and the arrangement direction of the calibration teeth, the actual distance D between two calibration tooth corner points w will not be equal to the connecting line distance D between these two corner points on the line-structured light profile 结构光 , specifically D w = D 结构光 *cosα. Therefore, it is necessary to place the calibration target so that the arrangement direction of the calibration teeth on the calibration target is parallel to the line-structured light (as Figure 2 shown, at this time α = 0°, cosα = 1), so that the actual distance between a pair of calibration tooth corner points can be equal to the distance between this pair of corner points on the line-structured light profile, that is, D w = D 结构光 .
[0044] Returning to Figure 1 , next in step 120, any adjacent pair of calibration teeth on the calibration target is selected.
[0045] Theoretically, any number and position of calibration teeth can be selected simultaneously for calibration, but it will be difficult, time-consuming, and error-prone to correlate numerous calibration teeth with the corresponding contours in the line-structured light profile image one by one. Therefore, only any adjacent pair of calibration teeth on the calibration target can be selected (for example, Figure 2 the calibration teeth a and b in the figure), so that only a pair of adjacent break points corresponding to the pair of corner points of this pair of calibration teeth need to be found in the line-structured light profile image (the break point is the turning point on the fold line in the image), thereby significantly reducing the difficulty and error rate of image recognition.
[0046] Subsequently, method 100 comes to step 130, obtains an image of the selected pair of calibration teeth through the imaging sensor, and records the height of the imaging sensor in the Z-axis direction. The image contains a pair of corner points of the selected pair of calibration teeth irradiated by the line-structured light, and this pair of corner points is used as a pair of target points.
[0047] Project the line structured light onto the calibration target to form a line structured light profile. According to the shape of the calibration teeth, this line structured light profile can present a pattern composed of line segments, broken lines, arcs, etc. Refer to Figure 4 , which shows a schematic diagram of a calibration system for line structured light imaging according to the present invention. An image sensor can be used above the calibration target to obtain an image containing a selected pair of calibration teeth, such that the line structured light profile of this pair of calibration teeth can be clearly presented in the image, as Figure 3 shown, where the inflection point B therein exactly corresponds to the corner point on the calibration tooth, that is, the target point.
[0048] Meanwhile, record the height h1 of the image sensor in the Z-axis direction. This Z-axis is perpendicular to the placement plane of the calibration target as shown in Figure 4 . For example, the height h1 can be directly read from the height adjuster (if any) of the image sensor or measured in other ways.
[0049] Return to Figure 1 . Next, in step 140, calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image, the actual distance between the pair of target points, and the recorded height.
[0050] For the convenience of describing the position of the world coordinates, usually define the X-Y plane of the world coordinate system with the plane where the calibration target is placed, and define the direction perpendicular to the X-Y plane as the Z-axis direction of the world coordinate system, as shown in Figure 4 . Figure 4 In , the arrangement direction of multiple calibration teeth is taken as the X-axis direction, and the thickness direction in which each calibration tooth extends is taken as the Y-axis direction; but actually, the arrangement direction of the calibration teeth can also be taken as the Y-axis direction, and the thickness direction in which each calibration tooth extends can be taken as the X-axis direction; or the coordinate axes can be defined in other ways.
[0051] The coordinates (two-dimensional pixel coordinates) of a pair of inflection points corresponding to the pair of target points can be obtained from the line structured light profile image obtained in step 130. The pixel coordinates corresponding to the pair of target points can be respectively represented as P l1 (x l1 ,y l1 ) and P r1 (x r1 ,y r1 ). The coordinates (three-dimensional world coordinates) of the pair of target points in the world coordinate system can be represented as P wl1 (x wl1 ,y wl1 ,z wl1 ) and P wr1 (x wr1 ,y wr1 ,z wr1 ).
[0052] As described above, since the line structured light is set to be parallel to the arrangement direction of the calibrated teeth, that is, parallel to the X axis in Figure 4 , the zero point of the Y axis can be defined as the line structured light plane, so that the Y-axis coordinates of all points in the line structured light profile are zero. Thus, the Y-axis coordinates in the world coordinates can be ignored, and only the homography matrix of the position relationship between the XOZ plane and the pixel plane needs to be established. As described above, the pixel coordinates P of the pair of target points in the image have been obtained l1 (x l1 ,y l1 ) and P r1 (x r1 ,y r1 ) and the height h1 of the imaging sensor. The actual distance D between the pair of target points w can be obtained by means such as measurement, looking up a table, or directly reading from the calibration target. On this basis, the world coordinates P of the pair of target points in the XOZ plane can be calculated wl1 (x wl1 ,z wl1 ) and P wr1 (x wr1 ,z wr1 ).
[0053] For example, the imaging sensor or the image can be rotated so that the line connecting the pair of target points in the image is parallel to the x axis of the pixel coordinate system (that is, the y coordinates of the pixel coordinates of the pair of target points are the same). Then, the x-axis distance of the pixel coordinates of the pair of target points is proportional to the X-axis distance of the world coordinates of the pair of target points, and the proportionality coefficient is the pixel unit length in the image: The center point coordinates (u0, v0) of the entire image are known, and the world coordinates of the pair of target points can be solved through the following formula:
[0054]
[0055] Returning to Figure 1 , after step 140, the method continues to step 150. In step 150, the imaging sensor is moved to a different height along the Z axis direction, and then steps 130 and 140 are executed again. This process is repeated N times, where N ≥ 3.
[0056] Through the above N repetitions, a total of (N + 1) pairs of pixel coordinates and (N + 1) pairs of world coordinates corresponding to (N + 1) different imaging sensor heights can be obtained, that is, (N + 1) sets of measurement data. Here, N needs to be at least 3. That is to say, according to the calibration method of the present invention, only 4 sets of measurement data are required to calibrate the line structured light imaging. However, obviously, the larger the value of N, the more sets of measurement data are obtained, and accordingly, a higher-precision homography matrix can be obtained.
[0057] After obtaining (N + 1) sets of measurement data, method 100 proceeds to step 160. In step 160, a homography matrix for calibrating the positional relationship between the world coordinates and the pixel coordinates is calculated based on the obtained (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
[0058] For example, when N = 3, a total of 4 pairs of pixel coordinates P l1 (x l1 ,y l1 ) ~ P l4 (x l4 ,y l4 ) and P r1 (x r1 ,y r1 ) ~ P r4 (x r4 ,y r4 ) and the corresponding 4 pairs of world coordinates on the XOZ plane P wl1 (x wl1 ,z wl1 ) ~ P wl4 (x wl4 ,z wl4 ) and P wr1 (x wr1 ,z wr1 ) ~ P wr4 (x wr4 ,z wr4 ) can be obtained.
[0059] Let the homography matrix H be:
[0060]
[0061] where or without affecting the relative relationship between the parameters. According to the definition of the homography matrix, for any point, the corresponding world coordinates on the XOZ plane are P w (x w ,z w ) and the corresponding pixel coordinates are P p (x p ,y p ), and the transformation between the world coordinates and the pixel coordinates can be expressed as: X w = HX p , where X w = [x w ,0,z w T , X p = [x p ,y p ,1]T . Simplification can yield:
[0062]
[0063] Use H’ to represent [h 11 , h 12 , h 13 , h 21 , h 22 , h 23 , h 31 , h 32 , h 33 T , then the above equation can be expressed as AH’ = 0. Select one pixel coordinate from each of the 4 pairs of pixel coordinates above, obtaining a total of 4 pixel coordinates. Then substitute the selected 4 pixel coordinates and their corresponding 4 XOZ plane world coordinates into Equation (2) above to obtain a matrix A of size 8×9. For example, select pixel coordinates P r1 (x r1 , y r1 ), P r2 (x r2 , y r2 ), P r3 (x r3 , y r3 ), P r4 (x r4 , y r4 ) and the corresponding XOZ plane world coordinates P wr1 (x wr1 , z wr1 ), P wr2 (x wr2 , z wr2 ), P wr3 (x wr3 , z wr3 ), P wr4 (x wr4 , z wr4 ) to obtain:
[0064]
[0065] Then find the singular solution of matrix A. For example, perform eigenvalue decomposition on matrix A to obtain: A = QΣQ T , where Q is an orthogonal matrix composed of eigenvectors, and Σ is a diagonal matrix composed of eigenvalues. Rearranging matrix Q can obtain H’; or other methods can also be used to solve for the parameters h 11 ~h 33 , thereby obtaining a unique homography matrix H associated with these 4 pairs of pixel coordinates and world coordinates.
[0066] In the calibration method of the prior art, after placing the calibration target and selecting the target points, the sensor is moved to different positions multiple times. After each movement, the pixel coordinates of the target points are recognized by the image and the corresponding world coordinates are measured and recorded. Only a set of measurement data of the target points can be obtained for each movement. It can be seen from this that the operation process of the existing calibration method is very cumbersome.
[0067] The above method adopts a completely new inventive concept for implementing line structured light imaging calibration. In its calibration calculation, only the height of the imaging sensor on the Z-axis needs to be measured for the data used, and the rest can be obtained from the image or are fixed and known (the pixel coordinates of the target points can be obtained from the image, and the actual distance between the target points is fixed and known). Therefore, measurement data can be obtained very conveniently, quickly, and accurately, and thus the efficiency and accuracy of calibration can be greatly improved. At the same time, the Y-axis perpendicular to the line connecting the target points can be ignored when calculating the world coordinates. Therefore, only the homography matrix of the positional relationship between the calibration pixel coordinates and the world coordinates in the XOZ plane needs to be calculated, which can simplify the calculation and reduce the introduction of random errors, thereby further improving the efficiency and accuracy of calibration.
[0068] Optionally, the step 160 may include sub-steps 1620 to 1660, as Figure 5 shown.
[0069] In sub-step 1620, the obtained (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates can be formed into n combinations. As described above, a unique homography matrix corresponding to the combination can be calculated through the combination of every 4 pairs of pixel coordinates and the corresponding 4 pairs of world coordinates (that is, every 4 sets of measurement data). Therefore, a total of unique homography matrices can be calculated for the obtained (N + 1) sets of measurement data.
[0070] In sub-step 1640, under each combination, the grouped homography matrix H i , i = 1 to n, is calculated based on the corresponding four pairs of pixel coordinates and the corresponding four pairs of world coordinates. For example, if N = 4, a total of 5 sets of measurement data are obtained. Selecting 4 sets from 5 sets of measurement data, there are different combinations, and thus 5 unique grouped homography matrices H1 to H5 can be obtained.
[0071] Next, in sub-step 1660, the average of all the grouped homography matrices H1 to H n is taken to obtain the homography matrix. Thus, the influence of random errors on the calibration accuracy can be further reduced, and a higher-precision homography matrix can be obtained.
[0072] Still taking N = 4 as an example, the average of the 5 grouped homography matrices H1 to H5 obtained above can be calculated, that is, the average of each parameter h 11 ~h 33 is calculated separately. Assume the grouped homography matrices H1 to H5 are:
[0073]
[0074] The average of each parameter h(i) jk is calculated separately:
[0075]
[0076] Thus, the homography matrix H is obtained:
[0077]
[0078] Optionally, after the calculation of the homography matrix is completed, the finally obtained homography matrix can be stored, and the stored homography matrix can be used for subsequent operations such as verification, correction, and measurement. Further, each unique grouped homography matrix obtained in step 160 can also be stored, and these grouped homography matrices can be used for subsequent operations such as correction.
[0079] Optionally, method 100 may further include steps 170 to 190 of verifying the accuracy of the homography matrix and correcting it by expanding the measurement data, as Figure 6 shown.
[0080] In step 170, the world coordinates obtained from the calculated homography matrix are compared with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements.
[0081] For example, one or more brand-new pixel coordinates can be substituted into the homography matrix to calculate the world coordinates, and the calculated world coordinates can be compared with the actual world coordinates corresponding to the one or more brand-new pixel coordinates to verify the accuracy of the homography matrix. For example, it can be determined whether the average error or the maximum error between the calculated world coordinates and the actual world coordinates exceeds a predetermined threshold. Since an approximate solution of the homography matrix is usually obtained in matrix solving for the sake of simplifying the operation, even if the pixel coordinates used for calculating the homography matrix are substituted back into the homography matrix, the obtained world coordinates are different from the actual world coordinates corresponding to the pixel coordinates. Therefore, one or more pixel coordinates (such as the pixel coordinates obtained in step 130) used for calculating the homography matrix previously can also be substituted into the homography matrix to calculate the world coordinates, and the calculated world coordinates can be compared with the actual world coordinates corresponding to the one or more pixel coordinates to verify the accuracy of the homography matrix. For example, it can be determined whether the average error or the maximum error between the calculated world coordinates and the actual world coordinates exceeds a predetermined threshold.
[0082] If the verification result indicates that the homography matrix does not meet the accuracy requirements, method 100 proceeds to step 180: move the imaging sensor to different heights along the Z-axis direction M times (M ≥ 1), and after each movement, use the imaging sensor to acquire images of a previously selected pair of calibration teeth, record the height of the imaging sensor, obtain a pair of target points corresponding to the corner points of the calibration teeth from the images, and calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image, the actual distance between the pair of target points, and the recorded height, so as to obtain M pairs of new pixel coordinates and the corresponding M pairs of new world coordinates. For example, if M = 1, the imaging sensor is moved to a different height along the Z-axis direction, and then a pair of new pixel coordinates and the corresponding pair of new world coordinates are obtained.
[0083] Then, in step 190, based on the obtained M pairs of new pixel coordinates and the corresponding M pairs of new world coordinates, as well as the original (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates, a new homography matrix is calculated. Still taking the case of N = 4 and M = 1 as an example, after step 180, a total of (N + 1 + M) = 6 sets of measurement data can be obtained, from which unique grouped homography matrices can be recalculated. By obtaining these increased numbers of grouped homography matrices, the random error can be further reduced, thereby improving the accuracy of the obtained homography matrix.
[0084] In actual operation, after step 190, it can also be returned to step 170 again for verification as needed and corrected by expanding the measurement data when necessary. The number of such loops can be set as needed, or it can be looped until the requirements are met.
[0085] Optionally, method 100 may further include steps 170' to 180' of verifying the accuracy of the homography matrix and correcting it by reselecting the calibration teeth, as Figure 7 shown.
[0086] Step 170' is the same as the aforementioned step 170, that is, comparing the world coordinates obtained from the calculated homography matrix with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements, which will not be elaborated here.
[0087] If the verification result indicates that the homography matrix does not meet the accuracy requirements, method 100 proceeds to step 180': reselect a pair of adjacent calibration teeth on the calibration target; and then re-execute the calibration process of steps 130 to 160.
[0088] For example, if the previously selected Figure 2 calibration teeth a and b, and the verification result indicates that the calculated homography matrix does not meet the accuracy requirements, then calibration tooth a or b can be retained, and another calibration tooth c or d adjacent to calibration tooth a or b in Figure 2 can be reselected to form a new pair of calibration teeth; of course, a completely new pair of adjacent calibration teeth can also be selected, such as Figure 2 calibration teeth d and e in.
[0089] By reselecting a pair of calibration teeth and performing calibration again as described above, the homography matrix obtained from calibration that does not meet the accuracy requirements can be corrected in a timely manner, thereby further improving the accuracy of the homography matrix.
[0090] Similarly, in actual operation, after the first correction, it can also be returned to step 170' again for verification according to needs and corrected again by reselecting a pair of calibration teeth when necessary. The number of such cycles can be set according to needs, or it can be looped continuously until the requirements are met as shown in Figure 7 .
[0091] Optionally, the distance between the corner points of the reselected pair of calibration teeth can be greater than the distance between the corner points of the previously selected pair of calibration teeth.
[0092] If the pixel distances of the corner points of the selected pair of calibration teeth in each image obtained by moving the imaging sensor are very small, the differences between the obtained multiple pairs of pixel coordinates will also be relatively small. However, when the differences between multiple sets of measurement data are low, the accuracy of the calculated homography matrix may also decrease. Therefore, in order to further improve the accuracy of the homography matrix, a pair of adjacent calibration teeth with a larger corner point spacing can be reselected (for example, if the previously selected Figure 2 calibration teeth a and b, when reselecting, Figure 2Calibration teeth d and e with a larger middle corner point spacing are used to make the differences between the obtained multiple pairs of pixel coordinates more obvious, so as to obtain a homography matrix with higher precision.
[0093] Optionally, in step 130, preprocessing of the acquired image may be included. The preprocessing may include graying the image to convert it into a grayscale picture, then performing filtering processing on the grayscale picture, and then obtaining a binary image through a threshold method according to the image features. The filtering function used for the filtering processing may be, for example, a Gaussian smoothing function, a median filtering function, etc. The threshold method may also include various types, such as the OSTU method, the fixed threshold method, the adaptive threshold method, etc. In addition, image enhancement processing, etc. may also be added.
[0094] Optionally, in step 130, it may include: target edge point detection, outlier screening, line fitting, and corner fitting.
[0095] First, the acquired image is processed by means of edge point detection to extract the line structured light contour. For example, based on the first-order and second-order derivatives of the image intensity, the sobel operator or the canny operator or other methods can be used to detect edge points.
[0096] Then, the boundary points of the image can be removed from the detected edge points first, because the image boundary points do not contribute to the line structured light contour. Since only a part of the obtained edge points may correspond to the line structured light contour, outlier screening is required to screen out the line structured light contour in the edge points. Outlier screening is to remove the edge points that do not belong to the line structured light contour based on certain screening conditions to finally screen out the line structured light contour. For example, if there are no other edge points within a circular range with a radius of r near an edge point, then this edge point can be removed as an outlier, where the radius r can be set according to experience.
[0097] Next, line fitting and corner fitting can be performed on the screened edge points, so as to identify the pair of corner points on the calibration target illuminated by the line structured light in the image. For example, the image can be segmented according to the screened line structured light contour, so that there is a segment of the line structured light contour in each segmented part of the image, and then the least squares method or other methods are used to perform line fitting on each segmented part of the image, and the pair of corner points are identified according to whether the obtained line segments intersect, the slope of the line segments, etc. Alternatively, all the corner points in the line structured light contour can also be directly detected by calculating the curvature and gradient of the edge points, etc., and then the pair of corner points are screened out.
[0098] Optionally, in step 130, it may include: contour extraction, contour point screening, line fitting, and corner fitting.
[0099] First, process the acquired image by contour extraction to extract the line structured light contour. Any contour extraction algorithm can be used for contour extraction to obtain the contours in the image.
[0100] Since multiple (point - composed) contours may be extracted from the image, and only one of them corresponds to the line structured light contour, it is necessary to screen out the contour points that truly correspond to the line structured light contour. The contour point screening is to eliminate the contours that do not belong to the line structured light contour according to certain screening criteria, and the criteria include contour length, whether the contour is closed, etc.
[0101] Similarly, the screened contours can be linearly fitted and corner - fitted as described above to obtain the pair of corner points, which will not be elaborated here.
[0102] Optionally, after obtaining the pair of corner points in the above - mentioned manner, the accuracy of the identified corner points can be further verified to ensure the accuracy of the identification. For example, the parameters of the obtained pair of corner points can be compared with empirical values. The empirical values used can include, for example, the pixel width of structured light imaging (the width range where the fitted line and corner points are located, such as Figure 3 the white area range shown), the linear fitting score (scoring the accuracy of linear fitting), and the empirical values judged by humans, etc. If the verification result indicates that the difference between the parameters of the obtained pair of corner points and the empirical values exceeds the accuracy permission range, it means that the corner points in the identified image may not truly correspond to the actually selected corner points. At this time, the screening and fitting can be performed again through the above - mentioned methods (the method of target edge point detection and outlier screening or the method of contour extraction and contour screening) until the verification result indicates that the difference between the parameters of the obtained pair of corner points and the empirical values is within the accuracy permission range.
[0103] Alternatively or additionally, in step 130, it may include manually selecting (such as by mouse clicking) the pair of corner points from the image via a graphical user interface as a supplement to the above - mentioned automatic acquisition of corner points.
[0104] Optionally, in step 110, when placing the calibration target, the line structured light can be projected onto the calibration target near the edge. This makes it easier to accurately align the direction of the line structured light with the arrangement direction of the calibration teeth to facilitate making the arrangement direction of the calibration teeth parallel to the line structured light, thus meeting the above - mentioned condition of ignoring the Y - axis of the world coordinate, and at the same time making the line structured light contour on the calibration teeth clearer and easier to identify.
[0105] Optionally, the imaging sensor can be equipped with a height adjuster, which can adjust the height of the imaging sensor in the Z - axis direction and keep the imaging sensor at the desired height. As described above, the height of the imaging sensor can be directly read from the height adjuster.
[0106] So far, a calibration method for line structured light imaging according to the present invention has been described. Compared with the prior art which has problems such as difficulty in obtaining accurate world coordinates, difficulty in accurately identifying target points on the calibration target, and cumbersome operation in the calibration process, the calibration method of the present invention can ignore the Y-axis coordinate when calculating the world coordinate, and at the same time, the X-axis coordinate is easy to obtain. Therefore, only by collecting the imaging sensor at different heights in the Z-axis direction, the world coordinate can be obtained conveniently, quickly and more accurately, which greatly simplifies the calibration process and can conveniently obtain a higher-precision homography matrix. Moreover, according to the calibration method of the present invention, the measurement data of two target points can be obtained each time data is collected (only one in the traditional method), which greatly shortens the time required for calibration. In addition, the calibration method of the present invention can make the line structured light profile on the calibration teeth clearer, thus facilitating the accurate identification of target points and being beneficial to obtaining a high-precision homography matrix.
[0107] The following table respectively shows the comparison of the average error and the maximum error of the homography matrix obtained by calibration using the traditional calibration method and the calibration method of the present invention:
[0108] Table 1 Average error (cm)
[0109] Calibration method X-axis Y-axis Z-axis Traditional method 0.051 0.045 0.639 The present invention 0.01 0 0.02
[0110] Table 2 Maximum error (cm)
[0111] Calibration method X-axis Y-axis Z-axis Traditional method 0.297 0.143 2.196 The present invention 0.03 0 0.06
[0112] As described above, since the calibration method of the present invention can ignore the Y-axis coordinate, the Y-axis error is 0. As shown in Table 1 and Table 2, in terms of both the maximum error and the average error, the error of the calibration method of the present invention is at least one order of magnitude lower than that of the traditional method. It can be seen that the accuracy of the calibration method of the present invention is significantly better than that of the traditional calibration method.
[0113] According to an embodiment of the present invention, there is also provided a computer-readable storage medium on which encoded instructions are recorded, and when the instructions are executed, the above-mentioned calibration method for line structured light imaging can be implemented. The computer-readable storage medium may include a hard disk drive, a floppy disk drive, a CD read / write (CD-R / W) drive, a digital versatile disk (DVD) drive, a flash drive, and / or a solid-state storage device, etc. For example, it may be an STM32F405 chip.
[0114] According to an embodiment of the present invention, there is also provided a calibration target for line structured light imaging.
[0115] Reference Figures 8a - 8c, which respectively shows a perspective view, a front view and a top view of an exemplary calibration target 800 for line structured light imaging according to the present invention. The calibration target 800 may include a plurality of calibration teeth 810 arranged in parallel on a plane. The bottom of the calibration tooth 810 is a plane and the shape of the calibration tooth is a triangular prism placed horizontally. Refer to Figure 8b , there may be a stepped portion 820 between the bottoms of the respective calibration teeth 810. The heights of the triangular cross-sections of the triangular prisms of the respective calibration teeth 810 are all equal.
[0116] The calibration teeth of the existing calibration target are continuously arranged, and there is no gap such as a stepped portion between the calibration teeth. Therefore, a fold angle will be formed between adjacent calibration teeth. So, the line structured light profile presented under the irradiation of line structured light will be a continuous broken line, in which there are many unnecessary fold angles, which brings great difficulties to recognition.
[0117] However, the unique design adopted by the calibration target 800 of the present invention enables it to present a clearer and more easily recognizable pattern than the existing calibration target under the irradiation of line structured light (as will be described below in conjunction with Figure 9 ), which is conducive to more rapid and accurate implementation of calibration calculation in line structured light imaging.
[0118] Refer to Figure 9 , which shows a line structured light profile image of the calibration target under the irradiation of line structured light parallel to the arrangement direction of the calibration teeth on the calibration target according to the present invention. As shown in the figure, in the line structured light profile, the stepped portion 920 clearly separates two adjacent calibration teeth 910a, 910b. At the same time, since the stepped portion 920 is recessed downward, only the corner points 912a, 912b of the adjacent calibration teeth 910a, 910b exist in the image, and the stepped portion 920 will not generate additional corner points in the image. Thus, the difficulty and error rate of corner point recognition can be greatly reduced.
[0119] Optionally, the adjacent inclined surfaces of adjacent calibration teeth 810 may be symmetric, so that the line structured light profile of the adjacent inclined surfaces is also symmetric, which is more conducive to the recognition of the line structured light profile.
[0120] Optionally, the distance D between the upper vertices (i.e., the corner points of the calibration teeth) of the triangular cross-sections of the triangular prisms of every two adjacent calibration teeth 810 of the calibration target 800 w may be different from each other. For example, as Figures 8b - 8c shown, the distance D between the upper vertices 812a, 812b of the calibration teeth 810a, 810b w1 may be different from the distance D between the upper vertices 812b, 812c of the calibration teeth 810b, 810c w2 . This enables different calibration tooth distances to be obtained by selecting different adjacent calibration teeth, so as to facilitate the selection of a pair of adjacent calibration teeth with a suitable distance during calibration.
[0121] Optionally, the calibration tooth distance can be marked on the calibration target or directly obtained by methods such as looking up a table, so that the measurement step can be omitted and the random error that may be introduced by the distance measurement can be reduced or even eliminated.
[0122] According to an embodiment of the present invention, a calibration system for line structured light imaging is also provided accordingly.
[0123] Reference Figure 4 , which shows a calibration system 400 for line structured light imaging according to the present invention, including a calibration target 410, an imaging sensor 420, and a computing device 430 (e.g., a computer).
[0124] A plurality of calibration teeth 412 are provided on the calibration target 410, such as Figure 4 the calibration teeth 412a, 412b in , and the calibration target 410 is arranged such that the arrangement direction of the calibration teeth 412 is parallel to the line structured light 402.
[0125] The imaging sensor 420 can move in the Z-axis direction perpendicular to the placement plane of the calibration target 410, for acquiring an image 422 of a pair of calibration teeth (e.g., calibration teeth 412a, 412b) selected on the calibration target 410. The image 422 includes a pair of corner points (e.g., corner points 414a, 414b) where the pair of calibration teeth are respectively irradiated by the line structured light 402, and this pair of corner points is used as a pair of target points. Although in Figure 4 , the image 422 only includes the coordinate axes xoy, it should be understood that this is for the convenience of explaining the pixel coordinates of the image. In fact, the image 422 presents an image including a pair of corner points of a pair of calibration teeth irradiated by the line structured light 402 (e.g., Figure 9 the line structured light profile image shown).
[0126] The computing device 430 is used to calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image 422, the actual distance D between the pair of target points w and the height of the imaging sensor 420 in the Z-axis direction. Move the imaging sensor 420 to (N + 1) different heights in the Z-axis direction, and image the same pair of calibration teeth selected on the calibration target 410 after each movement to obtain (N + 1) pairs of pixel coordinates of the pair of target points, N ≥ 3. The computing device 430 respectively calculates based on the (N + 1) pairs of pixel coordinates, the actual distance D between the pair of target points wAnd corresponding (N + 1) pairs of world coordinates of the pair of target points are calculated based on the (N + 1) different heights, and a homography matrix for calibrating the positional relationship between the world coordinates and the pixel coordinates is obtained based on the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
[0127] Optionally, the imaging sensor 420 may include a camera (not shown in the figure). Since the inherent depth of field of the camera itself may be relatively shallow, the lens of the camera can be angled with respect to the imaging plane to increase the inherent depth of field of the camera by using the Scheimpflug's law, so that the camera can obtain clear images within a larger imaging distance range.
[0128] Optionally, the imaging sensor 420 may be equipped with a height adjuster, which can adjust the height of the imaging sensor 420 in the Z-axis direction and hold the imaging sensor 420 at a desired height. As described above, the height of the imaging sensor 420 can be directly read from the height adjuster.
[0129] Optionally, the computing device 430 can form n combinations with the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates. Under each combination, a grouped homography matrix H is calculated based on the four pairs of pixel coordinates and the corresponding four pairs of world coordinates corresponding to the combination, where i = 1 to n. The average of all the grouped homography matrices H1 to H is taken to obtain the homography matrix. i n Take the average to obtain the homography matrix.
[0130] Optionally, the calibration system 400 may further include a verification unit, which is used to compare the world coordinates obtained through the homography matrix with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements. If the homography matrix does not meet the accuracy requirements, the imaging sensor 420 is moved to M different heights in the Z-axis direction and the same pair of calibration teeth selected on the calibration target 410 is imaged after each movement to obtain M pairs of new pixel coordinates, where M ≥ 1. The computing device 430 calculates M pairs of new world coordinates of the pair of target points respectively based on the M pairs of pixel coordinates, the actual distance between the pair of target points, and the M different heights, and calculates a new homography matrix based on the obtained M pairs of new pixel coordinates and the corresponding M pairs of new world coordinates, as well as the original (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
[0131] Optionally, if it is found after verification and comparison that the homography matrix does not meet the accuracy requirements, the above verification unit may also re-select an adjacent pair of calibration teeth on the calibration target 410 and obtain a new homography matrix through the imaging sensor 420 and the computing device 430.
[0132] Optionally, the verification unit may repeat the above operations until the homography matrix meets the accuracy requirements. For example, after obtaining a new homography matrix, verification may also be performed again as needed, and the homography matrix may be obtained again by augmenting the measurement data or reselecting the calibration teeth as needed.
[0133] Optionally, the distance between the corner points of the reselected pair of calibration teeth may be greater than the distance between the corner points of the previously selected pair of calibration teeth.
[0134] Optionally, the calibration system 400 may further include an image processing device, which is configured to obtain the pair of corner points through target edge point detection, outlier screening, line fitting, and corner fitting.
[0135] Optionally, the above image processing device may also be configured to obtain the pair of corner points through contour extraction, contour point screening, line fitting, and corner fitting.
[0136] Optionally, the image processing device may be further configured to verify whether the obtained pair of corner points meet the accuracy requirements based on empirical values. If the verification result indicates that the obtained pair of corner points do not meet the accuracy requirements, rescreening and refitting are performed until the verification result indicates that the obtained pair of corner points meet the accuracy requirements.
[0137] Optionally, the pair of corner points may also be selected from the image manually, for example, via a graphical user interface (e.g., by clicking with a mouse).
[0138] The above calibration system 400 may implement the calibration method for line structured light imaging according to the present invention as described above. Many design concepts and details in the above method according to the present invention are equally applicable to the above calibration system 400, and the same beneficial technical effects can be obtained, which will not be elaborated here.
[0139] According to an embodiment of the present invention, there is also provided a system for measurement using line structured light imaging, which includes the calibration system according to the present invention as described above. When imaging a target object through an imaging sensor, the actual size and position of the target object can be obtained based on the size and position of the target object in the image and the homography matrix calibrated by the calibration system. This measurement system uses the above calibration system to calibrate line structured light imaging, and thus can complete calibration quickly and accurately, and then can use the obtained homography matrix to obtain parameters such as high-precision object position and object size.
[0140] The various aspects of the present invention have been described above by way of some exemplary embodiments. However, it should be understood that various modifications can be made to the above exemplary embodiments without departing from the spirit and scope of the present invention. For example, appropriate results can also be achieved if the described methods are executed in a different order and / or if the components in the described systems, architectures, devices or apparatuses are combined in a different manner and / or replaced or supplemented by other components or their equivalents, and accordingly, these other modified embodiments also fall within the scope of protection of the claims.
Claims
1. A calibration method for line structured light imaging, comprising the following steps: a. Place a calibration target so that the arrangement direction of the calibration teeth on the calibration target is parallel to the line structured light; b. Select any adjacent pair of calibration teeth on the calibration target; c. Obtain an image of the pair of calibration teeth through an imaging sensor, and record the height of the imaging sensor in the Z-axis direction, where the Z-axis direction is perpendicular to the placement plane of the calibration target. The image includes a pair of corner points of the selected pair of calibration teeth irradiated by the line structured light, and use this pair of corner points as a pair of target points; d. Calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image, the actual distance between the pair of target points, and the recorded height; e. Move the imaging sensor to different heights along the Z-axis direction N times, and perform steps c and d again after each movement, where N≥3; and f. Calculate a homography matrix for calibrating the positional relationship between the world coordinates and the pixel coordinates based on the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates obtained in steps c to e; 2. The calibration method according to claim 1, wherein Step c includes target edge point detection, outlier screening, line fitting, and corner fitting to obtain the pair of corner points; or Step c includes contour extraction, contour point screening, line fitting, and corner fitting to obtain the pair of corner points.
3. The calibration method according to claim 2, characterized in that Step c further includes: Verifying whether the obtained pair of corner points meet the accuracy requirements based on empirical values; and If the verification result indicates that the obtained pair of corner points do not meet the accuracy requirements, re-screen and fit until the verification result indicates that the obtained pair of corner points meet the accuracy requirements.
4. The calibration method according to claim 1, characterized in that, Step c includes manually selecting the pair of corner points.
5. The calibration method according to claim 1, wherein Step f further includes: f1. Form n combinations with the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates, where n = ; f2. Under each combination, calculate the grouped homography matrix H based on the four pairs of pixel coordinates and the corresponding four pairs of world coordinates corresponding to this combination i , i = 1~n; and f3. For all the group homography matrices H1 to H n Find the average to obtain the homography matrix.
6. The calibration method according to any one of claims 1 to 5, further comprising the following steps: g. Compare the world coordinates obtained through the homography matrix with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements; h. If the homography matrix does not meet the accuracy requirements, move the imaging sensor to different heights along the Z-axis direction M times and perform steps c and d after each movement to obtain M pairs of new pixel coordinates and the corresponding M pairs of new world coordinates, where M≥1; and i. Calculate a new homography matrix based on the obtained M pairs of new pixel coordinates and the corresponding M pairs of new world coordinates, and the original (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
7. The calibration method according to any one of claims 1 to 5, further comprising the following steps: g’. Compare the world coordinates obtained through the homography matrix with the actual world coordinates to verify whether the homography matrix meets the accuracy requirements; and h’. If the homography matrix does not meet the accuracy requirements, re-select an adjacent pair of calibration teeth on the calibration target and perform steps c to f again.
8. The calibration method according to claim 7, wherein, The distance between the newly selected pair of calibration teeth is greater than the distance between the pair of calibration teeth selected in step b.
9. A calibration target for the calibration method according to any one of claims 1 to 8, comprising: a plurality of calibration teeth arranged in parallel on a plane, the bottom of the calibration tooth being a plane and the shape of the calibration tooth being a triangular prism placed horizontally; and a stepped portion between the bottoms of the respective calibration teeth, wherein the heights of the triangular cross-sections of the triangular prisms of the respective calibration teeth are all equal.
10. The calibration target according to claim 9, characterized in that, The distances between the upper vertices of the triangular cross-sections of the triangular prisms of every two adjacent calibration teeth are different from each other.
11. A calibration system for line structured light imaging, comprising: a calibration target, on which a plurality of calibration teeth are provided, the calibration target being arranged such that the arrangement direction of the plurality of calibration teeth is parallel to the line structured light; an imaging sensor, which can move in the Z-axis direction and is used to acquire an image of a pair of selected calibration teeth on the calibration target, the image including a pair of corner points of the selected calibration teeth irradiated by the line structured light, and taking the pair of corner points as a pair of target points, the Z-axis direction being the direction perpendicular to the placement plane of the calibration target; and a calculation device, configured to calculate the world coordinates of the pair of target points based on the pixel coordinates of the pair of target points in the image, the actual distance between the pair of target points, and the height of the imaging sensor in the Z-axis direction, wherein the imaging sensor is moved along the Z-axis direction to (N + 1) different heights, and the same pair of selected calibration teeth on the calibration target is imaged after each movement to obtain (N + 1) pairs of pixel coordinates of the pair of target points, N≥3, and wherein the calculation device respectively calculates the corresponding (N + 1) pairs of world coordinates of the pair of target points based on the (N + 1) pairs of pixel coordinates, the actual distance between the pair of target points, and the (N + 1) different heights, and obtains a homography matrix for calibrating the position relationship between the world coordinates and the pixel coordinates based on the (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
12. The calibration system according to claim 11, further comprising: an image processing device, configured to obtain the pair of corner points through target edge point detection, outlier screening, line fitting, and corner fitting; or an image processing device, configured to obtain the pair of corner points through contour extraction, contour point screening, line fitting, and corner fitting.
13. The calibration system according to claim 12, wherein The image processing device is further configured to: verify whether the obtained pair of corner points meets the accuracy requirements based on empirical values; and if the verification result indicates that the obtained pair of corner points does not meet the accuracy requirements, re-screen and fit until the verification result indicates that the obtained pair of corner points meets the accuracy requirements.
14. The calibration system according to claim 11, wherein The imaging sensor includes a camera, wherein the lens of the camera forms an angle with the imaging surface.
15. The calibration system according to claim 11, wherein The calculation device is further configured to: Form n combinations with the described (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates, where n = ; Under each combination, a grouped homography matrix H is calculated based on the four pairs of pixel coordinates and the corresponding four pairs of world coordinates corresponding to this combination i , where i = 1~n; and For all the homography matrices H1 to H of the groups n Take the average to obtain the homography matrix.
16. The calibration system according to any one of claims 11 to 15, further comprising: A verification unit, configured to compare the world coordinates obtained through the homography matrix with the actual world coordinates, so as to verify whether the homography matrix meets the accuracy requirements. Wherein, if the homography matrix does not meet the accuracy requirements, the imaging sensor is moved along the Z-axis direction to M different heights, and the same pair of calibrated teeth selected on the calibration target is imaged after each movement, so as to obtain M pairs of new pixel coordinates, M≥1, and Wherein, the computing device respectively calculates M pairs of new world coordinates of the pair of target points based on the M pairs of pixel coordinates, the actual distance between the pair of target points, and the M different heights, and calculates a new homography matrix based on the obtained M pairs of new pixel coordinates and the corresponding M pairs of new world coordinates, as well as the original (N + 1) pairs of pixel coordinates and the corresponding (N + 1) pairs of world coordinates.
17. The calibration system according to any one of claims 11 to 15, further comprising: A verification unit, configured to compare the world coordinates obtained through the homography matrix with the actual world coordinates, so as to verify whether the homography matrix meets the accuracy requirements. Wherein, if the homography matrix does not meet the accuracy requirements, a pair of adjacent calibrated teeth on the calibration target is reselected, and a new homography matrix is obtained through the imaging sensor and the computing device.
18. The calibration system according to claim 17, characterized in that, The distance between the reselected pair of calibrated teeth is greater than the distance between the originally selected pair of calibrated teeth.
19. A system for measurement using line structured light imaging, which includes the calibration system described in any one of claims 11-18, wherein, When the imaging sensor images the target object, the actual size and position of the target object are obtained based on the size and position of the target object in the image and the homography matrix.
20. A computer-readable storage medium, on which encoded instructions are recorded, and when the instructions are executed, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Quick calibration device and quick calibration method
CN109990698A