Workpiece inspection method, device and storage medium based on multi-camera vision inspection
By using a multi-camera vision inspection method, the problems of low efficiency, poor consistency, and high risk of missed inspections in sheet metal manufacturing have been solved, achieving efficient and reliable inspection and data management, and generating intuitive inspection reports.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KEMENG WIND POWER EQUIP TANGSHAN CO LTD
- Filing Date
- 2026-05-29
- Publication Date
- 2026-06-30
AI Technical Summary
Existing manual inspection methods in sheet metal manufacturing are inefficient, have poor consistency, high risk of missed inspections, high labor costs, and are difficult to manage data.
A multi-camera visual inspection method is adopted, which simultaneously acquires images through multiple cameras, performs distortion correction, edge detection and top view correction, and combines the incident angle weighted fusion algorithm to stitch together a panoramic top view, constructs a signed distance field, generates a deviation heat map, aligns it with the edge map of the CAD template, and obtains measured parameters for judgment.
It improves testing efficiency and accuracy, ensures the reliability of measurement data, generates intuitive test reports, reduces labor costs, and enhances testing consistency and data management efficiency.
Smart Images

Figure CN122305928A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automated inspection technology, and in particular to a workpiece inspection method, apparatus and storage medium based on multi-camera vision inspection. Background Technology
[0002] In the sheet metal manufacturing industry, after laser cutting machines complete the blanking, quality inspection is typically carried out manually. The specific process involves professional quality inspectors using manual measuring tools such as tape measures and calipers, based on paper drawings, to inspect the dimensions, hole positions, and notch sizes of each part according to the dimensions marked on the drawings, and visually inspecting for defects. This inspection method remains the mainstream in the industry, especially suitable for inspecting sheet metal parts in small batches with many varieties and complex shapes.
[0003] However, existing manual testing methods suffer from low testing efficiency, poor consistency, high risk of missed detection, high labor costs, and difficulty in data management. Summary of the Invention
[0004] The technical problem solved by this invention is to provide a workpiece inspection method, device and storage medium based on multi-camera vision inspection, which helps to solve the technical problems of low inspection efficiency, poor inspection consistency, high risk of missed inspection, high labor cost and difficult data management of manual inspection methods.
[0005] In a first aspect, the present invention provides a workpiece inspection method based on multi-camera vision inspection, comprising: Images of the workpiece to be inspected are acquired simultaneously by multiple cameras, and the images acquired by each camera are preprocessed to generate a top-view edge map and a grayscale image for each camera. Based on the top-view edge map and grayscale image of each camera, and combined with the incident angle weighted fusion algorithm, a panoramic top view covering the detection area of the workpiece to be detected is stitched together. The geometric contour of the workpiece to be inspected is extracted from the DXF design file of the workpiece to be inspected and rendered as a CAD template edge map. The panoramic top view is then aligned with the CAD template edge map. A signed distance field is constructed based on the aligned panoramic top view. Each edge point of the workpiece to be detected is sampled in the signed distance field. The deviation of the panoramic top view is calculated, and a deviation heatmap is generated. Based on the edge map of the CAD template and the panoramic top view, the measured parameters of the workpiece to be inspected are obtained, and the measured parameters are compared with the preset tolerance standard to obtain the judgment result of the measured parameters. Based on the deviation heatmap and the determination results of the measured parameters, an inspection report for the workpiece to be inspected is generated, and a comprehensive determination result is given.
[0006] In some optional implementations, the preprocessing of images acquired by each of the cameras to generate a top-view edge map and a grayscale image for each camera includes: The images acquired by the cameras are distorted based on the distortion coefficients calibrated for each camera, resulting in a distortion-corrected image. Edge detection is performed on the distortion-corrected image based on an edge detection deep learning model to obtain an edge probability map; Based on the homography matrix of the camera, the edge probability map is transformed to the top-view canvas coordinate system to generate the top-view edge map and grayscale map for each camera.
[0007] In some alternative implementations, prior to preprocessing the images acquired by each of the cameras, the process further includes: A local planar measurement coordinate system is established on the plane where the support panel of the workpiece to be inspected is located; Calculate the homography matrix for each camera from planar metric coordinates to camera pixel coordinates; The four corner points of the image captured by each camera are back-projected onto the planar metric coordinate system through the homography matrix to obtain four physical coordinate points; The actual visible area of each camera on the support panel is formed by enclosing the four physical coordinate points; Obtain the union of the actual visible areas of all cameras and combine it with safety margins to automatically determine the physical size and resolution of the panoramic top-view canvas.
[0008] In some optional implementations, after generating the top-view edge map and grayscale image for each of the cameras, the process further includes: Calculate the Pearson correlation coefficient of the grayscale images of any two cameras in the overlapping area, and determine whether the Pearson correlation coefficient meets the target threshold condition; Several feature points of the image are automatically extracted in the overlapping area. The feature points are back-projected onto the planar measurement coordinate system using the homography matrix of at least two cameras. The height deviation of the back-projected points of the feature points to the planar measurement coordinate system is calculated. It is then determined whether the height deviation meets the target allowable deviation range. Based on the judgment results of the Pearson correlation coefficient and / or the judgment results of the height deviation, a preliminary inspection report of the workpiece to be inspected is generated.
[0009] In some optional implementations, the step of stitching together the top-view edge map and the grayscale image from each of the cameras, combined with an incident angle-weighted fusion algorithm, to form a panoramic top view covering the detection area of the workpiece to be inspected includes: Obtain the angle between the optical axis direction of each camera and the plane normal vector of the supporting panel, determine the incident angle of the camera, and use the cosine value of the incident angle as the fusion weight of the corresponding camera; The top-view edge image is fused using the maximum value based on the fusion weights, and the grayscale image is fused using a weighted average. Based on the fused top edge image and the grayscale image, a panoramic top view covering the detection area of the workpiece to be inspected is stitched together.
[0010] In some optional implementations, the step of extracting the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected and rendering it as a CAD template edge map, and aligning the panoramic top view with the CAD template edge map, includes: Extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected; Based on the geometric contour, a set of planar points is sampled at fixed intervals and rendered as the edge map of the CAD template; Principal component analysis was performed on the edge point cloud of the panoramic top view and the sampled point cloud of the CAD template edge map to obtain the principal direction of the edge point cloud and the principal direction of the sampled point cloud. Based on the main direction of the edge point cloud and the main direction of the sampled point cloud, several candidate initial angles of the workpiece to be detected are generated; Each candidate initial angle is iteratively aligned based on a multi-scale distance field.
[0011] In some optional implementations, the step of obtaining the measured parameters of the workpiece to be inspected based on the template edge map and the panoramic top view, and comparing the measured parameters with a preset tolerance standard to obtain the judgment result of the measured parameters, includes: Based on the geometric element definition of the geometric contour in the edge diagram of the CAD template, the design position and size of each geometric element are projected onto the panoramic top view. Within the target range around the projection position in the panoramic top view, search for the actual edge points corresponding to the workpiece to be detected; The actual edge points are fitted with least squares to obtain the measured parameters of the workpiece to be tested. The measured parameters are compared with the preset tolerance standard to obtain the judgment result of the measured parameters.
[0012] Secondly, the present invention also provides a workpiece inspection device based on multi-camera vision inspection, comprising: The preprocessing module is used to simultaneously acquire images of the workpiece to be inspected based on multiple cameras, and to preprocess the images acquired by each of the cameras to generate a top-view edge map and a grayscale image for each camera. The stitching module is used to stitch together a panoramic top view covering the detection area of the workpiece to be inspected based on the top view edge map and the grayscale map of each camera, combined with the incident angle weighted fusion algorithm. The alignment module is used to extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected, render it as a CAD template edge map, and align the panoramic top view with the CAD template edge map. The calculation module is used to construct a signed distance field based on the aligned panoramic top view, sample each edge point of the workpiece to be detected into the signed distance field, calculate the deviation of the panoramic top view, and generate a deviation heatmap. The comparison module is used to obtain the measured parameters of the workpiece to be inspected based on the edge map of the CAD template and the panoramic top view, compare the measured parameters with the preset tolerance standard, and obtain the judgment result of the measured parameters. The generation module is used to generate an inspection report for the workpiece to be inspected based on the deviation heat map and the judgment results of the measured parameters, and to give a comprehensive judgment result.
[0013] Thirdly, the present invention also provides an electronic device, comprising: a memory, a processor, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus; The memory is used to store at least one executable instruction that causes the processor to execute the workpiece inspection method based on multi-camera vision inspection as described above.
[0014] Fourthly, the present invention also provides a computer-readable storage medium storing computer instructions that cause a processor to execute the workpiece detection method based on multi-camera vision inspection as described above.
[0015] In summary, the present invention provides a workpiece inspection method, apparatus, and storage medium based on multi-camera visual inspection. By sequentially performing distortion correction, edge detection, and top-view correction on the original images acquired by each camera, the grayscale information of the workpiece surface to be inspected can be retained in the top-view grayscale image for subsequent surface defect detection; the geometric contour information of the workpiece to be inspected can be retained in the top-view edge image for subsequent dimensional measurement and contour matching. By automatically assigning fusion weights according to the incident angle of each camera and filtering grazing angle views, the top-view edge image and grayscale image, after being stitched together, have a nearly uniform equivalent measurement resolution throughout the detection area, effectively improving edge positioning accuracy; and by comparing the image grayscale correlation coefficient and height deviation of the stitched panoramic top view, a preliminary inspection report of the workpiece to be inspected is generated.
[0016] The panoramic top view is further aligned with the edge image of the CAD template. A signed distance field is constructed based on the aligned panoramic top view to calculate the deviation of the panoramic top view and generate a deviation heatmap. Deviation quantification through the signed distance field not only outputs the magnitude of the deviation but also distinguishes its direction, providing directional guidance for process improvement. The deviation heatmap uses pseudo-color to visually display the global deviation distribution, enabling operators to quickly identify problem areas. Furthermore, by combining the CAD template edge image and the panoramic top view, the measured parameters of the workpiece to be inspected are obtained. These measured parameters are compared with preset tolerance standards to obtain the judgment results. The system can automatically distinguish different geometric elements such as outer contours, inner holes, arcs, and straight lines, independently fitting and judging tolerances for each element, indicating the deviation of each element, and improving the workpiece inspection efficiency.
[0017] By further combining the deviation heatmap and the judgment results of measured parameters, and taking into account the status of quality gating, a structured inspection report of the workpiece to be inspected is generated by summarizing the global deviation statistics, the measurement results of each geometric element, and the status of quality gating, and a comprehensive judgment result is given. From camera capture to inspection report output, no manual intervention is required. Automatic connection with the conveyor platform's electrical system is achieved through arrival and completion signals, which can effectively improve the inspection efficiency of the workpiece and ensure the reliability of the measurement data. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to an embodiment of the present invention; Figure 2 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to another embodiment of the present invention; Figure 3 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to another embodiment of the present invention; Figure 4 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to another embodiment of the present invention; Figure 5 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to another embodiment of the present invention; Figure 6 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to another embodiment of the present invention; Figure 7 This is a schematic flowchart of a workpiece inspection method based on multi-camera vision inspection according to another embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a workpiece inspection device based on multi-camera vision inspection according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0022] According to embodiments of the present invention, such as Figure 1 As shown, a workpiece inspection method based on multi-camera vision inspection is provided, including the following steps: Step S100: Simultaneously acquire images of the workpiece to be inspected based on multiple cameras, and preprocess the images acquired by each camera to generate a top-view edge map and a grayscale map of each camera.
[0023] In step S100, as Figure 2 As shown, the specific steps include: Step S110: Perform distortion correction on the images acquired by the cameras based on the distortion coefficients calibrated for each camera to obtain a distortion-corrected image; Step S120: Perform edge detection on the distortion-corrected image based on the edge detection deep learning model to obtain an edge probability map; Step S130: Based on the homography matrix of the camera, transform the edge probability map to the top view canvas coordinate system to generate the top view edge map and grayscale map of each camera.
[0024] Specifically, the process begins with multiple cameras simultaneously exposing and acquiring images of the workpiece to be inspected. Once the mobile platform carrying the workpiece has moved to the designated position at the inspection station, the electrical system sends a stop signal. Upon receiving this stop signal, the vision system immediately initiates the inspection process. Upon receiving the trigger signal, the vision system simultaneously sends hardware synchronization trigger signals to all cameras, causing all cameras to expose at the same time and acquire the original image of the workpiece. If all cameras fail to expose synchronously, even slight vibrations or displacements of the mobile platform can lead to ghosting and stitching misalignments during subsequent fusion, with measurement errors potentially reaching several millimeters, thus affecting the inspection results of the workpiece.
[0025] Understandably, for workpieces of different materials and colors, parameters such as exposure time and gain can be preset in advance to ensure uniform image brightness across all cameras, preventing overexposure or underexposure of any single camera that could lead to edge detection failure. If any camera times out or returns an error image, the system immediately terminates the process, triggers a camera acquisition failure alarm, and records the faulty camera's number.
[0026] Secondly, the images captured by each camera are preprocessed. Since lens distortion is an inherent optical error, it is necessary to perform distortion correction on the images captured by each camera based on the distortion coefficients independently calibrated for each camera. This process maps the pixels in the distorted image back to their corresponding positions in the ideal, distortion-free image, thus obtaining a distortion-corrected image.
[0027] Then, a deep learning edge detection model, such as the DexiNed edge detection model, is used to perform edge detection processing on the distortion-corrected image, resulting in a single-channel edge probability map. Each pixel's value ranges from 0 to 255, corresponding to the probability that the pixel represents a real workpiece edge; 0 indicates it is not an edge at all, and 255 indicates it is. This edge probability map retains the edge confidence information, and different thresholds can be set to filter edges according to different detection needs.
[0028] Finally, based on the homography matrix corresponding to each camera, the coordinates of the edge probability map corresponding to that camera in the top-view canvas coordinate system are calculated. Then, through inverse mapping and bilinear interpolation, the pixel values of the original image are assigned to the corresponding coordinates in the top-view canvas coordinate system, thereby generating the top-view edge map and grayscale map for each camera. The grayscale map retains the grayscale information of the surface of the workpiece to be inspected, facilitating subsequent surface defect detection; the top-view edge map retains the geometric contour information of the workpiece to be inspected, facilitating subsequent dimensional measurement and contour matching.
[0029] In some implementation methods, the number of cameras can be set according to the size of the workpiece to be inspected, such as setting 9 cameras in a 3×3 array, 6 cameras in a 2×3 array, or 12 cameras in a 3×4 array, etc., where the fusion algorithm adaptively adapts to different numbers of cameras.
[0030] Step S200: Based on the top-view edge map and grayscale image of each camera, and combined with the incident angle weighted fusion algorithm, a panoramic top view covering the detection area of the workpiece to be detected is stitched together.
[0031] In step S200, as Figure 3 As shown, the specific steps include: Step S210: Obtain the angle between the optical axis direction of each camera and the plane normal vector of the supporting panel, determine the incident angle of the camera, and use the cosine value of the incident angle as the fusion weight of the corresponding camera. Step S220: Based on the fusion weights, the top-view edge map is fused using the maximum value, and the grayscale image is fused using a weighted average. Step S230: Based on the fused top edge image and the grayscale image, stitch them together to form a panoramic top view covering the detection area of the workpiece to be detected.
[0032] Specifically, the support panel is a high-precision planar platform on which the workpiece to be inspected is placed. The plane normal vector is a vector perpendicular to the support panel and pointing upwards. The optical axis direction of the camera is the vector from the center of the camera lens to the shooting area. The angle between the optical axis direction of each camera and the plane normal vector of the support panel determines the incident angle of that camera. The cosine value of this incident angle is used as the fusion weight for the corresponding camera. The smaller the incident angle, the closer the camera is to perpendicular shooting, and the higher the fusion weight, allowing the fused image to retain high-quality information to the maximum extent. If the incident angle exceeds a set threshold, the view of that camera will be filtered.
[0033] The top-view edge map is fused using maximum value fusion based on the camera's fusion weights. For each pixel in the overlapping area, the maximum edge probability value of that pixel across all cameras is taken. As long as one camera clearly captures an edge of the workpiece to be detected, the fused top-view edge map will retain this strong edge, ensuring the edge integrity of the workpiece to be detected; it can also effectively suppress weak edges and false edges from oblique viewing angles.
[0034] Then, a weighted average fusion is applied to the grayscale images based on the camera's fusion weight. For each pixel in the overlapping area, a weighted sum is performed according to the normalized weights of each camera, which can effectively eliminate exposure differences between different cameras and achieve seamless stitching. Furthermore, it can integrate surface information from multiple perspectives, improving the accuracy of defect detection. Moreover, averaging multiple images can effectively reduce the impact of random noise.
[0035] In the weighted average fusion process of grayscale images, the total weight includes incident angle fusion weight, viewing distance weight, and field-of-view edge attenuation weight. In the viewing distance weight, the weight is inversely proportional to the square of the distance from the camera to the target point; cameras closer to the target point have higher signal-to-noise ratios and therefore higher weights. In the field-of-view edge attenuation weight, the weight linearly decreases from 1 to 0 in the edge regions of the camera's field of view. This is to compensate for edge illumination attenuation and edge distortion caused by the lens, making the transition in overlapping areas more natural and eliminating stitching seams.
[0036] The fused top-view edge image and grayscale image are integrated into the final panoramic top view. Specifically, based on the actual size of the workpiece to be inspected, blank areas in the top-view canvas that do not contain the workpiece to be inspected are cropped to reduce the computational load of subsequent processing. It is also necessary to ensure that the fused edge image and grayscale image are completely aligned at the pixel level to avoid misalignment between the edges and the surface.
[0037] By automatically assigning fusion weights based on the incident angle of each camera and filtering grazing angle views, the fused top view has a nearly uniform equivalent measurement resolution throughout the detection area, effectively improving edge positioning accuracy.
[0038] like Figure 4 As shown, the following steps are included after step S230: Step S240: Calculate the Pearson correlation coefficient of the grayscale images of any two cameras in the overlapping area, and determine whether the Pearson correlation coefficient meets the target threshold condition; Step S250: Automatically extract several feature points of the image in the overlapping area, back-project the several feature points onto the planar measurement coordinate system using the homography matrix of at least two cameras, calculate the height deviation of the back-projected points of the feature points to the planar measurement coordinate system, and determine whether the height deviation meets the target allowable deviation range. Step S260: Based on the judgment result of the Pearson correlation coefficient and / or the judgment result of the height deviation, generate a preliminary inspection report for the workpiece to be inspected.
[0039] Specifically, the Pearson correlation coefficient of grayscale images from any two cameras in the overlapping region is calculated to verify whether the imaging from different cameras in the same area is consistent, and to detect surface defects and system optical anomalies. After calculating the Pearson correlation coefficient of the grayscale images, the Pearson correlation coefficient is compared with the target threshold condition. If the Pearson correlation coefficient does not meet the target threshold condition, it indicates that there may be camera displacement, calibration failure, or foreign objects on the workpiece surface. If the Pearson correlation coefficient meets the target threshold condition, it indicates that the two images are highly consistent in the overlapping region and there is no obvious misalignment in the stitching.
[0040] Further, several feature points are automatically extracted from the overlapping area of the image. For each extracted feature point, the corresponding pixel coordinates of each feature point in the distortion-corrected images of at least two original cameras are found. Then, the image pixel coordinates are back-projected onto the planar measurement coordinate system using the homography matrix of the corresponding camera, resulting in multiple back-projection points. The height deviation of the back-projection points of the feature points to the planar measurement coordinate system is calculated. It is further determined whether the height deviation meets the target allowable deviation range. If the height deviation of a certain feature point exceeds the range, it indicates that the workpiece to be inspected may have warping, deformation, protrusions, depressions, etc., causing the feature point to be outside the planar measurement coordinate system.
[0041] Based on the results of the Pearson correlation coefficient and / or height deviation assessment, if the Pearson correlation coefficient does not meet the target threshold condition, or meets the target threshold condition, or the height deviation does not meet the target allowable deviation range, or meets the target allowable deviation range, a preliminary inspection report for the workpiece to be inspected is generated. If either the Pearson correlation coefficient or the height deviation fails the check, it indicates that the camera calibration may have failed. The system immediately terminates the process, issues an alarm, reports the anomaly to the host computer, and prompts for recalibration to avoid outputting erroneous measurement results.
[0042] Step S300: Extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected, render it as a CAD template edge map, and align the panoramic top view with the CAD template edge map.
[0043] In step S300, as Figure 5 As shown, the specific steps include: Step S310: Extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected; Step S320: Based on the geometric contour, sample the points at fixed intervals as a set of planar points and render them as the edge map of the CAD template; Step S330: Perform principal component analysis on the edge point cloud of the panoramic top view and the sampled point cloud of the CAD template edge map respectively to obtain the principal direction of the edge point cloud and the principal direction of the sampled point cloud; Step S340: Based on the main direction of the edge point cloud and the main direction of the sampling point cloud, generate several candidate initial angles for the workpiece to be detected; Step S350: Iteratively align each candidate initial angle based on the multi-scale distance field.
[0044] Specifically, the geometric contours of the workpiece to be inspected are extracted from its DXF design file, including but not limited to line segments, arcs, and polygons. Irrelevant information is filtered out to extract the valid geometric contours required for inspection, such as reading all graphic data in the DXF design file; filtering out non-inspection layers such as annotation layers, centerline layers, and comment layers; converting all graphic elements into a unified continuous line segment representation, such as discretizing arcs into short straight line segments; and grouping them according to inner and outer contours to form a complete set of closed contours.
[0045] The geometric contours are sampled at fixed intervals as planar point sets. Continuous vector geometric contours are converted into discrete point sets with the same density as the actual edge point cloud. These planar point sets are then rendered as binary images of the same size as the panoramic top view, i.e., CAD template edge maps. The fixed sampling interval is consistent with the physical resolution of the panoramic top view. For example, if the resolution of the panoramic top view is 0.1 mm / pixel, then the fixed sampling interval is also set to 0.1 mm. This ensures that the sampled point cloud density perfectly matches the actual edge point cloud density, improving the accuracy of subsequent alignment calculations.
[0046] Principal component analysis was further performed on the edge point cloud of the panoramic top view and the sampled point cloud of the CAD template edge image, respectively, to obtain the principal direction of the edge point cloud and two orthogonal principal directions of the sampled point cloud. Since most industrial workpieces have 90° rotational symmetry, the principal directions may differ by 90°, 180° or 270°. Therefore, the principal directions of the edge point cloud and the sampled point cloud can generate four candidate initial angles for the workpiece to be inspected, covering all possible rotation angles and avoiding alignment errors caused by rotational symmetry.
[0047] Further, multi-scale distance fields are used for iterative alignment of each candidate initial angle, and a coarse-to-fine pyramid strategy is employed for iterative refinement. For example, at the coarse scale, the image is reduced by a factor of 4 to quickly find the global optimum; at the medium scale, the image is reduced by a factor of 2 for further refinement; and at the fine scale, final optimization is performed on the original resolution. This approach ensures global convergence, avoids getting trapped in local optima, guarantees final alignment accuracy, and improves computational speed.
[0048] Furthermore, an alignment quality gate is set, using bidirectional Chamfer distance to measure the alignment quality between the edge point cloud and the sampled point cloud. If the bidirectional Chamfer distance is below a set threshold, such as 5 pixels, the alignment is considered successful; if it exceeds the set threshold, it indicates that the placement deviation of the workpiece to be inspected may be too large or the CAD file is incompatible, and the system cannot perform reliable measurement, thus determining that the alignment has failed. If the alignment fails, the system will automatically retry the alignment once; if the retry still fails, it is determined to be an alignment anomaly, an unqualified signal is output, and the operator is prompted to check the workpiece placement position or the CAD file.
[0049] Step S400: Construct a signed distance field based on the aligned panoramic top view, sample each edge point of the workpiece to be detected into the signed distance field, calculate the deviation of the panoramic top view, and generate a deviation heatmap.
[0050] In step S400, a signed distance field is constructed for the aligned panoramic top view. Points inside the geometric contour in the panoramic top view are negative values, and points outside are positive values, with units in millimeters. Each edge point of the workpiece to be inspected is sampled into the signed distance field using bilinear interpolation to obtain a signed deviation value for each edge point. A positive deviation indicates that the actual edge of the workpiece is outside the geometric contour, expanding outwards compared to the design size; a negative deviation indicates that the actual edge of the workpiece is inside the geometric contour, contracting inwards compared to the design size. After statistical analysis of the deviation values of all edge points, key indicators are output, including mean, standard deviation, P95, P99, maximum absolute deviation, and RMS. The mean is the overall average deviation of the workpiece, reflecting systematic error; the standard deviation is the dispersion of the deviation, reflecting random error; P95 / P99 indicates that 95% / 99% of the deviation values are less than this value, reflecting extreme deviation situations; the maximum absolute deviation is the maximum deviation across the entire geometric contour; and RMS is the root mean square deviation, comprehensively reflecting the overall deviation level of the workpiece. Then, a deviation heatmap is generated based on the key output indicators. Different colors in the deviation heatmap represent different deviation results. For example, red can indicate that the workpiece has a positive deviation, blue can indicate that the workpiece has a negative deviation, and green can indicate that the workpiece has no deviation.
[0051] Deviation quantification using signed distance fields not only outputs the magnitude of the deviation but also distinguishes its direction, providing directional guidance for process improvement. The deviation heatmap visually displays the global deviation distribution in pseudo-color, enabling operators to quickly identify problem areas.
[0052] Step S500: Based on the edge map of the CAD template and the panoramic top view, obtain the measured parameters of the workpiece to be inspected, compare the measured parameters with the preset tolerance standard, and obtain the judgment result of the measured parameters.
[0053] In step S500, as Figure 6 As shown, the specific steps include: Step S510: Based on the geometric element definition of the geometric contour in the edge diagram of the CAD template, project the design position and size of each geometric element onto the panoramic top view; Step S520: Search for the actual edge points corresponding to the workpiece to be detected within the target range around the projection position in the panoramic top view; Step S530: Perform least-squares fitting on the actual edge points to obtain the measured parameters of the workpiece to be tested; Step S540: Compare the measured parameters with the preset tolerance standard to obtain the judgment result of the measured parameters.
[0054] Specifically, using the geometric elements defined in the CAD template edge drawing, such as circles, holes, lines, arcs, and their design parameters, the design position and dimensions of each element are projected onto the coordinate system of the panoramic top view. Within the target range around the projected position in the panoramic top view, the actual edge points corresponding to the workpiece to be inspected are searched; for example, for a straight line element, edge points are searched within the rectangular areas on both sides of the theoretical straight line; for a circle or arc element, edge points are searched within the inner and outer annular areas of the theoretical circle. The target range is automatically adjusted based on global alignment errors to ensure that corresponding edge points are found. Then, least-squares fitting is performed on the actual edge points, including circle fitting, line fitting, and arc fitting, to obtain the measured parameters of the workpiece to be inspected. These measured parameters can be used to determine the radius deviation and center position deviation of circles, the length deviation and angle deviation of lines, and the radius deviation and center deviation of arcs. The measured parameters are then compared with preset tolerance standards (supporting ISO 2768 general tolerances and custom tolerances), and the results of judging whether each geometric element is qualified or unqualified are given, thus obtaining the judgment result of the measured parameters.
[0055] By automatically distinguishing different geometric elements such as outer contours, inner holes, arcs, and straight lines, and independently fitting and judging their tolerances, it can directly point out which hole is off-center, which side is too short, which arc radius is incorrect, etc. Compared with the traditional manual measurement with measuring tape or calipers, it effectively improves the inspection efficiency of workpieces.
[0056] Step S600: Based on the deviation heat map and the determination results of the measured parameters, generate a test report for the workpiece to be tested and give a comprehensive determination result.
[0057] In step S600, combining the deviation heatmap and the judgment results of measured parameters, and further combining the status of quality gating, a structured inspection report of the workpiece to be inspected is generated by summarizing the global deviation statistics, the measurement results of each geometric element, and the status of quality gating, and a comprehensive judgment result is given. Specifically, this includes: a global deviation report, such as mean, standard deviation, P95, RMS, and deviation heatmap; a geometric element inspection report, such as design value, measured value, deviation value, tolerance, and judgment, supporting CSV and JSON formats; a comprehensive pass / fail judgment; and a complete evidence traceability chain record.
[0058] Before issuing an inspection report for the workpiece to be inspected, the following checks will be made: whether the edge point coverage exceeds 80%, whether the RMS of the fitting residuals of each geometric element is below the threshold, and whether the number of fitting points meets the minimum requirements. Geometric elements that do not meet the conditions are marked as unreliable and are not included in the final judgment criteria.
[0059] Finally, after completing all inspection steps, the vision system sends an inspection completion signal to the electrical controller, along with a pass / fail signal. Upon receiving the signal, the electrical system controls the moving platform to automatically return to the loading station, or sorts the workpiece into the pass / fail feeder based on the judgment result.
[0060] like Figure 7 As shown, in one embodiment, before preprocessing the images acquired by each of the cameras, the following steps are also included: Step 001: Establish a local planar measurement coordinate system on the plane where the support panel of the workpiece to be inspected is located; Step 002: Calculate the homography matrix for each camera from the planar metric coordinates to the camera pixel coordinates; Step 003: Project the four corner points of the image captured by each camera onto the plane metric coordinate system through the homography matrix to obtain four physical coordinate points; Step 004: Based on the four physical coordinate points, form the actual visible area of each camera on the support panel; Step 005: Obtain the union of the actual visible areas of all cameras, and combine it with the safety margin to automatically determine the physical size and resolution of the panoramic top view canvas.
[0061] Specifically, a local planar measurement coordinate system is established on the plane containing the support panel of the workpiece to be inspected. This local planar measurement coordinate system includes an origin and two orthogonal in-plane axes, axis_u and axis_v. Three parameters are defined on this local planar measurement coordinate system: origin represents the three-dimensional coordinates of the origin in the world coordinate system; u_hat represents the unit orthogonal vector of the u-axis in the world coordinate system; and v_hat represents the unit orthogonal vector of the v-axis in the world coordinate system.
[0062] For each camera i, calculate the homography matrix Hi = Ki[Ri×u_hat, Ri×v_hat, Ri×origin+ti] from its local plane metric coordinates (u, v) to its pixel coordinates. Here, R and t are the extrinsic parameters of the camera relative to the world coordinate system, and K is the intrinsic parameter matrix of the camera. Each camera is independently calibrated to obtain the intrinsic parameter matrix K and distortion coefficients. The relative pose (extrinsic parameters) between cameras is obtained through calibration in a unified world coordinate system. The extrinsic parameters of each camera describe the transformation relationship from the world coordinate system to the camera coordinate system. Specifically, a checkerboard or ChArUco calibration board can be used to calibrate the intrinsic parameters of each camera. The calibration board is placed on the carrier panel of the mobile platform, and the extrinsic parameters of each camera, including the rotation matrix R and translation vector t, are solved synchronously using the known world coordinate points on the calibration board. The system automatically checks the calibration reprojection error (RMS) of each camera; if it exceeds the threshold, the data of that camera is rejected from participating in subsequent processes.
[0063] Further, the pixel coordinates of the four corner points of the image captured by each camera are obtained. For each corner point, the inverse of the homography matrix is used for backprojection to obtain its physical coordinates in the local plane metric coordinate system. The quadrilateral formed by the four physical coordinate points is the actual visible area of the camera on the mounting panel. It can be understood that the actual visible area is an irregular quadrilateral, which is an inevitable result of perspective distortion. The four vertices of the quadrilateral correspond to the four corner points of the original image; all physical points inside the quadrilateral can be seen by the camera, while points outside cannot.
[0064] Further, the actual visible areas of all cameras are collected, and the minimum bounding rectangle of the actual visible area is calculated. This rectangle includes the minimum and maximum X-coordinates of all actual visible area vertices, the minimum and maximum Y-coordinates of all actual visible area vertices, and the maximum Y-coordinate of all actual visible area vertices. This minimum bounding rectangle represents the maximum physical area that all cameras can cover. Based on this minimum bounding rectangle, a certain safety margin is added around the perimeter to compensate for positional deviations during workpiece placement, preventing the workpiece from exceeding the canvas area; to compensate for calibration errors and camera installation errors; and to provide a certain margin for subsequent image processing. By combining the minimum bounding rectangle and the safety margin, the physical size and resolution of the panoramic top-view canvas can be automatically determined, providing a basis for image preprocessing and ensuring the accuracy of subsequent detection results.
[0065] In summary, the workpiece inspection method based on multi-camera vision inspection provided by this invention sequentially performs distortion correction, edge detection, and top-view correction on the original images acquired by each camera. This allows the grayscale information of the workpiece surface to be inspected to be preserved in the top-view grayscale image, facilitating subsequent surface defect detection; and the geometric contour information of the workpiece to be inspected to be preserved in the top-view edge image, facilitating subsequent dimensional measurement and contour matching. By automatically assigning fusion weights according to the incident angle of each camera and filtering grazing angle views, the stitched top-view edge image and grayscale image achieve a nearly uniform equivalent measurement resolution throughout the detection area, effectively improving edge positioning accuracy. Furthermore, the image grayscale correlation coefficient and height deviation of the stitched panoramic top view are compared to generate a preliminary inspection report for the workpiece.
[0066] The panoramic top view is further aligned with the edge image of the CAD template. A signed distance field is constructed based on the aligned panoramic top view to calculate the deviation of the panoramic top view and generate a deviation heatmap. Deviation quantification through the signed distance field not only outputs the magnitude of the deviation but also distinguishes its direction, providing directional guidance for process improvement. The deviation heatmap uses pseudo-color to visually display the global deviation distribution, enabling operators to quickly identify problem areas. Furthermore, by combining the CAD template edge image and the panoramic top view, the measured parameters of the workpiece to be inspected are obtained. These measured parameters are compared with preset tolerance standards to obtain the judgment results. The system can automatically distinguish different geometric elements such as outer contours, inner holes, arcs, and straight lines, independently fitting and judging tolerances for each element, indicating the deviation of each element, and improving the workpiece inspection efficiency.
[0067] By further combining the deviation heatmap and the judgment results of measured parameters, and taking into account the status of quality gating, a structured inspection report of the workpiece to be inspected is generated by summarizing the global deviation statistics, the measurement results of each geometric element, and the status of quality gating, and a comprehensive judgment result is given. From camera capture to inspection report output, no manual intervention is required. Automatic connection with the conveyor platform's electrical system is achieved through arrival and completion signals, which can effectively improve the inspection efficiency of the workpiece and ensure the reliability of the measurement data.
[0068] According to embodiments of the present invention, such as Figure 8 As shown, on the other hand, a workpiece inspection device based on multi-camera vision inspection is also provided, including: The preprocessing module 100 is used to simultaneously acquire images of the workpiece to be inspected based on multiple cameras, and to preprocess the images acquired by each of the cameras to generate a top-view edge map and a grayscale image for each of the cameras. The stitching module 200 is used to stitch together a panoramic top view covering the detection area of the workpiece to be inspected based on the top view edge map and the grayscale map of each camera, combined with the incident angle weighted fusion algorithm. Alignment module 300 is used to extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected, render it as a CAD template edge map, and align the panoramic top view with the CAD template edge map; The calculation module 400 is used to construct a signed distance field based on the aligned panoramic top view, sample each edge point of the workpiece to be detected into the signed distance field, calculate the deviation of the panoramic top view, and generate a deviation heatmap. The comparison module 500 is used to obtain the measured parameters of the workpiece to be inspected based on the edge map of the CAD template and the panoramic top view, compare the measured parameters with the preset tolerance standard, and obtain the judgment result of the measured parameters. The first generation module 600 is used to generate an inspection report for the workpiece to be inspected based on the deviation heat map and the judgment results of the measured parameters, and to give a comprehensive judgment result.
[0069] In one embodiment, the preprocessing module 100 includes: The correction unit is used to perform distortion correction on the image acquired by the camera based on the distortion coefficient calibrated for each camera, so as to obtain a distortion-corrected image; The detection unit is used to perform edge detection on the distortion-corrected image based on an edge detection deep learning model to obtain an edge probability map; The transformation unit is used to transform the edge probability map to the top view canvas coordinate system based on the homography matrix of the camera, and generate the top view edge map and grayscale map of each camera.
[0070] In one embodiment, it further includes: A construction module is used to establish a local planar measurement coordinate system on the plane where the support panel of the workpiece to be inspected is located; The second calculation module is used to calculate the homography matrix of each camera from the planar metric coordinates to the camera pixel coordinates; The projection module is used to backproject the four corner points of the image captured by each of the cameras onto the planar metric coordinate system through the homography matrix to obtain four physical coordinate points. An enclosure module is used to enclose and form the actual visible area of each camera on the carrier panel based on the four physical coordinate points. The acquisition module is used to acquire the union of the actual visible areas of all cameras and, in conjunction with the safety margin, automatically determine the physical size and resolution of the panoramic top-view canvas.
[0071] In one embodiment, it further includes: The third calculation module is used to calculate the Pearson correlation coefficient of the grayscale images of any two cameras in the overlapping area, and to determine whether the Pearson correlation coefficient meets the target threshold condition. The fourth calculation module is used to automatically extract several feature points of the image in the overlapping area, back-project the several feature points onto the planar measurement coordinate system using the homography matrix of at least two cameras, calculate the height deviation of the back-projected points of the feature points to the planar measurement coordinate system, and determine whether the height deviation meets the target allowable deviation range. The second generation module is used to generate an inspection report for the workpiece to be inspected based on the judgment result of the Pearson correlation coefficient and / or the judgment result of the height deviation.
[0072] In one embodiment, the splicing module 200 includes: The acquisition unit is used to acquire the angle between the optical axis direction of each camera and the plane normal vector of the supporting panel, determine the incident angle of the camera, and use the cosine value of the incident angle as the fusion weight of the corresponding camera. The fusion unit is used to perform maximum value fusion on the top-view edge image based on the fusion weight, and to perform weighted average fusion on the grayscale image; The stitching unit is used to stitch together the fused top edge image and the grayscale image into a panoramic top view that covers the detection area of the workpiece to be inspected.
[0073] In one embodiment, the alignment module 300 includes: An extraction unit is used to extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected. A rendering unit is used to sample planar points at fixed intervals based on the geometric contour and render them as the edge map of the CAD template. The analysis unit is used to perform principal component analysis on the edge point cloud of the panoramic top view and the sampled point cloud of the CAD template edge map respectively, to obtain the principal direction of the edge point cloud and the principal direction of the sampled point cloud; The generation unit is used to generate several candidate initial angles for the workpiece to be detected based on the main direction of the edge point cloud and the main direction of the sampled point cloud; Alignment units are used to iteratively align each of the candidate initial angles based on a multi-scale distance field.
[0074] In one embodiment, the comparison module 500 includes: The projection unit is used to project the design position and size of each geometric element onto the panoramic top view based on the geometric element definition of the geometric contour in the edge diagram of the CAD template. The search unit is used to search for the actual edge point corresponding to the workpiece to be detected within the target range around the projection position in the panoramic top view. The fitting unit is used to perform least-squares fitting on the actual edge points to obtain the measured parameters of the workpiece to be inspected. The comparison unit is used to compare the measured parameters with the preset tolerance standard to obtain the judgment result of the measured parameters.
[0075] Figure 9 The diagram shows a structural schematic of an embodiment of an electronic device provided by the present invention. The specific embodiments of the present invention do not limit the specific implementation of the electronic device.
[0076] like Figure 9 As shown, the electronic device may include: a processor 1002, a communications interface 1004, a memory 1006, and a communications bus 1008.
[0077] The processor 1002, communication interface 1004, and memory 1006 communicate with each other via communication bus 1008. Communication interface 1004 is used to communicate with other network elements such as clients or other servers. The processor 1002 executes program 1010, specifically performing the relevant steps described in the above embodiment of the workpiece inspection method based on multi-camera vision inspection.
[0078] Specifically, program 1010 may include program code, which includes computer-executable instructions.
[0079] The processor 1002 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The electronic device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs.
[0080] Memory 1006 is used to store program 1010. Memory 1006 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0081] Specifically, program 1010 can be called by processor 1002 to cause electronic device to execute the relevant steps in the above embodiments of the workpiece inspection method based on multi-camera vision inspection.
[0082] Those skilled in the art will understand that Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned device. For example, electronic devices may also include components that are more... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown.
[0083] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0084] In the specific implementation of the above embodiments, the technical features can be combined in any non-contradictory way. For the sake of brevity, not all possible combinations of the above technical features are described. However, as long as the combination of these technical features is not contradictory, it should be considered to be within the scope of this specification.
[0085] The specific embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A workpiece inspection method based on multi-camera vision inspection, characterized in that, include: Images of the workpiece to be inspected are acquired simultaneously by multiple cameras, and the images acquired by each camera are preprocessed to generate a top-view edge map and a grayscale image for each camera. Based on the top-view edge map and grayscale image of each camera, and combined with the incident angle weighted fusion algorithm, a panoramic top view covering the detection area of the workpiece to be detected is stitched together. The geometric contour of the workpiece to be inspected is extracted from the DXF design file of the workpiece to be inspected and rendered as a CAD template edge map. The panoramic top view is then aligned with the CAD template edge map. A signed distance field is constructed based on the aligned panoramic top view. Each edge point of the workpiece to be detected is sampled in the signed distance field. The deviation of the panoramic top view is calculated, and a deviation heatmap is generated. Based on the edge map of the CAD template and the panoramic top view, the measured parameters of the workpiece to be inspected are obtained, and the measured parameters are compared with the preset tolerance standard to obtain the judgment result of the measured parameters. Based on the deviation heatmap and the determination results of the measured parameters, an inspection report for the workpiece to be inspected is generated, and a comprehensive determination result is given.
2. The workpiece inspection method based on multi-camera vision inspection according to claim 1, characterized in that, The step of preprocessing the images acquired by each of the cameras to generate a top-view edge map and a grayscale image for each camera includes: The images acquired by the cameras are distorted based on the distortion coefficients calibrated for each camera, resulting in a distortion-corrected image. Edge detection is performed on the distortion-corrected image based on an edge detection deep learning model to obtain an edge probability map; Based on the homography matrix of the camera, the edge probability map is transformed to the top-view canvas coordinate system to generate the top-view edge map and grayscale map for each camera.
3. The workpiece inspection method based on multi-camera vision inspection according to claim 1, characterized in that, Before preprocessing the images acquired by each of the cameras, the process also includes... A local planar measurement coordinate system is established on the plane where the support panel of the workpiece to be inspected is located; Calculate the homography matrix for each camera from planar metric coordinates to camera pixel coordinates; The four corner points of the image captured by each camera are back-projected onto the planar metric coordinate system through the homography matrix to obtain four physical coordinate points; The actual visible area of each camera on the support panel is formed by enclosing the four physical coordinate points; Obtain the union of the actual visible areas of all cameras and combine it with safety margins to automatically determine the physical size and resolution of the panoramic top-view canvas.
4. The workpiece inspection method based on multi-camera vision inspection according to claim 3, characterized in that, The top-view edge map and grayscale image of each camera are combined with an incident angle-weighted fusion algorithm to form a panoramic top view covering the detection area of the workpiece to be inspected, including: Obtain the angle between the optical axis direction of each camera and the plane normal vector of the supporting panel, determine the incident angle of the camera, and use the cosine value of the incident angle as the fusion weight of the corresponding camera; The top-view edge image is fused using the maximum value based on the fusion weights, and the grayscale image is fused using a weighted average. Based on the fused top edge image and the grayscale image, a panoramic top view covering the detection area of the workpiece to be inspected is stitched together.
5. The workpiece inspection method based on multi-camera vision inspection according to claim 3, characterized in that, After stitching together a panoramic top view covering the inspection area of the workpiece to be inspected, it also includes: Calculate the Pearson correlation coefficient of the grayscale images of any two cameras in the overlapping area, and determine whether the Pearson correlation coefficient meets the target threshold condition; Several feature points of the image are automatically extracted in the overlapping area. The feature points are back-projected onto the planar measurement coordinate system using the homography matrix of at least two cameras. The height deviation of the back-projected points of the feature points to the planar measurement coordinate system is calculated. It is then determined whether the height deviation meets the target allowable deviation range. Based on the judgment results of the Pearson correlation coefficient and / or the judgment results of the height deviation, a preliminary inspection report of the workpiece to be inspected is generated.
6. The workpiece inspection method based on multi-camera vision inspection according to claim 1, characterized in that, The process involves extracting the geometric contour of the workpiece from its DXF design file and rendering it as a CAD template edge map, then aligning the panoramic top view with the CAD template edge map, including: Extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected; Based on the geometric contour, a set of planar points is sampled at fixed intervals and rendered as the edge map of the CAD template; Principal component analysis was performed on the edge point cloud of the panoramic top view and the sampled point cloud of the CAD template edge map to obtain the principal direction of the edge point cloud and the principal direction of the sampled point cloud. Based on the main direction of the edge point cloud and the main direction of the sampled point cloud, several candidate initial angles of the workpiece to be detected are generated; Each candidate initial angle is iteratively aligned based on a multi-scale distance field.
7. The workpiece inspection method based on multi-camera vision inspection according to claim 1, characterized in that, The process of obtaining measured parameters of the workpiece to be inspected based on the template edge map and the panoramic top view, comparing the measured parameters with preset tolerance standards, and obtaining the judgment result of the measured parameters includes: Based on the geometric element definition of the geometric contour in the edge diagram of the CAD template, the design position and size of each geometric element are projected onto the panoramic top view. Within the target range around the projection position in the panoramic top view, search for the actual edge points corresponding to the workpiece to be detected; The actual edge points are fitted with least squares to obtain the measured parameters of the workpiece to be tested. The measured parameters are compared with the preset tolerance standard to obtain the judgment result of the measured parameters.
8. A workpiece inspection device based on multi-camera vision inspection, characterized in that, include: The preprocessing module is used to simultaneously acquire images of the workpiece to be inspected based on multiple cameras, and to preprocess the images acquired by each of the cameras to generate a top-view edge map and a grayscale image for each camera. The stitching module is used to stitch together a panoramic top view covering the detection area of the workpiece to be inspected based on the top view edge map and the grayscale map of each camera, combined with the incident angle weighted fusion algorithm. The alignment module is used to extract the geometric contour of the workpiece to be inspected based on the DXF design file of the workpiece to be inspected, render it as a CAD template edge map, and align the panoramic top view with the CAD template edge map. The first calculation module is used to construct a signed distance field based on the aligned panoramic top view, sample each edge point of the workpiece to be detected into the signed distance field, calculate the deviation of the panoramic top view, and generate a deviation heatmap. The comparison module is used to obtain the measured parameters of the workpiece to be inspected based on the edge map of the CAD template and the panoramic top view, compare the measured parameters with the preset tolerance standard, and obtain the judgment result of the measured parameters. The first generation module is used to generate an inspection report for the workpiece to be inspected based on the deviation heat map and the judgment results of the measured parameters, and to give a comprehensive judgment result.
9. An electronic device, characterized in that, include: The system includes a memory, a processor, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the workpiece inspection method based on multi-camera vision inspection as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the workpiece inspection method based on multi-camera vision inspection as described in any one of claims 1-7.