A macro detection method and device for appearance detection
Through three-dimensional scanning and multi-axis gimbal dynamic balance control, combined with motion compensation and attention mechanism algorithms, the problems of low efficiency and insufficient accuracy of traditional appearance inspection methods are solved, and high-precision, all-round defect detection of complex samples is achieved.
Patent Information
- Application Number
- CN202411103188.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-08-13
AI Technical Summary
Traditional appearance inspection methods are inefficient, inconsistent and susceptible to subjective factors. They are difficult to adapt to the high-precision inspection of complex curved surfaces or polyhedral structures, and it is difficult to quickly identify defects in massive high-resolution images.
By conducting three-dimensional scanning of the sample to be inspected, the initial configuration parameters of the multi-axis gimbal are generated, dynamic balance calculation and micro-vibration testing are performed, multi-degree-of-freedom collaborative motion control is achieved, multi-modal image data is collected, motion compensation processing is performed, and position sensing features are extracted. , generate a feature map with spatial information, and use the PTZ-guided attention mechanism algorithm to conduct defect distribution analysis.
It significantly improves the accuracy and robustness of defect detection, reduces false detections and missed detections, achieves all-round, high-precision detection of complex samples, and improves detection efficiency and image stability.
Smart Images

Figure CN118624626B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of macro detection technology, and in particular to a macro detection method and device for appearance detection. Background Art
[0002] In the field of modern manufacturing and quality control, appearance inspection, as an important part of product quality assessment, has always received widespread attention. Traditional appearance inspection methods mainly rely on manual visual inspection, which has problems such as low efficiency, poor consistency, and susceptibility to subjective factors.
[0003] However, existing technologies require complex hardware settings and a large number of inspection stations, which not only increases production costs, but also makes it difficult to adapt to rapidly changing product types and inspection requirements. The introduction of macro inspection technology has brought new possibilities for appearance inspection, as it can capture tiny defects that are difficult to observe with the naked eye. However, macro inspection also faces a series of technical challenges, such as image stability, precise focus control, and multi-angle observation. Especially when inspecting samples with complex curved surfaces or polyhedral structures, traditional fixed inspection systems have difficulty achieving all-round, high-precision observation. In addition, how to quickly and accurately identify and classify defects in massive amounts of high-resolution image data has also become a key issue restricting the widespread application of macro inspection technology. Summary of the invention
[0004] The present application provides a macro detection method and device for appearance detection, which are used to improve the accuracy of defect detection.
[0005] In a first aspect, the present application provides a macro detection method for appearance detection, the macro detection method for appearance detection comprising:
[0006] Performing a three-dimensional scan on the sample to be inspected to obtain three-dimensional data of the sample, and generating initial configuration parameters of the multi-axis gimbal according to the three-dimensional data of the sample;
[0007] Performing dynamic balance calculation on the initial configuration parameters to obtain balanced weight distribution and damping system parameters and performing micro-vibration test to generate vibration compensation data;
[0008] Based on the vibration compensation data and the initial configuration parameters, the multi-axis gimbal performs multi-degree-of-freedom coordinated motion control, and collects multimodal image data of the sample to be detected for motion compensation processing to obtain a stabilized image;
[0009] Performing position-aware feature extraction on the stabilized image and combining it with the real-time position information of the multi-axis gimbal to generate a feature map with spatial information;
[0010] Perform defect detection and multi-angle defect verification through the feature map with spatial information to obtain preliminary defect detection results;
[0011] Based on the preliminary defect detection results and the real-time position information, a gimbal-guided attention mechanism algorithm is executed to perform defect distribution analysis and generate sample defect distribution data.
[0012] In a second aspect, the present application provides a macro detection device for appearance detection, the macro detection device for appearance detection comprising:
[0013] A scanning module is used to perform three-dimensional scanning on the sample to be tested, obtain three-dimensional data of the sample, and generate initial configuration parameters of the multi-axis gimbal according to the three-dimensional data of the sample;
[0014] A test module, used to perform dynamic balance calculation on the initial configuration parameters, obtain the balance weight distribution and damping system parameters, perform micro-vibration test, and generate vibration compensation data;
[0015] A processing module, used for performing multi-degree-of-freedom coordinated motion control on the multi-axis gimbal based on the vibration compensation data and the initial configuration parameters, and collecting multimodal image data of the sample to be detected for motion compensation processing to obtain a stabilized image;
[0016] An extraction module, used for performing position-aware feature extraction on the stabilized image and combining the real-time position information of the multi-axis gimbal to generate a feature map with spatial information;
[0017] A detection module, used to perform defect detection and multi-angle defect verification through the feature map with spatial information to obtain preliminary defect detection results;
[0018] The analysis module is used to perform a defect distribution analysis using a gimbal-guided attention mechanism algorithm based on the preliminary defect detection results and the real-time position information to generate sample defect distribution data.
[0019] The third aspect of the present application provides a macro detection device for appearance detection, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the macro detection device for appearance detection executes the above-mentioned macro detection method for appearance detection.
[0020] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned macro detection method for appearance detection.
[0021] In the technical solution provided by the present application, an accurate three-dimensional model of the sample can be obtained by performing three-dimensional scanning and data processing on the sample to be detected. By performing dynamic balance calculation and micro-vibration test on the multi-axis gimbal, the vibration during the movement of the gimbal can be significantly reduced, and the stability and clarity of image acquisition can be improved. Multi-degree-of-freedom collaborative motion control based on vibration compensation data and initial configuration parameters can achieve accurate positioning and smooth movement of the gimbal, and adapt to samples of different shapes and sizes. By collecting and processing multimodal image data and combining motion compensation technology, high-quality stabilized images can be obtained. By combining position-aware feature extraction and real-time position information of the multi-axis gimbal, a feature map with spatial information is generated, and accurate positioning and three-dimensional characterization of defects are achieved. The defect detection method using dynamic threshold adjustment can adapt to the characteristics of different areas on the sample surface and improve the accuracy and robustness of defect detection. By utilizing the flexibility of the multi-axis gimbal, multi-angle verification of defects is achieved, effectively reducing the probability of false detection and missed detection. Through the attention mechanism algorithm guided by the gimbal, it can automatically focus on high-risk areas to improve detection efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0023] Figure 1 A schematic diagram of an embodiment of a macro detection method for appearance detection in an embodiment of the present application;
[0024] Figure 2 It is a schematic diagram of an embodiment of a macro detection device for appearance detection in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The embodiments of the present application provide a macro detection method and device for appearance detection. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 , an embodiment of a macro detection method for appearance detection in an embodiment of the present application includes:
[0027] Step S101, performing a three-dimensional scan on a sample to be inspected to obtain three-dimensional data of the sample, and generating initial configuration parameters of a multi-axis gimbal according to the three-dimensional data of the sample;
[0028] It is understandable that the execution subject of the present application may be a macro detection device for appearance detection, or a terminal or a server, which is not limited here. The present application embodiment is described by taking a server as the execution subject as an example.
[0029] Specifically, the sample to be tested is scanned at multiple angles to obtain the original point cloud data, and the original point cloud data is filtered and equalized to obtain the optimized point cloud data. The filtering step can effectively remove noise data, and the equalization process can improve the consistency and accuracy of the data. The optimized point cloud data is subjected to geometric feature extraction to obtain a geometric feature model, and the main axis direction and center of mass position of the sample to be tested are calculated based on the geometric feature model to obtain preliminary posture information. Based on the preliminary posture information, the optimized point cloud data is voxelized, and the voxels are probabilistically classified to generate a volume distribution model. During the voxelization process, the original point cloud data is divided into smaller cubic units (i.e., voxels), which helps to better describe the three-dimensional morphology of the sample. Through probabilistic classification, the possible categories of each voxel are identified to improve the accuracy and resolution of the model. According to the volume distribution model, the center of gravity coordinates of the sample are calculated, and the length, width and height data of the sample are calculated based on the geometric feature model and the volume distribution model. These data help to describe the overall size and shape characteristics of the sample. Based on the geometric feature model, the shape of the sample is parameterized to generate a shape feature vector. The shape feature vector is a high-dimensional description of the sample's geometric shape, which can provide detailed information about the sample's shape. Based on the coordinates of the center of gravity, length, width and height data, and the shape feature vector, the optimal initial position of the multi-axis gimbal is predicted to obtain the spatial coordinates of the gimbal. The spatial coordinates indicate the specific position of the gimbal in three-dimensional space, which helps to determine the relative position relationship between the sample and the detection equipment. Based on the gimbal spatial coordinates and preliminary attitude information, the initial angles of each joint of the multi-axis gimbal are calculated to obtain the gimbal attitude parameters. The gimbal attitude parameters include the angles and positions of each joint, which determine the initial configuration state of the gimbal. Based on the gimbal spatial coordinates and gimbal attitude parameters, the initial configuration parameters of the multi-axis gimbal are generated. The initial configuration parameters are used to guide the initial setting of the multi-axis gimbal so that it can be accurately positioned and adjusted for subsequent appearance inspection of the sample.
[0030] Step S102, performing dynamic balance calculation on the initial configuration parameters, obtaining the balanced weight distribution and damping system parameters, and performing micro-vibration test to generate vibration compensation data;
[0031] Specifically, according to the initial configuration parameters, the mass distribution model of the multi-axis gimbal is established, and the mass and moment of inertia of each axis are calculated to obtain the initial dynamic parameters, thereby describing the mass distribution and dynamic characteristics of the multi-axis gimbal. Based on the initial dynamic parameters, the motion equation of the multi-axis gimbal is constructed and numerically solved to obtain the theoretical equilibrium state under different postures. By solving the motion equation, the mechanical performance of the multi-axis gimbal in various postures is understood. The theoretical equilibrium state is analyzed, the moment distribution of each axis is calculated, and the optimal layout position of the balancing weight is determined according to the moment distribution to obtain a preliminary balancing weight distribution scheme. The optimal balancing weight distribution is determined through mechanical analysis to ensure that the multi-axis gimbal remains stable during operation. According to the preliminary balancing weight distribution scheme, the multi-axis gimbal is virtually loaded and the dynamic parameters are recalculated to obtain a revised dynamic model. Through virtual loading, the actual equilibrium state is simulated, and the dynamic parameters are corrected to improve the accuracy of the model. Based on the revised dynamic model, frequency domain analysis is performed to identify the natural frequency and mode of the multi-axis gimbal and obtain vibration characteristic data. According to the vibration characteristic data, the preliminary parameters of the damping system are designed to obtain a preliminary damping system solution, which includes the position, stiffness and damping coefficient of the damper. The damping system is designed to reduce the impact of vibration on the detection accuracy. Based on the preliminary damping system solution, the multi-axis gimbal is virtually assembled and the dynamic response simulation is performed to obtain the theoretical motion trajectory data. Through virtual assembly and simulation, the dynamic response of the multi-axis gimbal under actual working conditions is predicted. The theoretical motion trajectory data is analyzed, the vibration amplitude and frequency of the multi-axis gimbal under different working conditions are calculated, and the vibration response characteristics are obtained. The analysis of the vibration response characteristics helps to understand the vibration of the multi-axis gimbal in actual work and further optimize the damping system. Based on the vibration response characteristics, the damping system is optimized to obtain the damping system parameters and the balance weight distribution. Through optimization, it is ensured that the damping system can effectively reduce vibration under different working conditions, and the stability and detection accuracy of the multi-axis gimbal are guaranteed. According to the damping system parameters and the balance weight distribution, the multi-axis gimbal is actually tested for micro-vibration, the measured vibration data is recorded, and the vibration compensation data is generated by comparing the difference between the measured vibration data and the theoretical motion trajectory data. Through actual testing, the effect of the damping system is verified, and necessary adjustments and compensations are made according to the test data to ensure that the final system performance meets the expected requirements.
[0032] Step S103, performing multi-degree-of-freedom coordinated motion control on the multi-axis gimbal based on the vibration compensation data and the initial configuration parameters, and collecting multimodal image data of the sample to be tested for motion compensation processing to obtain a stabilized image;
[0033] Specifically, according to the initial configuration parameters and vibration compensation data, a motion trajectory planning model of the multi-axis gimbal is constructed, and the motion trajectory of each axis is optimized and calculated to obtain the initial collaborative motion trajectory. The trajectory planning model is based on the precise analysis and optimization calculation of the motion of the multi-axis gimbal, so that the motion of each axis can be coordinated and consistent in the multi-degree-of-freedom motion process to achieve the best motion effect. The initial collaborative motion trajectory is segmented to obtain multiple motion stages, and corresponding motion parameters are assigned to each motion stage to obtain a segmented motion control strategy. By segmenting the motion trajectory, the motion of the multi-axis gimbal is more carefully controlled, so that the motion parameters can be adjusted according to the actual situation at different stages, thereby improving the accuracy and stability of the motion. Based on the segmented motion control strategy, control signals are generated for each drive motor of the multi-axis gimbal to obtain a motor control instruction sequence. By generating specific motor control instructions, it is ensured that each drive motor of the multi-axis gimbal can move according to the predetermined trajectory and parameters. The motor control instruction sequence is executed to drive the multi-axis gimbal to move, and the attitude and acceleration data collected in real time based on the built-in sensor are compared with the initial collaborative motion trajectory to obtain real-time motion error data. Through real-time monitoring of built-in sensors, the actual movement of the multi-axis gimbal is fed back, and errors in the movement are discovered and corrected in time. According to the real-time motion error data, the multi-axis gimbal is corrected in real time, and the parameters of each drive motor are adjusted to obtain the actual motion trajectory. Through real-time correction, the motion trajectory of the multi-axis gimbal is ensured to be consistent with the predetermined trajectory. In the process of the multi-axis gimbal executing the actual motion trajectory, the multi-modal camera array is triggered, the multi-spectral image is synchronously acquired, and the real-time position information of the multi-axis gimbal is recorded to obtain multi-modal image data. The synchronous acquisition of the multi-modal camera array can ensure that the image data of the sample is obtained under different spectra, and the real-time position information of the multi-axis gimbal is recorded at the same time. The multi-modal image data is preprocessed to obtain preprocessed image data, and the precise gimbal posture at the moment of shooting each image is calculated according to the real-time position information and the actual motion trajectory, and the mapping relationship between the image and the spatial position is constructed to obtain a position-indexed image data set. The preprocessing process includes steps such as denoising and enhancement to improve the image quality; at the same time, by calculating the precise posture of each image, the image data is accurately matched with the spatial position to form a position-indexed image data set. Based on the vibration compensation data and the actual motion trajectory, the position-indexed image data set is subjected to motion blur removal and image registration to obtain a corrected image data set, and multi-frame image fusion is performed on the corrected image data set to generate a stabilized image. Motion blur removal and image registration can eliminate image blur and displacement errors generated during motion to ensure image clarity and accuracy. By fusion of multi-frame images, the quality and stability of the image are improved, and a stabilized image is finally obtained.
[0034] Step S104, extracting position-aware features from the stabilized image and combining it with the real-time position information of the multi-axis gimbal to generate a feature map with spatial information;
[0035] Specifically, the stabilized image is decomposed at multiple scales to obtain image pyramids of different scales, and edge detection is performed on each scale level of the image pyramid to obtain a multi-scale edge feature set. Through multi-scale decomposition, the information of different detail levels in the image can be effectively captured, and edge detection can highlight the structural features in the image. According to the multi-scale edge feature set, the stabilized image is segmented to obtain a preliminary segmentation result, and morphological operations are performed on the preliminary segmentation result to obtain an optimized image segmentation result. Regional segmentation helps to divide the image into several regions with similar features, and morphological operations (such as dilation and erosion) can optimize the segmentation results and eliminate noise and small pseudo-segmentation regions. Based on the optimized image segmentation results, the texture features and color features of each segmented region are extracted to obtain a regional feature descriptor. Texture features and color features are the main visual features of the image and can provide rich information to describe the content of each segmented region. Combined with the real-time position information of the multi-axis gimbal, the regional feature descriptor is mapped to spatial coordinates to obtain a feature point set with three-dimensional spatial information. Through spatial coordinate mapping, the feature points in the image are accurately located in three-dimensional space to obtain a more comprehensive feature description. Cluster analysis is performed on the feature point set with three-dimensional spatial information to obtain a feature region set. Cluster analysis helps to aggregate point sets with similar features to form a feature region set. Based on the feature region set, a regional adjacency graph is constructed to obtain the regional topological structure, and a hierarchical spatial feature tree is generated based on the regional topological structure and the feature region set. The spatial feature tree is fused with the original image information of the stabilized image to generate a feature map with spatial information. By fusing the spatial feature tree with the original image information, while maintaining the image visual information, its spatial description ability is enhanced. The feature map finally generated not only contains the visual features of the image, but also reflects its positional relationship in three-dimensional space.
[0036] Step S105, performing defect detection and multi-angle defect verification through a feature map with spatial information to obtain preliminary defect detection results;
[0037] Specifically, the feature map with spatial information is divided into regions to obtain multiple sub-regions to be detected, and local statistical features are calculated for each sub-region to be detected to obtain a sub-region feature statistical set. The statistical features of each sub-region, such as the mean value and standard deviation, are obtained by calculating the local statistical features. According to the sub-region feature statistical set, an initial detection threshold is set for each sub-region to be detected to obtain an initial threshold map, and an adaptive threshold calculation is performed on the initial threshold map to obtain an optimized threshold map. The initial detection threshold is set based on the statistical features of the sub-region, and the adaptive threshold calculation generates a more accurate threshold map by optimizing the initial threshold. These thresholds are used to distinguish potential defect areas from normal areas in the image. Based on the optimized threshold map, the feature map with spatial information is threshold segmented to obtain a preliminary defect marking map, and morphological features are extracted from each potential defect area in the preliminary defect marking map to obtain a defect morphological feature set. Threshold segmentation is to mark the potential defect areas in the image using the optimized threshold, while morphological feature extraction further analyzes the morphological features of these marked areas, such as shape, area, perimeter, etc., in order to perform more precise defect recognition. According to the defect morphological feature set, preliminary classification is performed to obtain a candidate defect set, and based on the motion capability of the multi-axis gimbal, a multi-angle observation plan is generated for each candidate defect to obtain a defect verification task list. Preliminary classification is to classify defects with similar morphological features, while the multi-angle observation plan uses the flexibility of the multi-axis gimbal to collect images of defects from different angles. According to the defect verification task list, the multi-axis gimbal is controlled to move, and multi-angle images of candidate defects are collected to obtain an enhanced defect image set, and the enhanced defect image set is deep-learned and classified to obtain preliminary defect detection results. Through the precise movement of the multi-axis gimbal, defect images are collected from multiple angles to enhance the richness and accuracy of image data. Through deep-learning classification, the enhanced defect image set is feature analyzed and classified to obtain defect detection results. The deep-learning classification algorithm can automatically learn complex features in the image, and perform high-precision classification and recognition to improve the accuracy and reliability of defect detection.
[0038] Step S106: Based on the preliminary defect detection results and real-time position information, execute the gimbal-guided attention mechanism algorithm to perform defect distribution analysis and generate sample defect distribution data.
[0039] Specifically, cluster analysis is performed on the preliminary defect detection results to obtain defect clusters, and a defect spatial distribution heat map is constructed based on the defect clusters and the real-time position information of the multi-axis gimbal. Cluster analysis helps to aggregate similar defects together to form defect clusters and reveal the distribution law of defects on the sample surface. The defect spatial distribution heat map is constructed using the position information of the defect clusters and the multi-axis gimbal to show the spatial density and distribution of defects. The spatial attention mechanism is analyzed on the defect spatial distribution heat map to obtain the attention weight map, and the optimized scanning path of the multi-axis gimbal is generated based on the attention weight map. The spatial attention mechanism generates an attention weight map by analyzing the high-attention areas in the heat map to determine which areas require higher detection priorities. Based on these priorities, the optimized scanning path of the multi-axis gimbal is generated to ensure that the gimbal can efficiently cover all important areas. The multi-axis gimbal is controlled to move based on the optimized scanning path, and high-resolution local images are collected to obtain a fine defect image set, and multi-scale feature extraction is performed on the fine defect image set to obtain an enhanced defect feature set. Based on the enhanced defect feature set, each defect in the preliminary defect detection results is re-evaluated, the confidence score of the defect is updated, and an optimized defect list is obtained. The re-evaluation process improves the accuracy of defect detection by analyzing the detailed information in the enhanced feature set, and an updated confidence score is assigned to each defect to generate an optimized defect list. Based on the optimized defect list and the real-time position information of the multi-axis gimbal, a surface defect topology map of the sample to be inspected is constructed. The surface defect topology map shows the relative position and distribution of defects on the sample surface. The surface defect topology map is subjected to spatial correlation analysis to obtain a defect mode feature map, and the defect mode feature map is combined with the optimized defect list to generate sample defect distribution data. Spatial correlation analysis can reveal the potential relationship and pattern between defects and generate a defect mode feature map. By combining the feature map with the optimized defect list, sample defect distribution data including defect location, type, severity and their spatial relationship information is generated.
[0040] In the embodiment of the present application, by performing three-dimensional scanning and data processing on the sample to be detected, an accurate three-dimensional model of the sample can be obtained. By performing dynamic balance calculation and micro-vibration test on the multi-axis gimbal, the vibration during the movement of the gimbal can be significantly reduced, and the stability and clarity of image acquisition can be improved. Multi-degree-of-freedom collaborative motion control based on vibration compensation data and initial configuration parameters can achieve accurate positioning and smooth movement of the gimbal, and adapt to samples of different shapes and sizes. By collecting and processing multimodal image data and combining motion compensation technology, high-quality stabilized images can be obtained. By combining position-aware feature extraction and real-time position information of the multi-axis gimbal, a feature map with spatial information is generated, and accurate positioning and three-dimensional characterization of defects are achieved. The defect detection method using dynamic threshold adjustment can adapt to the characteristics of different areas on the sample surface and improve the accuracy and robustness of defect detection. By utilizing the flexibility of the multi-axis gimbal, multi-angle verification of defects is achieved, effectively reducing the probability of false detection and missed detection. Through the attention mechanism algorithm guided by the gimbal, it can automatically focus on high-risk areas to improve detection efficiency and accuracy.
[0041] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0042] (1) Scan the sample to be tested at multiple angles to obtain raw point cloud data, and then filter and equalize the raw point cloud data to obtain optimized point cloud data;
[0043] (2) Extract geometric features from the optimized point cloud data to obtain a geometric feature model. Based on the geometric feature model, calculate the principal axis direction and center of mass position of the sample to be tested to obtain preliminary posture information.
[0044] (3) Based on the preliminary posture information, the optimized point cloud data is voxelized and the voxels are probabilistically classified to obtain a volume distribution model;
[0045] (4) Calculate the center of gravity coordinates based on the volume distribution model, and calculate the length, width and height data based on the geometric feature model and the volume distribution model;
[0046] (5) Based on the geometric feature model, the sample shape is parametrically described to obtain the shape feature vector. The optimal initial position of the multi-axis gimbal is predicted based on the coordinates of the center of gravity, length, width and height data, and the shape feature vector, and the spatial coordinates of the gimbal are obtained.
[0047] (6) Based on the gimbal spatial coordinates and preliminary attitude information, calculate the initial angles of each joint of the multi-axis gimbal and obtain the gimbal attitude parameters;
[0048] (7) Generate the initial configuration parameters of the multi-axis gimbal based on the gimbal spatial coordinates and gimbal attitude parameters.
[0049] Specifically, the sample to be tested is placed on a rotatable stand, and the original point cloud data of the sample is obtained by multi-angle scanning. The point cloud data is composed of a large number of points, each of which is represented by three-dimensional coordinates (x, y, z), reflecting the shape information of the sample surface. Comprehensive point cloud data is obtained by scanning the sample at different angles. The original point cloud data usually contains noise and uneven distribution problems, which are filtered and equalized. Filtering can remove noise points by statistical filtering, such as removing points far from the mean; equalization can make the point cloud data more uniform in spatial distribution through density equalization method, and obtain optimized point cloud data. Geometric feature extraction is performed on the optimized point cloud data to obtain a geometric feature model. Geometric feature extraction involves calculating geometric attributes such as curvature and normal vector of each point, which are used to construct a geometric feature model. Based on the geometric feature model, the main axis direction and center of mass position of the sample to be tested are calculated to obtain preliminary posture information. The main axis direction and center of mass position can be obtained by principal component analysis. Assume that the point cloud data is , where each point With three-dimensional coordinates . Center of mass position The calculation formula is:
[0050] ;
[0051] The covariance matrix of the point cloud data can be analyzed by principal component analysis, and the principal axis direction of the sample can be determined by solving the eigenvalues and eigenvectors of the matrix. Based on the preliminary posture information, the optimized point cloud data is voxelized and the voxels are probabilistically classified to obtain a volume distribution model. Voxelization is to divide the three-dimensional space into a number of voxels (cube units) and assign the points in the point cloud data to these voxels. Assume that the side length of the voxel is , then the spatial coordinates after voxelization are ,in . Through probability classification, voxels are divided into different categories, such as high-density areas and low-density areas, according to the density and distribution of points in the voxels, thereby generating a volume distribution model. According to the volume distribution model, the center of gravity coordinates are calculated, and the length, width and height data are calculated based on the geometric feature model and the volume distribution model. The center of gravity coordinates can be calculated by the mass center of the voxel, and the length, width and height data are calculated by determining the boundary range of the voxel model. Assume that the boundary coordinates of the volume distribution model are and , the length, width and height data are:
[0052] length ;
[0053] width ;
[0054] high ;
[0055] Based on the geometric feature model, the shape of the sample is parametrically described to obtain the shape feature vector. The shape feature vector is a mathematical description of the shape of the sample, including information such as curvature distribution and surface normal vector distribution. Assume that the shape feature vector is ,in Indicates According to the coordinates of the center of gravity, length, width and height data and shape feature vector, the optimal initial position of the multi-axis gimbal is predicted to obtain the gimbal space coordinates. Assume that the initial position of the gimbal is , the position can be determined by the optimization algorithm so that the gimbal can cover all the detection areas of the sample. Based on the gimbal spatial coordinates and preliminary attitude information, the initial angles of each joint of the multi-axis gimbal are calculated to obtain the gimbal attitude parameters. Assume that the gimbal has joints, and the angle of each joint is , then the gimbal attitude parameters are The calculation of the initial angle can be solved by the inverse kinematics method to ensure that the angles of each joint meet the detection requirements when the gimbal is in the initial position. The initial configuration parameters of the multi-axis gimbal are generated according to the gimbal spatial coordinates and gimbal attitude parameters. The initial configuration parameters include spatial coordinates and joint angles, through which the initial state of the gimbal can be accurately set.
[0056] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0057] (1) Based on the initial configuration parameters, the mass distribution model of the multi-axis gimbal is established and the mass and moment of inertia of each axis are calculated to obtain the initial dynamic parameters;
[0058] (2) Based on the initial dynamic parameters, the motion equations of the multi-axis gimbal are constructed and numerically solved to obtain the theoretical equilibrium state under different postures;
[0059] (3) Analyze the theoretical equilibrium state, calculate the moment distribution of each axis, and determine the optimal layout of the balancing weight based on the moment distribution to obtain a preliminary balancing weight distribution plan;
[0060] (4) According to the preliminary balanced weight distribution scheme, the multi-axis gimbal is virtually loaded and the dynamic parameters are recalculated to obtain a revised dynamic model;
[0061] (5) Perform frequency domain analysis based on the modified dynamic model to identify the natural frequency and mode of the multi-axis gimbal and obtain vibration characteristic data;
[0062] (6) Based on the vibration characteristic data, design the preliminary parameters of the damping system and obtain a preliminary damping system solution, which includes the location, stiffness and damping coefficient of the damper;
[0063] (7) Based on the preliminary damping system solution, the multi-axis gimbal was virtually assembled and the dynamic response simulation was performed to obtain the theoretical motion trajectory data;
[0064] (8) Analyze the theoretical motion trajectory data, calculate the vibration amplitude and frequency of the multi-axis gimbal under different working conditions, and obtain the vibration response characteristics;
[0065] (9) Optimize the damping system based on the vibration response characteristics to obtain the damping system parameters and balance weight distribution;
[0066] (10) According to the damping system parameters and the balance weight distribution, the multi-axis gimbal is subjected to actual micro-vibration test, and the measured vibration data is recorded. The vibration compensation data is generated by comparing the measured vibration data with the theoretical motion trajectory data.
[0067] Specifically, according to the initial configuration parameters, a mass distribution model of the multi-axis gimbal is established. The model needs to consider the mass of each part of the gimbal, including the base, the arm length of each axis, the joints, and the mass of the detection equipment installed on it. The mass distribution model can be established by modeling with CAD software, and the mass and moment of inertia of each part can be calculated using finite element analysis tools. Assume that the mass distribution is ,in Indicates The mass of the part. Moment of inertia The calculation formula is:
[0068] ;
[0069] in For the The radius of the part, is its height. The mass and moment of inertia of each part are calculated to obtain the initial dynamic parameters of the multi-axis gimbal. Based on the initial dynamic parameters, the motion equation of the multi-axis gimbal is constructed and numerically solved to obtain the theoretical equilibrium state under different postures. The motion equation can be obtained by the Lagrange equation to describe the dynamic behavior of the multi-axis gimbal under different external forces. The general form of the Lagrange equation is:
[0070] ;
[0071] in is the Lagrangian function, are generalized coordinates, is the generalized speed, is a generalized force. By numerically solving these motion equations, we can obtain the theoretical equilibrium state of the multi-axis gimbal in different postures. We analyze the theoretical equilibrium state, calculate the moment distribution of each axis, and determine the optimal layout of the balancing weight based on the moment distribution, and obtain a preliminary balancing weight distribution plan. The calculation of the moment distribution can be obtained by analyzing the force conditions of each axis. The calculation formula is:
[0072] ;
[0073] in is the lever arm, is the acting force. By calculating the moment distribution of each axis, the optimal arrangement position of the balancing weight is determined to keep the multi-axis gimbal stable during operation. According to the preliminary balancing weight distribution scheme, the multi-axis gimbal is virtually loaded and the dynamic parameters are recalculated to obtain the revised dynamic model. Virtual loading is achieved by adding balancing weights to the model and recalculating the mass and moment of inertia of each part to obtain the revised dynamic parameters. Based on the revised dynamic model, frequency domain analysis is performed to identify the natural frequency and mode of the multi-axis gimbal to obtain vibration characteristic data. Frequency domain analysis can be achieved through fast Fourier transform, and the natural frequency and mode are obtained through modal analysis. According to the vibration characteristic data, the preliminary parameters of the damping system are designed to obtain a preliminary damping system scheme, which includes the position, stiffness and damping coefficient of the damper. The design purpose of the damping system is to reduce the influence of vibration on the detection accuracy and effectively control the vibration of the gimbal by adjusting the position and parameters of the damper. Based on the preliminary damping system scheme, the multi-axis gimbal is virtually assembled and dynamically responded to simulate to obtain theoretical motion trajectory data. Virtual assembly is to add dampers to the model and perform dynamic response simulation to predict the motion trajectory of the multi-axis gimbal in actual work. The theoretical motion trajectory data is analyzed, the vibration amplitude and frequency of the multi-axis gimbal under different working conditions are calculated, and the vibration response characteristics are obtained. The vibration response characteristics can be calculated by analyzing the vibration components in the motion trajectory data to obtain the response of the gimbal at different frequencies. Based on the vibration response characteristics, the damping system is optimized to obtain the damping system parameters and the balance weight distribution. The optimization process minimizes the vibration amplitude and improves the stability of the system by adjusting the parameters and position of the damper. According to the damping system parameters and the balance weight distribution, the multi-axis gimbal is subjected to actual micro-vibration test, the measured vibration data is recorded, and the vibration compensation data is generated by comparing the difference between the measured vibration data and the theoretical motion trajectory data. The actual micro-vibration test is carried out under laboratory conditions, and the vibration of the gimbal under different working conditions is measured by precision sensors. The measured vibration data is compared with the theoretical data to identify the vibration characteristics and compensation requirements, and generate vibration compensation data. These data are used to adjust the control system of the gimbal to improve its vibration resistance and detection accuracy.
[0074] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0075] (1) Based on the initial configuration parameters and vibration compensation data, a motion trajectory planning model for the multi-axis gimbal is constructed, and the motion trajectory of each axis is optimized to obtain the initial collaborative motion trajectory;
[0076] (2) The initial collaborative motion trajectory is segmented to obtain multiple motion stages, and corresponding motion parameters are assigned to each motion stage to obtain a segmented motion control strategy;
[0077] (3) Based on the segmented motion control strategy, control signals are generated for each drive motor of the multi-axis gimbal to obtain a motor control instruction sequence;
[0078] (4) Execute the motor control command sequence to drive the multi-axis gimbal to move. At the same time, based on the built-in sensors, the real-time attitude and acceleration data are collected and compared with the initial collaborative motion trajectory to obtain real-time motion error data;
[0079] (5) Based on the real-time motion error data, the multi-axis gimbal is corrected in real time, and the parameters of each drive motor are adjusted to obtain the actual motion trajectory;
[0080] (6) When the multi-axis gimbal executes the actual motion trajectory, the multi-modal camera array is triggered to synchronously collect multi-spectral images and record the real-time position information of the multi-axis gimbal to obtain multi-modal image data;
[0081] (7) Preprocess the multimodal image data to obtain preprocessed image data, and calculate the precise gimbal posture at the moment of shooting each image based on the real-time position information and actual motion trajectory, construct a mapping relationship between the image and the spatial position, and obtain a position-indexed image data set;
[0082] (8) Based on the vibration compensation data and the actual motion trajectory, motion blur removal and image registration are performed on the position-indexed image dataset to obtain a corrected image dataset, and multi-frame image fusion is performed on the corrected image dataset to generate a stabilized image.
[0083] Specifically, a motion trajectory planning model for a multi-axis gimbal is established based on the initial configuration parameters and vibration compensation data. The model includes the starting position, target position, and all intermediate positions on the path of each axis. The vibration compensation data must also be taken into account to ensure that the impact of vibration on the trajectory is minimized during the entire motion process. The optimization of trajectory planning can be achieved by solving a set of nonlinear optimization problems. The goal is to minimize the total motion time and energy consumption while meeting all physical constraints and accuracy requirements. Assume that the position of each axis is ,in For time, the optimization problem can be expressed as:
[0084] ;
[0085] in is the energy consumption function, It's speed. is the motion completion time. The initial collaborative motion trajectory is segmented to obtain multiple motion stages, and corresponding motion parameters are assigned to each motion stage to obtain a segmented motion control strategy. The overall motion trajectory is divided into several small segments that can be controlled independently. The motion parameters of each segment include speed, acceleration, and power of each drive motor. Assume that the trajectory is divided into The motion parameters of each segment are ,in , the segmented motion control strategy can be expressed as a series of parameter sets Based on the segmented motion control strategy, control signals are generated for each drive motor of the multi-axis gimbal to obtain a motor control instruction sequence. The process of generating control signals includes converting the parameters of each motion stage into specific motor control signals. These signals include the voltage and current of the motor, etc., to ensure that the motor can move according to the predetermined trajectory and parameters. Assume that the control signal of the motor is , can be controlled by the control law Get, where It is a function that converts motion parameters into control signals. It executes the motor control instruction sequence to drive the multi-axis gimbal to move. At the same time, it collects attitude and acceleration data in real time based on the built-in sensors and compares them with the initial coordinated motion trajectory to obtain real-time motion error data. The collection of real-time motion error data is achieved through the attitude sensors and acceleration sensors installed on the gimbal. These sensors can provide real-time feedback on the actual motion state of the gimbal. Error data By comparing the actual position and scheduled location The calculation results are:
[0086] ;
[0087] According to the real-time motion error data, the multi-axis gimbal is corrected in real time, and the parameters of each drive motor are adjusted to obtain the actual motion trajectory. The real-time motion correction automatically adjusts the control parameters of the motor through the control system to make the actual motion trajectory as close to the predetermined trajectory as possible. The actual motion trajectory after adjustment This can be achieved through a real-time feedback control algorithm. During the multi-axis gimbal’s actual motion trajectory, the multi-modal camera array is triggered to synchronously collect multi-spectral images and record the real-time position information of the multi-axis gimbal to obtain multi-modal image data. The multi-modal camera array can simultaneously capture sample images under different spectra to obtain comprehensive image information. During each shot, the real-time position information of the gimbal is It will be recorded for subsequent image processing. The multimodal image data is preprocessed to obtain preprocessed image data, and the precise gimbal posture of each image at the moment of shooting is calculated according to the real-time position information and the actual motion trajectory, and the mapping relationship between the image and the spatial position is constructed to obtain a position-indexed image data set. The preprocessing process includes image denoising, enhancement and other processing to ensure image quality. Through the real-time position information, each image is accurately mapped to the spatial position of the gimbal to generate a position-indexed image data set. Based on the vibration compensation data and the actual motion trajectory, the position-indexed image data set is subjected to motion blur removal and image registration to obtain a corrected image data set, and the corrected image data set is subjected to multi-frame image fusion to generate a stabilized image. Motion blur removal corrects the blur phenomenon in the image through vibration compensation data, and the image matching criterion aligns images taken at different positions and times through a matching algorithm. Multi-frame image fusion is to synthesize multiple images into a high-quality image to improve the clarity and detail of the image. Through these steps, a stabilized image is finally obtained, which can accurately reflect the appearance characteristics of the sample.
[0088] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0089] (1) Perform multi-scale decomposition on the stabilized image to obtain image pyramids of different scales, and perform edge detection on each scale level of the image pyramid to obtain a multi-scale edge feature set;
[0090] (2) Based on the multi-scale edge feature set, the stabilized image is segmented to obtain a preliminary segmentation result, and morphological operations are performed on the preliminary segmentation result to obtain an optimized image segmentation result;
[0091] (3) Based on the optimized image segmentation results, the texture features and color features of each segmented region are extracted to obtain the regional feature descriptor;
[0092] (4) Combined with the real-time position information of the multi-axis gimbal, the regional feature descriptor is mapped to spatial coordinates to obtain a feature point set with three-dimensional spatial information, and cluster analysis is performed on the feature point set with three-dimensional spatial information to obtain a feature region set;
[0093] (5) Based on the feature region set, a regional adjacency graph is constructed to obtain the regional topological structure, and a hierarchical spatial feature tree is generated based on the regional topological structure and the feature region set;
[0094] (6) The spatial feature tree is fused with the original image information of the stabilized image to generate a feature map with spatial information.
[0095] Specifically, the stabilized image is decomposed at multiple scales. Multiscale decomposition is usually achieved by constructing an image pyramid, which is composed of a series of scaled-down images. Each level of the image pyramid can be obtained by a downsampling operation, where each pixel is the weighted average of its neighboring pixels. Suppose the original image is , then Level Image Pyramid It can be expressed as:
[0096] ;
[0097] in It is a downsampling operation, usually a Gaussian filter. In this way, image pyramids of different scales are obtained. Edge detection is performed on each scale level of the image pyramid to obtain a multi-scale edge feature set. Edge detection can use the Canny edge detection algorithm. For each scale , calculate its edge image , where each pixel value represents the edge strength. By summarizing the edge feature sets of all scales, a multi-scale edge feature set is formed . According to the multi-scale edge feature set, the stabilized image is segmented into regions to obtain preliminary segmentation results. Regional segmentation can be achieved through the watershed algorithm based on edge information, which divides the image using edge strength information. The preliminary segmentation results may contain noise and irregular areas, and morphological operations, including dilation, erosion, opening and closing operations, are required to smooth and correct the segmentation results. The optimized image segmentation results after morphological operations have more coherent and accurate regional boundaries. Based on the optimized image segmentation results, the texture features and color features of each segmented region are extracted to obtain regional feature descriptors. Texture features can be calculated through the grayscale co-occurrence matrix, including contrast, energy, entropy, etc. Color features are calculated through color histograms, and the color feature descriptors of each segmented region are obtained. It can be expressed as
[0098] ;
[0099] in , and The histograms of the red, green and blue channels are respectively. Combining texture features with color features to form a regional feature descriptor Combined with the real-time position information of the multi-axis gimbal, the regional feature descriptor is mapped to spatial coordinates to obtain a feature point set with three-dimensional spatial information. With 2D image coordinates and depth information , mapped to three-dimensional space coordinates , the formula is:
[0100] ;
[0101] in is the depth matrix. In this way, a feature point set with three-dimensional spatial information is obtained. Cluster analysis is performed on the feature point set with three-dimensional spatial information to obtain a feature region set. Cluster analysis can use the kmeans algorithm to form a feature region set by aggregating similar feature points together. , each feature region contains several feature points. Based on the feature region set, a region adjacency graph is constructed to obtain the region topology. The nodes of the region adjacency graph represent feature regions, and the edges represent the relationship between adjacent feature regions. The region adjacency graph is generated by calculating the connection strength between each pair of adjacent regions. ,in is a node set, is an edge set. Based on the regional topology and feature region set, a hierarchical spatial feature tree is generated. The root node of the spatial feature tree represents the entire image, the child nodes represent each feature region, and the leaf nodes represent specific feature points. By recursively dividing the feature region, a hierarchical spatial feature tree is constructed. The spatial feature tree is fused with the original image information of the stabilized image to generate a feature map with spatial information. The feature map contains the visual features of the image, as well as the spatial location information and regional topological structure. By fusing this information, a high-precision feature map is generated.
[0102] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0103] (1) Divide the feature map with spatial information into regions to obtain multiple sub-regions to be detected, and calculate the local statistical features of each sub-region to be detected to obtain a sub-region feature statistical set;
[0104] (2) According to the sub-region feature statistics set, an initial detection threshold is set for each sub-region to be detected to obtain an initial threshold map, and an adaptive threshold calculation is performed on the initial threshold map to obtain an optimized threshold map;
[0105] (3) Based on the optimized threshold map, the feature map with spatial information is threshold segmented to obtain a preliminary defect marking map, and the morphological features are extracted from each potential defect area in the preliminary defect marking map to obtain a defect morphological feature set;
[0106] (4) Perform preliminary classification based on the defect morphology feature set to obtain a candidate defect set, and generate a multi-angle observation plan for each candidate defect based on the motion capability of the multi-axis gimbal to obtain a defect verification task list;
[0107] (5) Control the movement of the multi-axis gimbal according to the defect verification task list, collect multi-angle images of candidate defects, obtain an enhanced defect image set, and perform deep learning classification on the enhanced defect image set to obtain preliminary defect detection results.
[0108] Specifically, the feature map with spatial information is divided into regions. The image is divided into several sub-regions by using an image segmentation algorithm, such as K-means clustering or superpixel segmentation method. Assume that the image is divided into Sub-areas Each sub-region contains several pixels, each pixel has its spatial position information and feature descriptor. The local statistical features of each sub-region to be detected are calculated to obtain the sub-region feature statistics set. The local statistical features include mean value, standard deviation, contrast, entropy, etc. Assume that the sub-region The feature descriptor in is ,in It is a sub-region The number of pixels in the sub-region is and standard deviation It can be expressed as:
[0109] ;
[0110] By calculating these statistical features, a sub-region feature statistical set is obtained. According to the sub-region feature statistical set, an initial detection threshold is set for each sub-region to be detected to obtain an initial threshold map. The initial detection threshold can be set according to the distribution of the feature statistics. For example, assuming that the mean value and standard deviation are used to set the threshold
[0111] ;
[0112] in is a constant used to adjust the sensitivity of the threshold. In this way, the initial threshold map is obtained. The initial threshold map is adaptively calculated to obtain an optimized threshold map. Adaptive threshold calculation is to dynamically adjust the threshold according to the image content and feature distribution to improve detection accuracy. An adaptive threshold algorithm, such as the Otsu algorithm or the local adaptive threshold method, can be used to optimize the initial threshold to obtain an optimized threshold map. Based on the optimized threshold map, the feature map with spatial information is threshold segmented to obtain a preliminary defect labeling map. Pixels with feature values higher than the threshold are marked as potential defect areas, and a preliminary defect labeling map is obtained by threshold segmentation of each sub-area. Morphological features are extracted from each potential defect area in the preliminary defect labeling map to obtain a defect morphological feature set. Morphological features include area, perimeter, shape factor, etc. For example, assuming that the area of the defect area is , the perimeter is , then the shape factor It can be expressed as:
[0113] ;
[0114] By calculating these morphological features, the defect morphological feature set is obtained. According to the defect morphological feature set, preliminary classification is performed to obtain a candidate defect set. Defects with similar morphological features are classified, for example, using support vector machines or K-means clustering methods to divide the defects into several categories to form a candidate defect set. Based on the motion capability of the multi-axis gimbal, a multi-angle observation plan is generated for each candidate defect to obtain a defect verification task list. The multi-angle observation plan uses the flexibility of the multi-axis gimbal to collect images of defects from different angles to more comprehensively understand the characteristics of the defects. Assume that the motion parameters of the multi-axis gimbal are ,in Indicates angles. Generate a defect verification task list by planning the motion trajectory of the gimbal. Control the movement of the multi-axis gimbal according to the defect verification task list, collect multi-angle images of candidate defects, and obtain an enhanced defect image set. By controlling the multi-axis gimbal to shoot at different angles, more detailed and comprehensive defect image data can be obtained. The enhanced defect image set contains defect images taken from different perspectives. Perform deep learning classification on the enhanced defect image set to obtain preliminary defect detection results. The deep learning classification model can be implemented through a convolutional neural network. The model input is a multi-angle defect image, and the output is the defect classification result. Assume that the model parameters are , the input image is , then the model's predicted output It can be expressed as:
[0115] ;
[0116] By training the deep learning model, defects can be accurately identified and classified to obtain preliminary defect detection results.
[0117] In a specific embodiment, the process of executing step S106 may specifically include the following steps:
[0118] (1) Perform cluster analysis on the preliminary defect detection results to obtain defect clusters, and construct a defect spatial distribution heat map based on the defect clusters and the real-time position information of the multi-axis gimbal;
[0119] (2) Perform spatial attention mechanism analysis on the defect spatial distribution heat map to obtain the attention weight map, and generate the optimized scanning path of the multi-axis gimbal based on the attention weight map;
[0120] (3) Based on the optimized scanning path, the multi-axis gimbal motion is controlled to collect high-resolution local images to obtain a set of fine defect images, and multi-scale feature extraction is performed on the fine defect image set to obtain an enhanced defect feature set;
[0121] (4) Based on the enhanced defect feature set, each defect in the preliminary defect detection results is re-evaluated, the confidence score of the defect is updated, and an optimized defect list is obtained;
[0122] (5) Construct a surface defect topology map of the sample to be inspected based on the optimized defect list and the real-time position information of the multi-axis gimbal;
[0123] (6) Perform spatial correlation analysis on the surface defect topology map to obtain a defect mode feature map, and combine the defect mode feature map with the optimized defect list to generate sample defect distribution data. The sample defect distribution data includes the location, type, severity and spatial relationship information of the defects.
[0124] Specifically, cluster analysis is performed on the preliminary defect detection results. Cluster analysis can use algorithms such as K means clustering or DBSCAN to cluster the detected defects according to their characteristics and locations. Assume that the defect set is ,in Indicates The location and characteristic information of each defect are analyzed, and several defect clusters are obtained through cluster analysis. Based on the real-time position information of defect clusters and the multi-axis gimbal, a defect spatial distribution heat map is constructed. The heat map provides the spatial distribution of defects by showing the density distribution of defects on the sample surface. The density of can be expressed by calculating the number of defects in its members, and the heat map can reflect this density by the depth of color. The spatial attention mechanism is analyzed on the defect spatial distribution heat map to obtain the attention weight map. The spatial attention mechanism determines the areas that need to be focused on by analyzing the importance of different areas in the heat map. The attention weight map represents the importance weight of each area. Assuming that the coordinates of the area in the heat map are , then the weight can be expressed as:
[0125] ;
[0126] in is the position in the heat map The density value, weight is the weight of the position, and are the number of rows and columns of the heat map, respectively. Based on the attention weight map, the optimized scanning path of the multi-axis gimbal is generated. The optimized scanning path plans the motion trajectory of the gimbal so that it preferentially scans the area with higher weight. The optimized scanning path can be expressed as a path sequence , where each path point Corresponding to a high-weight area. Based on the optimized scanning path, the multi-axis gimbal is controlled to move, collect high-resolution local images, and obtain a set of fine defect images. When the multi-axis gimbal moves along the optimized path, it uses a high-resolution camera to collect images of the sample surface. These images contain more detailed information, which is helpful for further defect analysis. The set of fine defect images can be expressed as ,in It is at the waypoint The image is collected at . Multi-scale feature extraction is performed on the fine defect image set to obtain the enhanced defect feature set. Multi-scale feature extraction extracts image features at different levels, such as texture, edge, and color, by decomposing the image at different scales. Assume that at the scale The features extracted are , then the defect feature set is enhanced It can be expressed as a collection of all scale features:
[0127] ;
[0128] Based on the enhanced defect feature set, each defect in the preliminary defect detection results is re-evaluated, the confidence score of the defect is updated, and an optimized defect list is obtained. The confidence score of each defect can be recalculated by a deep learning model or other classification algorithm. Assume that the confidence score is , then optimize the defect list can be represented as a set of defects and their updated confidences:
[0129] ;
[0130] Based on the optimized defect list and the real-time position information of the multi-axis gimbal, a surface defect topology map of the sample to be inspected is constructed. The topology map connects adjacent defect points to show the distribution and relationship of defects on the sample surface. The nodes represent defects, and the edges represent the connection between defects. The surface defect topology map is subjected to spatial correlation analysis to obtain the defect mode feature map. The spatial correlation analysis reveals the arrangement rules and characteristics of defects on the sample surface by calculating the distance, angle and distribution pattern between defects. Defect mode feature map It can be represented as a set of defect pattern features. The defect pattern feature map is combined with the optimized defect list to generate sample defect distribution data. The sample defect distribution data includes not only the location, type and severity of the defect, but also its spatial relationship information. Defect distribution data It can be expressed as:
[0131] ;
[0132] in Indicates defects The pattern characteristics.
[0133] The above describes the macro detection method for appearance detection in the embodiment of the present application. The following describes the macro detection device for appearance detection in the embodiment of the present application. Figure 2 In one embodiment of the present application, a macro detection device for appearance detection includes:
[0134] The scanning module 201 is used to perform three-dimensional scanning on the sample to be inspected, obtain three-dimensional data of the sample, and generate initial configuration parameters of the multi-axis gimbal according to the three-dimensional data of the sample;
[0135] The test module 202 is used to perform dynamic balance calculation on the initial configuration parameters, obtain the balance weight distribution and damping system parameters, perform micro-vibration test, and generate vibration compensation data;
[0136] The processing module 203 is used to perform multi-degree-of-freedom coordinated motion control on the multi-axis gimbal based on the vibration compensation data and the initial configuration parameters, and collect multimodal image data of the sample to be detected for motion compensation processing to obtain a stabilized image;
[0137] An extraction module 204 is used to extract position-aware features from the stabilized image and generate a feature map with spatial information in combination with the real-time position information of the multi-axis gimbal;
[0138] Detection module 205, used to perform defect detection and multi-angle defect verification through feature maps with spatial information to obtain preliminary defect detection results;
[0139] The analysis module 206 is used to perform a defect distribution analysis based on the preliminary defect detection results and the real-time position information by executing the gimbal-guided attention mechanism algorithm to generate sample defect distribution data.
[0140] Through the cooperation of the above components, an accurate three-dimensional model of the sample can be obtained by three-dimensional scanning and data processing of the sample to be inspected. By performing dynamic balance calculation and micro-vibration test on the multi-axis gimbal, the vibration during the movement of the gimbal can be significantly reduced, and the stability and clarity of image acquisition can be improved. Multi-degree-of-freedom collaborative motion control based on vibration compensation data and initial configuration parameters can achieve precise positioning and smooth movement of the gimbal, and adapt to samples of different shapes and sizes. Collecting and processing multimodal image data, combined with motion compensation technology, can obtain high-quality stabilized images. By combining position-aware feature extraction and real-time position information of the multi-axis gimbal, a feature map with spatial information is generated, which realizes the precise positioning and three-dimensional characterization of defects. The defect detection method using dynamic threshold adjustment can adapt to the characteristics of different areas on the sample surface and improve the accuracy and robustness of defect detection. By utilizing the flexibility of the multi-axis gimbal, multi-angle verification of defects is achieved, effectively reducing the probability of false detection and missed detection. Through the attention mechanism algorithm guided by the gimbal, it can automatically focus on high-risk areas to improve detection efficiency and accuracy.
[0141] The present application also provides a macro detection device for appearance detection, the macro detection device for appearance detection includes a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the macro detection method for appearance detection in the above-mentioned embodiments.
[0142] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the macro detection method for appearance detection.
[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0144] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0145] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A macro detection method for appearance detection, characterized in that: The method comprises: The method comprises the following steps: performing a three-dimensional scan on the sample to be detected to obtain three-dimensional data of the sample, and generating initial configuration parameters of the multi-axis gimbal according to the three-dimensional data of the sample; specifically comprising: performing a multi-angle scan on the sample to be detected to obtain original point cloud data, and filtering and equalizing the original point cloud data to obtain optimized point cloud data; performing geometric feature extraction on the optimized point cloud data to obtain a geometric feature model, and calculating the main axis direction and center of mass position of the sample to be detected according to the geometric feature model to obtain preliminary posture information; performing voxelization on the optimized point cloud data based on the preliminary posture information and performing probability classification on the voxels to obtain to a volume distribution model; according to the volume distribution model, calculate the center of gravity coordinates, and based on the geometric feature model and the volume distribution model, calculate the length, width and height data; based on the geometric feature model, perform a parameterized description of the sample shape to obtain a shape feature vector, and according to the center of gravity coordinates, the length, width and height data and the shape feature vector, predict the optimal initial position of the multi-axis gimbal to obtain the gimbal space coordinates; based on the gimbal space coordinates and the preliminary attitude information, calculate the initial angles of each joint of the multi-axis gimbal to obtain the gimbal attitude parameters; generate the initial configuration parameters of the multi-axis gimbal according to the gimbal space coordinates and the gimbal attitude parameters; Performing dynamic balance calculation on the initial configuration parameters to obtain the balance weight distribution and damping system parameters and performing micro-vibration test to generate vibration compensation data; specifically comprising: according to the initial configuration parameters, establishing the mass distribution model of the multi-axis gimbal and calculating the mass and moment of inertia of each axis to obtain initial dynamic parameters; based on the initial dynamic parameters, constructing the motion equation of the multi-axis gimbal and performing numerical solution to obtain the theoretical balance state under different postures; analyzing the theoretical balance state, calculating the moment distribution of each axis, and determining the optimal arrangement position of the balance weight according to the moment distribution to obtain a preliminary balance weight distribution plan; according to the preliminary balance weight distribution plan, virtually loading the multi-axis gimbal and recalculating the dynamic parameters to obtain a revised dynamic model; performing frequency domain analysis based on the revised dynamic model to identify the multi-axis gimbal The natural frequency and mode of the multi-axis gimbal are used to obtain vibration characteristic data; according to the vibration characteristic data, preliminary parameters of the damping system are designed to obtain a preliminary damping system solution, wherein the preliminary damping system solution includes the position, stiffness and damping coefficient of the damper; based on the preliminary damping system solution, the multi-axis gimbal is virtually assembled and dynamically responded to simulate to obtain theoretical motion trajectory data; the theoretical motion trajectory data are analyzed to calculate the vibration amplitude and frequency of the multi-axis gimbal under different working conditions to obtain vibration response characteristics; based on the vibration response characteristics, the damping system is optimized to obtain damping system parameters and balance weight distribution; according to the damping system parameters and the balance weight distribution, an actual micro-vibration test is performed on the multi-axis gimbal, the measured vibration data is recorded, and vibration compensation data is generated by comparing the difference between the measured vibration data and the theoretical motion trajectory data; Based on the vibration compensation data and the initial configuration parameters, the multi-axis gimbal is subjected to multi-degree-of-freedom collaborative motion control, and the multimodal image data of the sample to be detected is collected for motion compensation processing to obtain a stabilized image; specifically comprising: constructing a motion trajectory planning model of the multi-axis gimbal according to the initial configuration parameters and the vibration compensation data, optimizing and calculating the motion trajectory of each axis to obtain an initial collaborative motion trajectory; segmenting the initial collaborative motion trajectory to obtain multiple motion stages, and assigning corresponding motion parameters to each motion stage to obtain a segmented motion control strategy; based on the segmented motion control strategy, generating control signals for each drive motor of the multi-axis gimbal to obtain a motor control instruction sequence; executing the motor control instruction sequence to drive the multi-axis gimbal to move, and at the same time collecting attitude and acceleration data in real time based on the built-in sensor to compare with the initial collaborative motion trajectory to obtain a real-time motion motion error data; according to the real-time motion error data, perform real-time motion correction on the multi-axis gimbal, adjust the parameters of each drive motor, and obtain an actual motion trajectory; in the process of the multi-axis gimbal executing the actual motion trajectory, trigger the multi-modal camera array, synchronously collect multi-spectral images, and record the real-time position information of the multi-axis gimbal to obtain multi-modal image data; pre-process the multi-modal image data to obtain pre-processed image data, and calculate the precise gimbal posture at the moment of shooting each image according to the real-time position information and the actual motion trajectory, construct a mapping relationship between the image and the spatial position, and obtain a position-indexed image data set; based on the vibration compensation data and the actual motion trajectory, perform motion blur removal and image registration on the position-indexed image data set to obtain a corrected image data set, and perform multi-frame image fusion on the corrected image data set to generate a stabilized image; Extracting position-aware features from the stabilized image and combining it with the real-time position information of the multi-axis gimbal to generate a feature map with spatial information; specifically comprising: performing multi-scale decomposition on the stabilized image to obtain image pyramids of different scales, and performing edge detection on each scale level of the image pyramid to obtain a multi-scale edge feature set; performing regional segmentation on the stabilized image according to the multi-scale edge feature set to obtain a preliminary segmentation result, and performing morphological operations on the preliminary segmentation result to obtain an optimized image segmentation result; extracting texture features and color features of each segmented region based on the optimized image segmentation result to obtain a regional feature descriptor; performing spatial coordinate mapping on the regional feature descriptor in combination with the real-time position information of the multi-axis gimbal to obtain a feature point set with three-dimensional spatial information, and performing cluster analysis on the feature point set with three-dimensional spatial information to obtain a feature region set; constructing a regional adjacency graph based on the feature region set to obtain a regional topological structure, and generating a hierarchical spatial feature tree based on the regional topological structure and the feature region set; fusing the spatial feature tree with the original image information of the stabilized image to generate a feature map with spatial information; Defect detection and multi-angle defect verification are performed through the feature map with spatial information to obtain preliminary defect detection results; specifically including: dividing the feature map with spatial information into regions to obtain multiple sub-regions to be detected, and performing local statistical feature calculation on each sub-region to be detected to obtain a sub-region feature statistical set; setting an initial detection threshold for each sub-region to be detected according to the sub-region feature statistical set to obtain an initial threshold map, and performing adaptive threshold calculation on the initial threshold map to obtain an optimized threshold map; based on the optimized threshold map, performing threshold segmentation on the feature map with spatial information to obtain a preliminary defect marking map, and extracting morphological features from each potential defect region in the preliminary defect marking map to obtain a defect morphological feature set; performing preliminary classification according to the defect morphological feature set to obtain a candidate defect set, and based on the motion capability of the multi-axis gimbal, generating a multi-angle observation plan for each candidate defect to obtain a defect verification task list; controlling the movement of the multi-axis gimbal according to the defect verification task list, collecting multi-angle images of the candidate defects to obtain an enhanced defect image set, and performing deep learning classification on the enhanced defect image set to obtain preliminary defect detection results; Based on the preliminary defect detection results and the real-time position information, a gimbal-guided attention mechanism algorithm is executed to perform defect distribution analysis to generate sample defect distribution data; specifically comprising: performing cluster analysis on the preliminary defect detection results to obtain defect clusters, and constructing a defect spatial distribution heat map based on the defect clusters and the real-time position information of the multi-axis gimbal; performing spatial attention mechanism analysis on the defect spatial distribution heat map to obtain an attention weight map, and generating an optimized scanning path for the multi-axis gimbal according to the attention weight map; controlling the movement of the multi-axis gimbal based on the optimized scanning path, collecting high-resolution local images, obtaining a set of fine defect images, and Multi-scale feature extraction is performed on the fine defect image set to obtain an enhanced defect feature set; based on the enhanced defect feature set, each defect in the preliminary defect detection result is re-evaluated, the confidence score of the defect is updated, and an optimized defect list is obtained; based on the optimized defect list and the real-time position information of the multi-axis gimbal, a surface defect topology map of the sample to be detected is constructed; spatial correlation analysis is performed on the surface defect topology map to obtain a defect mode feature map, and the defect mode feature map is combined with the optimized defect list to generate sample defect distribution data, the sample defect distribution data including the location, type, severity and spatial relationship information of the defect.
2. A macro detection device for appearance detection, characterized in that: For executing the macro detection method for appearance detection according to claim 1, the device comprises: A scanning module is used to perform three-dimensional scanning on the sample to be tested, obtain three-dimensional data of the sample, and generate initial configuration parameters of the multi-axis gimbal according to the three-dimensional data of the sample; A test module, used to perform dynamic balance calculation on the initial configuration parameters, obtain the balance weight distribution and damping system parameters, perform micro-vibration test, and generate vibration compensation data; A processing module, used for performing multi-degree-of-freedom coordinated motion control on the multi-axis gimbal based on the vibration compensation data and the initial configuration parameters, and collecting multimodal image data of the sample to be detected for motion compensation processing to obtain a stabilized image; An extraction module, used for performing position-aware feature extraction on the stabilized image and combining the real-time position information of the multi-axis gimbal to generate a feature map with spatial information; A detection module, used to perform defect detection and multi-angle defect verification through the feature map with spatial information to obtain preliminary defect detection results; The analysis module is used to perform a defect distribution analysis using a gimbal-guided attention mechanism algorithm based on the preliminary defect detection results and the real-time position information to generate sample defect distribution data.
3. A macro inspection device for appearance inspection, characterized in that: The macro detection device for appearance detection comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the macro detection device for appearance detection to execute the macro detection method for appearance detection according to claim 1.
4. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the macro detection method for appearance detection according to claim 1 is implemented.
Citation Information
Patent Citations
Image data generation method and device
CN110428388A
Workpiece defect detection system and method
CN118115372A
