A method and system for detecting component surface quality based on machine vision

Based on machine vision detection methods, combined with image pre -processing, outline extract, regional recognition and feature value calculation, the accurate detection of the thickness of the surface oil film of the component, solving the accuracy and efficiency of traditional detection methods, ensuring parts and components Surface quality.

CN119151951BActive Publication Date: 2025-01-28NANCHONG XINYU PRECISION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411663267.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-01-28
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Traditional oil film thickness detection on the surface of parts depends on personnel experience, with low accuracy and low efficiency, resulting in uneven distribution of oil film, affecting the performance and life of parts.

Method used

Adopt a machine visual detection method, obtain the initial image of the components through the camera, perform image pre -processing and outline extraction, combined with regional recognition and feature value calculation, perform surface partitions and oil membrane thickness detection, use three -dimensional interpolation method and interference stripe analysis for analysis of analysis Precision measurement of oil membrane thickness.

Benefits of technology

The accurate detection of the thickness distribution of the surface oil film of the parts and components, improve the efficiency and accuracy of the detection, and timely warn the area where the thickness is not within the threshold range to ensure the surface quality of the parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151951B_ABST
    Figure CN119151951B_ABST
Patent Text Reader

Abstract

The present invention provides a component surface quality detection method and system based on machine vision, which obtains a component initial image through a camera, performs image preprocessing on the component initial image to obtain a component preprocessing image, performs contour extraction through an edge detection algorithm to obtain component contour information, obtains a component surface region group through a region recognition algorithm according to the component contour information, calculates the component surface region group through eigenvalues ​​to obtain a component surface region shape factor, compares the component surface region shape factor with a preset region shape feature threshold to obtain a component surface partition, performs thickness detection on the component surface partition through an oil film detection model to obtain a component global oil film thickness distribution, compares the global oil film thickness distribution of the component surface with a preset thickness threshold range, issues an early warning prompt to a component surface region outside the thickness threshold range, and realizes accurate and efficient component surface quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a component surface quality detection method and system based on machine vision. Background Art

[0002] With the rapid development of modern industrial manufacturing, the performance of parts and components is directly related to the operating efficiency, reliability and service life of the equipment. In the process of parts and components processing, in order to improve the performance of parts and components, a layer of oil film is usually sprayed on its surface. On the one hand, the oil film can reduce the friction between the surfaces of parts and components to extend the service life of parts and components. On the other hand, the oil film prevents oxygen, moisture and particulate matter in the air from directly contacting the parts and components to prevent oxidation and rust, thereby protecting the surface of parts and components. However, the thickness of the oil film on the surface of the parts and components needs to be uniform and should not be too thick or too thin. If the oil film is unevenly distributed, local high pressure will be formed and heat accumulation will affect its performance and life. If the oil film is too thick, it will easily absorb impurities, form sludge and hinder the heat dissipation of parts and components. If the oil film is too thin, the lubrication effect is insufficient and causes wear and scratches. Traditional detection of oil film thickness on the surface of parts and components usually relies on personnel experience and judgment, which is not accurate and inefficient. Therefore, how to accurately and efficiently detect the distribution of oil film thickness on the surface of parts and components after oil injection has become an important means to ensure the surface quality of parts and components. Summary of the invention

[0003] The purpose of the present invention is to provide a method and system for detecting the surface quality of components based on machine vision, so as to solve the problem of poor component quality caused by uneven distribution of oil film thickness on the surface of components.

[0004] To achieve the above object, on the one hand, the present invention provides a method for detecting the surface quality of parts based on machine vision, the method comprising:

[0005] The initial image of the component when it passes through the preset light source irradiation point is obtained by a camera arranged after the injection process, and the initial image of the component is preprocessed to obtain a component preprocessed image. The contour information of the component is obtained by contour extraction based on the component preprocessed image through an edge detection algorithm.

[0006] The component surface area group is obtained by the area recognition algorithm according to the component contour information, the component surface area group is calculated by eigenvalue to obtain the component surface area shape factor, and the component surface area shape factor is compared with the preset area shape feature threshold to obtain the component surface partition.

[0007] The component surface is partitioned and thickness detection is performed through the oil film detection model to obtain the global oil film thickness distribution of the component. The global oil film thickness distribution of the component surface is compared with the preset thickness threshold range, and an early warning prompt is given to the component surface area outside the thickness threshold range.

[0008] Furthermore, the method of obtaining a component surface area shape factor by calculating a component surface area group through a characteristic value, and obtaining a component surface partition by comparing the component surface area shape factor with a preset area shape characteristic threshold comprises:

[0009] Extracts the region perimeter and region area data for each region in a component surface region group.

[0010] The surface area shape factor of the component is obtained by calculating the eigenvalue based on the area perimeter and area. for:

[0011] .

[0012] in It is The perimeter of the component surface area, It is The surface area of ​​the component, It is The surface area form factor of a component.

[0013] The component surface area shape factor of each area is compared with a preset area shape feature threshold, and the component surface area less than the preset area shape feature threshold is marked as a first surface area, and the component surface area greater than the preset area shape feature threshold is marked as a second surface area.

[0014] Furthermore, the oil film detection model includes a first thickness detection model and a second thickness detection model, and the method of partitioning the surface of a component and performing thickness detection through the oil film detection model to obtain a global oil film thickness distribution of the component includes:

[0015] The first surface area is subjected to thickness detection through a first thickness detection model to obtain a first thickness distribution of the component, wherein the first thickness detection model is a mapping relationship between oil film color characteristics and oil film thickness established according to a three-dimensional interpolation method.

[0016] The second surface area is subjected to thickness detection through a second thickness detection model to obtain a second thickness distribution of the component, wherein the second thickness detection model is a mapping relationship between oil film interference fringe characteristics and oil film thickness established based on interference fringe analysis.

[0017] The global oil film thickness distribution is obtained by summarizing the first thickness distribution and the second thickness distribution of components.

[0018] Furthermore, the method of performing thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of a component includes:

[0019] The RGB image of the first surface area is converted into an HSV color space of the first surface area image by color space conversion, and a three-dimensional feature value of each pixel point in the first surface area image in the HSV color space is extracted, wherein the three-dimensional feature value includes a hue feature value, a saturation feature value, and a brightness feature value.

[0020] According to the three-dimensional eigenvalue of the pixel point, a preset number of sample points closest to the three-dimensional eigenvalue in the sample network are selected by the nearest neighbor sampling method to obtain the target sample point; the sample grid is a three-dimensional grid composed of the hue eigenvalue, saturation eigenvalue and brightness eigenvalue of samples of different oil film thicknesses collected according to historical experimental data.

[0021] The grid distance from the pixel point to the target sample point is obtained based on the three-dimensional feature value of the pixel point and the target sample point for:

[0022] .

[0023] in They are the hue characteristic value, saturation characteristic value, and brightness characteristic value of the pixel point. They are The hue characteristic value, saturation characteristic value, and brightness characteristic value of the target sample point are From pixel to The grid distance of each target sample point.

[0024] Get the target sample point weight according to the grid distance from the pixel point to the target sample point for:

[0025] .

[0026] in is the total number of target sample points of pixels, It is Target sample point weight.

[0027] According to the target sample point weight and the target sample point oil film thickness, the pixel point oil film thickness is obtained as follows:

[0028] .

[0029] in It is The oil film thickness at each target sample point is is the oil film thickness at the pixel.

[0030] The first thickness distribution of the component is obtained by traversing the oil film thickness at each pixel point in the first surface area.

[0031] Furthermore, the method of performing thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of a component includes:

[0032] The wavelength band of the light source is adjusted to a preset wavelength band, the light source is vertically irradiated to the second surface area through a beam splitter, and an interference fringe image of the second surface area is obtained through a camera.

[0033] An interference fringe profile image is obtained by using a Canny algorithm according to the interference fringe image of the second surface area, and the interference fringe profile image is binarized to obtain an interference fringe binarization image.

[0034] The interference fringe binary image is Fourier transformed to obtain the interference fringe frequency domain image, and the oil film thickness is calculated based on the frequency characteristics of the interference fringe frequency domain image. for:

[0035] .

[0036] in is the wavelength of the light source, is the refractive index of the oil film, is the frequency point in the interference fringe frequency domain diagram The spatial frequency, is the frequency point in the interference fringe frequency domain diagram The corresponding oil film thickness.

[0037] The second thickness distribution of the component is obtained by converting and mapping the oil film thickness corresponding to each frequency point in the interference fringe frequency domain diagram to the second surface area.

[0038] Furthermore, the method of binarizing the interference fringe profile image to obtain the interference fringe binary image includes:

[0039] The interference fringe contour image is grayed to obtain the interference fringe grayscale image.

[0040] The areas in the interference fringe grayscale image with brightness values ​​higher than a preset brightness threshold are set to white, and the areas with brightness values ​​lower than the preset brightness threshold are set to black to obtain an initial binary image.

[0041] The initial binary image is corroded to obtain a binary image with noise removed, and the binary image with noise removed is expanded to obtain an interference fringe binary image.

[0042] Furthermore, the method of converting and mapping the oil film thickness corresponding to each frequency point in the interference fringe frequency domain diagram to the second surface area to obtain the second thickness distribution of the component includes:

[0043] According to the frequency points in the interference fringe frequency domain diagram, the frequency information of the frequency points is converted into spatial domain information by inverse Fourier transform to obtain the spatial distribution area corresponding to the frequency points in the second surface area.

[0044] The multiple spatial distribution areas corresponding to the same frequency point are taken as the same periodic characteristic area group and the same periodic characteristic area group is assigned with a value according to the oil film thickness corresponding to the frequency point in the interference fringe frequency domain diagram to obtain an area group with thickness data.

[0045] The area groups with thickness data corresponding to each frequency point are summarized to obtain the complete thickness distribution of the second surface area of ​​the component as the second thickness distribution of the component.

[0046] Based on the same inventive concept, the present invention provides a component surface quality inspection system based on machine vision, the system comprising: an image preprocessing module, a surface partitioning module, and an oil film detection module, the image preprocessing module, the surface partitioning module and the oil film detection module being connected in sequence.

[0047] The image preprocessing module is used to obtain the initial image of the component when the component passes through the irradiation point of a preset light source through a camera arranged after the injection process, perform image preprocessing on the initial image of the component to obtain a preprocessed image of the component, and perform contour extraction based on the preprocessed image of the component through an edge detection algorithm to obtain component contour information.

[0048] The surface partitioning module is used to obtain a component surface area group through an area recognition algorithm according to the component contour information, obtain a component surface area shape factor through eigenvalue calculation of the component surface area group, and compare the component surface area shape factor with a preset area shape feature threshold to obtain the component surface partition.

[0049] The oil film detection module is used to partition the surface of the component and perform thickness detection through the oil film detection model to obtain the global oil film thickness distribution of the component, compare the global oil film thickness distribution of the component surface with a preset thickness threshold range, and issue an early warning prompt for the component surface area outside the thickness threshold range.

[0050] Furthermore, the oil film detection module includes: a first thickness detection module, a second thickness detection module, a thickness distribution integration module, and a quality warning module. The first thickness detection module and the second thickness detection module are respectively connected to the thickness distribution integration module, and the thickness distribution integration module is connected to the quality warning module.

[0051] The first thickness detection module is used to perform thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of the component. The first thickness detection model is a mapping relationship between oil film color characteristics and oil film thickness established according to a three-dimensional interpolation method.

[0052] The second thickness detection module is used to perform thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of the component. The second thickness detection model is a mapping relationship between oil film interference fringe characteristics and oil film thickness established based on interference fringe analysis.

[0053] The thickness distribution integration module is used to summarize the first thickness distribution of the component and the second thickness distribution of the component to obtain the global oil film thickness distribution.

[0054] The quality warning module is used to compare the global oil film thickness distribution on the surface of the component with a preset thickness threshold range, and to issue a warning prompt to the surface area of ​​the component outside the thickness threshold range.

[0055] Compared with the prior art, the present invention has the following beneficial effects: the surface partition of parts is realized through edge detection and regional shape factor calculation, and the first surface area is analyzed by the three-dimensional eigenvalue interpolation method in color space and the second surface is analyzed by the frequency domain characteristics of interference fringes to realize oil film thickness partition detection, thereby realizing accurate and efficient surface quality detection of parts as a whole. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 This is a flowchart of a component surface quality detection method based on machine vision according to Embodiment 1 of the present invention;

[0058] Figure 2 This is a schematic diagram of the module composition of a component surface quality inspection system based on machine vision according to Example 2 of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] Example 1: Figure 1 As shown, this embodiment provides a component surface quality detection method based on machine vision, the method comprising:

[0061] S1. Obtain an initial image of a component when it passes through a preset light source irradiation point through a camera arranged after the oil injection process, perform image preprocessing on the initial image of the component to obtain a component preprocessing image, and perform contour extraction based on the component preprocessing image through an edge detection algorithm to obtain component contour information; the camera is used to capture complete information of the surface of the component after oil injection, and can perform refined image capture of the component surface through multi-angle acquisition. The preset light source irradiation point is a multi-band light source set after the oil injection process to provide uniform irradiation. The image preprocessing includes image denoising and enhancement processing, such as using Gaussian blur for image denoising and using histogram equalization for enhancement processing to reduce noise that may be introduced during shooting and improve image clarity. The contour extraction, such as the Canny algorithm, the FindContours algorithm, etc., can achieve component contour extraction.

[0062] S2. Obtain a component surface region group according to the component contour information through a region recognition algorithm, obtain a component surface region shape factor through eigenvalue calculation of the component surface region group, and compare the component surface region shape factor with a preset region shape feature threshold to obtain the component surface partition; the region recognition algorithms such as the contour filling algorithm, the region growing algorithm, the watershed algorithm, etc. can all realize image region group recognition, and the surface region is partitioned by evaluating the region complexity through calculating the component surface region shape factor, so that different regions can be processed differently later.

[0063] S3. Partition the surface of the component to perform thickness detection through the oil film detection model to obtain the global oil film thickness distribution of the component, compare the global oil film thickness distribution of the component surface with the preset thickness threshold range, and issue an early warning prompt for the component surface area outside the thickness threshold range.

[0064] It should be noted that the method of obtaining the component surface area shape factor by calculating the component surface area group through the eigenvalue, and comparing the component surface area shape factor with a preset area shape feature threshold to obtain the component surface partition includes:

[0065] S21. Extracting the region perimeter and region area data of each region in the component surface region group; the region perimeter data can be obtained using the cv2.arcLength function in the image processing library, and the region area data can be obtained using the cv2.contourArea function in the image processing library.

[0066] S22. Calculate the shape factor of the component surface area based on the area perimeter and area through eigenvalue calculation for:

[0067] .

[0068] in It is The perimeter of the component surface area, It is The surface area of ​​the component, It is The surface area form factor of a component.

[0069] S23, comparing the component surface area shape factor of each area with a preset area shape feature threshold, marking the component surface area less than the preset area shape feature threshold as a first surface area, and marking the component surface area greater than the preset area shape feature threshold as a second surface area. The first surface area is a simple area, and the second surface area is a complex area.

[0070] It should be noted that the oil film detection model includes a first thickness detection model and a second thickness detection model. The method of partitioning the surface of a component and performing thickness detection through the oil film detection model to obtain the global oil film thickness distribution of the component includes:

[0071] S31. Performing thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of the component, wherein the first thickness detection model is a mapping relationship between oil film color characteristics and oil film thickness established according to a three-dimensional interpolation method.

[0072] S32, performing thickness detection on the second surface area using a second thickness detection model to obtain a second thickness distribution of the component, wherein the second thickness detection model is a mapping relationship between oil film interference fringe characteristics and oil film thickness established based on interference fringe analysis.

[0073] S33, summarizing the first thickness distribution of parts and the second thickness distribution of parts to obtain the global oil film thickness distribution. The first thickness detection model can quickly detect the oil film thickness of simple areas. When the area complexity is high, the accuracy of the first thickness detection model will decrease, so the second thickness detection is needed to detect the oil film thickness of complex areas. The partition detection through the first thickness detection model and the second thickness detection model is conducive to achieving efficient detection while ensuring the accuracy of the detection results.

[0074] It should be noted that the method of performing thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of a component includes:

[0075] S311, converting the RGB image of the first surface area into an HSV color space of the first surface area image through color space conversion, extracting three-dimensional eigenvalues ​​of each pixel in the first surface area image in the HSV color space, wherein the three-dimensional eigenvalues ​​include hue eigenvalues, saturation eigenvalues, and brightness eigenvalues.

[0076] S312. According to the three-dimensional eigenvalue of the pixel point, a preset number of sample points closest to the three-dimensional eigenvalue in the sample network are selected by the nearest neighbor sampling method to obtain the target sample point; the sample grid is a three-dimensional grid composed of hue eigenvalues, saturation eigenvalues, and brightness eigenvalues ​​of samples of different oil film thicknesses collected based on historical experimental data.

[0077] S313: Obtaining the grid distance from the pixel point to the target sample point based on the three-dimensional feature value of the pixel point and the target sample point for:

[0078] .

[0079] in They are the hue characteristic value, saturation characteristic value, and brightness characteristic value of the pixel point. They are The hue characteristic value, saturation characteristic value, and brightness characteristic value of the target sample point are From pixel to The grid distance of each target sample point.

[0080] For example, if the hue characteristic value of a pixel in the first surface area is 115, the saturation characteristic value is 155, and the brightness characteristic value is 195, then , when the preset number of sample points is set to 4, the 4 sample points closest to the 3D eigenvalue are selected. , thickness is , sample point 2 , thickness is , sample point 3 , thickness is , sample point 4 , thickness is , then we can calculate , that is, the grid distance from the pixel to the first target sample point is , similarly, , , .

[0081] S314: Obtaining the weight of the target sample point according to the grid distance from the pixel point to the target sample point for:

[0082] .

[0083] in is the total number of target sample points of pixels, It is Target sample point weight.

[0084] For example: Target sample point weight , similarly, , , .

[0085] S315, according to the target sample point weight and the target sample point oil film thickness, the pixel point oil film thickness is obtained as:

[0086] .

[0087] in It is The oil film thickness at each target sample point is is the oil film thickness at the pixel.

[0088] For example: The oil film thickness at this pixel is .

[0089] S316, traversing the oil film thickness of each pixel point in the first surface area to obtain a first thickness distribution of the component.

[0090] It should be noted that the method of performing thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of a component includes:

[0091] S321. Adjust the wavelength band of the light source to a preset wavelength band, and illuminate the second surface area vertically with the light source through a beam splitter, and obtain an interference fringe image of the second surface area through a camera; the preset wavelength band is a wavelength band set according to historical experience for different component materials that can enable the light beam to be clearly captured. For example, for metal components, a wavelength band set to 530nm to 650nm can produce clear interference fringes; the beam splitter is used to divide the light beam into reflected light and reference light to ensure that the two beams overlap to form interference fringes.

[0092] S322, obtaining an interference fringe contour image by using the Canny algorithm according to the interference fringe image of the second surface area, and binarizing the interference fringe contour image to obtain an interference fringe binary image; in the interference fringe binary image, the white area represents the edge of the fringe, and the black area represents the background.

[0093] S323, Fourier transform the interference fringe binary image to obtain an interference fringe frequency domain image, and calculate the oil film thickness based on the frequency characteristics in the interference fringe frequency domain image for:

[0094] .

[0095] in is the wavelength of the light source, is the refractive index of the oil film, is the frequency point in the interference fringe frequency domain diagram The spatial frequency, is the frequency point in the interference fringe frequency domain diagram The corresponding oil film thickness.

[0096] The image is converted from the spatial domain to the frequency domain by Fourier transform. The different thickness of the oil film causes different spacing of the interference fringes, resulting in frequency changes in the frequency domain. Higher frequencies usually correspond to areas with smaller spacing of interference fringes, that is, areas with thicker oil films, while lower frequencies correspond to areas with larger spacing of interference fringes, that is, areas with thinner oil films. For example, when the wavelength of the light source is , oil film refractive index , if there is a point in the frequency domain graph The corresponding frequency is , then the oil film thickness corresponding to the frequency point can be calculated , if there is a point in the frequency domain graph The corresponding frequency is , then the oil film thickness corresponding to the frequency point can be calculated .

[0097] S324, converting and mapping the oil film thickness corresponding to each frequency point in the interference fringe frequency domain diagram to the second surface area to obtain a second thickness distribution of the component.

[0098] It should be noted that the method of binarizing the interference fringe profile image to obtain the interference fringe binary image includes:

[0099] S3221, graying the interference fringe contour image to obtain an interference fringe grayscale image; the grayscale processing method is to calculate the grayscale value of each pixel by weighted averaging the three channels of R, G, and B to obtain the interference fringe grayscale image.

[0100] S3222. Set the areas in the interference fringe grayscale image whose brightness values ​​are higher than a preset brightness threshold to white, and set the areas whose brightness values ​​are lower than the preset brightness threshold to black to obtain an initial binary image; the preset brightness threshold is a brightness value that can separate the interference fringes from the background, set based on historical experience.

[0101] S3223, corroding the initial binary image to obtain a binary image with noise removed, and dilating the binary image with noise removed to obtain an interference fringe binary image. The corrosion process is first performed to remove noise in the image and enhance the sharpness of the fringe edges, and then the dilation process is performed to expand the white area to enhance the continuity of the fringe.

[0102] It should be noted that the method of converting and mapping the oil film thickness corresponding to each frequency point in the interference fringe frequency domain diagram to the second surface area to obtain the second thickness distribution of the component includes:

[0103] S3241. Convert the frequency information of the frequency points in the interference fringe frequency domain diagram into spatial domain information by inverse Fourier transform to obtain the spatial distribution area corresponding to the frequency points in the second surface area.

[0104] S3242, taking multiple spatial distribution areas corresponding to the same frequency point as the same periodic characteristic area group and assigning values ​​to the same periodic characteristic area group according to the oil film thickness corresponding to the frequency point in the interference fringe frequency domain diagram to obtain an area group with thickness data.

[0105] S3243. Summarize the area groups with thickness data corresponding to each frequency point to obtain the complete thickness distribution of the second surface area of ​​the component as the second thickness distribution of the component.

[0106] Embodiment 2: Based on the same inventive concept, Figure 2 As shown, this embodiment provides a component surface quality inspection system based on machine vision, the system includes: an image preprocessing module, a surface partitioning module, and an oil film detection module, and the image preprocessing module, the surface partitioning module and the oil film detection module are connected in sequence.

[0107] The image preprocessing module is used to obtain the initial image of the component when the component passes through the irradiation point of a preset light source through a camera arranged after the injection process, perform image preprocessing on the initial image of the component to obtain a preprocessed image of the component, and perform contour extraction based on the preprocessed image of the component through an edge detection algorithm to obtain component contour information.

[0108] The surface partitioning module is used to obtain a component surface area group through an area recognition algorithm according to the component contour information, obtain a component surface area shape factor through eigenvalue calculation of the component surface area group, and compare the component surface area shape factor with a preset area shape feature threshold to obtain the component surface partition.

[0109] The oil film detection module is used to partition the surface of the component and perform thickness detection through the oil film detection model to obtain the global oil film thickness distribution of the component, compare the global oil film thickness distribution of the component surface with a preset thickness threshold range, and issue an early warning prompt for the component surface area outside the thickness threshold range.

[0110] It should be noted that the oil film detection module includes: a first thickness detection module, a second thickness detection module, a thickness distribution integration module, and a quality warning module. The first thickness detection module and the second thickness detection module are respectively connected to the thickness distribution integration module, and the thickness distribution integration module is connected to the quality warning module.

[0111] The first thickness detection module is used to perform thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of the component. The first thickness detection model is a mapping relationship between oil film color characteristics and oil film thickness established according to a three-dimensional interpolation method.

[0112] The second thickness detection module is used to perform thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of the component. The second thickness detection model is a mapping relationship between oil film interference fringe characteristics and oil film thickness established based on interference fringe analysis.

[0113] The thickness distribution integration module is used to summarize the first thickness distribution of the component and the second thickness distribution of the component to obtain the global oil film thickness distribution.

[0114] The quality warning module is used to compare the global oil film thickness distribution on the surface of the component with a preset thickness threshold range, and to issue a warning prompt to the surface area of ​​the component outside the thickness threshold range.

[0115] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in Embodiment 1 of the method, and will not be elaborated here.

[0116] Finally, it should be noted that: Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting the surface quality of parts based on machine vision, characterized in that: The method comprises: The initial image of the component when the component passes through the irradiation point of the preset light source is obtained by using a camera arranged after the oil injection process, the initial image of the component is image preprocessed to obtain a preprocessed image of the component, and contour information of the component is obtained by extracting contours based on the preprocessed image of the component using an edge detection algorithm; According to the component contour information, a component surface area group is obtained by using a region recognition algorithm, the component surface area group is calculated by eigenvalue to obtain a component surface area shape factor, and the component surface area shape factor is compared with a preset area shape feature threshold to obtain a component surface partition; The component surface is partitioned and thickness detected by the oil film detection model to obtain the global oil film thickness distribution of the component. The global oil film thickness distribution of the component surface is compared with the preset thickness threshold range, and an early warning is given to the component surface area outside the thickness threshold range. The method of calculating the component surface area group by eigenvalue to obtain the component surface area shape factor, and comparing the component surface area shape factor with a preset area shape feature threshold to obtain the component surface partition comprises: Extracting the area perimeter and area data of each area in the component surface area group; The surface area shape factor F of the component is obtained by calculating the characteristic value based on the area perimeter and area. i for: Among them l i is the perimeter of the surface area of ​​the ith component, S i is the surface area of ​​the ith component, F i is the surface area shape factor of the i-th component; Compare the component surface area shape factor of each area with a preset regional shape feature threshold, mark the component surface area less than the preset regional shape feature threshold as a first surface area, and mark the component surface area greater than the preset regional shape feature threshold as a second surface area; The oil film detection model includes a first thickness detection model and a second thickness detection model. The method of performing thickness detection on the surface of a component by partitioning the component through the oil film detection model to obtain the global oil film thickness distribution of the component includes: Performing thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of the component, wherein the first thickness detection model is a mapping relationship between the oil film color feature and the oil film thickness established according to a three-dimensional interpolation method; Performing thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of the component, wherein the second thickness detection model is a mapping relationship between oil film interference fringe characteristics and oil film thickness established based on interference fringe analysis; The first thickness distribution of the components and the second thickness distribution of the components are summarized to obtain the global oil film thickness distribution; The method of performing thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of a component includes: The RGB image of the first surface area is converted into an HSV color space of the first surface area image by color space conversion, and a three-dimensional feature value of each pixel in the first surface area image in the HSV color space is extracted, wherein the three-dimensional feature value includes a hue feature value, a saturation feature value, and a brightness feature value; According to the three-dimensional characteristic value of the pixel point, a preset number of sample points closest to the three-dimensional characteristic value in the sample grid are selected by the nearest neighbor sampling method to obtain the target sample point; the sample grid is a three-dimensional grid composed of hue characteristic values, saturation characteristic values, and brightness characteristic values ​​of samples of different oil film thicknesses collected according to historical experimental data; According to the three-dimensional feature value of the pixel point and the target sample point, the grid distance D from the pixel point to the target sample point is obtained. i for: Among them, (H, E, R) are the hue characteristic value, saturation characteristic value, and brightness characteristic value of the pixel point respectively. i ,e i ,r i ) are the hue feature value, saturation feature value, and brightness feature value of the i-th target sample point, respectively. i is the grid distance from the pixel to the i-th target sample point; The target sample point weight K is obtained based on the grid distance from the pixel point to the target sample point. i for: Where n is the total number of target sample points of the pixel, K i is the weight of the i-th target sample point; According to the target sample point weight and the target sample point oil film thickness, the pixel point oil film thickness is obtained as follows: Where m i is the oil film thickness at the i-th target sample point, M is the oil film thickness at the pixel point; Traversing the oil film thickness of each pixel point in the first surface area to obtain a first thickness distribution of the component; The method of performing thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of a component comprises: Adjust the wavelength band of the light source to a preset wavelength band, vertically illuminate the second surface area with the light source through a beam splitter, and obtain an interference fringe image of the second surface area through a camera; According to the interference fringe image of the second surface area, an interference fringe profile image is obtained by using a Canny algorithm, and the interference fringe profile image is binarized to obtain an interference fringe binarization image; The interference fringe binary image is Fourier transformed to obtain the interference fringe frequency domain image. According to the frequency characteristics in the interference fringe frequency domain image, the oil film thickness H(x,y) is calculated as: Where λ is the wavelength of the light source, μ is the refractive index of the oil film, f(x,y) is the spatial frequency of the frequency point (x,y) in the interference fringe frequency domain diagram, and H(x,y) is the oil film thickness corresponding to the frequency point (x,y) in the interference fringe frequency domain diagram; According to the oil film thickness corresponding to each frequency point in the interference fringe frequency domain diagram, it is converted and mapped to the second surface area to obtain the second thickness distribution of the component; The method for converting and mapping the oil film thickness corresponding to each frequency point in the interference fringe frequency domain diagram to the second surface area to obtain the second thickness distribution of the component includes: According to the frequency points in the interference fringe frequency domain graph, the frequency information of the frequency points is converted into spatial domain information by inverse Fourier transform to obtain the spatial distribution area corresponding to the frequency points in the second surface area; The plurality of spatial distribution regions corresponding to the same frequency point are regarded as the same periodic characteristic region group and the same periodic characteristic region group is assigned values ​​according to the oil film thickness corresponding to the frequency point in the interference fringe frequency domain diagram to obtain a region group with thickness data; The area groups with thickness data corresponding to each frequency point are summarized to obtain the complete thickness distribution of the second surface area of ​​the component as the second thickness distribution of the component.

2. The method for detecting the surface quality of components based on machine vision according to claim 1, characterized in that: The method of binarizing the interference fringe profile image to obtain the interference fringe binary image comprises: The interference fringe contour image is processed into grayscale to obtain the interference fringe grayscale image; The areas with brightness values ​​higher than a preset brightness threshold in the interference fringe grayscale image are set to white, and the areas with brightness values ​​lower than the preset brightness threshold are set to black to obtain an initial binary image; The initial binary image is corroded to obtain a binary image with noise removed, and the binary image with noise removed is expanded to obtain an interference fringe binary image.

3. A component surface quality inspection system based on machine vision, used to execute the method described in any one of claims 1-2, characterized in that: The system comprises: an image preprocessing module, a surface partitioning module, and an oil film detection module, wherein the image preprocessing module, the surface partitioning module, and the oil film detection module are connected in sequence; The image preprocessing module is used to obtain an initial image of the component when the component passes through a preset light source irradiation point through a camera arranged after the oil injection process, perform image preprocessing on the initial image of the component to obtain a component preprocessing image, and perform contour extraction based on the component preprocessing image through an edge detection algorithm to obtain component contour information; The surface partitioning module is used to obtain a component surface area group through a region recognition algorithm according to the component contour information, obtain a component surface area shape factor through characteristic value calculation of the component surface area group, and compare the component surface area shape factor with a preset area shape feature threshold to obtain a component surface partition; The oil film detection module is used to partition the surface of the component and perform thickness detection through the oil film detection model to obtain the global oil film thickness distribution of the component, compare the global oil film thickness distribution of the component surface with a preset thickness threshold range, and issue an early warning prompt for the component surface area outside the thickness threshold range.

4. A component surface quality inspection system based on machine vision according to claim 3, characterized in that: The oil film detection module includes: a first thickness detection module, a second thickness detection module, a thickness distribution integration module, and a quality warning module. The first thickness detection module and the second thickness detection module are respectively connected to the thickness distribution integration module, and the thickness distribution integration module is connected to the quality warning module. The first thickness detection module is used to perform thickness detection on the first surface area through a first thickness detection model to obtain a first thickness distribution of the component, wherein the first thickness detection model is a mapping relationship between the oil film color feature and the oil film thickness established according to a three-dimensional interpolation method; The second thickness detection module is used to perform thickness detection on the second surface area through a second thickness detection model to obtain a second thickness distribution of the component, wherein the second thickness detection model is a mapping relationship between oil film interference fringe characteristics and oil film thickness established based on interference fringe analysis; The thickness distribution integration module is used to summarize the first thickness distribution of the component and the second thickness distribution of the component to obtain the global oil film thickness distribution; The quality warning module is used to compare the global oil film thickness distribution on the surface of the component with a preset thickness threshold range, and to issue a warning prompt to the surface area of ​​the component outside the thickness threshold range.

Citation Information

Patent Citations

  • Oil film thickness analysis device and method based on image recognition

    CN113375569A

  • Intelligent identification and detection method for automatic spraying process of complex parts

    CN113743473A