Workpiece thickness detection method
The detection device, built using an area array camera and a line laser, calculates camera parameters and acquires point cloud information on the workpiece surface, solving the problems of robustness and low accuracy in traditional detection methods and achieving real-time high-precision detection of workpiece thickness.
Patent Information
- Application Number
- CN202510945849.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional workpiece thickness detection methods have poor robustness, low detection accuracy, and can damage the workpiece, making it difficult to perform high-precision detection under workpiece vibration or tilt conditions.
A detection device was built using two area array cameras and four line lasers. By calculating the internal and external parameters of the cameras and combining them with the laser line images, point cloud information of the upper and lower surfaces of the workpiece was obtained, and three-dimensional fitting was performed to calculate the thickness.
It enables non-contact, real-time, high-precision thickness detection of vibrating or tilted workpieces, improving the robustness and accuracy of the detection and avoiding damage to the workpiece.
Smart Images

Figure CN120991726A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of workpiece detection, and in particular to a workpiece thickness detection method. BACKGROUND
[0002] In the mechanical industry production and manufacturing, in order to ensure the reliability and stability of the workpiece thickness tolerance, the processing and detection of the workpiece have very strict standards. Therefore, the high-precision thickness detection of the workpiece can effectively avoid the economic loss that may be caused in the industrial production process. The traditional detection method is a contact measurement method, which is simple and practical, but has low detection efficiency, weak resistance to workpiece inclination, low detection precision, high cost and damage to the workpiece. SUMMARY
[0003] To solve the above problems, the present application provides a workpiece thickness detection method to solve the problems of poor robustness and low detection precision of the existing traditional technology, specifically including:
[0004] A workpiece thickness detection method, comprising:
[0005] S1, a workpiece thickness detection device is built, the workpiece thickness detection device includes two area array cameras, four linear lasers and a calibration plate, wherein one camera and two linear lasers are used to detect the upper surface of the workpiece, and the other camera and the other two linear lasers are used to detect the lower surface of the workpiece;
[0006] S2, the internal and external parameters of the two area array cameras are calculated;
[0007] The laser is projected on the calibration plate, and the calibration plate is moved in multiple spaces, and the laser line images of the four linear lasers on the calibration plate are captured by the two area array cameras respectively;
[0008] S3, based on the laser line images, the internal and external parameters of the two area array cameras, the upper and lower surface point cloud information of the workpiece is obtained;
[0009] S4, three-dimensional fitting is performed according to the upper and lower surface point cloud information of the workpiece, the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece are obtained, and the workpiece thickness is obtained based on the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece.
[0010] Optionally, the workpiece thickness detection device in S1 comprises:
[0011] Two area array cameras are installed at 90° to each other on the upper and lower sides of the workpiece, and the two area array cameras are installed on a vertical surface, and the vertical surface is perpendicular to the horizontal surface;
[0012] Four line lasers are symmetrically arranged above and below, and each area array camera is equipped with two line lasers, and the area array camera is installed between the two line lasers on the same height side;
[0013] The intersection of the laser lines emitted by the two line lasers arranged above the workpiece is projected on the upper surface of the workpiece, the intersection of the laser lines emitted by the two line lasers arranged below the workpiece is projected on the lower surface of the workpiece, and the area array camera on the same height side observes the line laser on the same height side.
[0014] Optionally, the workpiece thickness detection device in S1 further comprises:
[0015] The included angle between the area array camera and the line laser on the same height side is α, and α ∈ [35°, 90°];
[0016] The included angle between the two line lasers on the same height side is β, and β ∈ [25°, 90°].
[0017] Optionally, the workpiece thickness detection device in S1 further comprises:
[0018] When calibrating the upper surface of the workpiece, the calibration plate is arranged between the area array camera above the workpiece and the upper surface of the workpiece, the calibration plate is supported to move up and down, and the calibration surface of the calibration plate and the upper surface of the workpiece are arranged in parallel;
[0019] When calibrating the upper surface of the workpiece, the calibration plate is arranged between the area array camera below the workpiece and the lower surface of the workpiece, the calibration plate is supported to move up and down, and the calibration surface of the calibration plate and the lower surface of the workpiece are arranged in parallel.
[0020] Optionally, the S2 calculates the internal parameters and external parameters of the two area array cameras;
[0021] A plurality of calibration plate images are taken from different angles, feature points in the plurality of calibration plate images are detected, and the internal parameters Mi and external parameters [Ri|Ti] of the corresponding area array camera are inversely solved by using the spatial coordinates [Xw, Yw, Zw] and image coordinates [u, v] of the feature points in the plurality of calibration plate images;
[0022] The calculation formula of the internal parameters Mi and external parameters [Ri|Ti] of the area array camera is formula (1):
[0023]
[0024] When Mi is M1, M1 is the internal parameter of the area array camera arranged above the workpiece; when Mi is M2, M2 is the internal parameter of the area array camera arranged below the workpiece.
[0025] [Ri|Ti] is the external parameter of the area array camera arranged above the workpiece when [Ri|Ti] is [R1|T1], and [R2|T2] is the external parameter of the area array camera arranged below the workpiece when [Ri|Ti] is [R2|T2].
[0026] Optionally, in S2, the laser is projected on the calibration plate and the calibration plate is moved in multiple spaces, and the laser line images of the four linear lasers on the calibration plate are captured by two area array cameras respectively:
[0027] When the laser line images of the two linear lasers above the workpiece on the calibration plate are captured, the calibration plate is moved multiple times between the area array camera above the workpiece and the upper surface of the workpiece, and the laser line images of the calibration plate after position transformation are captured by the area array camera on the same height side multiple times;
[0028] When the laser line images of the two linear lasers below the workpiece on the calibration plate are captured, the calibration plate is moved multiple times between the area array camera below the workpiece and the lower surface of the workpiece, and the laser line images of the calibration plate after position transformation are captured by the area array camera on the same height side multiple times.
[0029] Optionally, in S3, the upper and lower surface point cloud information of the workpiece is obtained based on the laser line images, the internal parameters and the external parameters of the two area array cameras, which comprises:
[0030] S301, obtaining the laser plane equation of each linear laser based on the laser line images of the four linear lasers on the calibration plate;
[0031] S302, performing gray scale calculation on the two laser line images captured by the two area array cameras respectively by a laser line center extraction algorithm to obtain the image polar coordinates of each laser line center point;
[0032] S303, obtaining the X-axis coordinate parameter and the Y-axis coordinate parameter in the spatial coordinates of the two laser line center points above the workpiece by the internal parameters of the area array camera arranged above the workpiece, the external parameters of the area array camera and the image polar coordinates of the two laser line center points above the workpiece;
[0033] obtaining the X-axis coordinate parameter and the Y-axis coordinate parameter in the spatial coordinates of the two laser line center points below the workpiece by the internal parameters of the area array camera arranged below the workpiece, the external parameters of the area array camera and the image polar coordinates of the two laser line center points below the workpiece;
[0034] S304, obtaining the Z-axis coordinate parameter in the spatial coordinates of the four laser line center points based on the laser plane equation of each linear laser and the image polar coordinates of the four laser line center points;
[0035] S305, integrate the X-axis coordinate parameter and the Y-axis coordinate parameter of each laser line center point in step S303, and the Y-axis coordinate parameter of each laser line center point in step S304, to obtain the upper and lower surface point cloud information of the workpiece.
[0036] Optionally, the three-dimensional fitting according to the upper and lower surface point cloud information of the workpiece in S4 obtains an upper surface plane equation of the workpiece and a lower surface plane equation of the workpiece, and the workpiece thickness is obtained based on the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece, including:
[0037] S401, obtaining a spatial plane expression of the upper surface of the workpiece according to the point cloud information of the upper surface of the workpiece and a three-dimensional plane fitting algorithm, and obtaining a spatial plane expression of the lower surface of the workpiece according to the point cloud information of the lower surface of the workpiece and the three-dimensional plane fitting algorithm;
[0038] S402, calculating the distance from each point on each laser line to another plane based on the spatial plane expression of the lower surface of the workpiece;
[0039] S403, calculating the workpiece thickness based on the distance from each point on each laser line to another plane.
[0040] Optionally, the distance from each point on each laser line to another plane based on the spatial plane expression of the lower surface of the workpiece in S402 includes:
[0041] The calculation formula (2) is:
[0042]
[0043] Wherein, d up1 to d upN is the distance from each point of points 1 to N of the two laser lines above the workpiece to another plane;
[0044] d dw1 to d uwM is the distance from each point of points 1 to M of the two laser lines above the workpiece to another plane;
[0045] Wherein, the plane equation of the upper surface of the workpiece is: z=a1x+b1y+c1; the plane equation of the lower surface of the workpiece is: {z=a1x+b1y+c1, z=a2x+by+c2};
[0046] Wherein, the coordinates of each point on the laser above the workpiece are [Xwu1, Ywu1, Zwu1] … [Xwu n , Ywu n , Zwu n ]; the coordinates of each point on the other laser above the workpiece are [Xwu11 Ywu1 1 Zwu1 1 ]……[Xwu m 1 Ywu m 1 Zwu m 1 ],N=n+m;
[0047] wherein the coordinates of each point on the one laser below the workpiece are respectively [Xwd1, Ywd1, Zwd1]……[Xwd j Ywd j Zwd j ]; the coordinates of each point on the other laser below the workpiece are respectively [Xwd1 1 Ywd1 1 Zwd1 1 ]……[Xwd k 1 Ywd k 1 Zwd k 1 ], M=j+k.
[0048] Optionally, the calculating the workpiece thickness based on the distance of each point on each laser line to another plane in the S403 comprises:
[0049] The workpiece thickness formula is formula (3):
[0050]
[0051] wherein X0 is the spatial horizontal coordinate of the intersection of the laser lines.
[0052] Compared with the prior art, the technical solution has at least the following beneficial effects:
[0053] The present application provides a workpiece thickness detection method, first, the detection device is assembled, after the assembly is completed, the calibration is started, the laser line is projected on the workpiece surface, and the surface array camera is used to continuously acquire the workpiece surface laser line image, the laser line center is extracted, the extracted laser line center sub-pixel coordinates are converted into space coordinates through three-dimensional space coordinate conversion, then the workpiece surface information is obtained through the method of fitting the space coordinate plane of the workpiece, the three-dimensional fitting method of the plane where the laser line is located is used to obtain the upper and lower surface space coordinates of the workpiece, and the space distance calculation of the two surfaces is carried out to realize the workpiece thickness detection. Due to the tilt and other abnormal conditions caused by vibration in the workpiece production process, the thickness detection device must be measured under the condition of suppressing the tilt. The present application can realize the non-contact real-time detection of the moving workpiece, especially the detection under the abnormal conditions such as workpiece tilt and vibration, the detection system has high accuracy, and the detection scheme is non-contact to the workpiece, which will not cause damage to the workpiece and has high measurement accuracy.
[0054] The traditional workpiece thickness detection method cannot complete the thickness detection under the tilt condition caused by workpiece vibration due to its low robustness, and the detection distortion often occurs for the moving tilt workpiece. The present application solves the problem of workpiece thickness detection under vibration, and is also suitable for normal workpieces, has higher robustness to workpiece vibration and tilt, and further improves the detection accuracy, realizes real-time online high-precision detection of workpiece thickness, and has important significance for workpiece quality detection. BRIEF DESCRIPTION OF DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creating labor.
[0056] Figure 1 The flow chart of one embodiment of the present application is shown in the figure.
[0057] Figure 2 The side view of the device of one embodiment of the present application is shown in the figure, and the meaning of marking two linear lasers is that the positions of the two linear lasers are overlapped in the direction of the figure.
[0058] Figure 3 The top view of the device of one embodiment of the present application is shown in the figure, and the meaning of marking two linear lasers is that the positions of the two linear lasers are overlapped in the direction of the figure, and the meaning of marking two surface array cameras is that the positions of the two surface array cameras are overlapped in the direction of the figure. DETAILED DESCRIPTION
[0059] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions of the embodiments of the present application with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the described embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort belong to the scope of protection of the present application.
[0060] Unless otherwise defined, technical terms or scientific terms used in the present application shall have the common meaning understood by one of ordinary skill in the art to which the present application pertains. The terms "first", "second", and similar terms used in the present application do not denote any order, quantity, or importance, but are used to distinguish different components. Similarly, the terms "one", "a", or "the" and similar terms do not denote a quantity restriction, but mean that at least one exists. The terms "include", "comprise", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0061] As shown in Figure 1 To solve the detection accuracy problem in the prior art, the present application provides a workpiece thickness detection method, comprising:
[0062] S1, a workpiece thickness detection device is built, the workpiece thickness detection device comprises two area array cameras, four line lasers, and a calibration plate, wherein one camera and two line lasers are used to detect the upper surface of the workpiece, and the other camera and the other two line lasers are used to detect the lower surface of the workpiece;
[0063] S2, the internal parameters and the external parameters of the two area array cameras are calculated;
[0064] Laser is projected on the calibration plate, and the calibration plate is moved in multiple spaces, and the laser line images of the four line lasers on the calibration plate are captured by the two area array cameras respectively;
[0065] S3, based on the laser line images, the internal parameters and the external parameters of the two area array cameras, the upper and lower surface point cloud information of the workpiece is obtained;
[0066] S4, three-dimensional fitting is performed according to the upper and lower surface point cloud information of the workpiece, the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece are obtained, and the thickness of the workpiece is obtained based on the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece.
[0067] A specific embodiment is as follows Figures 2 to 3As shown, the S1, the workpiece thickness detection device comprises:
[0068] Two planar array cameras are installed at the upper and lower sides of the workpiece at a 90° angle to each other, and the two planar array cameras are installed on a vertical surface which is perpendicular to the horizontal surface;
[0069] Four line lasers are symmetrically arranged above and below, and each planar array camera is equipped with two line lasers, and the planar array camera is installed between the two line lasers on the same height side;
[0070] Among them, the intersection of the laser lines emitted by the two line lasers arranged above the workpiece is projected on the upper surface of the workpiece, the intersection of the laser lines emitted by the two line lasers arranged below the workpiece is projected on the lower surface of the workpiece, and the planar array camera on the same height side observes the line laser on the same height side.
[0071] In addition, the included angle between the planar array camera and the line laser on the same height side is α, and α∈[35°, 90°];
[0072] The included angle between the two line lasers on the same height side is β, and β∈[25°, 90°].
[0073] When calibrating the upper surface of the workpiece, the calibration plate is arranged between the planar array camera above the workpiece and the upper surface of the workpiece, the calibration plate is supported to move up and down, and the calibration surface of the calibration plate and the upper surface of the workpiece are arranged in parallel;
[0074] When calibrating the upper surface of the workpiece, the calibration plate is arranged between the planar array camera below the workpiece and the lower surface of the workpiece, the calibration plate is supported to move up and down, and the calibration surface of the calibration plate and the lower surface of the workpiece are arranged in parallel.
[0075] The specific principle of this step is: two planar array cameras are distributed at the upper and lower sides of the measured workpiece at a 90° angle to each other, and are installed on the same vertical surface; four line lasers are used to irradiate the surface of the workpiece, the line lasers are symmetrically distributed above and below, the axis direction of the line laser is perpendicular to the horizontal surface, the two laser lines on the horizontal surface are crossed at an angle of 25° to 90°, the imaging range of the two planar array cameras covers the laser line intersection area, and one planar array camera observes two line lasers on the same side, the included angle between the planar array camera and the line laser is 35° to 90°, and the shooting range of the planar array camera coincides with the laser line intersection area.
[0076] In addition, in the device, the angle of the area array camera is universally adjustable, an optical filter is installed in front of the lens of the area array camera, four linear lasers are used to irradiate the surface of the workpiece, the linear lasers are symmetrically distributed up and down, the direction of the linear lasers is perpendicular to the horizontal plane, the two laser lines on the horizontal plane are crossed at an angle β, the laser lines are projected on the upper and lower surfaces of the workpiece at the intersection position of the laser lines, the imaging ranges of the two area array cameras cover the intersection area of the laser lines, and one area array camera observes two linear lasers on the same side, the angle between the area array camera and the linear lasers is α, and the imaging range of the area array camera overlaps the intersection area of the laser lines.
[0077] In a specific embodiment, S2, the internal parameters and external parameters of the two area array cameras are calculated; the laser is projected on the calibration plate, and the calibration plate is moved in multiple spaces, the laser line images of the four linear lasers on the calibration plate are captured by the two area array cameras respectively, and specifically, the method comprises the following steps:
[0078] S201, the camera calibration calculates the internal parameters Mi (i∈1, 2) of the upper and lower two area array cameras on the device, the laser plane space parameters [Ai, Bi, Ci] (i∈1, 2, 3, 4), and the external parameters [Ri|Ti] (i∈1, 2);
[0079] In the laser plane space parameters [Ai, Bi, Ci] (i∈1, 2, 3, 4), [A1, B1, C1] are the space parameters of one of the two linear lasers on the upper side, [A2, B2, C2] are the space parameters of the other of the two linear lasers on the upper side, [A3, B3, C3] are the space parameters of one of the two linear lasers on the lower side, and [A4, B4, C4] are the space parameters of the other of the two linear lasers on the lower side;
[0080] A plurality of calibration plate images are taken from different angles, feature points in the plurality of calibration plate images are detected, and the internal parameters Mi and the external parameters [Ri|Ti] of the corresponding area array camera are inversely solved by using the spatial coordinates [Xw, Yw, Zw] and the image coordinates [u, v] of the feature points in the plurality of calibration plate images;
[0081] The calculation formula of the internal parameters Mi and the external parameters [Ri|Ti] of the area array camera is formula (1):
[0082]
[0083] Wherein, when Mi is M1, M1 is the internal parameter of the area array camera arranged on the upper side of the workpiece; when Mi is M2, M2 is the internal parameter of the area array camera arranged on the lower side of the workpiece;
[0084] [Ri|Ti] is [R1|T1] when [R1|T1] is the external parameter of the area array camera arranged above the workpiece, and [Ri|Ti] is [R2|T2] when [R2|T2] is the external parameter of the area array camera arranged below the workpiece.
[0085] The principle of this step is: after adjusting the poses of the area array cameras and the laser, the internal parameters Mi (i∈1, 2) of the upper and lower area array cameras on the device are calculated by using Zhang Zhengyou calibration method:
[0086]
[0087] Where f: focal length, unit: millimeter, dx: pixel x direction width, unit: millimeter, 1 / dx: how many pixels in x direction within 1 millimeter, u0, v0: actual position of the principal point, unit: pixel.
[0088] External parameter [Ri|Ti] (i∈1, 2):
[0089]
[0090] Where Ri is a rotation matrix (3x3), and Ti is a translation vector (3x1).
[0091] S202, when capturing the laser line images of the two line lasers above the workpiece on the calibration plate, the calibration plate is moved multiple times between the area array camera above the workpiece and the upper surface of the workpiece, and the area array camera on the same height side captures the laser line images of the calibration plate after position transformation multiple times;
[0092] When capturing the laser line images of the two line lasers below the workpiece on the calibration plate, the calibration plate is moved multiple times between the area array camera below the workpiece and the lower surface of the workpiece, and the area array camera on the same height side captures the laser line images of the calibration plate after position transformation multiple times.
[0093] In a specific embodiment, S3, based on the laser line images, the internal parameters and the external parameters of the two area array cameras, the upper and lower surface point cloud information of the workpiece is obtained; specifically including:
[0094] S301, based on the laser line images of the four line lasers on the calibration plate, the laser plane equation of each line laser is obtained;
[0095] The specific embodiment of this step is: after projecting the laser on the calibration plate and moving the calibration plate at multiple spatial positions, the laser line sub-pixel coordinates are obtained by photographing, and the spatial coordinates of multiple points on the laser plane {[Xw1, Yw1, Zw1], …, [Xw n ,Yw n ,Zw n ]} are calculated:
[0096]
[0097] wherein {[u1, v1], …, [u n ,v n ]} is the laser line sub-pixel coordinates.
[0098] After the laser line sub-pixel coordinates are calculated, the equation of the laser plane in the space coordinate system is calculated by the least square method.
[0099] For example, the space coordinates {[Xw1, Yw1, Zw1], …, [Xw n ,Yw n ,Zw n ]} of multiple points on the laser plane are calculated by using the previously obtained M1 and [R1|T1] to perform space conversion on the obtained laser line image center coordinates, and the laser plane space function [A1, B1, C1] is calculated by the least square method, so as to obtain the laser plane z=A1x+B1y+C1 of one laser in the upper camera (in the embodiment, the upper camera is an upper array camera, and the lower camera is a lower array camera), as shown below, wherein n is the number of laser center coordinates in the image:
[0100]
[0101] Similarly, the laser plane formula z=A2x+B2y+C2, z=A3x+B3y+C3, and z=A4x+B4y+C4 are respectively calculated for the laser plane of another laser in the upper camera and the laser planes of two lasers in the lower camera.
[0102] S302, the gray scale of two laser line images captured by two array cameras is calculated by the laser line center extraction algorithm to obtain the image polar coordinates of each laser line center point; specifically including:
[0103] The line structure laser is projected on the workpiece surface, and the surface laser line image is continuously acquired by using the array camera.
[0104] The gray scale of two laser line images in the upper camera is calculated to extract the image polar coordinates of the laser line center
[0105] Similarly, the image polar coordinates of the laser line center of the lower camera can be calculated
[0106] wherein n is the number of image polar coordinates of one laser line center in the upper camera, m is the number of image polar coordinates of another laser line center in the upper camera, j is the number of image polar coordinates of one laser line center in the lower camera, and k is the number of image polar coordinates of another laser line center in the lower camera.
[0107] S303. By using the internal parameters of the area scan camera set above the workpiece, the external parameters of the area scan camera, and the image polar coordinates of the two laser line center points above the workpiece, the X-axis coordinate parameters and Y-axis coordinate parameters of the two laser line center points above the workpiece are obtained in the spatial coordinates. By using the internal parameters of the area scan camera set below the workpiece, the external parameters of the area scan camera, and the image polar coordinates of the two laser line center points below the workpiece, the X-axis coordinate parameters and Y-axis coordinate parameters of the two laser line center points below the workpiece are obtained in the spatial coordinates.
[0108] This step specifically includes:
[0109] Use M1, [R1|T1], {[u u1 ,v u1 ],…,[u un ,v un ]} Calculate the spatial X and Y coordinates of a laser's centerline within the upper camera: {[Xwu1,Ywu1],…,[Xwu1]} n Ywu n Similarly, the spatial X and Y coordinates of the other laser centerline within the upper camera can also be obtained {[Xwu1]}. 1 Ywu1 1 ],…,[Xwu m 1 Ywu m 1 The other two lasers are located within the lower camera at the spatial X and Y coordinates of the laser centerline {[Xwd1,Ywd1],…,[Xwd1]}. j Ywd j ]}、{[Xwd1 1 ,Ywd1 1 ],…,[Xwd k 1 Ywd k 1 The formula is:
[0110]
[0111]
[0112] S304. Based on the laser plane equation of each line laser and the image polar coordinates of the four laser line center points, obtain the Z-axis coordinate parameters in the spatial coordinates of the four laser line center points.
[0113] This step specifically includes:
[0114] Using the previously obtained z = A1x + B1y + C1, {[Xwu1,Ywu1],…,[Xwu n Ywun}, calculate the spatial Z coordinates of another laser centerline in the upper camera {Zwu1 n}, as follows:
[0115]
[0116] Similarly, using the previously obtained {z = A2x + B2y + C2, z = A3x + B3y + C3, z = A4x + B4y + C4}, {[Xwu1 1 ,Ywu1 1 ],…,[Xwd m 1 ,Ywu m 1 ]}, {[Xwd1,Ywd1],…,[Xwd j ,Ywd j ]}, {[Xwd1 1 ,Ywd1 1 ],…,[Xwd k 1 ,Ywd k 1 ]}, calculate the spatial Z coordinates of another laser centerline in the upper camera {Zwu1 1 ,…,Zwu m 1}, the spatial Z coordinates of 2 laser centerlines in the lower camera {Zwd1,…,Zwd j}, {Zwd1 1 ,…,Zwd k 1} ;
[0117] wherein the other three formulas are as follows:
[0118]
[0119] S305, integrate the X-axis coordinate parameters and Y-axis coordinate parameters of each laser line center point in step S303, and the Y-axis coordinate parameters of each laser line center point in step S304, to obtain the upper and lower surface point cloud information of the workpiece.
[0120] In a specific embodiment, S4, according to the upper and lower surface point cloud information of the workpiece, three-dimensional fitting is performed to obtain the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece, and based on the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece, the thickness of the workpiece is obtained, including:
[0121] S401. Obtain the spatial plane expression of the upper surface of the workpiece based on the point cloud information of the upper surface of the workpiece and the three-dimensional plane fitting algorithm, and obtain the spatial plane expression of the lower surface of the workpiece based on the point cloud information of the lower surface of the workpiece and the three-dimensional plane fitting algorithm.
[0122] Based on the spatial X, Y, and Z coordinates of the laser center lines inside the upper and lower cameras obtained by S3, the spatial plane equation expressions of the upper surface of the workpiece are calculated by the three-dimensional plane fitting algorithm: z = a1x + b1y + c1 and z = a2x + b2y + c2.
[0123] S402. Based on the spatial plane expression of the lower surface of the workpiece, calculate the distance from each point on each laser line to another plane;
[0124] Calculation formula (2):
[0125]
[0126] Where, d up1 to d upN Let N be the distance from each of the two laser lines above the workpiece, from point 1 to point N, to the other plane.
[0127] d dw1 to d uwM Let M be the distance from each of the two laser lines above the workpiece, from point 1 to point M, to the other plane.
[0128] The plane equation of the upper surface of the workpiece is: z = a1x + b1y + c1; the plane equation of the lower surface of the workpiece is: {z = a1x + b1y + c1, z = a2x + by + c2}.
[0129] The coordinates of each point on a laser above the workpiece are [Xwu1, Ywu1, Zwu1]...[Xwu1]... n Ywu n Zwu n The coordinates of each point on another laser above the workpiece are [Xwu1]. 1 Ywu1 1 Zwu1 1 ]……[Xwu m 1 Ywu m 1 Zwu m 1 ], N = n + m;
[0130] The coordinates of each point on a laser located below the workpiece are [Xwd1, Ywd1, Zwd1]...[ ... j Ywd jZwd j The coordinates of each point on another laser below the workpiece are [Xwd1]; 1 Ywd1 1 ,Zwd1 1 ]……[Xwd k 1 Ywd k 1 Zwd k 1 ], M = j + k.
[0131] S403. The workpiece thickness is calculated based on the distance from each point on each laser line to another plane.
[0132] The formula for the workpiece thickness is formula (3):
[0133]
[0134] Where X0 is the spatial x-coordinate of the laser line intersection.
[0135] In this embodiment, the focus is on the thickness detection of the workpiece. First, the workpiece thickness detection system is assembled. Then, machine vision calibration technology is used to calculate the internal parameters, external parameters, and image-space transformation relationship of the device camera. Next, an image analysis model is used to extract the center of the laser line. The image coordinates of the extracted laser center line are converted into actual spatial coordinates through three-dimensional spatial coordinates. Then, the spatial coordinates of the upper and lower surfaces of the workpiece are obtained by three-dimensional fitting of the plane where the laser line is located. Finally, the workpiece thickness is detected by calculating the spatial distance between the two surfaces.
[0136] Because workpieces may tilt or experience other abnormalities due to vibration during production, thickness detection devices must perform measurements while suppressing this tilt. This invention enables real-time thickness detection during workpiece production, particularly effective for detecting abnormalities such as workpiece tilting and swaying, and the detection system boasts high accuracy.
[0137] When this method is applied to a specific implementation, the following steps are included;
[0138] Step S1: Assembly of the workpiece thickness detection system:
[0139] Two area array cameras are positioned at a 90° angle to each other on the upper and lower sides of the workpiece being measured, and are mounted on the same vertical surface.
[0140] Four line lasers are used to irradiate the surface of the workpiece. The line lasers are symmetrically distributed vertically and perpendicular to the horizontal plane. The laser lines on the horizontal plane intersect each other at a 50° angle.
[0141] The imaging ranges of the two area array cameras cover the intersection region of the laser lines, and one area array camera observes two same-side line lasers, the included angle between the area array camera and the line laser is 45°, and the imaging range of the area array camera coincides with the intersection region of the laser lines;
[0142] In the embodiment, the installation schematic diagram of the workpiece thickness detection device is shown in Figure 2 and Figure 3 .
[0143] Step S2: After the detection device is installed, system calibration is performed to obtain a conversion matrix and a light plane equation;
[0144] S2-1, after adjusting the focal length of the area array camera, the internal parameters Mi (i∈1, 2) of the area array camera are obtained by using Zhang Zhengyou calibration method:
[0145]
[0146] External parameters [Ri|Ti] (i∈1, 2):
[0147]
[0148] S2-2, after projecting the laser on the calibration board and moving the calibration board at multiple spatial positions, the laser line sub-pixel coordinates are obtained by photographing;
[0149] S3, based on the laser line image, the internal parameters and the external parameters of the two area array cameras, the upper and lower surface point cloud information of the workpiece is obtained
[0150] S301, after obtaining the laser line sub-pixel coordinates, the least square method is used to calculate the equation of the laser plane in the spatial coordinate system z=A i x+B i y+C i , (i∈1, 2, 3, 4):
[0151] Upper camera plane 1: z=0.534322*x+105.329*y+1086.83;
[0152] Upper camera plane 2: z=15.6005*x+0.083721*y+668.51;
[0153] Lower camera plane 3: z=0.354015*x+95.0548*y+1014.87;
[0154] Lower camera plane 4: z=16.9009*x+8.50751*y+1185.94;
[0155] S302, project a line structure light on the workpiece surface, and acquire the workpiece surface laser line image by using a surface array camera; project the line structure laser on the workpiece surface; acquire the surface laser line image by using a surface array camera. Calculate the gray scale of the two laser line images in the camera to extract the image polar coordinates of the laser line center;
[0156] S303, calculate the spatial X, Y coordinates of the laser line center on the upper and lower surfaces of the workpiece by using the image polar coordinates of the laser line center, the internal parameters and the external parameters of the camera;
[0157] S304, input the spatial X, Y coordinates of the laser line center on the upper and lower surfaces of the workpiece into the corresponding laser plane equation to calculate the spatial Z coordinate of the laser line center;
[0158] S305, obtain the upper and lower surface point cloud information of the workpiece by comprehensively using the X axis coordinate parameter and the Y axis coordinate parameter of each laser line center point in step S303, and the Y axis coordinate parameter of each laser line center point in step S304.
[0159] Step S4: perform plane fitting by using the spatial X, Y, Z coordinates of the laser line center on the upper and lower surfaces of the workpiece, calculate the point-to-plane distance of each point on the laser line on the upper and lower surfaces of the workpiece to another plane, and perform weighted average on the point-to-plane distance of each point to obtain a weighted average value, i.e. the thickness of the workpiece;
[0160] S401, input the spatial X, Y, Z coordinates of the laser line center on the upper and lower surfaces of the workpiece in step S4 into a three-dimensional plane fitting algorithm respectively to obtain the plane space equations of the upper and lower surfaces of the workpiece as shown in the following formula:
[0161] The plane space equation of the upper surface: 0.100165*x+0.071*y+z=0.83;
[0162] The plane space equation of the lower surface: 0.09904*x+0.0922001*y+z=-5.63;
[0163] S402, calculate the point-to-plane distance of the spatial X, Y, Z coordinates of the laser line center on the upper and lower surfaces of the workpiece to another plane, such as the point-to-plane distance of the laser line center point (1.52, 0.52, 5.83) on the lower surface to the upper surface formula as shown in the following formula:
[0164]
[0165] Wherein a1=-0.100165, b1=-0.071, c1=0.83;
[0166] S403, perform weighted average on the point-to-plane distance of each point to obtain a weighted average value, i.e. the thickness of the workpiece as shown in the following formula:
[0167]
[0168] wherein M = 56, N = 52, d up1 = 5.15,..., d up52 = 5.05, d dw1 = 5.01,..., d dw52 = 4.97, X up1 = -15.6,..., X up52 = 14.9, X dw1 = -15.1,..., X dw56 = 15.9, X0 = 0.28, calculated workpiece thickness d avg = 5.03.
[0169] The application provides a workpiece thickness detection method, first, the detection device is assembled, after the assembly is completed, calibration is started, a laser line is projected on a workpiece surface, and a surface array camera is used to continuously acquire a laser line image of the workpiece surface; the laser line center is extracted; the sub-pixel coordinates of the extracted laser line center are converted into spatial coordinates through three-dimensional space coordinate conversion; then, the workpiece surface information is obtained through a method of fitting a spatial coordinate plane of the workpiece; the spatial coordinates of the upper and lower surfaces of the workpiece are obtained through a method of three-dimensional fitting of the plane where the laser line is located; and the workpiece thickness detection is realized through the spatial distance calculation of the two surfaces. Due to the abnormal conditions such as inclination caused by vibration in the workpiece production process, the thickness detection device must be measured under the condition of suppressing inclination. The application can realize non-contact real-time detection of the workpiece in motion, especially can realize detection under the abnormal conditions such as workpiece inclination and vibration, the detection system has strong accuracy, and the detection scheme does not contact the workpiece, does not cause damage to the workpiece and has high measurement precision.
[0170] The following points need to be explained:
[0171] (1) The drawings of the embodiments of the application only relate to the structures involved in the embodiments of the application, and other structures can refer to the general design.
[0172] (2) For the sake of clarity, in the drawings used to describe the embodiments of the application, the thickness of a layer or region is exaggerated or reduced, that is, the drawings are not drawn according to the actual proportion. It can be understood that when an element such as a layer, a film, a region or a substrate is referred to as being "on" or "under" another element, the element can be "directly" on or under another element or there can be an intermediate element.
[0173] (3) In the case of no conflict, the embodiments of the application and the features in the embodiments can be combined with each other to obtain new embodiments.
[0174] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A workpiece thickness detection method, characterized by, The method comprises the following steps: S1, a workpiece thickness detection device is built, the workpiece thickness detection device comprises two area array cameras, four linear lasers and a calibration plate, wherein one camera and two linear lasers are used to detect the upper surface of the workpiece, the other camera and the other two linear lasers are used to detect the lower surface of the workpiece; S2, the internal parameters and the external parameters of the two area array cameras are calculated; laser is projected on the calibration plate, and the calibration plate is moved in multiple spaces, and the laser line images of the four linear lasers on the calibration plate are captured by the two area array cameras respectively; S3, based on the laser line images, the internal parameters and the external parameters of the two area array cameras, the upper and lower surface point cloud information of the workpiece is obtained; S4, three-dimensional fitting is performed according to the upper and lower surface point cloud information of the workpiece, the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece are obtained, and the thickness of the workpiece is obtained based on the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece.
2. The workpiece thickness detection method of claim 1, wherein The workpiece thickness detection device in S1 comprises: The two area array cameras are installed at 90° angles with each other on the upper and lower sides of the workpiece, and the two area array cameras are installed on a vertical surface, and the vertical surface is perpendicular to the horizontal surface; The four linear lasers are symmetrically arranged above and below, and each area array camera is respectively provided with two linear lasers, and the area array camera is installed between the two linear lasers on the same height side; The intersection points of the laser lines emitted by the two linear lasers arranged above the workpiece are projected on the upper surface of the workpiece, the intersection points of the laser lines emitted by the two linear lasers arranged below the workpiece are projected on the lower surface of the workpiece, and the area array camera on the same height side observes the linear laser on the same height side.
3. The workpiece thickness detection method according to claim 2, characterized by, The workpiece thickness detection device in S1 further comprises: The included angle between the area array camera on the same height side and the linear laser is α, and α ∈ [35°, 90°]; The included angle between the two linear lasers on the same height side is β, and β ∈ [25°, 90°].
4. The workpiece thickness detection method of claim 3, wherein The workpiece thickness detection device in S1 further comprises: When calibrating the upper surface of the workpiece, the calibration plate is arranged between the area array camera above the workpiece and the upper surface of the workpiece, the calibration plate is supported to move up and down, and the calibration surface of the calibration plate and the upper surface of the workpiece are arranged in parallel; When calibrating the upper surface of the workpiece, the calibration plate is arranged between the area array camera below the workpiece and the lower surface of the workpiece, the calibration plate is supported to move up and down, and the calibration surface of the calibration plate and the lower surface of the workpiece are arranged in parallel.
5. The workpiece thickness detection method of claim 4, wherein, The S2 calculates the internal parameters and the external parameters of the two area array cameras; A plurality of calibration plate images are taken from different angles, feature points in the plurality of calibration plate images are detected, and the internal parameters Mi and the external parameters [Ri|Ti] of the corresponding area array camera are inversely solved by using the spatial coordinates [Xw, Yw, Zw] and the image coordinates [u, v] of the feature points in the plurality of calibration plate images; The calculation formula of the internal parameters Mi and the external parameters [Ri|Ti] of the area array camera is formula (1): wherein Mi is M1, M1 is the internal parameter of the area array camera arranged above the workpiece; Mi is M2, M2 is the internal parameter of the area array camera arranged below the workpiece; [Ri|Ti] is [R1|T1] when [R1|T1] is the external parameter of the area array camera arranged above the workpiece, and [Ri|Ti] is [R2|T2] when [R2|T2] is the external parameter of the area array camera arranged below the workpiece.
6. The workpiece thickness detection method of claim 5, wherein In S2, the laser is projected on the calibration plate and the calibration plate is moved in multiple spaces, and four linear laser images on the calibration plate are captured by two area array cameras respectively: When the linear laser images on the calibration plate above the workpiece are captured, the calibration plate is moved multiple times between the area array camera above the workpiece and the upper surface of the workpiece, and the laser line images of the calibration plate after position transformation are captured by the area array camera on the same height side multiple times; When the linear laser images on the calibration plate below the workpiece are captured, the calibration plate is moved multiple times between the area array camera below the workpiece and the lower surface of the workpiece, and the laser line images of the calibration plate after position transformation are captured by the area array camera on the same height side multiple times.
7. The workpiece thickness detection method of claim 6, wherein In S3, the upper and lower surface point cloud information of the workpiece is obtained based on the linear laser images, the internal parameters and the external parameters of the two area array cameras, which comprises: S301, obtaining the laser plane equation of each linear laser based on the linear laser images of the four linear lasers on the calibration plate; S302, calculating the gray scale of each laser line center point by calculating the gray scale of the two laser line images captured by the two area array cameras respectively through the laser line center extraction algorithm to obtain the image polar coordinates of each laser line center point; S303, obtaining the X-axis coordinate parameter and the Y-axis coordinate parameter of the spatial coordinates of the two laser line center points above the workpiece through the internal parameters of the area array camera arranged above the workpiece, the external parameters of the area array camera and the image polar coordinates of the two laser line center points above the workpiece; obtaining the X-axis coordinate parameter and the Y-axis coordinate parameter of the spatial coordinates of the two laser line center points below the workpiece through the internal parameters of the area array camera arranged below the workpiece, the external parameters of the area array camera and the image polar coordinates of the two laser line center points below the workpiece; S304, obtaining the Z-axis coordinate parameter of the spatial coordinates of the four laser line center points based on the laser plane equation of each linear laser and the image polar coordinates of the four laser line center points; S305, obtaining the upper and lower surface point cloud information of the workpiece by comprehensively combining the X-axis coordinate parameter and the Y-axis coordinate parameter of each laser line center point in step S303, and the Y-axis coordinate parameter of each laser line center point in step S304.
8. The workpiece thickness detection method of claim 7, wherein, In S4, the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece are obtained by three-dimensional fitting according to the upper and lower surface point cloud information of the workpiece, and the thickness of the workpiece is obtained based on the upper surface plane equation of the workpiece and the lower surface plane equation of the workpiece, which comprises: S401, obtaining the spatial plane expression of the upper surface of the workpiece according to the point cloud information of the upper surface of the workpiece and the three-dimensional plane fitting algorithm, and obtaining the spatial plane expression of the lower surface of the workpiece according to the point cloud information of the lower surface of the workpiece and the three-dimensional plane fitting algorithm; S402, calculating the distance from each point on each laser line to another plane based on the spatial plane expression of the lower surface of the workpiece; S403、based on the distance of each point on each laser line to another plane, the thickness of the workpiece is calculated.
9. The workpiece thickness detection method of claim 8, wherein, The S402 includes calculating the distance of each point on each laser line to another plane based on the spatial plane expression of the lower surface of the workpiece. The calculation formula (2) is as follows: wherein d up1 from d upN is the distance of each of the points 1 to N of the two laser lines above the workpiece to the other plane; d dw1 to d uwM is the distance from each of the points 1 to M of the two laser lines above the workpiece to another plane; Wherein, the plane equation of the upper surface of the workpiece is: z=a1x+b1y+c1; the plane equation of the lower surface of the workpiece is: {z=a1x+b1y+c1, z=a2x+by+c2}; The coordinates of each point on a laser above the workpiece are [Xwu1, Ywu1, Zwu1]...[Xwu1]... n Ywu n Zwu n The coordinates of each point on another laser above the workpiece are [Xwu1]. 1 Ywu1 1 Zwu1 1 ]……[Xwu m 1 Ywu m 1 Zwu m 1 ], N = n + m; wherein the coordinates of each point on the one laser below the workpiece are respectively [Xwd1, Ywd1, Zwd1] … [XwdM, YwdM, ZwdM]; the coordinates of each point on the other laser below the workpiece are respectively [Xwd1, Ywd1, Zwd1] … [XwdM, YwdM, ZwdM], M = j + k. j j j 1 1 1 k 1 k 1 k 1 10. The workpiece thickness detection method of claim 9, wherein, The S403 includes calculating the thickness of the workpiece based on the distance of each point on each laser line to another plane. The thickness formula of the workpiece is formula (3): Wherein, X0 is the spatial horizontal coordinate of the intersection of the laser lines.
Citation Information
Patent Citations
Warped plate-shaped object thickness measuring method based on area array structured light
CN116481442A
Calibration method for differential type medium plate thickness measuring device
CN116862993A
Line laser thickness measuring equipment
CN216593225U
Cited By
Box interlayer detection method and system
CN121348312A