Visual inspection method and device for precision metal part machining
Through the combination of microlens array and high-resolution sensors, the depth information loss and light scattering interference problems of metal parts surface detection in the prior art are solved, and high-precision metal parts imaging and analysis are achieved.
Patent Information
- Application Number
- CN202510463848.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing optical imaging methods are difficult to clearly present different depth characteristics at the same time when detecting surfaces of metal parts, resulting in loss of depth information or blurred image, and complex surface reflection characteristics and light scattering interference limit high-precision applications.
Dynamic light field data is collected through microlens arrays, combined with high-resolution sensors to generate two-dimensional light field images, used depth segmentation algorithm to separate different depth layers, used convolutional neural networks to perform feature enhancement and denoising processing, combined with light field refocusing algorithm for global reconstruction, and corrected light scattering interference through adaptive filtering algorithms to generate high-quality fused full-focus depth images.
The spatial resolution and depth information quality of metal parts surface imaging are significantly improved, and high-precision metal parts detection and analysis are achieved.
Smart Images

Figure CN120374559A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of precision machining and inspection of machinery, and more particularly to a vision inspection method and device for machining precision metal parts. Background Art
[0002] Problem Background:
[0003] In the fields of modern manufacturing and precision inspection, optical imaging technology has become an indispensable core means due to its non-contact, high-precision, and high-efficiency characteristics, especially in the surface quality inspection of metal parts. However, when facing the surface inspection of metal parts, existing optical imaging methods often expose significant limitations. Traditional techniques mostly rely on single focal plane imaging, making it difficult to clearly present different depth features simultaneously, resulting in the loss of depth information or blurred images. In addition, the complex surface reflection characteristics and light scattering interference further reduce the imaging quality and limit its application in high-precision scenarios.
[0004] Behind these limitations, there are deeper core challenges. Specifically, how to capture the complete information of the metal part surface in a dynamic light field and achieve high-resolution reconstruction in multiple depth planes is the bottleneck of current technological breakthroughs. Among them, the spatial resolution ability of the microlens array, the information integration efficiency of the high-resolution sensor, and the processing and reconstruction accuracy of the full light field data have become the three major technical factors restricting the imaging effect. Since these factors have not been effectively coordinated and optimized, the system often has difficulty overcoming the contradiction between depth resolution and global clarity, resulting in the loss of details or excessive computational complexity in the generation of full focal depth images. Such technical problems not only increase the detection cost but also hinder the full promotion of automated detection.
[0005] Therefore, how to efficiently capture the full light field information of the metal part surface through the collaborative design of the microlens array and the high-resolution sensor and accurately reconstruct the full focal depth image covering multiple depth planes has become the key problem to be solved in this study. Summary of the Invention
[0006] The present invention provides a vision inspection method for machining precision metal parts, mainly including:
[0007] Collect the dynamic light field data of the metal part surface through a microlens array, obtain the original light field data set containing multi-angle and multi-depth information, and form a full light field data set;
[0008] Starting from the full light field data set, use a high-resolution sensor for signal conversion and integration to generate two-dimensional light field image data with high spatial resolution ability, and form a preliminary light field image;
[0009] For the initial light field image, extract multi-depth plane feature points, apply a depth segmentation algorithm based on region growing to separate the light field data of different depth layers, and generate a hierarchical depth data set;
[0010] According to the hierarchical depth data set, use a convolutional neural network to perform feature enhancement and denoising processing on each depth layer, generate an enhanced hierarchical image data set, and quantify the clarity improvement result through the peak signal-to-noise ratio;
[0011] Starting from the enhanced hierarchical image data set, combine the light field refocusing algorithm to globally reconstruct the multi-depth plane, generate an initial all-in-focus image, and verify the global depth consistency index through depth deviation analysis;
[0012] For the initial all-in-focus image, detect the surface reflection characteristics and the light scattering interference region. If the gray level gradient of the interference region exceeds a preset threshold based on sample statistics, then use an adaptive filtering algorithm for local correction to generate a corrected all-in-focus image;
[0013] According to the corrected all-in-focus image, apply an image fusion algorithm to integrate the detailed features of the multi-depth plane, generate a fused all-in-focus image, and evaluate the detailed reconstruction accuracy data through the edge sharpness index;
[0014] Starting from the fused all-in-focus image, calculate the quantization indexes of the spatial resolution and the data processing accuracy, and generate an imaging quality determination result by comparing with a preset standard value based on the detection requirements;
[0015] If the imaging quality determination result does not meet the standard, then according to the deviation analysis data of the quantization indexes, adjust the focal length parameter of the microlens array and the sampling frequency of the high-resolution sensor, re-collect the full light field data set, and generate an optimized fused all-in-focus image.
[0016] The present invention provides a vision detection device for precision metal part processing, mainly including:
[0017] A light field data acquisition module, which is used to collect the dynamic light field data on the surface of the metal part through a microlens array, obtain the original light field data set containing multi-angle and multi-depth information, and form a full light field data set;
[0018] A signal conversion module, which is used to start from the full light field data set, perform signal conversion and integration using a high-resolution sensor, generate two-dimensional light field image data with high spatial resolution ability, and form an initial light field image;
[0019] A depth segmentation module, which is used to extract multi-depth plane feature points for the initial light field image, apply a depth segmentation algorithm based on region growing to separate the light field data of different depth layers, and generate a hierarchical depth data set;
[0020] A feature enhancement module, which is used to perform feature enhancement and denoising processing on each depth layer by using a convolutional neural network according to a hierarchical depth dataset, generate an enhanced hierarchical image dataset, and quantify the sharpness improvement result through the peak signal-to-noise ratio;
[0021] A global reconstruction module, which is used to start from the enhanced hierarchical image dataset, combine the light field refocusing algorithm to globally reconstruct multiple depth planes, generate an initial all-in-focus image, and verify the global depth consistency index through depth deviation analysis;
[0022] A local correction module, which is used to detect the surface reflection characteristics and light scattering interference regions for the initial all-in-focus image. If the gray level gradient of the interference region exceeds a preset threshold based on sample statistics, an adaptive filtering algorithm is used for local correction to generate a corrected all-in-focus image;
[0023] An image fusion module, which is used to apply an image fusion algorithm to integrate the detail features of multiple depth planes according to the corrected all-in-focus image, generate a fused all-in-focus image, and evaluate the detail reconstruction accuracy data through an edge sharpness index;
[0024] A quality assessment module, which is used to calculate the quantization indexes of spatial resolution and data processing accuracy starting from the fused all-in-focus image, and generate an imaging quality determination result by comparing with a preset standard value based on detection requirements;
[0025] A parameter optimization module, which is used to, if the imaging quality determination result does not meet the standard, adjust the focal length parameter of the microlens array and the sampling frequency of the high-resolution sensor according to the deviation analysis data of the quantization indexes, re-collect the full light field dataset, and generate an optimized fused all-in-focus image.
[0026] The technical solution provided by the embodiment of the present invention may include the following beneficial effects:
[0027] The present invention discloses a method for all-in-focus light field imaging on the surface of a metal part. This method collects dynamic light field data through a microlens array and generates a two-dimensional light field image by using a high-resolution sensor. Subsequently, a depth segmentation algorithm is used to separate data of different depth layers, and feature enhancement and denoising processing are performed through a convolutional neural network. The present invention combines the light field refocusing algorithm to globally reconstruct multiple depth planes to generate an all-in-focus image, and corrects light scattering interference through an adaptive filtering algorithm. Finally, an image fusion algorithm is applied to integrate the detail features of multiple depth planes to generate a high-quality fused all-in-focus image. If the imaging quality does not meet the standard, the present invention can also adjust parameters according to the quantization indexes and re-collect data to achieve optimization. This method significantly improves the spatial resolution and depth information quality of the imaging on the surface of the metal part, providing strong support for precision detection and analysis. Description of the Drawings
[0028] Figure 1It is a flowchart of a vision inspection method for processing precision metal parts of the present invention.
[0029] Figure 2 It is a schematic diagram of a vision inspection method for processing precision metal parts of the present invention.
[0030] Figure 3 It is another schematic diagram of a vision inspection method for processing precision metal parts of the present invention.
[0031] Figure 4 It is a schematic diagram of the composition of a vision inspection device for processing precision metal parts of the present invention. Detailed implementation manners
[0032] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0033] As Figures 1-4 , a vision inspection method and device for processing precision metal parts in this embodiment may specifically include:
[0034] Step S101, collect dynamic light field data on the surface of the metal part through a microlens array, obtain an original light field data set containing multi-angle and multi-depth information, and form a full light field data set.
[0035] Obtain an original light field data set on the surface of the metal part, where the original light field data set includes dynamic light field data collected from multiple angles and multiple depths through a microlens array. According to the original light field data set, use a light field reconstruction algorithm based on Fourier transform to determine the spatial distribution information of surface features. If there is noise in the spatial distribution information, use a mean filtering algorithm to smooth the spatial distribution information to obtain an optimized full light field set. According to the optimized full light field set, use principal component analysis to extract the change trend of multi-angle data and judge the continuous distribution of surface features. Match the multi-depth data with the continuous distribution, and use the least squares method to obtain the depth profile information of the surface of the metal part. Perform clustering analysis on the depth profile information, use the K-means algorithm to divide regions, and obtain hierarchical feature data. Extract key geometric parameters from the hierarchical feature data to obtain the complete description information of the surface of the metal part.
[0036] Exemplarily, obtaining the original light field data set on the surface of the metal part is the basis of the entire process.
[0037] Exemplarily, dynamic light field data on the surface of a metal part can be collected by a microlens array device. Assume the metal part is a polished steel plate, and the microlens array can capture light field information from different angles (such as 0°, 45°, 90°) and different depths (such as 0.1 mm, 0.5 mm, 1 mm). The advantage of this method is that it can record the propagation direction and intensity change of light, providing multi-dimensional data support for subsequent reconstruction.
[0038] For example, the collected data may show the reflection differences of minute surface scratches at different angles. According to the original light field data set, a light field reconstruction algorithm is used to determine the spatial distribution information of surface features.
[0039] Specifically, the light field refocusing technology can be utilized to reconstruct the three-dimensional features of the metal part surface by adjusting the focal plane position. Assume there is a 0.2-mm depression on the steel plate surface. After light field reconstruction, the distribution pattern of the depression in space can be presented. The advantage of this method is that it can integrate multi-view data into unified spatial information, intuitively reflecting the surface characteristics. If there is noise in the spatial distribution information, a mean filtering algorithm is used for smoothing.
[0040] In a possible implementation, assume that there are noise points in the reconstructed data due to uneven illumination. The average value of a 5×5 area around each pixel point can be taken to eliminate isolated high-frequency noise. After processing, the details at the edge of the depression are still retained, but the messy interference points are effectively suppressed. The optimized full light field set is clearer, which is helpful for subsequent analysis. According to the optimized full light field set, the change trend of multi-angle data is extracted to judge the continuous distribution of surface features.
[0041] Preferably, the gradual change law of the reflection intensity on the steel plate surface from 0° to 90° can be analyzed. If the intensity change is smooth, it indicates that the surface continuity is good; if there is a sudden change, there may be cracks.
[0042] For example, the multi-angle data in the depression area may show a smooth transition, while the crack area shows an obvious jump, which provides a basis for surface quality assessment. The multi-depth data is matched with the continuous distribution to obtain the depth profile information of the metal part surface.
[0043] In one embodiment, by combining the depth data from 0.1 mm to 1 mm with the above continuous analysis, it can be inferred that the depth of the depression is about 0.2 mm and the edge has a smooth transition. This matching process can accurately depict the surface topography and improve the reliability of subsequent feature extraction. Cluster analysis is performed on the depth profile information, and the K-means algorithm is used to divide the regions to obtain hierarchical feature data.
[0044] For example, the surface of the steel plate is divided into three categories: flat area, concave area, and edge area. Set K = 3, and the algorithm automatically clusters according to the depth value. The depth of the flat area is close to 0 mm, and the concave area is concentrated around 0.2 mm. This layering result clearly shows the structural differences on the surface, facilitating further parametric description. Key geometric parameters are extracted from the layered feature data to obtain the complete description information of the surface of the metal part.
[0045] It can be understood that the parameters that can be extracted include the diameter of the depression (assumed to be 1.5 mm), the depth (0.2 mm), and the area ratio of the flat area (about 90%). These parameters together constitute the geometric characteristics of the surface, providing a quantitative basis for quality inspection or processing optimization.
[0046] For example, the depth and diameter data can be used to evaluate whether the steel plate meets the industrial standards, and the continuous distribution helps to judge the severity of surface defects. This complete description significantly improves the accuracy and practicality of the surface analysis of metal parts.
[0047] Based on the original light field data set of the metal surface and the multi-angle and multi-depth data of the microlens array, the light field reconstruction algorithm using Fourier transform is used to determine the spatial distribution information of the surface features. The spatial distribution information is smoothed by the mean filtering algorithm to obtain the optimized full light field set. The change trend of the multi-angle data and the continuous distribution of the surface features are judged, the multi-depth data is matched with the continuous distribution, and the least squares method is used to obtain the depth profile information of the surface of the metal part.
[0048] The original light field containing multi-angle data and multi-depth data is obtained by using a microlens array. Fourier transform is performed on the original light field to obtain the spatial distribution of the surface features. If there is interference in the spatial distribution, mean filtering is used to smooth the spatial distribution to obtain an optimized light field. The multi-angle data is analyzed based on the optimized light field to judge the change trend of the surface features. The continuous distribution is extracted through the optimized light field, the multi-depth data is matched with the continuous distribution by using the least squares method to obtain a depth profile. The depth profile is divided into regions, and the layering features are determined by cluster analysis. Geometric parameters are extracted from the layering features to obtain the surface description information. The feature boundaries are analyzed from the surface description information to determine the boundary distribution law.
[0049] Exemplarily, the original light field containing multi-angle data and multi-depth data is obtained by using a microlens array, laying a foundation for subsequent analysis.
[0050] Exemplarily, assume that the target is a polished aluminum plate. The microlens array collects light field information from different angles such as 30°, 60°, 90° and different depths such as 0.3 mm, 0.7 mm, 1.2 mm, and records the light direction and intensity. Performing a Fourier transform on the original light field can convert it into frequency-domain data, revealing the spatial distribution of surface features.
[0051] Specifically, after the transformation, it may be found that there are periodic textures left on the surface of the aluminum plate due to processing, and their spatial frequencies are concentrated in a certain range, reflecting the spatial regularity of the textures.
[0052] In a possible implementation, if there is interference in the spatial distribution due to light source jitter, such as isolated high-frequency noise points, mean filtering can be used for smoothing processing.
[0053] For example, take the average value of the surrounding 3×3 area for each pixel point to weaken the influence of noise and obtain an optimized light field. This processing preserves the main distribution characteristics of the textures and improves the readability of the data. Analyze the multi-angle data based on the optimized light field to judge the change trend of surface features.
[0054] Preferably, observe the change in the reflection intensity of the aluminum plate at angles from 30° to 90°. If the intensity gradually increases, it may indicate that there is a slight tilt on the surface; if there is a sudden change at a certain angle, it may imply a local defect. Extract the continuous distribution through the optimized light field, and use the least squares method to match the multi-depth data with the continuous distribution to generate a depth profile.
[0055] In one embodiment, assume that there is a 0.5-mm deep scratch on the surface of the aluminum plate. The least squares method outlines the contour shape of the scratch by fitting the depth data from 0.3 mm to 1.2 mm and the intensity change. This method effectively integrates multi-dimensional information and accurately describes the surface undulations. Perform regional division on the depth profile and determine the hierarchical features through clustering analysis.
[0056] For example, set the number of clusters to 3. The algorithm divides the surface into a smooth area, a scratch area, and a transition area according to the depth value. The depth of the smooth area is close to 0 mm, and the scratch area is concentrated around 0.5 mm, clearly distinguishing the surface structure. Extract geometric parameters based on the hierarchical features to obtain surface description information.
[0057] It can be understood that parameters such as a width of 2 mm and a depth of 0.5 mm are extracted from the scratch area, and the area proportion such as 85% is calculated for the smooth area. These parameters quantitatively characterize the surface state. Analyze the feature boundaries from the surface description information to determine the boundary distribution law.
[0058] Specifically, observe the intensity transition at the edge of the scratch. If the change from the smooth area to the scratch area is gentle, the boundary tends to be gradual; if the jump is obvious, the boundary is distinct.
[0059] For example, the scratch boundary may exhibit a smooth transition due to the polishing degree, reflecting the processing consistency.
[0060] It should be noted that the above process progresses step by step from the core light field acquisition to the boundary analysis to ensure a comprehensive characterization of the surface features. In a possible extended solution, if it is necessary to further verify the boundary law, data at an additional angle such as 15° can be combined to enrich the analysis dimension. This method gradually constructs a complete surface description through multi-faceted support, enhancing the reliability and practicality of the analysis.
[0061] Step S102: Starting from the full light field data set, use a high-resolution sensor to perform signal conversion and integration to generate two-dimensional light field image data with high spatial resolution ability, forming a preliminary light field image.
[0062] Obtain the initial signal from the full light field data, use a high-resolution sensor for conversion to obtain the converted signal data. According to the converted signal data, use signal integration technology for processing to generate two-dimensional light field image data. For the two-dimensional light field image data, extract the spatial resolution features to determine the spatial distribution information of the image. If there are discontinuous regions in the spatial distribution information, use the mean filter algorithm for smoothing processing to obtain the smoothed image data. Analyze the resolution ability through the smoothed image data to judge the degree of detail presentation of the image. According to the degree of detail presentation, use the K-means algorithm to divide the image area to obtain the layered image data. Extract the geometric distribution features from the layered image data to obtain the surface description information.
[0063] According to the full light field signal data, use a high-resolution sensor for conversion, process the converted data through signal integration technology to obtain a two-dimensional light field image, and use the K-means algorithm to divide the image area according to the spatial resolution features and discontinuous area smoothing processing to obtain the geometric distribution information of the layered image.
[0064] Obtain the original data of the full light field signal, and convert the original data into the converted signal data through a high-resolution sensor. For the two-dimensional light field image data generated from the converted signal data, if there are discontinuous regions with pixel value mutations in the image, use the mean filter algorithm to process the two-dimensional light field image data to obtain the smoothed image data. According to the smoothed image data, use the K-means clustering algorithm for area division, set the number of cluster centers to a preset value to obtain the layered image data. Extract the geometric distribution information from the layered image data for subsequent analysis.
[0065] Exemplarily, starting from the original data of the full light field signal, the acquisition process usually depends on optical acquisition devices. For example, the light field information can be captured through a multi-view camera array.
[0066] Exemplarily.
[0067] In a possible implementation, an array consisting of 16 micro-lenses can be envisioned, with a spacing of 2 millimeters between each lens. The raw data collected contains light intensity and direction information at different angles. This data form is complex and multi-dimensional, requiring further processing to adapt to subsequent analysis. For the conversion of raw data into converted signal data, the role of a high-resolution sensor is particularly crucial.
[0068] Specifically, a CMOS sensor with a pixel resolution of 4000×3000 can be used to convert the light intensity information of the raw light field signal into an electrical signal.
[0069] For example, when collecting a scene containing leaf details, each pixel of the sensor records the light intensity in a specific direction, and the converted signal data retains the characteristics of high spatial resolution. This method ensures the quality of the basic data for subsequent image generation. When generating two-dimensional light field image data, the converted signal data needs to undergo integration processing.
[0070] It can be understood that the integration may involve projecting multi-view data onto the same plane.
[0071] For example, extracting signals from the above leaf scene and generating a two-dimensional image after integration, where the pixel values reflect the brightness distribution. If there are discontinuous regions with sudden changes in pixel values in the image, such as the brightness jump caused by light occlusion at the leaf edge, the mean filtering algorithm comes in handy.
[0072] Preferably, the filtering window size is set to 5×5, and the region with sudden changes in pixel values is processed by neighborhood averaging. After smooth transition, the image is more continuous. This smoothing process helps to reduce noise interference. When using the K-means clustering algorithm for region division based on the smoothed image data, the selection of the number of cluster centers is crucial.
[0073] In one embodiment, for the leaf scene, the number of preset cluster centers is 3, representing the leaf body, background, and edge transition region respectively.
[0074] Specifically, the algorithm iteratively clusters based on pixel brightness and spatial position, and finally divides the image into distinct regions.
[0075] For example, the brightness values in the leaf body region are concentrated between 150 - 200, while those in the background region are between 50 - 80. This division intuitively reflects the structural characteristics of the image content. Extracting geometric distribution information from the hierarchical image data provides a spatial basis for subsequent analysis.
[0076] It should be noted that the geometric distribution information may include the length of the region boundary, shape characteristics, etc.
[0077] For example, the boundary contour is extracted from the main area of the leaf, and its calculated perimeter is about 1200 pixels, and the area ratio is 60% of the image.
[0078] In one possible implementation, this information can be used to characterize the surface distribution law of the object.
[0079] Preferably, by analyzing the change of boundary curvature, the texture direction of the leaf can be further inferred. This extraction method lays the foundation for subsequent surface description and improves the data availability at the same time.
[0080] For example, in practical applications, the combination of smoothing processing and region division can effectively enhance the visualization effect of the image, especially when highlighting the object contour.
[0081] It can be understood that while retaining details, this method reduces the interference of noise to the analysis and provides guarantee for the accurate extraction of geometric information.
[0082] In one embodiment, if the subsequent analysis focuses on surface texture recognition, these layered data can also support higher-level feature mining.
[0083] Exemplarily, this technical route has strong adaptability in the field of light field imaging and can meet the requirements of different complexity scenarios.
[0084] Step S103: For the preliminary light field image, extract multi-depth plane feature points, apply a depth segmentation algorithm based on region growing to separate the light field data of different depth layers, and generate a layered depth data set.
[0085] Extract SIFT feature points from the light field image, calculate the matching feature points using binocular disparity to generate an initial disparity map. Extract depth discrete values from the disparity map, and use the SGBM algorithm of OpenCV to calculate the depth plane. Use the pixels with gradient change greater than the preset threshold on the depth plane as seed points, and apply the region growing algorithm to output the depth segmentation boundary. Mark the connected regions according to the segmentation boundary to obtain preliminary layered data. Input the preliminary layered data into the DBSCAN clustering of Scikit-learn, and separate the layered data set structure based on density. Calculate the variance of the three-dimensional coordinates of the feature points within each layer. If the variance is less than the preset threshold, it is determined that the distribution is consistent. For the data within the layers with qualified consistency, use the K-means algorithm to determine the number of clusters according to the silhouette coefficient, and generate the optimized layered depth data. Finally, output the layered depth data.
[0086] Exemplarily, extracting SIFT feature points from the light field image is the basis for constructing the disparity map.
[0087] For example, when processing a light field image, the SIFT algorithm can be used to detect key points in the image. These key points are usually edges or corners and have strong local invariance.
[0088] Exemplarily, in a light field image of an indoor scene, SIFT may detect feature points at positions such as table corners and window frame edges, and the number may reach hundreds. These feature points carry scale information and direction descriptions, facilitating subsequent matching.
[0089] In one possible implementation, binocular disparity calculation will match the feature points of the light field images of the left and right views.
[0090] Specifically, by comparing the descriptors of the SIFT feature points in the two images, the closest matching pairs can be found.
[0091] For example, if the Euclidean distance between the descriptor of the feature point at the table corner in the left image and the descriptor of the corresponding point in the right image is the smallest, it is considered a match. Based on the horizontal displacement difference of the matching pairs, an initial disparity map is generated. Each pixel value in the disparity map represents a depth cue, and a larger value usually means the object is closer. When extracting depth discrete values from the disparity map.
[0092] It can be understood that the pixel values will be discretized into several levels.
[0093] For example, when the disparity value range is between 0 and 255, it can be divided into 10 depth levels, and each level represents a different distance range.
[0094] It should be noted that when using the SGBM algorithm in OpenCV to calculate the depth plane, these discrete values will be further optimized.
[0095] In one embodiment, SGBM smooths the disparity map through semi-global matching, reduces the influence of noise, and makes the depth plane more continuous.
[0096] For example, the depth value at the front edge of the table may be smoothed from discrete values of 5, 7, 6 to a consistent 6.
[0097] Preferably, pixels with a gradient change greater than a preset threshold are used as seed points for region growing.
[0098] For example, setting the threshold to 20, the table corner area in the depth plane is selected as a seed point due to the drastic gradient change. The region growing algorithm will expand from the seed point, connect pixels with similar depth values, and form a segmentation boundary. This boundary can clearly distinguish the foreground and background, facilitating subsequent layering. After marking the connected regions according to the segmentation boundary, the preliminary layering data is formed.
[0099] For example, an indoor scene may be divided into three layers: a table in the foreground, a chair in the middle ground, and a wall in the background. When these data are input into DBSCAN clustering, finer structures are separated based on density.
[0100] Exemplarily, DBSCAN may cluster the table surface into one class due to dense depth values, while the chair is separated into another class due to sparse distribution. This method can effectively handle noise points and improve the layering accuracy. When calculating the variance of the three-dimensional coordinates of feature points within each layer, the threshold can be set to 0.5.
[0101] For example, the variance of the feature points within the table layer is 0.3, which is less than the threshold, and it is determined that their distribution is consistent. This indicates that the depth of this layer is stable and suitable for further processing. For the layers that meet the consistency standard, the K-means algorithm is used to determine the number of clusters according to the silhouette coefficient.
[0102] For example, silhouette coefficient analysis may show that the table layer is best divided into two clusters, corresponding to the tabletop and the table legs respectively. The optimized layered depth data is thus more hierarchical.
[0103] In one embodiment, the finally output layered depth data can be used for three-dimensional reconstruction or object recognition.
[0104] For example, the layered table data can clearly present its contour and height information. This layering method not only improves the structure of the data but also provides more reliable basic information for subsequent applications.
[0105] Step S104, according to the layered depth data set, use a convolutional neural network to perform feature enhancement and denoising processing on each depth layer, generate an enhanced layered image data set, and quantify the clarity improvement result through the peak signal-to-noise ratio.
[0106] Obtain the data set, perform layered depth division on the data set according to a preset depth standard to obtain a data subset for each depth layer. Input the divided data subset into a pre-established convolutional neural network to perform feature enhancement processing to obtain a first image set after feature enhancement. Process the first image set using a denoising algorithm to generate a second image set after denoising. According to the quantization result of the second image set, determine whether the quantization result is lower than a preset threshold. If the quantization result is lower than the preset threshold, adjust the parameters of the convolutional neural network and re-input the data subset into the convolutional neural network for processing.
[0107] Exemplarily, when obtaining the data set.
[0108] It can be understood that the data usually comes from a light field acquisition device and contains multi-view information.
[0109] For example, the light field data of a set of indoor scenes may cover images from multiple angles, and each image carries the original pixel information. When performing hierarchical depth division according to a preset depth standard.
[0110] Preferably, the standard can be set according to the range of disparity values of the pixels.
[0111] For example, when the disparity value is between 0 and 255, it can be divided into 5 depth layers, and each layer corresponds to a specific distance range, such as the near view from 0 to 50, the middle view from 51 to 100, etc.
[0112] Specifically, the near view layer may contain data of the desktop, the middle view layer may be the chair, and the far view layer is the wall. This division method can decompose the complex scene into ordered subsets. When the divided data subsets are input into a pre-established convolutional neural network to perform feature enhancement processing.
[0113] In a possible implementation, the network can extract edge and texture information through convolutional layers.
[0114] For example, after the subset of the desktop is input, the network may enhance the contrast of its surface texture to form the first image set.
[0115] It should be noted that the image set after feature enhancement usually highlights the details of the key areas more, which is convenient for subsequent analysis.
[0116] Exemplarily, if the edge of the desktop in the original image is blurred, the edge will become clearer and the details will be richer after enhancement. When using a denoising algorithm to process the first image set, a method based on wavelet transform can be considered to remove noise.
[0117] For example, when processing the desktop image, wavelet transform can retain the edge information while filtering out the high-frequency noise generated by uneven illumination to generate the second image set.
[0118] Specifically, the image after denoising will reduce the interference of noise spots, and the pixel value distribution in the desktop area will be more uniform.
[0119] In one embodiment, if the original image has inconsistent brightness due to shadows, the brightness will tend to be smoother after denoising, and the visual effect will be better. This processing can improve the data quality and provide a reliable basis for subsequent quantization. When judging whether the quantization result of the second image set is lower than a preset threshold.
[0120] Preferably, the signal-to-noise ratio can be used as the quantization index.
[0121] For example, if the set threshold is 30 dB and the signal-to-noise ratio of the desktop image is 28 dB, it is lower than the standard.
[0122] It should be noted that a low signal-to-noise ratio may mean loss of details or residual noise.
[0123] In a possible implementation, if the signal-to-noise ratio of the mid-shot chair image is 25 dB and still does not meet the standard, it indicates insufficient denoising effect. This judgment can intuitively reflect whether the image quality meets the requirements. If the quantization result is lower than the preset threshold, the parameters of the convolutional neural network are adjusted and reprocessed.
[0124] For example, the convolution kernel size can be increased from 3x3 to 5x5 to improve the feature extraction ability.
[0125] Specifically, after adjustment and re-input of the desktop subset, the network may better capture edge details, increasing the signal-to-noise ratio to 32 dB and meeting the standard.
[0126] Exemplarily, for the chair subset, the depth of the convolutional layer of the network is adjusted, and after enhancement, the signal-to-noise ratio rises from 25 dB to 31 dB. This parameter optimization can effectively improve the accuracy of feature enhancement.
[0127] Preferably, multiple iterative adjustments can further stabilize the results and ensure the quality consistency of the data subsets at each depth layer. This method optimizes the network performance through a feedback mechanism and provides a higher-quality image set for subsequent processing.
[0128] Step S105: Starting from the enhanced hierarchical image data set, the multi-depth planes are globally reconstructed by combining the light field refocusing algorithm to generate an initial full-depth-of-field image, and the global depth consistency index is verified through depth deviation analysis.
[0129] An enhanced image data set carrying hierarchical features is obtained, and the data set is processed hierarchically to determine the distribution characteristics of multiple depth planes; depth deviation analysis is performed for each depth plane to obtain the depth offset, and it is judged whether the global depth is consistent; if the depth is inconsistent, the parameters of the light field refocusing algorithm are iteratively optimized until the consistency index converges.
[0130] It can be understood that when obtaining the enhanced image data set carrying hierarchical features, the data usually comes from a light field acquisition device and contains multi-view information. For hierarchical processing, the purpose is to decompose a complex scene into multiple depth planes.
[0131] For example, a set of indoor scene data may include the distribution characteristics of a desktop, a chair, and a wall. Hierarchical processing can determine the depth planes through the range of disparity values. Assuming the disparity values are between 0 and 255, they can be divided into a near view from 0 to 50, a mid view from 51 to 150, and a far view from 151 to 255. This division can clearly reflect the spatial structure of the scene and lay a foundation for subsequent analysis.
[0132] Specifically, for the depth deviation analysis of each depth plane, the offset can be calculated by comparing the difference between the actual depth value and the expected value.
[0133] For example, the depth value of the foreground desktop area is expected to be 40, but the actual measurement is 45, with an offset of 5. Similarly, the middle-ground chair area is expected to have a depth of 100, but the actual value is 95, with an offset of -5. This kind of analysis can reveal the regularity of depth distribution from multiple aspects.
[0134] Exemplarily, if the offset of the background wall area fluctuates between -3 and 2, it indicates that its depth is relatively stable. Through these values, it is possible to preliminarily judge whether there are problems with the depth consistency of each plane.
[0135] In a possible implementation, when judging whether the global depth is consistent, a consistency index can be introduced, such as the standard deviation of the depth offset. Suppose the offsets of the foreground, middle-ground, and background are 5, -5, and 2 respectively. A relatively large standard deviation indicates that the global depth is inconsistent.
[0136] It should be noted that this kind of inconsistency may be caused by perspective deviation during light field acquisition or insufficient device calibration.
[0137] For example, the desktop area has a depth error due to light refraction, while the chair area has a lower measurement due to occlusion. This kind of analysis can help locate the root cause of the problem.
[0138] Preferably, if the depth is inconsistent, it is necessary to iteratively optimize the parameters of the light field refocusing algorithm.
[0139] For example, the field of view angle range of the refocusing algorithm can be adjusted, expanded from the initial 30 degrees to 45 degrees, to cover more perspective information.
[0140] Specifically, for the desktop area, the depth offset may decrease from 5 to 2 after adjustment; while the offset of the chair area changes from -5 to -1. This kind of optimization can gradually reduce the deviation.
[0141] Exemplarily, if the offset of the background wall decreases from 2 to 0.5, it indicates that the algorithm's processing ability for distant objects has been enhanced.
[0142] In one embodiment, the iterative optimization can also improve the accuracy by increasing the sampling point density.
[0143] For example, the initial sampling is once per pixel, and after adjusting to three times per pixel, the depth value of the desktop area is closer to the expected value. This method can improve the data quality at the detailed level.
[0144] It should be noted that the optimization process will continue until the consistency index converges, for example, the standard deviation drops from 5 to less than 1. This kind of convergence means that the global depth distribution tends to be uniform.
[0145] For example, in the case of the chair area, if the initial consistency index is poor, it may be due to uneven weight distribution during multi-view data fusion. After adjusting the fusion weights of the algorithm, the depth offset is significantly reduced. This method provides support from multiple perspectives of algorithm design to ensure reliable results.
[0146] Preferably, the optimized dataset can more accurately reflect the spatial characteristics of the scene, providing a high-quality basis for subsequent applications. This processing method gradually improves the accuracy of the depth plane distribution through multi-level analysis and adjustment.
[0147] Step S106: For the initial full-depth-of-field image, detect the surface reflection characteristics and the light scattering interference regions. If the gray level gradient of an interference region exceeds a preset threshold based on sample statistics, then use an adaptive filtering algorithm for local correction to generate a corrected full-depth-of-field image.
[0148] Obtain the surface reflection characteristics and the distribution of light scattering interference regions of the full-depth-of-field image; if the gray level gradient of the interference region exceeds the preset threshold, then use an adaptive filtering algorithm to process the interference region to obtain preliminary correction data; according to the preliminary correction data, perform a local correction operation to generate a corrected full-depth-of-field image; extract the change in surface reflection characteristics from the corrected full-depth-of-field image and judge the uniformity of the change; according to the uniformity judgment result, adjust the parameters of the adaptive filtering algorithm to obtain an optimized corrected full-depth-of-field image; verify the degree of reduction of light scattering interference in the optimized corrected full-depth-of-field image to obtain the final processed image.
[0149] Exemplarily, obtaining the surface reflection characteristics and the distribution of light scattering interference regions of the full-depth-of-field image is an important step in analyzing the optical characteristics of the scene.
[0150] It can be understood that the surface reflection characteristics are usually related to the object material and the lighting conditions, while the light scattering interference may be caused by particles in the environment or an uneven light field.
[0151] For example, in an indoor scene, the desktop may have strong reflections due to its smooth surface, while the wall may have scattering interference due to its rough texture.
[0152] Exemplarily, assume that the reflection brightness value of the desktop area reaches 200, while the wall area shows a relatively low 120 due to scattering. This difference can initially reflect the distribution characteristics of the interference regions. If the gray level gradient of an interference region exceeds the preset threshold, further processing is required.
[0153] In a possible implementation, the preset threshold can be set to 50, and exceeding this value indicates significant scattering interference.
[0154] For example, if the gray-scale gradient of the wall area reaches 70, it indicates that the scattering effect is obvious. The adaptive filtering algorithm can adjust the filtering intensity according to the local gray-scale change.
[0155] Specifically, for the wall area, the gradient can be reduced from 70 to 40 through smoothing to obtain the preliminary corrected data. This method can effectively retain details while suppressing interference. When performing local correction operations based on the preliminary corrected data, the characteristics of specific areas need to be concerned.
[0156] Preferably, for the desktop area, the reflection characteristics can be highlighted by enhancing the edge contrast. For example, the edge brightness can be adjusted from 180 to 200, while for the wall area, the scattering noise is reduced to make the gray scale more uniform. This local correction can generate a clearer corrected full-depth-of-focus image, laying a foundation for subsequent analysis. When extracting the change of surface reflection characteristics from the corrected full-depth-of-focus image, the uniformity judgment is crucial.
[0157] For example, if the reflection value of the desktop area fluctuates between 190 and 210, while the wall area is stable between 115 and 125, the former has poorer uniformity.
[0158] In one embodiment, the uniformity can be evaluated by statistically analyzing the range of reflection values. The smaller the range, the more consistent the distribution. This analysis can intuitively reflect the correction effect. Adjusting the parameters of the adaptive filtering algorithm according to the uniformity judgment result is a key step in optimization.
[0159] Specifically, if the uniformity of the desktop area is insufficient, the size of the filtering window can be increased, expanded from 3x3 to 5x5, so that the fluctuation range of the reflection value is reduced to between 195 and 205.
[0160] It should be noted that this adjustment can better adapt to local characteristics and improve the image quality. When verifying the degree of reduction of light scattering interference in the optimized corrected full-depth-of-focus image, it can be evaluated from multiple aspects.
[0161] Exemplarily, if the gray-scale gradient of the wall area is further reduced from 40 to 25, it indicates that the scattering interference is significantly reduced.
[0162] In one possible implementation, the noise levels of the original image and the final image can be compared. For example, the original noise value of 50 is reduced to 15. This verification can ensure the reliability of the processing effect.
[0163] Preferably, the finally processed image can more realistically reflect the surface characteristics of the scene.
[0164] For example, the reflection details of the desktop area are more prominent, and the scattering interference in the wall area is almost invisible. This improvement provides higher-quality data support for subsequent optical analysis or 3D modeling. Through multi-level processing and verification, the entire process forms a rigorous logical chain to ensure the practicality of the results.
[0165] In step S107, based on the corrected all-in-focus image, an image fusion algorithm is applied to integrate the detailed features of multiple depth planes to generate a fused all-in-focus image, and the detailed reconstruction accuracy data is evaluated through an edge sharpness index.
[0166] After obtaining the all-in-focus image data, the original image is processed using a bilateral filtering algorithm to obtain a corrected image. For the corrected image, a Laplacian pyramid fusion algorithm is used to extract the detailed features of multiple depth planes to generate feature integration data. From the feature integration data, a convolutional neural network is used to classify the detailed features to determine the preliminary structure of the fused all-in-focus image. Through the preliminary structure of the fused all-in-focus image, the information of multiple depth planes is integrated using a weighted average method to generate a fused all-in-focus image. The fused all-in-focus image is obtained, and the Sobel operator is used to calculate the edge sharpness index to obtain the detailed reconstruction accuracy data. If the detailed reconstruction accuracy data is lower than a preset threshold, the weight parameters of the Laplacian pyramid fusion algorithm are adjusted to regenerate the fused all-in-focus image. Based on the adjusted fused all-in-focus image, the Sobel operator is used to recalculate the edge sharpness index to determine the final accuracy data.
[0167] In step S108, starting from the fused all-in-focus image, quantization indexes of the spatial resolution and data processing accuracy are calculated, and an imaging quality determination result is generated by comparing with a preset standard value based on the detection requirements.
[0168] The initial data obtained from the fused all-in-focus image is acquired, and the quantization indexes of the spatial resolution and data processing accuracy of the initial data are calculated; the resolution calculation result and the accuracy quantization value are extracted from the quantization indexes to determine a preliminary feature set; the preliminary feature set is compared with a preset standard value to judge the deviation range of the preliminary feature set; if the deviation range exceeds a preset threshold, the image fusion parameters are adjusted, and the quantization indexes are recalculated to obtain an updated feature set; based on the comparison result between the updated feature set and the preset standard value, a quality determination basis is obtained; a support vector machine algorithm is used to classify the quality determination basis to determine the imaging quality result.
[0169] In step S109, if the imaging quality determination result does not meet the standard, the focal length parameter of the microlens array and the sampling frequency of the high-resolution sensor are adjusted according to the deviation analysis data of the quantization indexes, and the full light field data set is re-acquired to generate an optimized fused all-in-focus image.
[0170] If the imaging quality is lower than the preset threshold, deviation analysis data is calculated through quantization metrics to determine the adjustment direction. The focal length parameters of the microlens array and the sampling frequency of the high-resolution sensor are adjusted according to the deviation analysis data to obtain an updated configuration. Data acquisition is re-executed with the updated configuration to acquire the full light field dataset. An optical field reconstruction algorithm is applied to the full light field dataset to generate a preliminary fused image. If the resolution of the preliminary fused image does not meet the standard, super-resolution algorithm is used to optimize the fusion to obtain the full depth-of-focus image. According to the imaging quality determination result of the full depth-of-focus image, it is judged whether it is necessary to iteratively adjust the focal length parameters and the sampling frequency. The final optimized fused full depth-of-focus image is generated through the iteratively adjusted full light field dataset.
[0171] The present invention provides a vision detection device for precision metal part processing, mainly including:
[0172] An optical field data acquisition module, configured to collect dynamic optical field data on the surface of the metal part through a microlens array, obtain an original optical field dataset containing multi-angle and multi-depth information, and form a full optical field dataset;
[0173] A signal conversion module, configured to start from the full optical field dataset, perform signal conversion and integration using a high-resolution sensor, generate two-dimensional optical field image data with high spatial resolution ability, and form a preliminary optical field image;
[0174] A depth segmentation module, configured to extract multi-depth plane feature points for the preliminary optical field image, apply a depth segmentation algorithm based on region growing to separate the optical field data of different depth layers, and generate a stratified depth dataset;
[0175] A feature enhancement module, configured to perform feature enhancement and denoising processing on each depth layer using a convolutional neural network according to the stratified depth dataset, generate an enhanced stratified image dataset, and quantify the clarity improvement result through the peak signal-to-noise ratio;
[0176] A global reconstruction module, configured to start from the enhanced stratified image dataset, perform global reconstruction on the multi-depth plane in combination with the optical field refocusing algorithm, generate an initial full depth-of-focus image, and verify the global depth consistency index through depth deviation analysis;
[0177] A local correction module, configured to detect the surface reflection characteristics and the light scattering interference region for the initial full depth-of-focus image. If the gray level gradient of the interference region exceeds the preset threshold based on sample statistics, an adaptive filtering algorithm is used for local correction to generate a corrected full depth-of-focus image;
[0178] An image fusion module, configured to integrate the detailed features of the multi-depth plane according to the corrected full depth-of-focus image using an image fusion algorithm, generate a fused full depth-of-focus image, and evaluate the detailed reconstruction accuracy data through the edge sharpness index;
[0179] A quality assessment module, which is used to calculate the quantization indexes of spatial resolution and data processing accuracy starting from the fused all-focus images, and generate an imaging quality determination result by comparing with the preset standard values based on the detection requirements;
[0180] A parameter optimization module, which is used to analyze the data according to the deviation of the quantization indexes if the imaging quality determination result does not meet the standard, adjust the focal length parameter of the microlens array and the sampling frequency of the high-resolution sensor, re-collect the all-optical field data set, and generate an optimized fused all-focus image.
[0181] The specific embodiments described above further elaborate on the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A vision detection method for precision metal part processing, characterized in that The method includes: Collecting dynamic light field data on the surface of the metal part through a microlens array, obtaining an original light field data set containing multi-angle and multi-depth information, and forming a full light field data set; Starting from the full light field data set, using a high-resolution sensor for signal conversion and integration, generating two-dimensional light field image data with high spatial resolution ability, and forming a preliminary light field image; For the preliminary light field image, extracting multi-depth plane feature points, applying a depth segmentation algorithm based on region growing to separate the light field data of different depth layers, and generating a stratified depth data set; According to the stratified depth data set, using a convolutional neural network to perform feature enhancement and denoising processing on each depth layer, generating an enhanced stratified image data set, and quantifying the clarity improvement result through the peak signal-to-noise ratio; Starting from the enhanced stratified image data set, combining the light field refocusing algorithm to globally reconstruct the multi-depth plane, generating an initial full-depth-of-field image, and verifying the global depth consistency index through depth deviation analysis; For the initial full-depth-of-field image, detecting the surface reflection characteristics and the light scattering interference region. If the gray scale gradient of the interference region exceeds a preset threshold based on sample statistics, then an adaptive filtering algorithm is used for local correction to generate a corrected full-depth-of-field image; According to the corrected full-depth-of-field image, applying an image fusion algorithm to integrate the detail features of the multi-depth plane, generating a fused full-depth-of-field image, and evaluating the detail reconstruction accuracy data through the edge sharpness index; Starting from the fused full-depth-of-field image, calculating the quantization indexes of the spatial resolution and the data processing accuracy, and generating an imaging quality determination result by comparing with a preset standard value based on the detection requirements; If the imaging quality determination result does not meet the standard, then according to the deviation analysis data of the quantization indexes, adjusting the focal length parameter of the microlens array and the sampling frequency of the high-resolution sensor, re-collecting the full light field data set, and generating an optimized fused full-depth-of-field image.
2. The method according to claim 1, wherein The collecting dynamic light field data on the surface of the metal part through a microlens array, obtaining an original light field data set containing multi-angle and multi-depth information, and forming a full light field data set includes: Obtaining an original light field data set on the surface of the metal part, where the original light field data set includes dynamic light field data collected from multiple angles and multiple depths through the microlens array; According to the original light field data set, using a light field reconstruction algorithm based on Fourier transform to determine the spatial distribution information of the surface features; If there is noise in the spatial distribution information, then using a mean filtering algorithm to smooth the spatial distribution information to obtain an optimized full light field set; According to the optimized full light field set, using principal component analysis to extract the change trend of the multi-angle data and judge the continuous distribution of the surface features; Matching the multi-depth data with the continuous distribution, and using the least square method to obtain the depth profile information of the surface of the metal part; Performing clustering analysis on the depth profile information, using the K-means algorithm to divide regions, and obtaining stratified feature data; Extracting key geometric parameters from the stratified feature data to obtain the complete description information of the surface of the metal part.
3. The method according to claim 2, wherein It also includes: Based on the original light field data set of the metal surface and the multi-angle and multi-depth data of the microlens array, the spatial distribution information of the surface features is determined by the light field reconstruction algorithm of Fourier transform. The spatial distribution information is smoothed by the mean filtering algorithm to obtain the optimized full light field set. The change trend of the multi-angle data and the continuous distribution of the surface features are judged, the multi-depth data is matched with the continuous distribution, and the depth profile information of the metal part surface is obtained by the least square method, specifically including: A microlens array is used to obtain the original light field containing multi-angle data and multi-depth data, and Fourier transform is performed on the original light field to obtain the spatial distribution of the surface features; If there is interference in the spatial distribution, mean filtering is used to smooth the spatial distribution to obtain an optimized light field; The multi-angle data is analyzed according to the optimized light field to judge the change trend of the surface features; The continuous distribution is extracted through the optimized light field, and the multi-depth data is matched with the continuous distribution by the least square method to obtain the depth profile; The depth profile is divided into regions, and the hierarchical features are determined by cluster analysis; Geometric parameters are extracted according to the hierarchical features to obtain the surface description information; The feature boundaries are analyzed from the surface description information to determine the boundary distribution law.
4. The method according to claim 1, characterized in that, Starting from the full light field data set, a high-resolution sensor is used for signal conversion and integration to generate two-dimensional light field image data with high spatial resolution ability to form a preliminary light field image, including: An initial signal is obtained from the full light field data and converted by a high-resolution sensor to obtain the converted signal data; According to the converted signal data, signal integration technology is used for processing to generate two-dimensional light field image data; For the two-dimensional light field image data, the spatial resolution features are extracted to determine the spatial distribution information of the image; If there are discontinuous regions in the spatial distribution information, the mean filtering algorithm is used for smoothing to obtain the smoothed image data; The resolution ability is analyzed through the smoothed image data to judge the degree of detail presentation of the image; According to the degree of detail presentation, the K-means algorithm is used to divide the image region to obtain the hierarchical image data; Geometric distribution features are extracted from the hierarchical image data to obtain the surface description information.
5. The method according to claim 4, wherein It also includes: According to the full light field signal data, a high-resolution sensor is used for conversion, and the converted data is processed by signal integration technology to obtain a two-dimensional light field image. According to the spatial resolution features and the smoothing processing of the discontinuous region, the K-means algorithm is used to divide the image region to obtain the hierarchical image geometric distribution information, specifically including: The original data of the full light field signal is obtained, and the original data is converted into the converted signal data by a high-resolution sensor; For the two-dimensional light field image data generated from the converted signal data, if there are discontinuous regions with sudden changes in pixel values in the image, the mean filtering algorithm is used to process the two-dimensional light field image data to obtain the smoothed image data; According to the smoothed image data, the K-means clustering algorithm is used for region division, and the number of clustering centers is set to a preset value to obtain the hierarchical image data; Geometric distribution information is extracted from the hierarchical image data for subsequent analysis.
6. The method according to claim 1, characterized in that, The method extracts multi-depth plane feature points from the preliminary light field image, separates light field data of different depth layers by using a depth segmentation algorithm based on region growing, and generates a layered depth data set, including: SIFT feature points are extracted from the light field image, and the initial disparity map is generated by matching the feature points using binocular disparity calculation. Extract the depth discrete values from the disparity map and calculate the depth plane using OpenCV's SGBM algorithm; On the depth plane, pixels with gradient changes greater than a preset threshold are used as seed points, and the region growing algorithm is applied to output the depth segmentation boundary; Mark the connected areas according to the segmentation boundaries to obtain preliminary hierarchical data; The preliminary stratified data was input into Scikit-learn’s DBSCAN clustering to separate the stratified data set structure based on density; Calculate the variance of the three-dimensional coordinates of the feature points in each layer. If the variance is less than the preset threshold, the distribution is determined to be consistent. For the data within the layer that meets the consistency standard, the K-means algorithm is used to determine the number of clusters according to the silhouette coefficient to generate optimized layered depth data; Finally, the layered depth data is output.
7. The method according to claim 1, wherein The method uses a convolutional neural network to perform feature enhancement and denoising on each depth layer according to the layered depth dataset, generates an enhanced layered image dataset, and quantifies the clarity improvement result by peak signal-to-noise ratio, including: Obtain a data set, divide the data set into layers according to a preset depth standard, and obtain a data subset for each depth layer; Inputting the divided data subsets into a pre-established convolutional neural network, performing feature enhancement processing, and obtaining a first image set after feature enhancement; Processing the first image set using a denoising algorithm to generate a denoised second image set; According to the quantization result of the second image set, determining whether the quantization result is lower than a preset threshold; If the quantization result is lower than the preset threshold, the parameters of the convolutional neural network are adjusted, and the data subset is re-input into the convolutional neural network for processing.
8. The method according to claim 1, wherein Starting from the enhanced layered image dataset, the multi-depth planes are globally reconstructed in combination with the light field refocusing algorithm to generate an initial full-focus depth image, and the global depth consistency index is verified through depth deviation analysis, including: Acquire an enhanced image dataset carrying hierarchical features, the dataset being hierarchically processed to determine distribution characteristics of a plurality of depth planes; Perform depth deviation analysis on each depth plane to obtain the depth offset and determine whether the global depth is consistent; If the depths are inconsistent, the parameters of the light field refocusing algorithm are iteratively optimized until the consistency index converges.
9. The method according to claim 1, characterized in that The initial full-focus depth image is detected by detecting the surface reflection characteristics and the light scattering interference area. If the grayscale gradient of the interference area exceeds a preset threshold based on sample statistics, an adaptive filtering algorithm is used to perform local correction to generate a corrected full-focus depth image, including: Obtain the surface reflection characteristics and light scattering interference area distribution of the full-focus depth image; If the grayscale gradient of the interference area exceeds a preset threshold, an adaptive filtering algorithm is used to process the interference area to obtain preliminary correction data; According to the preliminary correction data, a local correction operation is performed to generate a corrected full-focus depth image; Extract the surface reflection characteristic changes from the corrected all-in-focus image and judge the uniformity of the changes; Adjust the parameters of the adaptive filtering algorithm according to the uniformity judgment result to obtain an optimized corrected all-in-focus image; Verify the degree of reduction of light scattering interference in the optimized corrected all-in-focus image to obtain the final processed image.
10. A vision inspection device for processing precision metal parts, characterized in that The device includes: A light field data acquisition module for collecting dynamic light field data on the surface of a metal part through a microlens array, obtaining an original light field data set containing multi-angle and multi-depth information, and forming a full light field data set; A signal conversion module for starting from the full light field data set, performing signal conversion and integration using a high-resolution sensor to generate two-dimensional light field image data with high spatial resolution ability, and forming a preliminary light field image; A depth segmentation module for extracting multi-depth plane feature points for the preliminary light field image, applying a depth segmentation algorithm based on region growing to separate the light field data of different depth layers, and generating a stratified depth data set; A feature enhancement module for performing feature enhancement and denoising processing on each depth layer using a convolutional neural network according to the stratified depth data set, generating an enhanced stratified image data set, and quantifying the clarity improvement result through the peak signal-to-noise ratio; A global reconstruction module for starting from the enhanced stratified image data set, globally reconstructing the multi-depth plane in combination with the light field refocusing algorithm to generate an initial all-in-focus image, and verifying the global depth consistency index through depth deviation analysis; A local correction module for detecting the surface reflection characteristics and light scattering interference regions for the initial all-in-focus image. If the gray level gradient of the interference region exceeds a preset threshold based on sample statistics, an adaptive filtering algorithm is used for local correction to generate a corrected all-in-focus image; An image fusion module for integrating the detailed features of the multi-depth plane using an image fusion algorithm according to the corrected all-in-focus image to generate a fused all-in-focus image, and evaluating the detailed reconstruction accuracy data through an edge sharpness index; A quality assessment module for calculating the quantization indexes of the spatial resolution and data processing accuracy starting from the fused all-in-focus image, and generating an imaging quality determination result by comparing with a preset standard value based on the detection requirements; A parameter optimization module for, if the imaging quality determination result does not meet the standard, adjusting the focal length parameter of the microlens array and the sampling frequency of the high-resolution sensor according to the deviation analysis data of the quantization indexes, re-collecting the full light field data set, and generating an optimized fused all-in-focus image.
Citation Information
Cited By
Weld joint parameter anti-interference measurement method
CN121112903A
A method for measuring weld parameters immune to interference
CN121112903B