Machining part optical detection method and system based on industrial vision

By using multispectral imaging and real-time image correction technology, the influence of contaminants during the processing is identified and compensated, solving the problem of low efficiency in traditional manual quality inspection and realizing automated quality control of high-precision mechanical parts.

CN121830725AInactive Publication Date: 2026-04-10SHENZHEN KAIRUIQI AUTOMATICAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-02
Publication Date
2026-04-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional manual quality inspection is inefficient, with high rates of missed inspections and false judgments. Furthermore, byproducts generated during processing can interfere with the accuracy of optical inspection systems, leading to inaccurate inspection results in the production of high-precision mechanical parts.

Method used

An optical inspection method for machined parts based on industrial vision is adopted. By acquiring image data of the workpiece surface under multiple preset spectral bands, optical response characteristics are analyzed, contaminant areas and types are identified, influence distribution information is generated, and real-time image correction algorithm is used for compensation processing to obtain target image data reflecting the surface morphology of the workpiece. Finally, the quality is judged by comparing it with a preset three-dimensional digital model.

Benefits of technology

It significantly improves the accuracy and reliability of optical inspection of machined parts, realizes online, automated, and high-precision monitoring of product quality, and reduces the rate of misjudgment and missed detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121830725A_ABST
    Figure CN121830725A_ABST
Patent Text Reader

Abstract

The invention provides a machining part optical detection method and system based on industrial vision, and relates to the technical field of industrial vision detection. Comparing the optical response of each region in the image data with a pre-stored standard spectral response characteristic of a typical pollutant, and identifying the existing region and type of the pollutant; according to the identified pollutant information, influence distribution information is generated; according to the influence distribution information, carrying out real-time image correction compensation processing on the pollutant existence area in the image data to obtain target image data; the three-dimensional shape data of the workpiece is obtained based on the target image data and compared with the preset three-dimensional digital model to judge the quality of the workpiece, the problems that in the prior art, traditional manual quality inspection is low in efficiency and high in misjudgment rate are effectively solved, and the interference of by-products generated in the machining process on the accuracy of an optical detection system is overcome.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of industrial vision detection, in particular, to a machining part optical detection method and system based on industrial vision. BACKGROUND

[0002] In the modern manufacturing field, especially for the production of high-precision mechanical parts, the requirement for quality control is increasingly strict. The traditional quality inspection method relying on manual work is not only inefficient, but also has an unacceptable false negative rate and false positive rate when facing complex geometric shapes and micron-level defects. In order to solve this core pain point, a machining part optical detection method and system based on industrial vision is introduced into the machining process of a universal machine tool. The system integrates high-resolution industrial cameras and multispectral imaging technology to capture the surface features of the workpiece in real time during the machining process, and compares them with the pre-loaded three-dimensional digital model for high-precision analysis, thereby realizing online and automatic monitoring of product quality. However, in the actual production environment, the machining of certain special materials and the by-products generated during the machining process may cause unexpected interference with the accuracy of the optical detection system.

[0003] In a workshop focusing on small-batch, high-precision part production, an advanced universal machine tool is performing a machining task. In order to ensure that each part meets the stringent quality standards when it leaves the machine, an online optical detection module is integrated into the machine. This module performs well in the conventional machining process: after the machine completes a stage of cutting, the machining is temporarily paused, and a detection head equipped with a high-resolution industrial camera moves above the workpiece. It obtains the current three-dimensional topography information of the workpiece by projecting specific pattern light and taking images of the workpiece surface. The system compares the collected surface information with the preset three-dimensional digital model, calculates the deviation in size, contour, etc. As long as the deviation is within the allowable tolerance range, the system will instruct the machine to continue the next step of the machining program. This real-time quality control method during machining greatly improves production efficiency and effectively avoids the accumulation of machining errors leading to the entire workpiece being scrapped.

[0004] However, this smooth workflow encountered unprecedented challenges in a new machining task. The raw material of the part to be machined is a special alloy with mirror-like reflection characteristics. When the machining process is halfway through, the online detection module is activated as usual, and the problem arises. The light source of the detection module shines on the surface of the workpiece after finishing, and since the surface is smooth like a mirror, most of the light is directly reflected, forming a very high-intensity bright spot, which is commonly known as a mirror highlight. The brightness of these highlight areas far exceeds the normal receiving range of the industrial camera's photosensitive element, resulting in complete loss of detail information in the corresponding areas of the image, forming a white overexposed area. At the same time, in some grooves or internal hole structures of the workpiece, the light undergoes multiple complex internal reflections, forming a series of unpredictable chaotic spots and deep shadows. The camera's image is no longer a clear surface texture of the workpiece, but a severely distorted image composed of dazzling bright spots and dark shadows.

[0005] Based on such a severely disturbed image, the subsequent analysis and processing steps also fail. The program responsible for reconstructing the three-dimensional topography cannot extract valid depth information from the overexposed and underexposed areas. It mistakenly interprets the mirror highlight area as a protrusion that does not exist on the workpiece surface, and judges the deep shadow area as a size-out-of-tolerance recess. Ultimately, the system generates a three-dimensional surface data that is vastly different from the actual situation of the workpiece, full of erroneous features. When this erroneous surface data is compared with the standard three-dimensional digital model, the system calculates a huge, non-existent machining deviation. As a result, the system determines that the workpiece is a defective product, immediately suspending the entire machining process and issuing an alarm to the operator. After checking, the operator finds that the actual machining quality of the workpiece fully meets the requirements, and the interruption of production is completely caused by the misjudgment of the detection system.

[0006] Furthermore, in actual machining environments, the problem becomes even more complex. During the cutting process, the cooling fluid forms a thin oil film on the workpiece surface, and some tiny metal chips inevitably remain on the surface. For ordinary non-mirror-finish workpieces, the impact of these residues on optical inspection is still within a controllable range. However, for mirror-finish alloy workpieces, the situation is completely different. The transparent oil film will form an uneven thickness due to surface tension, like an irregular lens covering a mirror, making the reflection path of light more unpredictable and variable. The tiny metal chips themselves also have strong reflective properties; scattered on the mirror surface, they are like adding thousands of tiny interfering light sources, further aggravating the noise and complexity of the image. These existing machining residues, combined with the mirror-like properties of the workpiece itself, make obtaining a clear and accurate image of the workpiece surface extremely difficult, leading to frequent false alarms in the entire online inspection system. Instead of improving efficiency, it becomes a bottleneck in the production process. Summary of the Invention

[0007] This application provides an optical inspection method and system for machined parts based on industrial vision, aiming to solve the problems of low efficiency, high missed inspection rate and false judgment rate of traditional manual quality inspection in modern manufacturing, especially for the production of high-precision mechanical parts, as well as the interference of by-products generated during the processing on the accuracy of the optical inspection system.

[0008] On the one hand, this application provides an optical inspection method for machined parts based on industrial vision, including: Acquire image data of the workpiece surface in multiple preset spectral bands; The optical response of each region in the image data is analyzed and compared with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence and type of pollutants in the image data. Based on the identified location and type of pollutants, the extent to which the pollutants affect the absorption, scattering, or reflection of light is determined, and the distribution information of the pollutant's influence is generated. Based on the influence distribution information, the areas where pollutants exist in the image data are compensated using a real-time image correction algorithm to obtain target image data that reflects the surface morphology of the workpiece. Based on the target image data, the three-dimensional shape data of the workpiece is obtained; and the three-dimensional shape data is compared with a preset three-dimensional digital model to determine the quality of the workpiece.

[0009] On the other hand, this application provides an optical inspection system for machined parts based on industrial vision, the system comprising: The image acquisition module is used to acquire image data of the workpiece surface under multiple preset spectral bands. The identification module is used to analyze the optical response of each region in the image data and compare it with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence area and type of pollutants in the image data. The impact quantification module is used to determine the degree of impact of the identified pollutants on the absorption, scattering or reflection of light based on the location and type of the pollutants, and to generate the impact distribution information of the pollutants. The image compensation module is used to compensate the area where pollutants exist in the image data using a real-time image correction algorithm based on the influence distribution information, so as to obtain target image data that reflects the surface morphology of the workpiece. The quality judgment module is used to acquire the three-dimensional shape data of the workpiece based on the target image data; and to compare the three-dimensional shape data with the preset three-dimensional digital model to judge the quality of the workpiece.

[0010] This application relates to an optical inspection method and system for machined parts based on industrial vision. It acquires image data of the workpiece surface in multiple preset spectral bands, analyzes the optical response of each region in the image data, and compares it with the standard spectral response characteristics of typical contaminants stored in the database to identify the location and type of contaminants. Based on this, the degree of contaminant influence on light is determined according to the identified contaminant information, and influence distribution information is generated. According to this influence distribution information, real-time image correction and compensation processing is performed on the areas where contaminants are present in the image data to obtain target image data reflecting the surface morphology of the workpiece. Finally, the three-dimensional morphology data of the workpiece is obtained based on the target image data and compared with a preset three-dimensional digital model to determine the quality of the workpiece. This method effectively solves the problems of low efficiency, high missed detection rate, and high false positive rate in traditional manual quality inspection, while overcoming the interference of by-products generated during processing on the accuracy of the optical inspection system. By using multispectral imaging and optical response analysis of contaminants, this application can accurately identify and compensate for the impact of contaminants on the detection results, thereby obtaining more realistic and accurate surface morphology data of the workpiece body, significantly improving the accuracy and reliability of optical inspection of machined parts, and realizing online, automated, and high-precision monitoring of product quality. Attached Figure Description

[0011] To illustrate this application more clearly, the accompanying drawings used in the embodiments will be briefly described below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0012] Figure 1The diagram illustrates a process flow diagram of an optical inspection method for machined parts based on industrial vision. Figure 2 The diagram above illustrates a structural schematic of an optical inspection system for machined parts based on industrial vision.

[0013] Figure reference numerals: 100, Optical inspection system for machined parts based on industrial vision; 10, Image acquisition module; 20, Recognition module; 30, Impact quantification module; 40, Image compensation module; 50, Quality judgment module. Detailed Implementation

[0015] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0016] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0017] In modern manufacturing, especially for the production of high-precision mechanical parts, the requirements for quality control are becoming increasingly stringent. Traditional methods relying on manual quality inspection are not only inefficient but also suffer from unacceptable rates of missed detections and false positives when dealing with complex geometries and micron-level defects. To address this critical issue, an optical inspection method and system for machined parts based on industrial vision has been introduced into the machining process of universal machine tools. This system integrates a high-resolution industrial camera and multispectral imaging technology to capture the surface morphology of the workpiece in real time during processing and perform high-precision comparative analysis with a pre-loaded 3D digital model, thereby achieving online and automated monitoring of product quality. However, in actual production environments, the processing of certain special materials and byproducts generated during processing may unexpectedly interfere with the accuracy of the optical inspection system.

[0018] like Figure 1The diagram illustrates an exemplary flow chart of an optical inspection method for machined parts based on industrial vision. This application proposes an optical inspection method for machined parts based on industrial vision, comprising: S10, acquire image data of the workpiece surface under multiple preset spectral bands; Image data refers to a collection of images acquired through optical imaging equipment, containing information on the light response of a workpiece surface under different spectral bands. This data can be two-dimensional images or processed multi-dimensional data for subsequent analysis and processing. Preset spectral bands refer to a series of specific wavelengths or wavelength ranges predetermined within the visible and / or non-visible light range; for example, they may include infrared, ultraviolet, or specific narrowband visible light bands. The purpose of selecting multiple preset spectral bands is to capture the unique optical responses of contaminants at different wavelengths, thereby improving the accuracy of identification.

[0019] S20, Analyze the optical response of each region in the image data and compare it with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence area and type of pollutants in the image data; Typical contaminants refer to various substances that may appear on the surface of a workpiece during machining, such as cutting fluid residue, oil, metal shavings, and oxides. Each contaminant has its own specific spectral response characteristics, which are pre-stored as standard spectral response characteristics for comparison with measured data.

[0020] S30, based on the identified location and type of pollutants, determine the degree of influence of the pollutants on the absorption, scattering, or reflection of light, and generate the distribution information of the influence of the pollutants; S40, based on the influence distribution information, the area where pollutants exist in the image data is compensated by a real-time image correction algorithm to obtain target image data reflecting the surface morphology of the workpiece. Among them, the real-time image correction algorithm is an algorithm that can dynamically adjust the pixel values ​​of the contaminated area in the image data according to the optical influence distribution information of the contaminants. It aims to eliminate or reduce the interference of contaminants on the image, thereby restoring the true surface morphology information of the workpiece.

[0021] S50: Based on the target image data, acquire the three-dimensional shape data of the workpiece; and compare the three-dimensional shape data with the preset three-dimensional digital model to determine the quality of the workpiece.

[0022] The three-dimensional digital model is a digital model of the workpiece generated during the design phase, accurately describing its geometry and dimensions, and typically exists in CAD model or other three-dimensional data formats. During inspection, the measured three-dimensional shape data of the workpiece is compared with this digital model to determine whether the workpiece's quality meets the design requirements. The implementation environment of this application typically includes an industrial vision inspection system, which integrates a high-resolution multispectral camera, a multispectral light source, a data processing unit, and a data interface with the machine tool control system, enabling automated inspection of workpieces in the machining site or near-line environment.

[0023] Firstly, there are several methods for acquiring image data of a workpiece surface in multiple preset spectral bands. For example, a tunable multispectral light source can be used, capable of sequentially emitting light of different wavelengths, and simultaneously acquiring images with a broadband camera. Each time a specific wavelength of light is emitted, the camera captures the reflection or scattering image of the workpiece surface at that wavelength, thus forming a series of image data in different spectral bands. Another method is to use multiple narrowband light sources with fixed wavelengths, each corresponding to a specific spectral band, and simultaneously image with a multi-channel camera or multiple single-channel cameras. This allows for the simultaneous acquisition of image data in multiple spectral bands in a single exposure. Furthermore, a combination of a spectrometer and a scanning mechanism can be used to scan the workpiece surface, acquiring its spectral response point-by-point or line-by-line within a continuous spectral range, and then extracting image data in preset spectral bands from it.

[0024] Secondly, in analyzing the optical response of each region in the image data and comparing it with the pre-stored standard spectral response characteristics of typical pollutants to identify the presence and type of pollutants in the image data, pixel-level analysis can be performed on the acquired image data. For example, for each pixel in the image data, its brightness or intensity value under different preset spectral bands can be extracted to form a vector representing the spectral response of that pixel. Then, this measured spectral response vector is compared with the pre-stored standard spectral response characteristics of various typical pollutants. The comparison method can employ spectral matching algorithms, such as calculating spectral angles, spectral correlation coefficients, or Euclidean distances. By calculating the similarity between the measured spectral response vector and the standard spectral response characteristics of each pollutant and comparing it with a preset threshold, it can be determined whether a certain pollutant exists in the region where the pixel is located and its type can be identified. For example, if the spectral response of a certain pixel highly matches the spectral response characteristics of cutting fluid, it can be determined that there is a cutting fluid pollutant in that region.

[0025] Furthermore, in determining the extent to which pollutants affect the absorption, scattering, or reflection of light based on their identified locations and types, and in generating information on the distribution of pollutant impacts, once the locations and types of pollutants are identified, it is necessary to quantify their impact on optical signals. For example, an optical model can be established based on the optical properties of different types of pollutants (such as refractive index, absorption coefficient, scattering coefficient, etc.). This model can predict the specific impact of pollutants on the absorption, scattering, or reflection of incident light based on parameters such as the thickness, concentration, or coverage of the pollutants. By inputting the identified pollutant type and region information into this model, the degree of optical signal attenuation or enhancement at each contaminated pixel can be calculated, thereby generating a detailed pollutant impact distribution information map. This information map can be represented as an optical signal correction factor or offset for each pixel.

[0026] Next, based on the influence distribution information, the areas where contaminants exist in the image data are compensated using a real-time image correction algorithm to obtain target image data reflecting the surface morphology of the workpiece. The contaminant influence distribution information generated in the previous step can be used to compensate the original image data. For example, a physical model-based optical signal decoupling algorithm can be employed. This algorithm treats the original image data as a superposition of the workpiece signal and the contaminant interference signal. By subtracting or correcting the influence of the contaminants, the true optical response of the workpiece can be recovered. Specifically, for each contaminated pixel, its brightness or color value can be adjusted according to its corresponding influence distribution information to counteract the absorption, scattering, or reflection effects of the contaminants. For example, if the contaminants cause light signal attenuation, the brightness value of that pixel can be increased accordingly. After compensation processing, the resulting image data will more accurately reflect the surface morphology of the workpiece, thus becoming the "target image data."

[0027] Finally, regarding acquiring the workpiece's 3D topographic data based on the target image data, and comparing this 3D topographic data with a pre-set 3D digital model to determine the workpiece's quality, after acquiring the target image data, 3D reconstruction techniques can be used to obtain the workpiece's 3D topographic data. For example, methods such as stereo vision, structured light projection, or laser triangulation can be employed. By analyzing the texture, shadows, or projection patterns in the target image data, the depth information of the workpiece surface can be calculated, thereby constructing its 3D point cloud or mesh model. Once the workpiece's 3D topographic data is obtained, it can be compared with a pre-set 3D digital model with high precision. The comparison process typically includes steps such as point cloud registration, deviation calculation, and feature matching. By calculating the geometric deviation between the measured 3D topographic data and the digital model, quality problems such as defects on the workpiece surface, dimensional deviations, or non-compliance of geometric tolerances can be identified, and ultimately, the quality of the workpiece can be determined.

[0028] The core innovation of this application lies in the introduction of multispectral image data acquisition and an image compensation mechanism based on the spectral characteristics of contaminants. Compared with traditional single-spectrum or broadband optical inspection, this application can capture the unique optical response of contaminants at different wavelengths by acquiring image data of the workpiece surface in multiple preset spectral bands. For example, cutting fluid films and nano-alloy particles may exhibit different absorption and scattering characteristics in the visible and infrared bands. These differences are difficult to distinguish in single-spectrum images, but become obvious in multispectral data.

[0029] Furthermore, this application analyzes the optical response of each region in the image data and compares it with the standard spectral response characteristics of pre-stored typical pollutants to accurately identify the location and type of pollutants. This step is not available in traditional methods, enabling the "intelligent" identification of interference sources. For example, through spectral angle matching algorithms, the similarity between the measured spectrum and the known pollutant spectrum can be quantified, thereby achieving accurate classification of pollutants.

[0030] More importantly, this application determines the degree of influence of identified contaminants on light absorption, scattering, or reflection based on the identified contaminant information, and generates contaminant influence distribution information. Then, it uses a real-time image correction algorithm to compensate for the areas in the image data where contaminants are present. This image compensation step is a breakthrough contribution of this application. Traditional detection methods often cannot effectively eliminate the influence of contaminants, or can only roughly remove some interference through simple threshold segmentation, but these methods often lose detailed information about the workpiece or cannot completely eliminate the optical effects of contaminants. The real-time image correction algorithm of this application can precisely adjust the pixel values ​​of the contaminated area according to the specific optical effects of the contaminants, thereby "restoring" the true surface morphology of the workpiece and obtaining target image data reflecting the surface morphology of the workpiece.

[0031] Therefore, by acquiring the three-dimensional morphology data of the workpiece based on the compensated target image data and comparing it with the preset three-dimensional digital model, the accuracy of quality judgment can be significantly improved. Since the target image data has eliminated the interference of contaminants, the reconstructed three-dimensional morphology data will be closer to the true geometry of the workpiece, making the comparison results with the digital model more reliable and effectively avoiding misjudgments and missed detections caused by contaminants.

[0032] In summary, this application, by introducing a series of innovative technologies such as multispectral imaging, contaminant spectral identification, optical influence quantification, and real-time image correction, constructs an industrial visual inspection method capable of effectively addressing contaminant interference during processing. This method not only improves the automation and efficiency of inspection, but more importantly, it significantly enhances the accuracy and reliability of high-precision mechanical parts quality inspection, providing a more advanced and reliable solution for quality control in modern manufacturing.

[0033] In some embodiments, the step of acquiring image data of the workpiece surface in multiple preset spectral bands includes: By controlling a multispectral light source to emit pulsed light onto the surface of a workpiece according to a preset wavelength sequence, and simultaneously acquiring images of the workpiece surface under the illumination of pulsed light of each wavelength, image data is obtained. The preset wavelength sequence emitted by the multispectral light source includes at least one visible light band and one non-visible light band.

[0034] Specifically, a multispectral light source can be understood as an illumination device capable of emitting multiple different wavelengths of light. It can sequentially or simultaneously emit specific wavelengths of light onto the workpiece surface according to a preset wavelength sequence. The preset wavelength sequence refers to a series of pre-determined wavelengths used for detection; these wavelengths are carefully selected to ensure coverage of the characteristic responses of typical contaminants under different spectra. Pulsed light refers to a high-intensity beam emitted in an extremely short time, offering the advantage of providing instantaneous high brightness while reducing thermal effects and background noise interference. Synchronous acquisition refers to the precise capture of images of the workpiece surface under corresponding wavelength illumination by an image acquisition device (such as a CCD or CMOS camera) while the multispectral light source emits pulsed light, ensuring that each frame strictly corresponds to the illumination conditions of a specific wavelength. The preset wavelength sequence includes both visible and non-visible light bands, aiming to comprehensively acquire the optical information of the workpiece surface. The visible light band reflects the color, texture, and other characteristics of the workpiece surface within the range visible to the human eye, while non-visible light bands (such as infrared or ultraviolet bands) reveal material properties and contaminant absorption or reflection characteristics that are difficult to detect under visible light, thus providing richer and more comprehensive spectral information.

[0035] The above technical solutions significantly improve the quality and information richness of image data. Specifically, employing a multispectral light source to emit pulsed light and simultaneously acquire it effectively suppresses environmental noise, improves image clarity and contrast, and ensures that the acquired image data accurately reflects the optical properties of the workpiece surface. Simultaneously, combining image data from both visible and non-visible light bands allows subsequent contaminant identification and impact quantification steps to be based on more comprehensive and accurate spectral information, thereby enhancing the accuracy of contaminant identification and the effectiveness of compensation processing, providing a more reliable data foundation for the final workpiece quality assessment.

[0036] In some embodiments, the step of analyzing the optical response of each region in the image data and comparing it with pre-stored standard spectral response characteristics of typical pollutants to identify the presence region and type of pollutants in the image data includes: For each pixel in the image data, extract its brightness value in each preset spectral band to form the measured spectral response vector of that pixel. The spectral angle matching algorithm is used to calculate the spectral angle between the measured spectral response vector of the pixel and the standard spectral response characteristics of each pre-stored typical pollutant. The spectral angle is compared with the corresponding preset judgment threshold; if the spectral angle between the measured spectral response vector of the pixel and the standard spectral response characteristics of the pre-stored typical pollutant is less than the corresponding judgment threshold, then it is determined that the pollutant exists in the region where the pixel is located.

[0037] Specifically, after acquiring image data of the workpiece surface under multiple preset spectral bands, detailed spectral analysis is required to accurately identify potential contaminants on the workpiece surface. Each pixel in the image data exhibits different brightness values ​​under different preset spectral bands. These brightness values ​​can be extracted and combined into a multi-dimensional vector, namely the measured spectral response vector of that pixel. This vector characterizes the optical response characteristics of the pixel at different wavelengths and is crucial information for identifying the substance it represents.

[0038] Furthermore, to identify the regions and types of contaminants in image data, a spectral angle matching algorithm can be employed. This algorithm measures the similarity between two spectral vectors by calculating the angle between them. Specifically, the measured spectral response vector of each pixel is compared with the pre-stored standard spectral response features of various typical contaminants. Each typical contaminant, such as degraded cutting fluid films or nano-alloy particles, has its unique standard spectral response features, which can be used as reference vectors. By calculating the spectral angle between the measured spectral response vector and each standard spectral response feature, the similarity of the pixel to various contaminants in spectral properties can be quantified. The smaller the spectral angle, the more similar the spectral shapes are, meaning the pixel is more likely to belong to that type of contaminant.

[0039] Based on this, the calculated spectral angle is compared with a preset judgment threshold. One or more corresponding judgment thresholds can be set for each type of contaminant. If the spectral angle between the measured spectral response vector of a pixel and the standard spectral response feature of a pre-stored typical contaminant is less than its corresponding judgment threshold, then it can be determined that the region containing that pixel contains that type of contaminant. In this way, refined identification of contaminants on the workpiece surface can be achieved, including their specific spatial location and type.

[0040] The above technical solution enables refined, pixel-level identification of contaminants on workpiece surfaces, overcoming the problems of insufficient identification accuracy or misjudgment that may exist in traditional methods. This method utilizes the robustness of the spectral angle matching algorithm to effectively address complex situations such as uneven illumination and noise interference that may occur in actual inspections, improving the accuracy and reliability of contaminant identification. Furthermore, by identifying the specific type of contaminant, a data foundation is provided for subsequent optical impact compensation for different contaminants, thereby enabling more accurate acquisition of target image data reflecting the surface morphology of the workpiece, laying a solid foundation for the final workpiece quality assessment.

[0041] In some embodiments, the step of compensating the areas where contaminants exist in the image data using a real-time image correction algorithm based on the influence distribution information to obtain target image data reflecting the surface morphology of the workpiece includes: The contributions of the workpiece body, the degraded cutting fluid film, and the nano-alloy particles to the total optical signal were initially separated, and preliminary information on the distribution of contaminant effects was generated. Based on preliminary information on the distribution of pollutants, preliminary compensation processing is performed on the areas where pollutants exist in the image data to obtain image data that preliminarily reflects the surface morphology of the workpiece. Based on the image data that initially reflects the surface morphology of the workpiece, preliminary three-dimensional morphology data of the workpiece is obtained. The preliminary three-dimensional topography data is compared with the preset three-dimensional digital model to identify minor deviations in the preliminary three-dimensional topography data that do not belong to actual processing defects. Based on the minute deviation and the image data, the adjustment amount of the optical response parameters of the degraded cutting fluid film and the nano-alloy particles is deduced in reverse to generate contaminant optical response parameter correction information; and the image data is then subjected to a second optical signal decoupling and image correction using the contaminant optical response parameter correction information to obtain target image data that ultimately reflects the surface morphology of the workpiece.

[0042] Specifically, the contributions of the workpiece body, the degraded cutting fluid film, and the nano-alloy particles to the total optical signal are initially separated. By establishing a multispectral optical model, the total optical signal at different wavelengths is decomposed, and the reflection, absorption, and scattering coefficients of the workpiece body, the degraded cutting fluid film, and the nano-alloy particles at each wavelength are estimated, thereby quantifying their relative contributions to the total optical signal. This allows for the generation of preliminary information on the distribution of contaminants, characterizing their spatial distribution and the initial degree of their influence on the optical signal.

[0043] Based on the preliminary information on the distribution of pollutants, preliminary compensation processing is performed on the areas where pollutants exist in the image data. This can be achieved by using real-time image correction algorithms based on physical models or driven by data. For example, by subtracting or correcting the optical contribution of pollutants at each pixel, the interference of pollutants on the image data can be initially eliminated, thereby obtaining image data that initially reflects the surface morphology of the workpiece.

[0044] Furthermore, based on the image data that initially reflects the surface morphology of the workpiece, preliminary three-dimensional morphology data of the workpiece can be obtained using three-dimensional reconstruction techniques, such as structured light projection, laser triangulation, or stereo vision.

[0045] In practical applications, preliminary 3D topographic data is compared with a pre-set 3D digital model. The aim is to identify minor deviations in the preliminary 3D topographic data that do not conform to the ideal model through geometric matching and deviation analysis. These deviations may originate from the influence of residual contaminants, measurement noise, or actual processing defects.

[0046] Specifically, based on minute deviations and image data, the adjustment amounts of the optical response parameters of the degraded cutting fluid film and nano-alloy particles are derived in reverse. Using the minute deviations identified in the preliminary comparison results, combined with the original image data, the parameters in the pollutant optical model are optimized in reverse. For example, through iterative optimization algorithms, parameters such as film thickness, particle density, and optical constants are adjusted so that the pollutant model, after parameter correction, can more accurately eliminate the influence of pollutants when decoupled from the image data, thereby generating corrected information for the pollutant optical response parameters.

[0047] Finally, by utilizing the contaminant optical response parameter correction information, a second optical signal decoupling and image correction is performed on the image data. This means using updated and more accurate contaminant optical parameters to further refine the optical signal separation and image correction of the original image data. The aim is to further eliminate the influence of residual contaminants, restore the true surface morphology of the workpiece to the greatest extent possible, and thus obtain the target image data that ultimately reflects the surface morphology of the workpiece.

[0048] Through the above technical solution, this application can significantly improve the accuracy and reliability of optical inspection of machined parts in complex pollutant environments. Compared with the aforementioned method that only performs one-time compensation, this application introduces an iterative optimization process of preliminary compensation, three-dimensional morphology comparison, micro-deviation identification, parameter reverse derivation, and secondary compensation. This allows for more precise decoupling of the optical signals from the workpiece body and various complex pollutants (such as degraded cutting fluid films and nano-alloy particles). Therefore, it can effectively avoid misjudging morphological deviations caused by pollutants as actual machining defects, ensuring the accuracy of subsequent three-dimensional morphology data acquisition, thereby improving the accuracy of workpiece quality judgment and reducing false positive and false negative rates. This has significant practical implications for the quality control of high-precision machined parts.

[0049] In some embodiments, the step of comparing the preliminary three-dimensional topography data with a preset three-dimensional digital model to identify minor deviations in the preliminary three-dimensional topography data that do not belong to actual processing defects includes: The position information of the workpiece in the machine tool coordinate system and the vibration state information of the machine tool at the moment of detection are obtained. The preliminary three-dimensional topography data is roughly aligned using the location information, and the preliminary three-dimensional topography data is finely adjusted based on the vibration state information to obtain the target three-dimensional topography data. Extract geometric features from the target 3D topography data and the preset 3D digital model, calculate the spatial transformation relationship between the geometric features, and achieve precise alignment between the target 3D topography data and the preset 3D digital model; Based on the distance deviation between the precisely aligned target 3D topography data and the preset 3D digital model, minor deviations in the preliminary 3D topography data that do not belong to actual processing defects are identified.

[0050] Specifically, the position information of the workpiece in the machine tool coordinate system is acquired. This is done in real time through the machine tool's own encoder, laser tracker, or external vision positioning system, obtaining the spatial position and attitude data of the workpiece relative to the machine tool's reference coordinate system during inspection. Simultaneously, the vibration state information of the machine tool at the moment of inspection is acquired. This can be understood as real-time monitoring of the minute vibration amplitude and frequency of the machine tool during data acquisition using accelerometers or vibration sensors installed on key parts of the machine tool. The purpose is to quantify the impact of the machine tool's dynamic characteristics on the measurement data.

[0051] The process involves roughly aligning the initial 3D topographic data using positional information. Based on the known approximate position of the workpiece, the initial 3D topographic data is initially transformed into a coordinate system roughly the same as the preset 3D digital model, for example, through rigid body transformations (translation and rotation). Fine-tuning is then performed on the roughly aligned initial 3D topographic data based on vibration state information. This can be understood as making minor corrections to the initially aligned data based on the machine tool vibration data at the moment of detection, in order to eliminate or reduce measurement errors caused by vibration, thereby obtaining more accurate target 3D topographic data.

[0052] In practical applications, extracting geometric features from target 3D topography data and a pre-set 3D digital model specifically refers to identifying representative geometric elements from the 3D data, such as planes, circular holes, cylindrical surfaces, edges, and corners. The spatial transformation relationship between these geometric features is then calculated. For example, iterative nearest point (ICP) algorithms, feature point matching algorithms, or shape context-based matching algorithms can be used to solve for the optimal rotation and translation matrix by minimizing the distance or difference between corresponding geometric features. The goal is to achieve precise alignment between the target 3D topography data and the pre-set 3D digital model.

[0053] Furthermore, based on the distance deviation between the precisely aligned target 3D topography data and the preset 3D digital model, minor deviations in the preliminary 3D topography data that do not belong to actual processing defects are identified. This refers to calculating the shortest distance from each point on the target 3D topography data to the surface of the preset 3D digital model after high-precision registration. Among these distance deviations, areas that exceed a certain threshold but do not conform to the characteristics of typical processing defects are identified as minor deviations that do not belong to actual processing defects. For example, these deviations may be morphology changes caused by residual contaminant films or nanoparticles.

[0054] Through the above technical solution, this application can significantly improve the registration accuracy between preliminary three-dimensional morphology data and preset three-dimensional digital models, thereby more accurately identifying minute deviations that are not actual processing defects. This high-precision identification capability helps to distinguish morphological changes caused by contaminants (such as degraded cutting fluid films and nano-alloy particles) from actual processing defects, avoiding misjudging contaminants as defects or attributing morphological deviations caused by contaminants to registration errors. Therefore, it can provide more reliable input for subsequent reverse derivation of contaminant optical response parameters and second optical signal decoupling, ultimately obtaining target image data that more accurately reflects the surface morphology of the workpiece, thereby improving the accuracy and reliability of the entire optical inspection method.

[0055] For example, suppose the machined part to be inspected is a metal part with multiple precision holes and planar areas.

[0056] First, while the image acquisition module collects image data, the laser tracker installed on the machine tool acquires the real-time position information of the workpiece in the machine tool coordinate system, and the high-precision accelerometer acquires the minute vibration data of the machine tool at the moment of detection.

[0057] Subsequently, the preliminary three-dimensional topography data is imported into the processing system. First, using the workpiece position information provided by the laser tracker, a simple rigid body transformation algorithm is used to roughly translate and rotate the preliminary three-dimensional topography data so that it is roughly aligned with the preset three-dimensional digital model.

[0058] Based on this, the roughly aligned data will be finely adjusted according to the vibration data collected by the accelerometer. For example, if periodic vibration is detected in a certain direction, the corresponding filtering or compensation algorithm will be applied to fine-tune the topography data in that direction to eliminate local deviations caused by vibration, thereby obtaining the target's three-dimensional topography data.

[0059] Next, key geometric features, such as the center point and edge lines of precision holes, and the normal vectors of planar regions, are automatically extracted from the target 3D topography data and the preset 3D digital model. Then, an improved Iterative Closest Point (ICP) algorithm is used to calculate the precise spatial transformation matrix between the two by matching these geometric features, achieving sub-micron level precise alignment between the target 3D topography data and the preset 3D digital model.

[0060] Finally, based on the precisely aligned data, the distance deviation from each point on the target 3D topography data to the surface of the preset 3D digital model is calculated. By setting a reasonable distance threshold (e.g., 5 micrometers) and combining it with the spatial distribution characteristics of the deviation, it is possible to identify minute topography deviations that do not conform to typical machining defect patterns (such as tool marks or chipping) but exceed the threshold. For example, if a region exhibits a thin film or granular micro-protrusion, and its topography characteristics match the optical response characteristics of pre-stored degraded cutting fluid films or nano-alloy particles, it is identified as a minute deviation that does not belong to actual machining defects, providing a basis for subsequent correction of contaminant parameters.

[0061] In some embodiments, after the step of identifying minute deviations in the preliminary three-dimensional shape data that do not belong to actual processing defects based on the distance deviation between the precisely aligned target three-dimensional shape data and the preset three-dimensional digital model, the method includes: Analyze whether the small deviations match the characteristic patterns of registration residual errors to distinguish between morphological deviations caused by registration errors and contaminants.

[0062] Specifically, the aforementioned minute deviations refer to geometric differences that, while not actual processing defects, still exist after comparing and precisely aligning the preliminary 3D topographic data with the preset 3D digital model. These deviations may stem from various factors, such as inherent errors in the measurement system, environmental disturbances, or incomplete compensation for the influence of contaminants during image correction. Among these, the characteristic patterns of registration residual errors are residual deviation patterns with specific spatial distributions and statistical characteristics, resulting from incomplete and inaccurate alignment of data during 3D data registration due to algorithm limitations, data noise, or imperfect reference models. For example, these patterns may manifest as systematic warping, distortion, or periodic fluctuations in local areas. Topographic deviations caused by contaminants refer to localized protrusions or depressions in the final acquired 3D topographic data that do not match the true topography of the workpiece, caused by the incomplete elimination of the absorption, scattering, or reflection effects of residual contaminants (such as cutting fluid films, nano-alloy particles, etc.) on the workpiece surface. This application aims to effectively distinguish between false deviations caused by registration errors and true morphological deviations caused by contaminants by analyzing whether these minute deviations match the preset registration residual error characteristic pattern.

[0063] The above technical solution significantly improves the accuracy and reliability of optical inspection of machined parts using industrial vision. Specifically, this solution effectively distinguishes between registration residual errors and morphological deviations caused by contaminants, thus avoiding misjudging registration errors as workpiece quality defects and reducing false alarm rates. Simultaneously, it can more accurately identify true morphological deviations caused by contaminants, ensuring a comprehensive assessment of workpiece surface quality and improving detection sensitivity. Therefore, it not only provides more accurate data support for workpiece quality judgment but also helps to optimize processing techniques or cleaning procedures, thereby improving overall manufacturing efficiency.

[0064] In some embodiments, the step of analyzing whether the minute deviation matches the characteristic pattern of the registration residual error to distinguish between the morphological deviation caused by the registration error and contaminants includes: The spatial frequency distribution, amplitude distribution, and spatial continuity characteristics of the minute deviation are extracted to obtain the deviation characteristics; Acquire current thermal deformation status information of the machine tool and tool wear status information; The deviation features are matched with the pre-stored registration residual error feature patterns related to the thermal deformation state information and the tool wear state information to obtain the registration residual error feature pattern matching result. The deviation features are matched with pre-stored pollutant morphology deviation feature patterns related to pollutant type and distribution to obtain pollutant morphology deviation feature pattern matching results. Based on the registration residual error characteristic pattern matching results and the contaminant morphology deviation characteristic pattern matching results, it is determined whether the small deviation is mainly caused by the registration residual error or by the morphology deviation caused by the contaminant.

[0065] Specifically, the spatial frequency distribution of the minute deviations is analyzed by examining the rate of change of the deviations at different spatial scales, for example, through methods such as Fourier transform, to reveal their periodicity or randomness; the amplitude distribution refers to the range of deviation values ​​and their statistical characteristics, such as calculating their mean, variance, and kurtosis, to reflect the severity of the deviations; the spatial continuity characteristics refer to the connectivity or discreteness of the deviations in space, which can be extracted, for example, through connected component analysis, morphological operations, etc., with the aim of comprehensively characterizing the geometric shape and distribution characteristics of minute deviations, providing a rich data foundation for subsequent matching and judgment.

[0066] The thermal deformation status information can be understood as the structural deformation data caused by temperature changes during machine tool operation. For example, it can be monitored in real time by temperature sensors and displacement sensors installed in key parts of the machine tool, and calculated in combination with a pre-established thermal deformation model. The tool wear status information refers to the degree of wear of the cutting edge of the tool during use. For example, it can be obtained through a tool life monitoring system, cutting force sensor or vision inspection system. Its purpose is to provide background information directly related to the machine tool's operating conditions, because these factors are important sources of registration residual errors.

[0067] Specifically, the registration residual error feature pattern is established in advance through a large amount of experimental and simulation data. It includes typical small deviation patterns caused by registration errors under different thermal deformation and tool wear conditions. For example, machine learning models (such as support vector machines and neural networks) or rule-based expert systems can be used for matching. The purpose is to evaluate the similarity between the currently detected small deviation and the known registration error pattern.

[0068] The pollutant morphology deviation feature pattern is obtained in advance through experimental analysis and modeling of pollutants of different types (e.g., degraded cutting fluid films, nano-alloy particles, etc.) and different distributions (e.g., uniform coverage, local aggregation, etc.). For example, pattern recognition algorithms or deep learning models can be used for matching. The purpose is to evaluate the similarity between the small deviation currently detected and the morphology deviation pattern caused by known pollutants.

[0069] In practical applications, this judgment can be based on a comprehensive decision made on the confidence level, similarity score, or probability value of the matching results. For example, a threshold can be set, or methods such as weighted average or Bayesian inference can be used. The purpose is to provide a clear judgment, pointing out the main source of minor deviations, thereby providing an accurate basis for subsequent quality assessment and process optimization.

[0070] Through the above technical solution, this application can significantly improve the accuracy and robustness of identifying the sources of minute deviations on the workpiece surface. By fully considering various geometric features of minute deviations and real-time machine tool operating information, and matching them with the characteristic patterns of registration residual error and contaminant morphology deviations respectively, it can more accurately distinguish morphology deviations caused by system registration errors from those caused by actual contaminants in complex and variable industrial environments. This precise differentiation capability helps avoid misjudging non-machining defects as quality problems, thereby reducing unnecessary rework or scrap, improving detection efficiency and the reliability of product quality judgment, and providing more accurate data support for subsequent processing optimization and quality control.

[0071] In some embodiments, the step of determining whether the minute deviation is caused primarily by registration residual error or by morphological deviation caused by contaminants, based on the registration residual error feature pattern matching result and the contaminant morphology deviation feature pattern matching result, includes: Acquire machine tool operating load information, spindle speed information, feed rate information, and ambient temperature information; The instantaneous fluctuation range of the machining parameters is obtained by evaluating the operating load information, the spindle speed information, the feed rate information, and the ambient temperature information. Based on the instantaneous fluctuation amplitude, the weight of the registration residual error feature pattern matching result is adjusted, and the weight of the pollutant morphology deviation feature pattern matching result is also adjusted. Based on the adjusted weights, determine the initial dominant source of the minor deviation; The spatial distribution of the minute deviation is analyzed to obtain the distribution characteristics of the local area; and based on the distribution characteristics of the local area, the initial dominant source is corrected to obtain the final dominant source of the minute deviation.

[0072] Specifically, the system acquires information on the machine tool's operating load, spindle speed, feed rate, and ambient temperature. This is done through sensors integrated into the machine tool's control system or external monitoring devices, which collect key parameters related to the machine tool's operating status and environmental conditions in real time. These parameters directly reflect the machine tool's operating condition at the moment of detection. For example, operating load information indicates the magnitude of the cutting force, spindle speed and feed rate information reflect the dynamic characteristics of the machining process, and ambient temperature information is closely related to the machine tool's thermal deformation.

[0073] The evaluation of the operating load information, spindle speed information, feed rate information, and ambient temperature information yields the instantaneous fluctuation amplitude of the machining parameters. This can be understood as analyzing these real-time acquired parameters and calculating their instantaneous changes relative to preset stable values ​​or historical averages. For example, the degree of fluctuation of these parameters can be quantified by comparing the current value with the average value or set value over a period of time. These instantaneous fluctuation amplitudes can reflect the stability or abnormal state of the machine tool at the moment of inspection. For example, large load fluctuations may lead to increased machine tool vibration, thereby affecting registration accuracy.

[0074] In practical applications, the weights of the registration residual error feature pattern matching results and the contaminant morphology deviation feature pattern matching results are adjusted based on the instantaneous fluctuation amplitude. This dynamically adjusts the importance of the matching results for registration residual error and contaminant morphology deviation when determining the dominant source of minor deviations, according to the instantaneous fluctuation amplitude of the processing parameters. For example, when a large spindle speed fluctuation is detected, the weight of the registration residual error feature pattern matching results can be appropriately increased, as speed fluctuations are more likely to cause registration errors; conversely, if the processing parameters are stable, the weight of the contaminant morphology deviation may be relatively increased. This dynamic weight adjustment makes the judgment process more adaptable and accurate.

[0075] Furthermore, based on the adjusted weights, the preliminary dominant source of the minor deviation is determined. After considering the dynamic weight adjustment, the registration residual error characteristic pattern matching results and the pollutant morphology deviation characteristic pattern matching results are comprehensively evaluated to arrive at a preliminary judgment, namely, which factor is more likely to cause the minor deviation.

[0076] Furthermore, analyzing the spatial distribution of these minute deviations reveals the distribution characteristics of local regions, allowing for more detailed geometric and topological analysis of the initially identified minute deviation areas. For example, information such as the shape, size, orientation, continuity, and relative position of the deviation areas to other deviation areas can be extracted. These local distribution characteristics provide deeper clues because different types of deviations (such as registration errors, which are typically systematic or periodic, while contaminants may exhibit random distribution or specific morphologies) often show significant differences in spatial distribution.

[0077] Therefore, based on the distribution characteristics of the local area, the initial dominant source is corrected to obtain the final dominant source of the minor deviation. By utilizing the fine distribution characteristics of the local area, the preliminary judgment obtained based on dynamic weights is verified and corrected. For example, if the initial judgment is a registration error, but the distribution characteristics of the local area show highly random and irregular speckled patterns, this may be more consistent with the characteristics of pollutants. In this case, the preliminary judgment can be corrected to obtain a more accurate final dominant source.

[0078] Through the above technical solution, this application overcomes the problem of insufficient accuracy in judging the source of minute deviations in complex dynamic machining environments using traditional methods. By acquiring and evaluating the instantaneous fluctuation amplitude of machine tool operating parameters in real time, and dynamically adjusting the judgment weights of different deviation sources accordingly, it can adapt to changes in actual working conditions more flexibly and accurately. Furthermore, by combining detailed analysis of the local distribution characteristics of minute deviations, the initial judgment is further corrected, greatly improving the accuracy and robustness of distinguishing residual errors in precision and the morphological deviations of contaminants. This not only helps avoid misjudging contaminants as machining defects or vice versa, thereby reducing unnecessary rework or scrap, but also provides more precise guidance for subsequent process optimization or equipment maintenance, significantly improving the intelligence level and inspection efficiency of optical inspection of machined parts.

[0079] In some embodiments, the step of correcting the initial dominant source based on the distribution characteristics of the local region to obtain the final dominant source of the minor deviation includes: Obtain the material type, specific processing parameters, and spatial location of the detection point on the workpiece currently being processed; Based on the distribution characteristics of the local region, its morphology, texture, and edge information are extracted at different spatial scales; Based on the material type, specific processing parameters, and the spatial position of the detection point on the workpiece, a set of features containing multiple superimposed deviation modes that match the current working condition is selected from the preset deviation mode library. The extracted morphology, texture, and edge information are matched with each overlay deviation pattern in the feature set to obtain the matching degree of each overlay pattern. Based on the matching degree of each superposition mode, and the weighted influence of the material type, specific processing parameters, and the spatial position of the detection point on the workpiece on each superposition mode, the probability that the distribution characteristics of the local area are dominated by registration residual error or by contaminant morphology deviation is calculated; and based on the probability, and in conjunction with the initial dominant source, the initial dominant source is corrected to obtain the final dominant source of the minor deviation.

[0080] Specifically, in the process of correcting the initial dominant source, it is first necessary to obtain the material type used in the current machining of the workpiece, the specific machining process parameters, and the spatial location of the detection point on the workpiece. The material type can be understood as the physical and chemical properties of the workpiece, such as steel, aluminum alloy, and ceramics, which affect the workpiece's response to light and the types of defects that may arise. Specific machining process parameters refer to the various parameters set during machining, such as cutting speed, feed rate, depth of cut, coolant type and flow rate, etc. These parameters directly affect machining quality and the potential introduction of contaminants or deformations. The spatial location of the detection point on the workpiece refers to the specific coordinates or area identifier of the currently detected area within the entire workpiece geometry model; different locations may be affected by different machining stresses or environmental influences. This information can be obtained through data interaction with the machine tool control system, production management system, or CAD / CAM system, with the aim of providing accurate contextual information for subsequent deviation pattern matching.

[0081] Furthermore, considering the distribution characteristics of the aforementioned local areas, it is necessary to extract their morphological, textural, and edge information at different spatial scales. Morphological information refers to the geometric shape, size, and contour features of the deviation area; textural information refers to the variation patterns of the fine surface structures of the deviation area, such as roughness and periodic patterns; edge information refers to the boundary features between the deviation area and the surrounding normal area. These features can be extracted using multi-scale image processing techniques, such as wavelet transform, Gabor filters, and morphological operators, to capture deviation details at different granularities, aiming to comprehensively characterize the visual representation of minute deviations.

[0082] Based on this, according to the aforementioned material type, specific processing parameters, and the spatial location of the detection point on the workpiece, a set of features containing multiple superimposed deviation patterns is selected from a pre-set deviation pattern library to match the current working condition. The deviation pattern library is a pre-established database that stores typical morphological deviation patterns and their corresponding feature sets caused by registration residual errors and various contaminants (such as degraded cutting fluid films, nano-alloy particles, etc.) under different materials, processing techniques, and workpiece positions. Selecting a feature set that matches the current working condition means dynamically filtering out the most relevant deviation patterns for comparison based on the current production environment and workpiece characteristics, aiming to improve the accuracy and efficiency of the matching.

[0083] Subsequently, the extracted morphological, texture, and edge information are matched with each overlay deviation pattern in the aforementioned feature set to obtain the matching degree of each overlay pattern. The matching degree can be calculated using various similarity metrics, such as correlation coefficient, Euclidean distance, Mahalanobis distance, or the confidence score of a machine learning-based classifier output, with the aim of quantifying the similarity between the measured deviation and the known deviation pattern.

[0084] Finally, based on the matching degree of each superimposed mode, and the weighted influence of the material type, specific processing parameters, and the spatial position of the detection point on the workpiece on each superimposed mode, the probability that the distribution characteristics of the aforementioned local area are dominated by registration residual error or by contaminant morphology deviation is calculated. Here, the weighted influence refers to the moderating effect of different operating parameters on the manifestation of a specific deviation mode. For example, under specific cutting fluid usage conditions, the weight of contaminant morphology deviation may be higher. By combining the matching degree and the weighted influence, a more accurate probability value can be obtained, indicating the true source of the deviation. Based on this probability, and combined with the aforementioned preliminary dominant source, the preliminary dominant source is corrected to obtain the final dominant source of the aforementioned minor deviation. For example, if initially judged to be a registration error, but probability calculation shows that contaminant morphology deviation is more likely, then it is corrected to be dominated by contaminant morphology deviation.

[0085] Through the above technical solution, this application can significantly improve the accuracy of identifying the source of minor deviations in image data that are not actual processing defects. Specifically, by acquiring and utilizing key information such as the workpiece's material type, processing parameters, and the spatial location of detection points, it can more accurately identify deviation patterns consistent with the current working conditions, avoiding misjudgments caused by changes in working conditions. Multi-scale feature extraction and a probability-based correction mechanism enable the differentiation of deviations that are similar macroscopically but significantly different microscopically, thereby more reliably allocating morphological deviations caused by quasi-residual errors and contaminants. This accurate source identification provides a more reliable basis for subsequent image compensation processing, ensuring that the final acquired target image data more realistically reflects the surface morphology of the workpiece, thus improving the accuracy and reliability of workpiece quality assessment.

[0086] This application also proposes an optical inspection system for machined parts based on industrial vision, such as... Figure 2 As shown, an optical inspection system 100 for machined parts based on industrial vision is disclosed. The system includes: Image acquisition module 10 is used to acquire image data of the workpiece surface under multiple preset spectral bands; The identification module 20 is used to analyze the optical response of each region in the image data and compare it with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence area and type of pollutants in the image data. The influence quantification module 30 is used to determine the degree of influence of the pollutants on the absorption, scattering or reflection of light based on the identified area and type of the pollutants, and to generate the influence distribution information of the pollutants. Image compensation module 40 is used to compensate the area where pollutants exist in the image data according to the influence distribution information using a real-time image correction algorithm, so as to obtain target image data reflecting the surface morphology of the workpiece body. The quality judgment module 50 is used to acquire the three-dimensional shape data of the workpiece based on the target image data; and to compare the three-dimensional shape data with the preset three-dimensional digital model to judge the quality of the workpiece.

[0087] This system integrates an image acquisition module, an identification module, an impact quantification module, an image compensation module, and a quality assessment module, forming a closed-loop automated inspection process. The image acquisition module captures multispectral image data of the workpiece surface, providing raw information for subsequent analysis. The identification module utilizes pre-stored contaminant spectral characteristics to accurately identify contaminant regions and types in the image data. The impact quantification module quantifies the specific influence of contaminants on optical signals based on the identification results. The image compensation module is the core of this system for solving contaminant interference. It uses a real-time image correction algorithm to remove the influence of contaminants from the original image, thereby obtaining target image data reflecting the true morphology of the workpiece. Finally, the quality assessment module reconstructs the three-dimensional morphology of the workpiece based on the corrected image data and compares it with a digital model to accurately assess the workpiece quality. This system aims to overcome the limitations of traditional optical inspection, which is susceptible to contaminant interference, and significantly improve the accuracy and reliability of high-precision mechanical component inspection.

[0088] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for optical inspection of machined parts based on industrial vision, characterized in that, Includes the following steps: Acquire image data of the workpiece surface in multiple preset spectral bands; The optical response of each region in the image data is analyzed and compared with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence and type of pollutants in the image data. Based on the identified location and type of pollutants, the extent to which the pollutants affect the absorption, scattering, or reflection of light is determined, and the distribution information of the pollutant's influence is generated. Based on the influence distribution information, the areas where pollutants exist in the image data are compensated using a real-time image correction algorithm to obtain target image data that reflects the surface morphology of the workpiece. Based on the target image data, obtain the three-dimensional shape data of the workpiece; The quality of the workpiece is determined by comparing the three-dimensional topography data with a preset three-dimensional digital model.

2. The optical inspection method for machined parts based on industrial vision according to claim 1, characterized in that, The step of acquiring image data of the workpiece surface in multiple preset spectral bands includes: By controlling a multispectral light source to emit pulsed light onto the surface of a workpiece according to a preset wavelength sequence, and simultaneously acquiring images of the workpiece surface under the illumination of pulsed light of each wavelength, image data is obtained. The preset wavelength sequence emitted by the multispectral light source includes at least one visible light band and one non-visible light band.

3. The optical inspection method for machined parts based on industrial vision according to claim 1, characterized in that, The step of analyzing the optical response of each region in the image data and comparing it with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence and type of pollutants in the image data includes: For each pixel in the image data, extract its brightness value in each preset spectral band to form the measured spectral response vector of that pixel. The spectral angle matching algorithm is used to calculate the spectral angle between the measured spectral response vector of the pixel and the standard spectral response characteristics of each pre-stored typical pollutant. The spectral angle is compared with the corresponding preset judgment threshold; if the spectral angle between the measured spectral response vector of the pixel and the standard spectral response characteristics of the pre-stored typical pollutant is less than the corresponding judgment threshold, then it is determined that the pollutant exists in the region where the pixel is located.

4. The optical inspection method for machined parts based on industrial vision according to claim 1, characterized in that, The step of compensating the areas where contaminants exist in the image data using a real-time image correction algorithm based on the influence distribution information to obtain target image data reflecting the surface morphology of the workpiece includes: The contributions of the workpiece body, the degraded cutting fluid film, and the nano-alloy particles to the total optical signal were initially separated, and preliminary information on the distribution of contaminant effects was generated. Based on preliminary information on the distribution of pollutants, preliminary compensation processing is performed on the areas where pollutants exist in the image data to obtain image data that preliminarily reflects the surface morphology of the workpiece. Based on the image data that initially reflects the surface morphology of the workpiece, preliminary three-dimensional morphology data of the workpiece is obtained. The preliminary three-dimensional topography data is compared with the preset three-dimensional digital model to identify minor deviations in the preliminary three-dimensional topography data that do not belong to actual processing defects. Based on the minute deviation and the image data, the adjustment amount of the optical response parameters of the degraded cutting fluid film and the nano-alloy particles is deduced in reverse to generate contaminant optical response parameter correction information; and the image data is then subjected to a second optical signal decoupling and image correction using the contaminant optical response parameter correction information to obtain target image data that ultimately reflects the surface morphology of the workpiece.

5. The optical inspection method for machined parts based on industrial vision according to claim 4, characterized in that, The step of comparing the preliminary three-dimensional topography data with a preset three-dimensional digital model to identify minor deviations in the preliminary three-dimensional topography data that do not belong to actual processing defects includes: The position information of the workpiece in the machine tool coordinate system and the vibration state information of the machine tool at the moment of detection are obtained. The preliminary three-dimensional topography data is roughly aligned using the location information, and the preliminary three-dimensional topography data is finely adjusted based on the vibration state information to obtain the target three-dimensional topography data. Extract geometric features from the target 3D topography data and the preset 3D digital model, calculate the spatial transformation relationship between the geometric features, and achieve precise alignment between the target 3D topography data and the preset 3D digital model; Based on the distance deviation between the precisely aligned target 3D topography data and the preset 3D digital model, minor deviations in the preliminary 3D topography data that do not belong to actual processing defects are identified.

6. The optical inspection method for machined parts based on industrial vision according to claim 5, characterized in that, Following the step of identifying minor deviations in the preliminary three-dimensional shape data that do not belong to actual processing defects based on the distance deviation between the precisely aligned target three-dimensional shape data and the preset three-dimensional digital model, the following steps are included: Analyze whether the small deviations match the characteristic patterns of registration residual errors to distinguish between morphological deviations caused by registration errors and contaminants.

7. The optical inspection method for machined parts based on industrial vision according to claim 6, characterized in that, The step of analyzing whether the minute deviation matches the characteristic pattern of the registration residual error, in order to distinguish the morphological deviation caused by registration error and contaminants, includes: The spatial frequency distribution, amplitude distribution, and spatial continuity characteristics of the minute deviation are extracted to obtain the deviation characteristics; Acquire current thermal deformation status information of the machine tool and tool wear status information; The deviation features are matched with the pre-stored registration residual error feature patterns related to the thermal deformation state information and the tool wear state information to obtain the registration residual error feature pattern matching result. The deviation features are matched with pre-stored pollutant morphology deviation feature patterns related to pollutant type and distribution to obtain pollutant morphology deviation feature pattern matching results. Based on the registration residual error characteristic pattern matching results and the contaminant morphology deviation characteristic pattern matching results, it is determined whether the small deviation is mainly caused by the registration residual error or by the morphology deviation caused by the contaminant.

8. The optical inspection method for machined parts based on industrial vision according to claim 7, characterized in that, The step of determining whether the minor deviation is caused primarily by registration residual error or by morphological deviation caused by pollutants, based on the registration residual error feature pattern matching result and the pollutant morphology deviation feature pattern matching result, includes: Acquire machine tool operating load information, spindle speed information, feed rate information, and ambient temperature information; The instantaneous fluctuation range of the machining parameters is obtained by evaluating the operating load information, the spindle speed information, the feed rate information, and the ambient temperature information. Based on the instantaneous fluctuation amplitude, the weight of the registration residual error feature pattern matching result is adjusted, and the weight of the pollutant morphology deviation feature pattern matching result is also adjusted. Based on the adjusted weights, determine the initial dominant source of the minor deviation; The spatial distribution of the minute deviation is analyzed to obtain the distribution characteristics of the local area; and based on the distribution characteristics of the local area, the initial dominant source is corrected to obtain the final dominant source of the minute deviation.

9. The optical inspection method for machined parts based on industrial vision according to claim 8, characterized in that, The step of correcting the initial dominant source based on the distribution characteristics of the local region to obtain the final dominant source of the minor deviation includes: Obtain the material type, specific processing parameters, and spatial location of the detection point on the workpiece currently being processed; Based on the distribution characteristics of the local region, its morphology, texture, and edge information are extracted at different spatial scales; Based on the material type, specific processing parameters, and the spatial position of the detection point on the workpiece, a set of features containing multiple superimposed deviation modes that match the current working condition is selected from the preset deviation mode library. The extracted morphology, texture, and edge information are matched with each overlay deviation pattern in the feature set to obtain the matching degree of each overlay pattern. Based on the matching degree of each superposition mode, and the weighted influence of the material type, specific processing parameters, and the spatial position of the detection point on the workpiece on each superposition mode, the probability that the distribution characteristics of the local area are dominated by registration residual error or by contaminant morphology deviation is calculated; and based on the probability, and in conjunction with the initial dominant source, the initial dominant source is corrected to obtain the final dominant source of the minor deviation.

10. An optical inspection system for machined parts based on industrial vision, characterized in that, The system includes: The image acquisition module is used to acquire image data of the workpiece surface under multiple preset spectral bands. The identification module is used to analyze the optical response of each region in the image data and compare it with the standard spectral response characteristics of pre-stored typical pollutants to identify the presence area and type of pollutants in the image data. The impact quantification module is used to determine the degree of impact of the identified pollutants on the absorption, scattering or reflection of light based on the location and type of the pollutants, and to generate the impact distribution information of the pollutants. The image compensation module is used to compensate the area where pollutants exist in the image data using a real-time image correction algorithm based on the influence distribution information, so as to obtain target image data that reflects the surface morphology of the workpiece. The quality judgment module is used to acquire the three-dimensional shape data of the workpiece based on the target image data; and to compare the three-dimensional shape data with the preset three-dimensional digital model to judge the quality of the workpiece.

Citation Information

Cited By

  • A visual rapid screening method for microbial contamination of plant extracts

    CN122238331A