Industrial production part detection method based on machine vision
The three-dimensional feature space is constructed through the fusion of multi-spectral imaging and structured light projection, and combined with the composite analysis of geometry, texture and material characteristic parameters, the problem of single detection dimensions in traditional machine vision detection methods is solved, achieving efficient and accurate recognition of part detection.
Patent Information
- Application Number
- CN202510581848.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional machine vision detection methods rely on a single sensor to fully capture the three-dimensional geometric features, surface texture and material characteristics of parts, resulting in insufficient recognition capabilities for composite defects and microscopic quality defects, and it is difficult to take into account both detection accuracy and real-time in high-speed production scenarios.
Multi-spectral imaging and structured light projection are used to construct a three-dimensional feature space, combined with composite analysis of geometric, texture and material characteristic parameters, image data is collected through multi-spectral industrial cameras, pre-processing and spatial registration, and composite parameters are extracted for detection.
It improves the accuracy and efficiency of identification of complex defects, solves the problem of single detection dimensions of traditional methods, and achieves efficient and accurate detection of parts.
Smart Images

Figure CN120446134A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image detection, and in particular to an industrial production parts detection method based on machine vision. Background Art
[0002] In industrial production, the accuracy and efficiency of part quality inspection directly affect product yield and production costs. Traditional machine vision inspection methods mostly rely on a single sensor (such as a visible light camera) to obtain two-dimensional image information, which makes it difficult to fully capture the three-dimensional geometric features, surface texture and material properties (such as reflectivity and temperature distribution) of parts. In addition, existing technologies often adopt a phased independent inspection strategy, and the coarse screening and fine judgment processes lack coordination, resulting in insufficient recognition of complex defects (such as coexistence of dimensional deviation and deformation) or microscopic quality defects (such as abnormal surface reflectivity and excessive temperature gradients), which is prone to missed detection or misjudgment. At the same time, in high-speed production scenarios, existing methods are limited by the efficiency of image registration and the limitations of parameter fusion algorithms, making it difficult to balance detection accuracy and real-time performance. Therefore, it is very necessary to design an industrial production parts inspection method based on machine vision. Summary of the Invention
[0003] The purpose of this invention is to provide an industrial production parts inspection method based on machine vision, which constructs a three-dimensional feature space by fusing multispectral imaging and structured light projection, and combines the composite analysis of geometry, texture and material characteristic parameters to solve the problem of single detection dimension of traditional methods and improve the recognition accuracy and efficiency of complex defects.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] A method for detecting industrial parts based on machine vision comprises the following steps:
[0006] When a part passes through a preset inspection area, a multi-spectral industrial camera collects multi-dimensional image data and pre-processes the multi-dimensional image data. The multi-dimensional image data includes: multi-spectral image data and structured light projection; the multi-spectral image data includes: visible light image and near-infrared image;
[0007] Construct a three-dimensional feature space based on structured light projection, and map the pre-processed multispectral image data into the three-dimensional feature space for spatial registration to obtain the image to be detected;
[0008] Extracting composite parameters from the image to be detected; composite parameters include: geometric parameters, texture parameters and material characteristic parameters; material characteristic parameters include: surface reflectivity distribution and temperature;
[0009] Use geometric parameters and texture parameters to perform rough screening of parts and eliminate parts with appearance defects;
[0010] The parts after coarse screening are accurately identified at the micro level through material characteristic parameters to eliminate parts with quality defects.
[0011] Optionally, when the part passes through the preset inspection area, multi-dimensional image data is collected by a multispectral industrial camera, and the multi-dimensional image data is pre-processed, including:
[0012] Determine the exposure time and frame rate of the multispectral industrial camera based on the conveyor belt speed;
[0013] Adaptive white balance processing of visible light images is performed through a nonlinear correction algorithm based on color temperature estimation;
[0014] The reflectance normalization process of the near-infrared image is performed through the reflectance mapping relationship between the near-infrared image and the standard reference plate;
[0015] The structured light projection is dynamically encoded by Gray code and phase offset coding to obtain a coded image, which is then decoded by a multi-frequency heterodyne phase unwrapping algorithm.
[0016] Optionally, a three-dimensional feature space is constructed based on structured light projection, and the pre-processed multispectral image data is mapped into the three-dimensional feature space for spatial registration operation to obtain an image to be detected, including:
[0017] Gaussian kernels of different scales are used to enhance the depth mutation area and flat area in visible light images respectively;
[0018] Perform Poisson surface reconstruction on the structured light projection to obtain a 3D point cloud, and perform bidirectional projection matching on the enhanced visible light image and the 3D point cloud to obtain the normal vector field;
[0019] The feature descriptor is constructed by performing correlation analysis on the normal vector and edge curvature of the normal vector field;
[0020] A multi-objective loss function is constructed by using the normal vector direction difference of the normal vector field and the local entropy value of the enhanced visible light image;
[0021] Based on the multi-objective loss function, the extreme value of the feature descriptor is selected through the RANSAC algorithm;
[0022] Based on the extreme value of the feature descriptor, the ICP algorithm is used to perform registration operations on the multi-dimensional image data to obtain the image to be detected.
[0023] Optionally, the step of extracting geometric parameters includes:
[0024] Calculate the Scharr gradient amplitude of the multispectral bands in the image to be detected respectively, and fuse the bands with cosine similarity between the Scharr gradient amplitudes greater than 0.85 into a consensus edge map;
[0025] The consensus edge map is projected into the three-dimensional feature space, and geometric edges with an overlap rate > 70% after projection are extracted through bidirectional distance transform matching;
[0026] The geometric edge is traced back to the three-dimensional feature space, the principal curvature after tracing back is calculated, and the geometric edge is divided into rigid edge, flexible edge and transition zone according to the principal curvature;
[0027] The rigid edge, flexible edge and transition zone are reconstructed by RANSAC algorithm, non-uniform rational B-spline and least square method respectively, and the reconstructed results are fused into geometric parameters.
[0028] Optionally, the step of extracting texture parameters includes:
[0029] Marking an area in the image to be detected whose curvature is greater than a preset curvature threshold as a region of interest, and dividing the region of interest and the remaining area in the image to be detected into multiple grid cells using different grid spacings;
[0030] Calculate the gray-level co-occurrence matrix along the principal curvature direction for the area in the grid cell whose curvature is greater than the curvature threshold;
[0031] The curvature of the area in the grid unit that does not exceed the curvature threshold is weighted in four directions to obtain a weighted matrix, and the weighted matrix is spliced with the gray-level co-occurrence matrix to form a texture matrix;
[0032] The texture matrix is spatially aligned with the three-dimensional feature space to obtain the texture parameters.
[0033] Optionally, the step of extracting the surface reflectance distribution includes:
[0034] Construct material spectral feature library through sparse coding dictionary learning method;
[0035] Perform non-negative matrix decomposition on the image to be detected through the material spectral feature library;
[0036] The light incident angle and fiber exit angle of the decomposed image to be detected are calculated through three-dimensional feature space to generate the surface reflectivity distribution.
[0037] Optionally, parts can be screened using geometric and texture parameters to remove parts with appearance defects, including:
[0038] Extract standard size data based on the 3D CAD model of the parts and build a standard library;
[0039] Set a sliding time window based on the batch production time of the parts;
[0040] Perform kernel density estimation on geometric parameters based on a sliding time window and remove geometric parameters with confidence less than 95%;
[0041] By formula The size difference and curvature distribution difference between the geometric parameters and the standard library are calculated using the Wasserstein distance, where α i is the weight coefficient of the i-th position size, L t,i is the size of the i-th position in the geometric parameters, μ s,i is the mean of the i-th position in the standard library, σ s,i is the standard deviation of the i-th position in the standard library;
[0042] By formula The shape defect judgment index is calculated, where V is the real-time speed of the conveyor belt, V max is the maximum speed of the conveyor belt, ΔQ is the curvature distribution difference;
[0043] The texture parameters are transformed by dual-tree complex wavelet transform to obtain the direction-sensitive similarity index;
[0044] Calculate the deviation between the direction-sensitive similarity index and the standard library;
[0045] Parts with appearance defects are identified based on the appearance defect judgment index and deviation.
[0046] Optionally, parts with appearance defects are identified based on appearance defect determination indicators and deviations, including:
[0047] When WX>2 and the deviation is ≤1.05, the part is judged as a dimensional defect;
[0048] When WX≤1 and the deviation is >1.5, the part is judged as a deformation defect;
[0049] When WX>1.6 and the deviation>1.2, the part is judged as a composite defect.
[0050] Optionally, the parts after coarse screening can be accurately identified at a microscopic level using material characteristic parameters to eliminate parts with quality defects, including:
[0051] By formula Calculate the surface defect judgment index, where σ R is the standard deviation of the surface reflectivity distribution, μ R is the mean of the surface reflectivity distribution, is the surface temperature gradient of the part, T s is the reference value of the surface temperature of qualified parts during stable production, ρ(R, T) is the Pearson correlation coefficient between surface reflectivity and part temperature, and ρ0 is the theoretical Pearson correlation coefficient;
[0052] When QX<0.5, the part is qualified;
[0053] When 0.5≤QX<1.0, mark the part as requiring re-inspection;
[0054] When QX≥1.0, the part is marked as unqualified and rejected.
[0055] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: The present invention provides a method for detecting industrial production parts based on machine vision, the method comprising: when a part passes through a preset detection area, collecting multi-dimensional image data through a multispectral industrial camera, and pre-processing the multi-dimensional image data; constructing a three-dimensional feature space based on structured light projection, and mapping the pre-processed multispectral image data into the three-dimensional feature space for spatial registration operations to obtain an image to be detected; extracting composite parameters from the image to be detected; performing a coarse screening and identification of parts through geometric parameters and texture parameters, and eliminating parts with appearance defects; performing microscopic precise identification of the coarsely screened parts through material characteristic parameters, and eliminating parts with quality defects. This method constructs a three-dimensional feature space by fusing multispectral imaging and structured light projection, and combines the composite analysis of geometric, texture and material characteristic parameters to solve the problem of the single detection dimension of traditional methods and improve the accuracy and efficiency of identifying complex defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 This is a flow chart of the industrial production parts detection method of the present invention;
[0058] Figure 2 This is a flowchart of image preprocessing of the present invention;
[0059] Figure 3 This is a flow chart of the spatial registration of the present invention. DETAILED DESCRIPTION
[0060] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0061] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0062] like Figure 1 As shown, the present invention provides an industrial production parts detection method based on machine vision, comprising the following steps:
[0063] Step 100: When a part passes through a preset inspection area, multi-dimensional image data is collected by a multispectral industrial camera and pre-processed. The multi-dimensional image data includes multispectral image data and structured light projection. The multispectral image data includes visible light images and near-infrared images.
[0064] Step 200: constructing a three-dimensional feature space based on structured light projection, and mapping the multispectral image data into the three-dimensional feature space for spatial registration to obtain an image to be detected;
[0065] Step 300: extracting composite parameters from the image to be detected; the composite parameters include: geometric parameters, texture parameters and material characteristic parameters; the material characteristic parameters include: surface reflectivity distribution and temperature;
[0066] Step 400: Perform a rough screening of parts using geometric parameters and texture parameters to remove parts with appearance defects;
[0067] Step 500: Perform microscopic precise identification on the coarsely screened parts using material characteristic parameters to eliminate parts with quality defects.
[0068] like Figure 2 As shown in the figure, when a part passes through a preset inspection area, a multi-spectral industrial camera collects multi-dimensional image data and pre-processes the multi-dimensional image data, including:
[0069] Step 101: Determine the exposure time and frame rate of the multispectral industrial camera according to the conveyor belt speed;
[0070] Specifically, the exposure time is determined by the ratio of the allowable displacement of the conveyor belt to the conveyor belt speed.
[0071] Step 102: performing adaptive white balance processing on the visible light image using a nonlinear correction algorithm based on color temperature estimation;
[0072] Specifically, a neutral gray area (such as a fixed background plate or part fixture) is first extracted from the image. The current color temperature is estimated using the McCamy cube interpolation method, and then the RGB channels are nonlinearly adjusted using a piecewise gamma curve. When the color temperature is low (warm light), the blue channel is enhanced to neutralize the yellow bias; when the color temperature is high (cold light), the red channel is enhanced to balance the cool tones. This eliminates the color cast caused by ambient light reflection and improves color consistency when multispectral data is fused, providing reliable input for subsequent texture analysis.
[0073] Step 103: performing reflectance normalization processing on the near-infrared image based on the reflectance mapping relationship between the near-infrared image and the standard reference plate;
[0074] Specifically, a near-infrared image of the reference plate is collected under the same light source, and a reflectance-grayscale curve is generated through polynomial fitting or a lookup table (LUT). Then, the grayscale value of each pixel in the part image is converted into a standard reflectance value.
[0075] Step 104: Dynamically encode the structured light projection using Gray code and phase offset coding to obtain an encoded image, and decode the encoded image using a multi-frequency heterodyne phase unwrapping algorithm.
[0076] Specifically, the Gray code divides coarse-grained areas by binary stripes, solving the phase ambiguity problem. During the projection process, the stripe width is dynamically adjusted according to the part size. The phase offset is encoded within the interval divided by the Gray code, and multiple sets of phase-shifted sinusoidal gratings are projected. The wrapped phase is calculated through four frames of images, and sub-pixel phase information is extracted. Subsequently, a dual-frequency heterodyne method is used to fuse the high-frequency (rich in details) and low-frequency (strong in noise resistance) phase images to reconstruct a continuous, non-jumping phase field. This resists interference from reflections on metal surfaces and solves the phase jump problem of traditional single-frequency coding.
[0077] like Figure 3 As shown, a three-dimensional feature space is constructed based on structured light projection, and the multispectral image data is mapped into the three-dimensional feature space for spatial registration operation to obtain the image to be detected, including:
[0078] Step 201: using Gaussian kernels of different scales to perform image enhancement on depth mutation areas and flat areas in the visible light image;
[0079] Specifically, a small-scale Gaussian kernel is used to sharpen the edges of regions with sudden depth changes to enhance geometric details. A large-scale Gaussian kernel is used to smooth noise in flat regions to preserve the overall topography. By distinguishing different regions, this avoids detail loss or over-smoothing caused by global filtering, providing images with a high signal-to-noise ratio for subsequent 3D reconstruction.
[0080] Step 202: Perform Poisson surface reconstruction on the structured light projection to obtain a three-dimensional point cloud, and perform bidirectional projection matching on the enhanced visible light image and the three-dimensional point cloud to obtain a normal vector field;
[0081] Specifically, a Poisson surface reconstruction algorithm is used to generate a dense 3D point cloud based on the phase data of structured light projection. The enhanced visible light image is then fused with the point cloud through bidirectional projection matching. The point cloud is projected onto the image to extract texture information, while the image is projected onto the point cloud using gradient-optimized vectors.
[0082] Step 203: constructing a feature descriptor by performing correlation analysis on the normal vector and edge curvature of the normal vector field;
[0083] Specifically, the normal vector (gradient information after PCA or Poisson surface reconstruction) and local edge curvature (principal curvature is solved using the coordinate covariance matrix of adjacent points) of each point are first calculated based on the 3D point cloud data. The maximum and minimum curvatures are then obtained and the curvature difference is calculated. The correlation between the normal vector direction and curvature is then analyzed using the covariance matrix. The principal component weights are extracted through matrix eigenvalue decomposition and embedded into the histogram bins of the feature descriptor. By quantifying the differences, the descriptor can generate more discriminative feature vectors, avoiding the confusion between deformation and wear caused by traditional single features.
[0084] Step 204: construct a multi-objective loss function using the normal vector direction difference of the normal vector field and the local entropy value of the enhanced visible light image;
[0085] Specifically, the normal vector orientation difference between each point in the normal field and its neighboring points is first measured, and the difference value is calculated using cosine similarity. The enhanced visible light image is then divided into 8×8 pixel grid cells, and the grayscale entropy of each cell is calculated. The orientation difference and grayscale entropy are then weighted and fused using a dynamic weighting strategy to construct a multi-objective loss function.
[0086] Step 205: Based on the multi-objective loss function, select the extreme value of the feature descriptor through the RANSAC algorithm;
[0087] Specifically, the RANSAC algorithm first iteratively performs the following process: a minimum subset (e.g., three pairs of points, corresponding to the 6 degrees of freedom parameters of the rigid body transformation) is randomly selected from the feature point set, an initial transformation model is fitted using this subset, and then the match between all feature points and the model is evaluated based on a multi-objective loss function. For each candidate point, its projection error and local entropy difference are calculated. If the weighted sum of the two meets a threshold (0.8 in this example), it is determined to be an extreme value.
[0088] Step 206: Based on the extreme values of the feature descriptors, the multi-dimensional image data is registered using the ICP algorithm to obtain the image to be detected.
[0089] Specifically, the nearest neighbor search is accelerated by the KD tree to establish the correspondence between the feature points of the multispectral image and the three-dimensional feature space point cloud. The matching weight of each corresponding point pair is determined by its geometric distance (Euclidean space), the difference in the normal vector direction (cosine similarity), and the difference in spectral properties (such as reflectivity difference). Then, the weighted centroid is calculated and a decentralized coordinate matrix is constructed. The SVD decomposition is performed using the weighted covariance matrix to solve the optimal rotation matrix and translation vector. The transformation parameters are iteratively updated and the corresponding points are re-matched until the average registration error converges or the maximum number of iterations (50 in this embodiment) is reached.
[0090] Specifically, the steps of extracting geometric parameters include:
[0091] Calculate the Scharr gradient amplitude of the multispectral bands in the image to be detected respectively, and fuse the bands with cosine similarity between the Scharr gradient amplitudes greater than 0.85 into a consensus edge map;
[0092] The consensus edge map is projected into the three-dimensional feature space, and geometric edges with an overlap rate > 70% after projection are extracted through bidirectional distance transform matching;
[0093] The geometric edge is traced back to the three-dimensional feature space, the principal curvature after tracing back is calculated, and the geometric edge is divided into rigid edge, flexible edge and transition zone according to the principal curvature;
[0094] The rigid edge, flexible edge and transition zone are reconstructed by RANSAC algorithm, non-uniform rational B-spline and least square method respectively, and the reconstructed results are fused into geometric parameters.
[0095] It should be noted that, first, the Scharr gradient amplitude is calculated for the multispectral image (visible light and near-infrared bands), and the bands with consistent gradient directions are screened using cosine similarity (threshold > 0.85), and the consensus edge map is generated by fusion to eliminate the noise of a single band. The consensus edge is then projected into the three-dimensional feature space, and the geometric edges with an overlap rate > 70% are screened by calculating the Hausdorff distance between the projected edge and the three-dimensional point cloud to ensure the consistency of the three-dimensional space. The three-dimensional point cloud is then traced back, and the edges are divided into rigid edges (maximum curvature > 0.1mm) based on the principal curvature (obtained by calculating the maximum curvature and minimum curvature through eigenvalue decomposition of the covariance matrix). -1 , such as machined edges), flexible edges (0.05< maximum curvature ≤ 0.1mm -1 , such as curved surface transition) and transition area (maximum curvature ≤ 0.05mm -1, such as smooth connections), the RANSAC algorithm is used to fit the straight line / plane model of the rigid edge, outliers are removed, non-uniform rational B-splines are used to smoothly interpolate the flexible edge, and the least squares method is used to optimize the curvature continuity of the transition zone. Finally, a geometric parameter set containing size, curvature and topological relationships is generated by fusion. The recognition accuracy of the tooth top chipping of the rigid edge and the tooth root fillet of the flexible edge is improved, while the processing texture noise is suppressed.
[0096] Specifically, the steps of extracting texture parameters include:
[0097] Marking an area in the image to be detected whose curvature is greater than a preset curvature threshold as a region of interest, and dividing the region of interest and the remaining area in the image to be detected into multiple grid cells using different grid spacings;
[0098] Calculate the gray-level co-occurrence matrix along the principal curvature direction for the area in the grid cell whose curvature is greater than the curvature threshold;
[0099] The curvature of the area in the grid unit that does not exceed the curvature threshold is weighted in four directions to obtain a weighted matrix, and the weighted matrix is spliced with the gray-level co-occurrence matrix to form a texture matrix;
[0100] The texture matrix is spatially aligned with the three-dimensional feature space to obtain the texture parameters.
[0101] It should be noted that 3D point cloud data was collected, and the mean and standard deviation of the principal curvature differences were calculated. A threshold was set at the mean plus three times the standard deviation. Regions exceeding this threshold were marked as regions of interest (ROIs), and the rest were marked as non-ROIs. An adaptive meshing strategy was employed, with a dense 2×2 pixel grid for the ROI to capture detailed textures, and a sparse 8×8 pixel grid for non-ROIs to improve computational efficiency. Subpixel texture information was supplemented to the meshes using bilinear interpolation. For each ROI grid cell, the gray-level co-occurrence matrix (GLCM) was calculated along the principal curvature direction (30°) with a step size of d = 1 pixel and directional offsets of 0°, 45°, 90°, and 135°. Four statistical measures, namely contrast, energy, homogeneity, and correlation, were extracted, resulting in a total of 16-dimensional feature vectors. For meshes outside of the region of interest, curvature weighting is applied along four orthogonal directions (0°, 90°, 180°, and 270°) to generate a 4-dimensional weighted matrix. This matrix is then concatenated with the GLCM statistics to form a 20-dimensional texture matrix. Principal component analysis (PCA) is then used to reduce the dimensionality to 8, reducing redundancy and improving classification efficiency. Finally, the 2D coordinates (image pixel locations) of the texture matrix are mapped to a 3D point cloud space. An affine transformation is performed using the rotation matrix and translation vector output by ICP to ensure coordinate consistency between the texture features and the geometric parameters.
[0102] Specifically, the steps of extracting the surface reflectance distribution include:
[0103] Construct material spectral feature library through sparse coding dictionary learning method;
[0104] Perform non-negative matrix decomposition on the image to be detected through the material spectral feature library;
[0105] The light incident angle and fiber exit angle of the decomposed image to be detected are calculated through three-dimensional feature space to generate the surface reflectivity distribution.
[0106] It should be noted that the spectral reflectance data (resolution 1nm) of a variety of standard materials (such as metals, plastics, and ceramics) in the visible light to near-infrared band (400-1000nm) are first collected, and the sparse dictionary is trained through the K-SVD algorithm so that it can sparsely represent the reflective characteristics of any material. Subsequently, the multispectral data of the image to be detected (such as visible light RGB and near-infrared bands) is subjected to non-negative matrix decomposition (NMF) to characterize the proportion of different material components. Finally, the normal vector of each surface point is calculated through the three-dimensional point cloud data, and the incident angle and exit angle of each surface point are calculated according to the preset light source space coordinates and the camera observation position, and combined with the bidirectional reflectance distribution function Generate a surface reflectance distribution map, where h k is the coefficient of the kth element of the matrix after non-negative matrix decomposition, f k is the BRDF response of the corresponding material, θ i and θ o The three-dimensional geometric correction eliminates the interference of curved surface reflections, improves the reflectivity measurement accuracy, and supports the analysis of the reflective characteristics of multi-material mixed surfaces (such as carbon fiber + resin).
[0107] Specifically, parts are screened and identified using geometric and texture parameters to eliminate parts with appearance defects, including:
[0108] Extract standard size data based on the 3D CAD model of the parts and build a standard library;
[0109] Set a sliding time window based on the batch production time of the parts;
[0110] Perform kernel density estimation on geometric parameters based on a sliding time window and remove geometric parameters with confidence less than 95%;
[0111] By formula The size difference and curvature distribution difference between the geometric parameters and the standard library are calculated using the Wasserstein distance, where α i is the weight coefficient of the i-th position size, L t,i is the size of the i-th position in the geometric parameters, μ s,iis the mean of the i-th position in the standard library, σ s,i is the standard deviation of the i-th position in the standard library;
[0112] By formula The shape defect judgment index is calculated, where V is the real-time speed of the conveyor belt, V max is the maximum speed of the conveyor belt, ΔQ is the curvature distribution difference;
[0113] The texture parameters are transformed by dual-tree complex wavelet transform to obtain the direction-sensitive similarity index;
[0114] Calculate the deviation between the direction-sensitive similarity index and the standard library;
[0115] Parts with appearance defects are identified based on the appearance defect judgment index and deviation.
[0116] It should be noted that the dual-tree complex wavelet transform uses two parallel discrete wavelet transform trees (using LeGall5 / 3 wavelet and Haar wavelet to generate real and imaginary coefficients, respectively) to extract direction-sensitive subbands in six directions (±15°, ±45°, and ±75°). The energy of each subband is calculated and then normalized to a direction-sensitive similarity index. The deviation is calculated using the Mahalanobis distance, combined with the mean and covariance matrix of normal samples in the standard library.
[0117] Specifically, parts with appearance defects are identified based on appearance defect judgment indicators and deviations, including:
[0118] When WX>2 and the deviation is ≤1.05, the part is judged as a dimensional defect;
[0119] When WX≤1 and the deviation is >1.5, the part is judged as a deformation defect;
[0120] When WX>1.6 and the deviation>1.2, the part is judged as a composite defect.
[0121] Specifically, the parts after coarse screening are accurately identified at the micro level using material characteristic parameters to eliminate parts with quality defects, including:
[0122] By formula Calculate the surface defect judgment index, where σ R is the standard deviation of the surface reflectivity distribution, μ R is the mean of the surface reflectivity distribution, is the surface temperature gradient of the part, T s is the reference value of the surface temperature of qualified parts during stable production, ρ(R, T) is the Pearson correlation coefficient between surface reflectivity and part temperature, and ρ0 is the theoretical Pearson correlation coefficient;
[0123] When QX<0.5, the part is qualified;
[0124] When 0.5≤QX<1.0, mark the part as requiring re-inspection;
[0125] When QX≥1.0, the part is marked as unqualified and rejected.
[0126] The beneficial effects of the present invention are as follows:
[0127] 1) Fusion of multispectral imaging and structured light projection to construct a three-dimensional feature space and simultaneously extract geometric parameters, texture parameters, and material characteristic parameters, breaking through the limitations of traditional single-modality detection;
[0128] 2) Real-time parameter adjustment based on the production environment, including conveyor speed-driven exposure time / frame rate optimization, adaptive white balance under fluctuating lighting conditions, and dynamic calibration of curvature thresholds, ensuring stable detection under high-speed and multi-condition conditions;
[0129] 3) Gray code-phase offset hybrid encoding and multi-frequency heterodyne unwrapping algorithm are used to achieve micron-level three-dimensional morphology reconstruction, and the ICP algorithm and RANSAC feature screening are combined to reduce data registration errors.
[0130] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0131] The present invention uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A method for detecting industrial parts based on machine vision, characterized in that: The steps include: When a part passes through a preset inspection area, multi-dimensional image data is collected by a multispectral industrial camera, and the multi-dimensional image data is pre-processed; The multi-dimensional image data includes: multi-spectral image data and structured light projection; the multi-spectral image data includes: visible light image and near infrared image; Constructing a three-dimensional feature space according to the structured light projection, and mapping the pre-processed multispectral image data into the three-dimensional feature space for performing a spatial registration operation to obtain an image to be detected; Extracting composite parameters from the image to be detected; the composite parameters include: geometric parameters, texture parameters and material characteristic parameters; the material characteristic parameters include: surface reflectivity distribution and temperature; Performing a rough screening identification on the parts using the geometric parameters and the texture parameters, and eliminating the parts with appearance defects; The parts after coarse screening are subjected to microscopic precise identification through the material characteristic parameters, and the parts with quality defects are eliminated.
2. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: When a part passes through a preset inspection area, multi-dimensional image data is collected by a multispectral industrial camera and pre-processed, including: Determining the exposure time and frame rate of the multispectral industrial camera according to the conveyor belt speed; performing adaptive white balance processing on the visible light image by using a nonlinear correction algorithm based on color temperature estimation; performing reflectance normalization processing on the near-infrared image according to a reflectance mapping relationship between the near-infrared image and a standard reference plate; The structured light projection is dynamically encoded by Gray code and phase offset encoding to obtain a coded image, and the coded image is decoded by a multi-frequency heterodyne phase unwrapping algorithm.
3. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: Constructing a three-dimensional feature space according to the structured light projection, and mapping the pre-processed multispectral image data into the three-dimensional feature space for performing a spatial registration operation to obtain an image to be detected, including: Gaussian kernels of different scales are used to perform image enhancement on depth mutation areas and flat areas in the visible light image respectively; Performing Poisson surface reconstruction on the structured light projection to obtain a three-dimensional point cloud, and performing bidirectional projection matching on the enhanced visible light image and the three-dimensional point cloud to obtain a normal vector field; Constructing a feature descriptor by performing correlation analysis on the normal vector and edge curvature of the normal vector field; Constructing a multi-objective loss function through the normal vector direction difference of the normal vector field and the enhanced local entropy value of the visible light image; Based on the multi-objective loss function, selecting the extreme value of the feature descriptor by using the RANSAC algorithm; Based on the extreme value of the feature descriptor, an ICP algorithm is used to perform a registration operation on the multi-dimensional image data to obtain the image to be detected.
4. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: The step of extracting the geometric parameters comprises: Calculating the Scharr gradient amplitudes of the multispectral bands in the image to be detected respectively, and fusing the bands whose cosine similarity between the Scharr gradient amplitudes is greater than 0.85 into a consensus edge map; Projecting the consensus edge map into the three-dimensional feature space, and extracting geometric edges with an overlap rate greater than 70% after projection by bidirectional distance transform matching; Tracing the geometric edge back into the three-dimensional feature space, calculating the principal curvature after tracing back, and dividing the geometric edge into a rigid edge, a flexible edge, and a transition zone according to the principal curvature; Edge reconstruction is performed on the rigid edge, the flexible edge and the transition zone respectively by using a RANSAC algorithm, a non-uniform rational B-spline and a least square method, and the reconstructed results are fused into the geometric parameters.
5. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: The step of extracting the texture parameters comprises: Marking an area in the image to be detected whose curvature is greater than a preset curvature threshold as a region of interest, and dividing the region of interest and the remaining area in the image to be detected into a plurality of grid cells using different grid spacings; Calculating the gray level co-occurrence matrix along the principal curvature direction for the region in the grid unit where the curvature is greater than the curvature threshold; Performing curvature weighting on the areas of the grid unit whose curvature does not exceed the curvature threshold in four directions to obtain a weighted matrix, and concatenating the weighted matrix with the gray-level co-occurrence matrix to form a texture matrix; The texture matrix is spatially aligned with the three-dimensional feature space to obtain the texture parameters.
6. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: The step of extracting the surface reflectivity distribution comprises: Construct material spectral feature library through sparse coding dictionary learning method; Performing non-negative matrix decomposition on the image to be detected using the material spectral feature library; The light incident angle and the optical fiber exit angle of the decomposed image to be detected are calculated through the three-dimensional feature space to generate a surface reflectivity distribution.
7. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: Performing a rough screening identification on the parts by using the geometric parameters and the texture parameters to eliminate the parts with appearance defects includes: Extracting standard size data based on the three-dimensional CAD model of the part and building a standard library; Setting a sliding time window according to the batch production time of the parts; Performing kernel density estimation on the geometric parameters based on the sliding time window, and eliminating the geometric parameters with a confidence level less than 95%; By formula The size difference and curvature distribution difference between the geometric parameters and the standard library are calculated using the Wasserstein distance, where α i is the weight coefficient of the i-th position size, L t,i is the size of the i-th position in the geometric parameters, μ s,i is the mean of the i-th position in the standard library, σ s,i is the standard deviation of the i-th position in the standard library; By formula The shape defect judgment index is calculated, where V is the real-time speed of the conveyor belt, V max is the maximum speed of the conveyor belt, ΔQ is the curvature distribution difference; Performing a dual-tree complex wavelet transform on the texture parameters to obtain a direction-sensitive similarity index; Calculating the deviation between the direction-sensitive similarity index and the standard library; The parts with appearance defects are identified according to the appearance defect judgment index and the deviation.
8. The method for detecting industrial parts based on machine vision according to claim 7, characterized in that: Identifying the part with structure according to the shape defect determination index and the deviation includes: When WX>2 and the deviation is ≤1.05, the part is judged as having a dimensional defect; When WX≤1 and the deviation is greater than 1.5, the part is judged as a deformation defect; When WX>1.6 and the deviation>1.2, the part is judged as a composite defect.
9. The method for detecting industrial parts based on machine vision according to claim 1, characterized in that: Performing microscopic precise identification on the parts after coarse screening using the material characteristic parameters to eliminate the parts with quality defects, including: By formula Calculate the surface defect judgment index, where σ R is the standard deviation of the surface reflectivity distribution, μ R is the mean of the surface reflectivity distribution, is the surface temperature gradient of the part, T s is the reference value of the surface temperature of qualified parts during stable production, ρ(R, T) is the Pearson correlation coefficient between surface reflectivity and part temperature, and ρ0 is the theoretical Pearson correlation coefficient; When QX<0.5, the part is a qualified part; When 0.5≤QX<1.0, the part is marked as a part requiring re-inspection; When QX≥1.0, the part is marked as a defective part and is rejected.
Citation Information
Cited By
Three-dimensional imaging detection method for surface defects of connector
CN120703106A
Wafer quality analysis method based on image recognition
CN120894675A
Wafer quality analysis method based on image recognition
CN120894675B
Online visual detection method and system for die-cutting mylar product
CN120948470A
Processing quality monitoring system and method for precision part with complex structure
CN120952634A