Workpiece thickness detection method, device and apparatus

By using multiple scans with relatively set cameras and image stitching technology, the problems of low efficiency and high false detection rate in workpiece thickness detection are solved, and high-precision measurement of workpiece thickness is achieved.

CN122107958APending Publication Date: 2026-05-29SHENZHEN FII-LUSTER LIGHTTECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN FII-LUSTER LIGHTTECH CO LTD
Filing Date
2026-04-17
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies have low detection efficiency and high false detection rate in workpiece thickness detection, and require high image shooting angle and clarity, making it difficult to accurately determine the thickness and shape of the workpiece.

Method used

The target workpiece is scanned multiple times using a first and second camera that are set relative to each other to obtain depth maps at multiple locations. The workpiece thickness is then calculated by directly associating bidirectional three-dimensional data through transformation parameter matrix transformation and image stitching.

Benefits of technology

It improves the accuracy and consistency of workpiece thickness detection, reduces random errors in single acquisitions, and can accurately measure the thickness of the entire surface and complex structural areas of the workpiece.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122107958A_ABST
    Figure CN122107958A_ABST
Patent Text Reader

Abstract

The application discloses a workpiece thickness detection method, device and equipment, and is applied to the computer technology field. The application captures three-dimensional form information of multiple positions of a workpiece from a two-way visual angle through a first camera and a second camera arranged oppositely, and reduces random errors of single acquisition in a single camera multiple scanning mode. Then, corresponding transformation parameters are respectively used for transformation processing of two groups of depth maps, so as to effectively correct errors caused by camera installation deviation, acquisition angle deviation and workpiece placement deviation. Further, a complete first splicing map and a second splicing map are obtained by respectively splicing the transformed maps obtained through transformation, so that the obtained splicing maps can cover the whole surface and the complex structure area of the workpiece, and the global consistency of workpiece thickness measurement is improved. Finally, the thickness of each position of the workpiece is calculated through the two splicing maps, and the thickness measurement result of each position in the workpiece is more accurate through direct correlation of two-way three-dimensional data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and equipment for detecting workpiece thickness. Background Technology

[0002] Currently, various electronic and mechanical devices are becoming increasingly sophisticated, requiring greater accuracy in the dimensions and shapes of their workpieces. Typically, after production, images of the workpiece are captured, and its quality is determined by detecting factors such as thickness, diameter, and shape within the image. This method places high demands on image capture angle, image clarity, and detection algorithms, resulting in low detection efficiency and a high false detection rate. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide a workpiece thickness detection method, workpiece thickness detection device, electronic device, computer-readable storage medium and computer program product, which can capture images of the entire surface and complex structural areas of the workpiece, calculate the workpiece thickness through two stitched images from a two-way viewing angle, and directly correlate two-way three-dimensional data to improve detection accuracy.

[0004] To address the aforementioned technical problems, this application provides a workpiece thickness detection method, comprising:

[0005] By using a first camera and a second camera that are positioned relative to each other, the target workpiece is scanned multiple times to obtain a first depth map and a second depth map corresponding to multiple positions of the target workpiece, respectively; wherein, each first depth map is obtained by the first camera scanning the target workpiece in a single scan from a first direction, and each second depth map is obtained by the second camera scanning the target workpiece in a single scan from the opposite direction of the first direction.

[0006] Determine the first transformation parameters corresponding to the multiple first depth maps respectively, and use the first transformation parameters to perform matrix transformation on the multiple first depth maps respectively to obtain multiple first transformed maps;

[0007] Determine the second transformation parameters corresponding to the multiple second depth maps respectively, and use the second transformation parameters to perform matrix transformations on the multiple second depth maps respectively to obtain multiple second transformed maps;

[0008] By stitching together multiple first-transformation images, a first stitched image is obtained; by stitching together multiple second-transformation images, a second stitched image is obtained.

[0009] Based on the first and second stitched images, the thickness at multiple locations is determined.

[0010] Optionally, the process of determining the first transformation parameter and the second transformation parameter includes:

[0011] Multiple first calibration depth maps and multiple second calibration depth maps of the calibration board are acquired; wherein each first calibration depth map is obtained by a first camera scanning the calibration board in a single scan from a first direction, and each second calibration depth map is obtained by a second camera scanning the calibration board in a single scan from the opposite direction from the first direction;

[0012] Determine the point cloud data corresponding to multiple first calibration depth maps and multiple second calibration depth maps respectively;

[0013] For each point cloud data, calculate the normal vector of the corresponding calibration depth map based on the current point cloud data;

[0014] Based on the azimuth and elevation angles of the normal vector, mark each plane of the calibration board in the current point cloud data;

[0015] Align each plane with the template data of the calibration board to obtain the initial transformation matrix;

[0016] The current point cloud data is spatially transformed using the initial transformation matrix, and the spatial transformation result is aligned with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data.

[0017] Based on the transformation parameters corresponding to multiple first calibration depth maps and multiple second calibration depth maps, the first transformation parameters and the second transformation parameters are determined.

[0018] Optionally, the normal vector of the corresponding calibration depth map is calculated based on the current point cloud data, including:

[0019] Calculate the row and column integral map corresponding to the calibration depth map of the current point cloud data;

[0020] Calculate the normal vector based on the current point cloud data and the row and column integral diagram.

[0021] Optionally, the template data of each plane is aligned with that of the calibration board to obtain an initial transformation matrix, including:

[0022] The least squares method is used to compare each plane with the corresponding plane in the template data, and the initial transformation matrix that satisfies the preset conditions is calculated.

[0023] Optionally, the spatial transformation result is aligned with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data, including:

[0024] The optimized transformation matrix is ​​obtained by comparing the spatial transformation results with the template data using the iterative nearest point algorithm.

[0025] The transformation parameters corresponding to the calibration depth map of the current point cloud data are obtained based on the optimized transformation matrix.

[0026] Optionally, multiple first transformed images are stitched together to obtain a first stitched image, and multiple second transformed images are stitched together to obtain a second stitched image, including:

[0027] The stitched pixels corresponding to each pixel in the first transformation image are calculated by sub-pixel interpolation, and the average value of the overlapping pixels in different first transformation images is taken to determine the first stitched image.

[0028] The stitched pixels corresponding to each pixel in the second transformation image are calculated using sub-pixel interpolation, and the average value of the overlapping pixels in different second transformation images is taken to determine the second stitched image.

[0029] Optionally, based on the first and second stitched images, the thickness at multiple locations is determined, including:

[0030] Choose one of the first and second spliced ​​images as a reference image;

[0031] For multiple locations in the reference image, the corresponding reference plane equations are fitted to obtain them respectively;

[0032] Determine the center points corresponding to multiple positions in another stitched image that was not selected;

[0033] For each location, calculate the distance between the center point of that location and the reference plane equation for that location, and determine the thickness at that location based on the distance.

[0034] This application also provides a workpiece thickness detection device, including:

[0035] The acquisition module is used to scan the target workpiece multiple times using a first camera and a second camera that are set relative to each other, and obtain a first depth map and a second depth map corresponding to multiple positions of the target workpiece respectively; wherein, each first depth map is obtained by the first camera scanning the target workpiece in a single scan from a first direction, and each second depth map is obtained by the second camera scanning the target workpiece in a single scan from the opposite direction of the first direction.

[0036] The transformation module is used to determine the first transformation parameters corresponding to the multiple first depth maps respectively, and to perform matrix transformation on the multiple first depth maps respectively using the first transformation parameters to obtain multiple first transformed maps; and to determine the second transformation parameters corresponding to the multiple second depth maps respectively, and to perform matrix transformation on the multiple second depth maps respectively using the second transformation parameters to obtain multiple second transformed maps.

[0037] The splicing module is used to splice multiple first transformation images to obtain a first spliced ​​image, and to splice multiple second transformation images to obtain a second spliced ​​image;

[0038] The detection module is used to determine the thickness at multiple locations based on the first and second stitched images.

[0039] Optionally, the transformation module is specifically used for:

[0040] Multiple first calibration depth maps and multiple second calibration depth maps of the calibration board are acquired; wherein each first calibration depth map is obtained by a first camera scanning the calibration board in a single scan from a first direction, and each second calibration depth map is obtained by a second camera scanning the calibration board in a single scan from the opposite direction from the first direction;

[0041] Determine the point cloud data corresponding to multiple first calibration depth maps and multiple second calibration depth maps respectively;

[0042] For each point cloud data, calculate the normal vector of the corresponding calibration depth map based on the current point cloud data;

[0043] Based on the azimuth and elevation angles of the normal vector, mark each plane of the calibration board in the current point cloud data;

[0044] Align each plane with the template data of the calibration board to obtain the initial transformation matrix;

[0045] The current point cloud data is spatially transformed using the initial transformation matrix, and the spatial transformation result is aligned with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data.

[0046] Based on the transformation parameters corresponding to multiple first calibration depth maps and multiple second calibration depth maps, the first transformation parameters and the second transformation parameters are determined.

[0047] Optionally, the transformation module is specifically used for:

[0048] Calculate the row and column integral map corresponding to the calibration depth map of the current point cloud data;

[0049] Calculate the normal vector based on the current point cloud data and the row and column integral diagram.

[0050] Optionally, the transformation module is specifically used for:

[0051] The least squares method is used to compare each plane with the corresponding plane in the template data, and the initial transformation matrix that satisfies the preset conditions is calculated.

[0052] Optionally, the transformation module is specifically used for:

[0053] The optimized transformation matrix is ​​obtained by comparing the spatial transformation results with the template data using the iterative nearest point algorithm.

[0054] The transformation parameters corresponding to the calibration depth map of the current point cloud data are obtained based on the optimized transformation matrix.

[0055] Optionally, the splicing module is specifically used for:

[0056] The stitched pixels corresponding to each pixel in the first transformation image are calculated by sub-pixel interpolation, and the average value of the overlapping pixels in different first transformation images is taken to determine the first stitched image.

[0057] The stitched pixels corresponding to each pixel in the second transformation image are calculated using sub-pixel interpolation, and the average value of the overlapping pixels in different second transformation images is taken to determine the second stitched image.

[0058] Optionally, the detection module is specifically used for:

[0059] Choose one of the first and second spliced ​​images as a reference image;

[0060] For multiple locations in the reference image, the corresponding reference plane equations are fitted to obtain them respectively;

[0061] Determine the center points corresponding to multiple positions in another stitched image that was not selected;

[0062] For each location, calculate the distance between the center point of that location and the reference plane equation for that location, and determine the thickness at that location based on the distance.

[0063] This application also provides an electronic device, including a memory and a processor, wherein:

[0064] The memory is used to store computer programs;

[0065] The processor is used to execute the computer program to implement the above-described workpiece thickness detection method.

[0066] Optionally, the electronic device further includes: a material loading component and a detection component;

[0067] The material loading component is used to load the target workpiece; the detection component is equipped with a first camera and a second camera that are arranged opposite to each other.

[0068] The processor is used to: control the movement of the material loading component to move the target workpiece to the detection position;

[0069] The detection component is used to control the first camera and the second camera to scan the target workpiece multiple times; wherein the travel length and direction of the first camera or the second camera are the same in different scans, and the distance between them and the target workpiece remains unchanged.

[0070] This application also provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the above-described workpiece thickness detection method.

[0071] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned disclosed workpiece thickness detection method.

[0072] The beneficial effects of this application include: by repeatedly scanning multiple positions of the target workpiece with a first camera and a second camera positioned opposite each other, first depth maps and second depth maps corresponding to multiple positions of the target workpiece are obtained (e.g., obtaining first depth maps corresponding to the upper, middle, and lower positions of the front surface of the target workpiece, and obtaining second depth maps corresponding to the upper, middle, and lower positions of the rear surface of the target workpiece, for a total of three first depth maps and three second depth maps). This allows for the capture of three-dimensional morphological information of multiple positions of the workpiece from a bidirectional viewing perspective, and reduces random errors in single acquisition by using a single camera for multiple scans. Subsequently, the two sets of depth maps (multiple first depth maps and multiple second depth maps) are transformed using corresponding transformation parameters to effectively correct errors caused by camera installation deviations, acquisition angle deviations, and workpiece placement offsets. Furthermore, by stitching the transformed maps separately, complete first and second stitched maps are obtained, which allows the obtained stitched maps to cover the entire surface of the workpiece and complex structural areas, improving the overall consistency of workpiece thickness measurement. Finally, the workpiece thickness is calculated using two stitched images (e.g., calculating the thickness from the upper, middle, and lower positions of the front surface of the target workpiece to the rear surface of the workpiece). By directly linking bidirectional three-dimensional data, the thickness measurement results at each position in the workpiece are made more accurate.

[0073] In addition, this application also provides a workpiece thickness detection device, electronic device, computer-readable storage medium, and computer program product, which also have the above-mentioned beneficial effects. Attached Figure Description

[0074] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0075] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0076] Figure 2 This is a flowchart of a workpiece thickness detection method provided in an embodiment of this application;

[0077] Figure 3 A schematic diagram of a calibration plate and control tower provided in an embodiment of this application;

[0078] Figure 4A pixel interpolation schematic diagram provided for an embodiment of this application;

[0079] Figure 5 This application provides a schematic diagram of a depth map obtained by scanning a workpiece using two 3D cameras.

[0080] Figure 6 This is a schematic diagram of image stitching provided in an embodiment of this application;

[0081] Figure 7 This is a schematic diagram illustrating the registration, fusion, and splicing of a calibration board provided in an embodiment of this application. Detailed Implementation

[0082] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0083] The steps in this application can be performed by a specified electronic device, the form of which is not limited; for example, it can be a general-purpose computing device such as a computer or server. Please refer to... Figure 1 , Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 100 may include a processor 101 and a memory 102, and may further include one or more of the following: a multimedia component 103, an information input / output (I / O) interface 104, and a communication component 105.

[0084] The processor 101 controls the overall operation of the electronic device 100 to complete all or part of the steps in the workpiece thickness detection method described above. The memory 102 stores various types of data to support the operation of the electronic device 100. This data may include, for example, instructions for any application or method operating on the electronic device 100, as well as application-related data. The memory 102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as one or more of Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0085] Multimedia component 103 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 102 or transmitted via communication component 105. The audio component also includes at least one speaker for outputting audio signals. I / O interface 104 provides an interface between processor 101 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 105 is used for wired or wireless communication between electronic device 100 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of these. Therefore, the corresponding communication component 105 may include a Wi-Fi component, a Bluetooth component, and an NFC component.

[0086] The electronic device 100 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the workpiece thickness detection method proposed in this application.

[0087] This application provides an electronic device, including a memory and a processor, wherein: the memory is used to store a computer program; and the processor is used to execute the computer program to implement the above-described workpiece thickness detection method.

[0088] In one embodiment, the electronic device further includes: a material loading component and a detection component; wherein the material loading component is used to load a target workpiece; the detection component is provided with a first camera and a second camera arranged opposite to each other; the processor is used to: control the movement of the material loading component so that the target workpiece moves to the detection position; the detection component is used to: control the first camera and the second camera to scan the target workpiece multiple times; wherein the stroke length and direction of different scans by the first camera or the second camera are the same, and the distance from the target workpiece remains unchanged.

[0089] In one specific embodiment, the aforementioned electronic device may include a material loading component, a detection component, and a control component. The control component may be the aforementioned processor 101, and the detection component may be connected to other components, such as the control component, via the aforementioned I / O interface 104. The material loading component is used to load materials awaiting workpiece thickness detection and may specifically include multiple fixtures. The control component may specifically consist of a motion control card, an industrial computer, and a display. The industrial computer, through the motion control card, can control the detection component to move to the detection position of the material, and can also control the materials corresponding to the multiple fixtures of the material loading component to be detected sequentially. Specifically, the material (i.e., the target workpiece to be detected) is placed on the material loading component, and then the control component moves the material to the detection position. The detection component controls two cameras (e.g., two cameras arranged vertically opposite each other, two cameras arranged horizontally opposite each other, etc.) to capture images of the target workpiece online, and then performs calculations and analyses based on the workpiece thickness detection method of this application to obtain the workpiece thickness detection result (i.e., the workpiece thickness). Finally, the workpiece thickness detection result is sent back to the control component. The control unit can further visualize the workpiece thickness detection results, and when needed, such as if the detection results are not within the tolerance range of the material, the control unit can also issue a reminder or alarm.

[0090] Please refer to Figure 2 , Figure 2 A flowchart illustrating a workpiece thickness detection method provided in this application embodiment. The method includes:

[0091] S101. Using a first camera and a second camera that are set relative to each other, the target workpiece is scanned multiple times to obtain a first depth map and a second depth map corresponding to multiple positions of the target workpiece respectively; wherein, each first depth map is obtained by the first camera scanning the target workpiece once from a first direction, and each second depth map is obtained by the second camera scanning the target workpiece once from the opposite direction of the first direction.

[0092] It should be noted that the target workpiece can be placed on the carrier plane of the workpiece loading component. After the target workpiece is moved to the detection position by the control component connected to the workpiece loading component, the detection component controls the relatively set first and second cameras to perform online image acquisition, thereby capturing first and second depth maps corresponding to multiple positions of the target workpiece. For example, first depth maps corresponding to the upper, middle, and lower positions of the front surface of the target workpiece are obtained, and second depth maps corresponding to the upper, middle, and lower positions of the rear surface of the target workpiece are obtained, for a total of three first depth maps and three second depth maps. Then, the workpiece thickness detection method of this embodiment is run to perform calculation and analysis to obtain the thickness of each position of the target workpiece (e.g., the upper, middle, and lower positions of the front surface of the workpiece). Both the first and second cameras are 3D cameras. Therefore, the first and second cameras, which are set opposite to each other, can be set in front of or behind the target workpiece, or on the left or right side of the target workpiece. Thus, when the first direction is in front of the target workpiece, the opposite direction of the first direction is behind the target workpiece; when the first direction is on the left side of the target workpiece, the opposite direction of the first direction is on the right side of the target workpiece. Other opposing layouts of the first and second cameras set opposite to each other can be deduced by analogy, and will not be elaborated here.

[0093] Generally, each pixel value in a depth image represents the distance of that point from the camera (usually in millimeters or meters), focusing on the representation of spatial depth information. The distance information for each pixel value can be stored as a 16-bit short, which can be used to reconstruct the true three-dimensional point data of the image in space, enhancing the realism of the image. In this embodiment, to reduce the random error of a single camera acquiring an image of the workpiece in a single scan, two cameras are set up to simultaneously capture multiple images of the target workpiece. For example, each camera scans the target workpiece three times, with the same scan length and direction each time, and the distance between the camera and the workpiece remains constant. Specifically, after the camera completes the first scan, it returns to its initial scanning position, the workpiece is offset by a certain distance (this distance is set based on experience and the camera's standard parameters), and then the second scan begins. After the second scan is completed, the camera returns to its initial scanning position again, and the workpiece is offset again by a certain distance for the third scan.

[0094] Therefore, the process of the first camera or the second camera scanning the target workpiece in a single scan includes: after placing the first camera or the second camera in the initial scanning position, controlling the target workpiece to move a set distance (i.e., offset by a certain distance); controlling the first camera or the second camera to perform scanning to obtain the corresponding first depth map or second depth map; wherein, the stroke length and direction of the first camera or the second camera are the same in different scans, and the distance from the target workpiece remains unchanged.

[0095] S102. Determine the first transformation parameters corresponding to the multiple first depth maps respectively, and use the first transformation parameters to perform matrix transformation on the multiple first depth maps respectively to obtain multiple first transformed maps.

[0096] S103. Determine the second transformation parameters corresponding to the multiple second depth maps respectively, and use the second transformation parameters to perform matrix transformation on the multiple second depth maps respectively to obtain multiple second transformation maps.

[0097] In this process, multiple first depth maps are transformed using first transformation parameters corresponding to each first depth map, resulting in multiple transformed first depth maps that lie in the same coordinate system. The first transformation parameters corresponding to different first depth maps can be synchronized to the same coordinate system before the transformations of the different first depth maps are performed separately. Similarly, multiple second depth maps are transformed using second transformation parameters corresponding to each second depth map, resulting in multiple transformed second depth maps that lie in the same coordinate system. The second transformation parameters corresponding to different second depth maps can be synchronized to the same coordinate system before the transformations of the different second depth maps are performed separately.

[0098] It should be noted that each first depth map corresponds to a first transformation parameter, and each second depth map also corresponds to a second transformation parameter. The transformation parameters for different depth maps are different. The transformation parameter corresponding to any depth map is matched with the depth map obtained by scanning the calibration plate with any camera based on position. For example, if the first and second cameras scan the target workpiece three times, they obtain three first depth maps A1, A2, and A3; and three second depth maps B1, B2, and B3. Correspondingly, if the first and second cameras scan the calibration plate three times in the same manner, they obtain three first calibration depth maps C1, C2, and C3; and three second calibration depth maps D1, D2, and D3. Then, based on C1, C2, and C3, their respective transformation parameters (i.e., transformation matrices) Y can be determined. C1 Y C2 Y C3 Since C1 and A1 have the same scanning position and angle, therefore Y C1 That is, the transformation parameters of A1, and correspondingly, Y C2 Y C3 These can be used as transformation parameters for A2 and A3, respectively. Based on this principle, the transformation parameters for D1, D2, and D3 can be determined accordingly, which are also the transformation parameters for B1, B2, and B3.

[0099] In this embodiment, to determine the transformation parameters corresponding to different depth maps, the calibration plate is scanned multiple times using the first and second cameras to obtain multiple first calibration depth maps and multiple second calibration depth maps. Transformation parameters are calculated for each depth map in the first and second calibration depth maps. Each first calibration depth map is obtained by the first camera performing a single scan of the calibration plate from a first direction, and each second calibration depth map is obtained by the second camera performing a single scan of the calibration plate from the opposite direction in the first direction. In one embodiment, the process of generating transformation parameters corresponding to arbitrary depth maps includes: the process of determining first and second transformation parameters includes: acquiring multiple first calibration depth maps and multiple second calibration depth maps of a calibration board; wherein each first calibration depth map is obtained by a first camera scanning the calibration board in a single scan from a first direction, and each second calibration depth map is obtained by a second camera scanning the calibration board in a single scan from a opposite direction in the first direction; determining the point cloud data corresponding to the multiple first calibration depth maps and multiple second calibration depth maps respectively; for each point cloud data, calculating the normal vector of the corresponding calibration depth map based on the current point cloud data; marking each plane of the calibration board in the current point cloud data according to the azimuth and elevation angles of the normal vectors; aligning each plane with the template data of the calibration board to obtain an initial transformation matrix; performing a spatial transformation on the current point cloud data using the initial transformation matrix, and aligning the spatial transformation result with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data; and determining the first and second transformation parameters based on the transformation parameters corresponding to the multiple first calibration depth maps and multiple second calibration depth maps respectively. As can be seen, this embodiment calculates the corresponding transformation parameters based on the point cloud data of each depth map in the first and second calibration depth maps. This method utilizes the template data of the calibration board for registration, and then performs a secondary fine registration based on the point cloud data through spatial transformation, which improves the accuracy of the final transformation parameters.

[0100] Furthermore, to improve the efficiency of normal vector calculation, row and column integrals can be calculated on the depth map first. The integral result can then be used to determine the corresponding point cloud integral result in the point cloud data of the depth map, thereby accelerating normal vector calculation and avoiding computational complexity caused by calculating integrals using the point cloud data of the depth map. Therefore, in one implementation, calculating the normal vector of the corresponding calibration depth map based on the current point cloud data includes: calculating the row and column integral map corresponding to the calibration depth map of the current point cloud data; and calculating the normal vector based on the current point cloud data and the row and column integral map.

[0101] It should be noted that the calibration plate has multiple towers, and each plane on the calibration plate refers to the surface of each tower on the calibration plate and the plane on which the calibration plate is located. For example... Figure 3As shown, a tower on the calibration board has five faces: target face 1, target face 2, target face 3, target face 4, and target face 5; the background is the plane where the calibration board is located. In one embodiment, each plane is aligned with the template data of the calibration board to obtain an initial transformation matrix, including: comparing each plane with the corresponding plane in the template data using the least squares method, and calculating an initial transformation matrix that satisfies preset conditions. Specifically, four planes are randomly selected from the planes on the calibration board, and a point is selected from each of these four planes. Corresponding points are also selected from the four planes in the template data of the calibration board, thus forming four pairs of points. The least squares method is used to calculate PT=Q based on each pair of points. If the number of interior points in the calculated T reaches the preset condition, then T is retained; otherwise, the above process is repeated to select planes and execute subsequent steps. Finally, the matrix T1 with the most interior points is retained as the initial transformation matrix.

[0102] In one implementation, the spatial transformation result is aligned with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data. This includes: comparing the spatial transformation result with the template data using an iterative nearest-point algorithm to obtain an optimized transformation matrix; obtaining the transformation parameters corresponding to the calibration depth map corresponding to the current point cloud data based on the optimized transformation matrix, and optimizing matrix T1 to obtain an optimized transformation matrix T2, which can then be used as the transformation parameters corresponding to the depth map.

[0103] S104. Combine multiple first transformation images to obtain a first composite image, and combine multiple second transformation images to obtain a second composite image.

[0104] After step S102, multiple first transformation images have been synchronized to the same coordinate system; after step S103, multiple second transformation images have also been synchronized to the same coordinate system; therefore, multiple first transformation images and multiple second transformation images can be stitched together. In one embodiment, stitching multiple first transformation images to obtain a first stitched image and stitching multiple second transformation images to obtain a second stitched image includes: calculating the stitched pixels corresponding to pixels in each first transformation image using sub-pixel interpolation, and taking the average of overlapping pixels in different first transformation images to determine the first stitched image; calculating the stitched pixels corresponding to pixels in each second transformation image using sub-pixel interpolation, and taking the average of overlapping pixels in different second transformation images to determine the second stitched image. The sub-pixel interpolation method can be referred to... Figure 4 As shown, Figure 4 In Figure A, an original pixel 13 can be interpolated into 9 pixels in Figure B. Among these 9 pixels, at least one can be used as the stitching pixel of the original pixel 13 in the stitched image, so as to prevent the original pixel 13 from being lost in the stitched image.

[0105] S105. Based on the first and second stitched images, determine the thickness at multiple locations.

[0106] To achieve more accurate calculation of the thickness at various locations on the target workpiece, in one embodiment, the thickness at multiple locations is determined based on a first and a second spliced ​​image. This includes: selecting one of the first and second spliced ​​images as a reference image; fitting corresponding reference plane equations to multiple locations in the reference image; determining the center points corresponding to multiple locations in the other spliced ​​image that was not selected; and for each location, calculating the distance between the center point of that location and the reference plane equation for that location, and determining the thickness at that location based on the distance. For example, when calculating the thickness from the upper, middle, and lower locations on the front surface of the target workpiece to the corresponding locations on the rear surface of the workpiece, for the upper location, the distance between the center point of that location on the front surface of the workpiece and the reference plane equation for that location on the rear surface of the workpiece is calculated, and this distance is the thickness from the upper three locations on the front surface of the target workpiece to the corresponding locations on the rear surface of the workpiece.

[0107] In one implementation, if the target workpiece is a cube, determining the thickness of the target workpiece based on the distance between the first and second stitched images includes: selecting one of the first and second stitched images as a reference image; fitting a reference plane based on the region of interest in the reference image; determining the center point of the region of interest in the other unselected stitched image; calculating the distance between the center point and the reference plane; and determining the thickness of the target workpiece based on the distance. The distance between the center point and the reference plane can be considered the thickness of the target workpiece.

[0108] As can be seen, this embodiment uses a first camera and a second camera positioned opposite each other to scan the target workpiece multiple times, acquiring multiple first depth maps and multiple second depth maps respectively. This captures the three-dimensional morphological information of the workpiece from a bidirectional viewing perspective and reduces random errors in a single acquisition by using a single camera for multiple scans. Then, corresponding transformation parameters are applied to the two sets of depth maps to effectively correct errors caused by camera installation deviations, acquisition angle deviations, and workpiece placement offsets. Furthermore, by stitching the transformed maps, complete first and second stitched images are obtained, ensuring that the resulting stitched images cover the entire surface of the workpiece and complex structural areas, improving the overall consistency of workpiece thickness measurement. Finally, the workpiece thickness is calculated using the two stitched images, directly linking the bidirectional three-dimensional data, so that the calculation results accurately reflect the actual thickness of the workpiece.

[0109] The calibration process provided in this application, namely the transformation parameter calculation process, is further described below, including: scanning the calibration plate three times with two relatively set 3D cameras to obtain three first calibration depth maps C1, C2, and C3; and three second calibration depth maps D1, D2, and D3; and then calculating the transformation parameters for each depth map using the following steps.

[0110] Step 1: Quickly calculate the normal vector of the depth map.

[0111] ① An integral image of the depth map is constructed using a row-column separation technique, i.e., first integrating by row, then by column. Row integration involves accumulating the height data of the same row from left to right. Since it's depth map integration, invalid values ​​use the integration result of the previous valid pixel. Column integration involves accumulating the row integration data of the same column from top to bottom. During row integration, invalid height values ​​must be set to 0, and the coordinate integration value of invalid pixels uses the integration result of the previous valid pixel.

[0112] ②The normal vector is calculated based on the row and column integral results and the point cloud data of the depth map.

[0113] The least squares plane is fitted using 5 neighboring pixels, and its calculation formula is as follows: .

[0114] Therefore, the normal vector is calculated as {a,b,1}, which can be normalized to {x,y,z}. In the above calculation formula, each element in the first matrix is ​​taken as the result of column integral, which can improve the efficiency of normal vector calculation.

[0115] Step 2: Planar differentiation and extraction.

[0116] ① Calculate the azimuth angle of the normal vector n=(x,y,z) of each valid pixel in the depth map. and elevation angle This yields an azimuth and elevation diagram. The calculation formula is: ; .

[0117] ②Statistical azimuth and elevation angle The histogram has a size of 3600, meaning 0.1 degrees is one unit.

[0118] ③ Based on the histogram, distinguish all the faces of the towers and the plane where the background is located on the current calibration plate depth map, mark the main face (i.e. the plane where the background is located) as 1, and mark the other faces accordingly.

[0119] ④ Perform connected component processing on all faces.

[0120] ⑤ Extract point clouds from each connected region, calculate the center of the point cloud, and form a face center array. This yields the face center arrays for each face.

[0121] Step 3: Calculation of transformation parameters.

[0122] Preliminary registration of feature points: Randomly select 4 planes from the marked planes above, select one point in each of these 4 planes, and select the corresponding point in the corresponding 4 planes of the template data of the calibration board. This will form 4 pairs of points. Calculate PT=Q based on the least squares method for each pair of points. If the number of interior points of the calculated T reaches the preset condition, then retain T; otherwise, repeat the above process to select planes and execute subsequent steps. Finally, retain the initial transformation matrix T1 with the most interior points as the initial transformation matrix.

[0123] Point cloud fine registration: After spatially transforming the 3D point cloud data of the depth map using the initial transformation matrix T1, it is aligned with the template point cloud (the point cloud data of the template data of the calibration board) with high precision through the iterative nearest point algorithm (ICP). Finally, the optimized transformation matrix T2 is obtained, realizing sub-millimeter level registration of point cloud data.

[0124] Steps 1-3 are performed on C1, C2, C3, D1, D2, and D3 respectively, resulting in six corresponding T2 values. The T2 values ​​corresponding to C1, C2, and C3 are transformed to the same coordinate system, as are the T2 values ​​corresponding to D1, D2, and D3, to achieve coordinate alignment of images captured by the same camera.

[0125] After this calibration process is completed, the workpiece thickness inspection process includes:

[0126] Two 3D cameras, positioned vertically, are used to scan the workpiece to acquire a depth map. Due to the limited field of view of the 3D cameras, multiple scans are required to capture a local depth map of the workpiece each time. Specifically, the two cameras simultaneously perform three scans to achieve the goal of capturing a full image of the workpiece. Figure 5 As shown, the camera scans three times to obtain three images from the front. Figure 5 The first row of three images), the lower camera scans three times to obtain the three images on the back ( Figure 5 (The three images in the second row). For example: the first camera (upper camera) and the second camera (lower camera) scan the workpiece three times, obtaining three first depth maps A1, A2, and A3; and three second depth maps B1, B2, and B3. The travel length and direction of each camera's three scans are the same, and the distance between the camera and the workpiece remains constant. Furthermore, the depth maps can store height information, but due to the camera's imaging principle, some height information contains invalid values. The data format includes two channels: a 16-bit integer height channel and a Boolean marker channel, where true indicates valid and false indicates invalid.

[0127] Because the two cameras are positioned vertically and scan multiple times, it is necessary to stitch the three front images together and the three back images together, ensuring that the stitched data from the front and back have a physical positional correspondence in space. Therefore, it is necessary to first transform A1, A2, and A3 to the same coordinate system, and B1, B2, and B3 to the same coordinate system. The specific transformation process includes: after transforming the T2 values ​​corresponding to C1, C2, and C3 to the same coordinate system, operations are performed on A1, A2, and A3 with their corresponding T2 values ​​to obtain A1-1, A2-2, and A3-3 (i.e., the three first-transformation images) in the same coordinate system. Similarly, after transforming the T2 values ​​corresponding to D1, D2, and D3 to the same coordinate system, operations are performed on B1, B2, and B3 with their corresponding T2 values ​​to obtain B1-1, B2-2, and B3-3 (i.e., the three second-transformation images) in the same coordinate system.

[0128] It should be noted that this conversion process can be calculated based on point cloud data. Therefore, before performing the conversion process, each depth map: A1, A2, A3, B1, B2, and B3 can be converted into point cloud data respectively. The conversion formula is as follows: ; ; In the formula: i and j represent the column and row of a pixel in the depth map, res represents the resolution, off represents the offset, and P represents a point in the point cloud. The resolution and offset are parameters of the 3D camera, stored in the depth map data, and can be directly obtained and calculated.

[0129] Next, the three local images (three first-transformation images) from the upper camera are stitched together, and the three local images (three second-transformation images) from the lower camera are stitched together. The stitching process can be found in [reference needed]. Figure 6 As shown, four images are constructed into rectangles and subjected to affine transformation. The center point of each rectangle becomes the center point of the stitched image, and the width and height of the rectangles are equal to the width and height of the images. The size of the stitched image is the bounding rectangle of the transformed rectangles. Specifically, using... Figure 4 In Figure 1 As a reference image, making Figure 2 , Figure 3 , Figure 4 Sync to Figure 1 Under the given coordinates, then complete. Figure 1 , Figure 2 , Figure 3 , Figure 4 exist Figure 6 The image is stitched together within the rectangle shown. Since the different local images to be stitched overlap, the average height value of the overlapping area is taken.

[0130] In this embodiment, to reduce the error in transforming the original pixel coordinates to the stitched image, sub-pixel interpolation is performed on the local image to calculate the position of a single pixel in the stitched image. For example... Figure 4 As shown, the 3-neighborhood interpolation of the image is performed using the following formula: ; ; In the formula: i t j t (u0, v0) represents the row and column offsets, (u1, v1) represents the subpixel coordinates of the local image, and (u1, v1) represents the coordinates of the stitched image.

[0131] The following steps involve measuring the workpiece thickness: Distance measurements are performed on the stitched images from the upper and lower cameras. First, a plane is fitted: Multiple Regions of Interest (ROIs) are selected on the lower camera stitched image, representing the detection frame where the measured location lies on the lower surface of the workpiece. Valid points within the ROIs are extracted to fit the plane, accurately determining the surface location of that workpiece position and providing a reference for thickness measurement. Thickness measurement: Multiple ROIs are selected on the upper camera stitched image, representing the detection frame where the measured location lies on the upper surface of the workpiece. The center point of each valid point within the ROI is extracted, and the height from this center point to the fitted plane of the lower camera is calculated. This height value represents the thickness of the workpiece at the measured location.

[0132] Please see Figure 7 Referring to the aforementioned fusion and stitching scheme, the calibration board depth map can also be registered, fused, and stitched to obtain the upper camera stitched image and the lower camera stitched image of the calibration board.

[0133] As can be seen, this embodiment uses two 3D cameras to scan the workpiece to acquire a local depth map. Then, the 3D sensor automatically calibrates the acquired depth map and performs depth map fusion and stitching, which can quickly and accurately measure the thickness of the workpiece.

[0134] The workpiece thickness detection device provided in the embodiments of this application is described below. The workpiece thickness detection device described below and the workpiece thickness detection method described above can be referred to in correspondence.

[0135] This application provides a workpiece thickness detection device, including:

[0136] The acquisition module is used to scan the target workpiece multiple times using a first camera and a second camera that are set relative to each other, and obtain a first depth map and a second depth map corresponding to multiple positions of the target workpiece respectively; wherein, each first depth map is obtained by the first camera scanning the target workpiece in a single scan from a first direction, and each second depth map is obtained by the second camera scanning the target workpiece in a single scan from the opposite direction of the first direction.

[0137] The transformation module is used to determine the first transformation parameters corresponding to the multiple first depth maps respectively, and to perform matrix transformation on the multiple first depth maps respectively using the first transformation parameters to obtain multiple first transformed maps; and to determine the second transformation parameters corresponding to the multiple second depth maps respectively, and to perform matrix transformation on the multiple second depth maps respectively using the second transformation parameters to obtain multiple second transformed maps.

[0138] The splicing module is used to splice multiple first transformation images to obtain a first spliced ​​image, and to splice multiple second transformation images to obtain a second spliced ​​image;

[0139] The detection module is used to determine the thickness at multiple locations based on the first and second stitched images.

[0140] In one implementation, the transformation module is specifically used for:

[0141] Multiple first calibration depth maps and multiple second calibration depth maps of the calibration board are acquired; wherein each first calibration depth map is obtained by a first camera scanning the calibration board in a single scan from a first direction, and each second calibration depth map is obtained by a second camera scanning the calibration board in a single scan from the opposite direction from the first direction;

[0142] Determine the point cloud data corresponding to multiple first calibration depth maps and multiple second calibration depth maps respectively;

[0143] For each point cloud data, calculate the normal vector of the corresponding calibration depth map based on the current point cloud data;

[0144] Based on the azimuth and elevation angles of the normal vector, mark each plane of the calibration board in the current point cloud data;

[0145] Align each plane with the template data of the calibration board to obtain the initial transformation matrix;

[0146] The current point cloud data is spatially transformed using the initial transformation matrix, and the spatial transformation result is aligned with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data.

[0147] Based on the transformation parameters corresponding to multiple first calibration depth maps and multiple second calibration depth maps, the first transformation parameters and the second transformation parameters are determined.

[0148] In one implementation, the transformation module is specifically used for:

[0149] Calculate the row and column integral map corresponding to the calibration depth map of the current point cloud data;

[0150] Calculate the normal vector based on the current point cloud data and the row and column integral diagram.

[0151] In one implementation, the transformation module is specifically used for:

[0152] The least squares method is used to compare each plane with the corresponding plane in the template data, and the initial transformation matrix that satisfies the preset conditions is calculated.

[0153] In one implementation, the transformation module is specifically used for:

[0154] The optimized transformation matrix is ​​obtained by comparing the spatial transformation results with the template data using the iterative nearest point algorithm.

[0155] The transformation parameters corresponding to the calibration depth map of the current point cloud data are obtained based on the optimized transformation matrix.

[0156] In one implementation, the splicing module is specifically used for:

[0157] The stitched pixels corresponding to each pixel in the first transformation image are calculated by sub-pixel interpolation, and the average value of the overlapping pixels in different first transformation images is taken to determine the first stitched image.

[0158] The stitched pixels corresponding to each pixel in the second transformation image are calculated using sub-pixel interpolation, and the average value of the overlapping pixels in different second transformation images is taken to determine the second stitched image.

[0159] In one implementation, the detection module is specifically used for:

[0160] Choose one of the first and second spliced ​​images as a reference image;

[0161] For multiple locations in the reference image, the corresponding reference plane equations are fitted to obtain them respectively;

[0162] Determine the center points corresponding to multiple positions in another stitched image that was not selected;

[0163] For each location, calculate the distance between the center point of that location and the reference plane equation for that location, and determine the thickness at that location based on the distance.

[0164] The workpiece thickness detection device provided in this embodiment can capture the entire surface of the workpiece and complex structural areas, thereby improving the accuracy of the workpiece thickness measurement results.

[0165] The following describes the computer-readable storage medium provided in the embodiments of this application. The computer-readable storage medium described below can be referred to in correspondence with the workpiece thickness detection method described above.

[0166] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described workpiece thickness detection method.

[0167] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0168] The following describes a computer program product provided by an embodiment of this application. The computer program product described below can be referred to in conjunction with other embodiments described herein.

[0169] A computer program product includes a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned disclosed workpiece thickness detection method.

[0170] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the steps in any of the above embodiments.

[0171] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0172] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0173] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0174] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "include," "contain," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0175] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for detecting the thickness of a workpiece, characterized in that, include: By using a first camera and a second camera that are positioned relative to each other, the target workpiece is scanned multiple times to obtain a first depth map and a second depth map corresponding to multiple positions of the target workpiece, respectively; wherein, each first depth map is obtained by the first camera scanning the target workpiece once from a first direction, and each second depth map is obtained by the second camera scanning the target workpiece once from the opposite direction of the first direction; Determine the first transformation parameters corresponding to the multiple first depth maps respectively, and perform matrix transformation on the multiple first depth maps respectively using the first transformation parameters to obtain multiple first transformed maps; Determine the second transformation parameters corresponding to the multiple second depth maps respectively, and perform matrix transformation on the multiple second depth maps respectively using the second transformation parameters to obtain multiple second transformed maps; A first stitched image is obtained by stitching together the plurality of first transformed images, and a second stitched image is obtained by stitching together the plurality of second transformed images; Based on the first stitched image and the second stitched image, the thickness at the plurality of locations is determined.

2. The method according to claim 1, characterized in that, Multiple first calibration depth maps and multiple second calibration depth maps of the calibration board are acquired; wherein each first calibration depth map is obtained by the first camera scanning the calibration board in a single scan from a first direction, and each second calibration depth map is obtained by the second camera scanning the calibration board in a single scan from the opposite direction of the first direction; Determine the point cloud data corresponding to the plurality of first calibration depth maps and the plurality of second calibration depth maps respectively; For each point cloud data, calculate the normal vector of the corresponding calibration depth map based on the current point cloud data; Based on the azimuth and elevation angles of the normal vector, mark each plane of the calibration board in the current point cloud data; Align each plane with the template data of the calibration board to obtain the initial transformation matrix; The initial transformation matrix is ​​used to perform spatial transformation on the current point cloud data, and the spatial transformation result is aligned with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data. Based on the transformation parameters corresponding to the plurality of first calibration depth maps and the plurality of second calibration depth maps, the first transformation parameter and the second transformation parameter are determined.

3. The method according to claim 2, characterized in that, Calculate the normal vector of the corresponding calibration depth map based on the current point cloud data, including: Calculate the row and column integral map corresponding to the calibration depth map of the current point cloud data; The normal vector is calculated based on the current point cloud data and the row and column integral map.

4. The method according to claim 2, characterized in that, Align each plane with the template data of the calibration board to obtain the initial transformation matrix, including: The least squares method is used to compare each plane with the corresponding plane in the template data, and the initial transformation matrix that satisfies the preset conditions is calculated.

5. The method according to claim 2, characterized in that, Align the spatial transformation result with the template data to obtain the transformation parameters of the calibration depth map corresponding to the current point cloud data, including: The optimized transformation matrix is ​​obtained by comparing the spatial transformation result with the template data using the iterative nearest point algorithm. Based on the optimized transformation matrix, the transformation parameters corresponding to the calibration depth map of the current point cloud data are obtained.

6. The method according to any one of claims 1 to 5, characterized in that, A first stitched image is obtained by stitching together the plurality of first transformed images, and a second stitched image is obtained by stitching together the plurality of second transformed images, including: The stitched pixels corresponding to each pixel in the first transformation image are calculated by sub-pixel interpolation, and the average value of the overlapping pixels in different first transformation images is taken to determine the first stitched image. The stitched pixels corresponding to each pixel in the second transformation image are calculated using sub-pixel interpolation, and the average value of the overlapping pixels in different second transformation images is taken to determine the second stitched image.

7. The method according to any one of claims 1 to 5, characterized in that, Based on the first stitched image and the second stitched image, the thickness at the plurality of locations is determined, including: Choose one of the first stitched image and the second stitched image as the reference image; For each of the multiple locations in the reference diagram, a corresponding reference plane equation is obtained by fitting the equation. Determine the center points corresponding to the plurality of positions in another stitched image that was not selected; For each location, calculate the distance between the center point of that location and the reference plane equation for that location, and determine the thickness of that location based on the distance.

8. A workpiece thickness detection device, characterized in that, include: The acquisition module is used to scan the target workpiece multiple times using a first camera and a second camera that are set relative to each other, and obtain a first depth map and a second depth map corresponding to multiple positions of the target workpiece respectively; wherein, each first depth map is obtained by the first camera scanning the target workpiece once from a first direction, and each second depth map is obtained by the second camera scanning the target workpiece once from the opposite direction of the first direction; The transformation module is used to determine first transformation parameters corresponding to multiple first depth maps, and to perform matrix transformations on the multiple first depth maps using the first transformation parameters to obtain multiple first transformed maps; and to determine second transformation parameters corresponding to multiple second depth maps, and to perform matrix transformations on the multiple second depth maps using the second transformation parameters to obtain multiple second transformed maps. A splicing module is used to splice the plurality of first transformation images to obtain a first spliced ​​image, and to splice the plurality of second transformation images to obtain a second spliced ​​image; The detection module is used to determine the thickness at the plurality of locations based on the first stitched image and the second stitched image.

9. An electronic device, characterized in that, Includes memory and processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method as described in any one of claims 1 to 7.

10. The electronic device according to claim 9, characterized in that, Also includes: Material loading and detection components; The material loading component is used to load the target workpiece; the detection component is equipped with a first camera and a second camera that are arranged opposite to each other. The processor is used to: control the movement of the material loading component to move the target workpiece to the detection position; The detection component is used to control the first camera and the second camera to scan the target workpiece multiple times; wherein the travel length and direction of the first camera or the second camera are the same in different scans, and the distance between them and the target workpiece remains unchanged.