An ultra-fine imaging type surface roughness detection method and system based on image analysis technology
By combining the ultra-fine imaging system with resampling and Fourier transform technology, the problem of high-precision non-contact detection of surface roughness in narrow cavities is solved, and efficient and economical surface roughness detection is achieved.
Patent Information
- Application Number
- CN202511071999.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-01
AI Technical Summary
Existing technologies cannot achieve high-precision non-contact detection of surface roughness in narrow cavities, and traditional methods have problems such as complex detection device structure, high environmental requirements, high cost, or the probe cannot enter the narrow cavity.
An ultra-fine imaging system is used for end-face illumination, combined with resampling and extended Fourier transform technology, and image analysis technology is used to identify surface texture features. A neural network model is used to realize surface roughness detection, determine the safe detection distance and perform texture feature preprocessing.
It achieves high-precision non-contact detection of surface roughness in narrow cavities, expands the scope of detection scenarios, reduces hardware requirements, and improves detection efficiency and accuracy.
Smart Images

Figure CN120580227B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of surface roughness detection, and in particular to an ultra-fine imaging surface roughness detection method and system based on image analysis technology. Background Art
[0002] The internal surface roughness of metals is of great significance to the quality and performance of specific products. Currently, the detection of metal surface roughness is mainly divided into contact and non-contact measurement methods. Among them, non-contact measurement methods can be further divided into optical methods (interference method and scattering method, etc.) and machine vision imaging methods.
[0003] The contact measurement method is a method of measuring roughness by using a specific stylus-type detection sensor to directly contact the surface to be measured. It has good stability and excellent measurement accuracy and has been widely used in the workpiece manufacturing field at home and abroad. However, its direct contact with the surface to be measured during the detection process will cause surface damage and wear of the probe itself. In addition, the stylus needs to be perpendicular to the surface to be measured and apply a certain force in a certain direction for scanning. These detection conditions limit its application in the field of roughness detection.
[0004] Among non-contact optical methods, interferometry is the primary method for high-precision surface roughness measurement. Scattering methods are difficult to quantitatively assess surface roughness. Interferometry is based on the principle of white light interference. By analyzing minute variations in the interference fringes formed between the test surface and a reference mirror, it achieves nanometer-level roughness measurement. This method has found widespread application in high-precision manufacturing fields such as semiconductors and optical components. However, the complex optical path structure, strict environmental requirements, and high cost of interferometry limit its widespread application. With the rapid development of computer vision and image processing technologies, the study of the correlation between surface roughness and surface image texture features, and the establishment of a correspondence between images and surface roughness using neural networks, has enabled high-precision surface roughness measurement. This has gradually become a key technique for rapid, automated, nondestructive testing in the machining industry. This technique relies on the high-precision recognition and extraction of roughness feature information from surface texture images, as well as the intelligent recognition and detection capabilities of neural network algorithms. Therefore, if a clear surface texture image can be acquired, surface roughness measurement can be achieved using software algorithms. This detection method has low environmental requirements, is simple and efficient, and has strong applicability for online testing. This technology is particularly useful for detecting the internal surface roughness of deep holes, micro-tubes, and other special applications. Therefore, image-based workpiece surface roughness detection technology provides a promising approach for non-contact roughness detection in special environments and is worthy of further research. Summary of the Invention
[0005] One of the purposes of the present invention is to provide an ultra-fine imaging surface roughness detection method based on image analysis technology to overcome the shortcoming that non-contact surface detection cannot achieve high-precision detection of surface roughness.
[0006] The present invention is implemented through the following technical solution: an ultra-fine imaging surface roughness detection method based on image analysis technology, comprising the following steps: S100, using an ultra-fine imaging system to extend into the interior of a cavity to be detected and close to the inner surface of the cavity to perform a first detection, and using the end face illumination of the ultra-fine imaging system to locally enhance the image of the target area and highlight the roughness texture, and the image sensor of the ultra-fine imaging system to collect the roughness image of the inner surface of the cavity to be detected; S200, resampling the collected roughness image, and then converting the spatial domain signal of the resampled roughness image into a spectral domain signal, that is, amplifying the resampled roughness texture. The spectral domain of the image is localized, so that the sidelobe information of the spectral domain signal can be effectively identified and extracted, thereby obtaining the periodic variation of the texture characteristics of the measured surface; S300, according to the periodic variation of the texture characteristics of the measured surface, controlling the ultra-fine imaging system to perform secondary detection, and performing real-time positioning and safe detection distance determination in the secondary detection; S400, after determining the safe detection distance, collecting the roughness texture image of the measured surface, and then using the extended Fourier transform to perform texture feature preprocessing on the roughness texture image, and inputting the preprocessed texture feature image into the pre-trained surface roughness neural network model, thereby realizing the detection of the roughness of the measured surface.
[0007] Furthermore, the probe size of the ultra-fine imaging system is 0.48 mm to 3 mm.
[0008] Furthermore, resampling is achieved by the following sub-steps: S210, identifying an image I(x, y) with texture feature distribution in the collected roughness image, and flipping the identified image in four directions to obtain an image I inv (x, y), the original image has M×N pixels, and the flipped image has 2M×2N pixels; S220, the flipped image I inv (x,y) is resampled in two dimensions, with each Z f Pixels are sampled and the image I is obtained after resampling. sample (x, y), the pixels of this image are Ms×Ns, where: Ms=round(2M / Z f ), N f =round(2Ns / Z f ), Z f The value of is an integer.
[0009] Furthermore, the spatial domain signal of the resampled roughness image is converted into a spectral domain signal by the following sub-steps: S230, the resampled image I sample (x,y) performs a two-dimensional Fourier transform to obtain the spectrum distribution I fft (fx, fy), take the 1~2 level sidelobe frequency components and perform inverse Fourier transform IFFT to obtain an image with obvious texture features I tex (x, y) is the image to be subjected to feature extraction and feature parameter calculation, which realizes the preprocessing of effective image texture feature extraction.
[0010] Furthermore, real-time positioning and safe detection distance determination include continuously capturing images while the probe of the micro-imaging system is close to the target surface, and calculating the positioning calibration characteristic parameter Cm value corresponding to the captured image based on the captured image combined with the periodic changes in the texture of the surface. When the Cm value of the positioning calibration characteristic parameter has an inflection point, the inflection point is the pre-set safe working distance position for detection by the ultra-fine imaging system.
[0011] Furthermore, the positioning calibration characteristic parameter Cm is obtained by the following steps: S310, firstly, pre-training the neural network model is performed, and the safe working distance Ls between the micro-imaging system probe and the surface to be measured required for detection is selected, and an image is acquired at the pre-selected safe working distance Ls to obtain an image Is(x, y); S320, the image Is(x, y) is subjected to a resampled extended Fourier transform to obtain a spectrum distribution diagram I ffts (f x , f y ) and in the spectrum distribution diagram I ffts (f x , f y ) of the first-order sidelobe region setting the positioning frame Rects; S330, the image continuously collected when the probe of the micro imaging system is close to the target surface is resampled, and then the spectrum distribution diagram of each image continuously collected is extracted I fft_i (f x , f y ) The information in the frequency domain of the positioning frame Rects is extracted and the surface roughness characteristic distribution map I is obtained after the inverse Fourier transform of the extracted information tex_i (x, y); S340, calculate the surface roughness characteristic distribution map I tex_i Each characteristic parameter of the gray-level co-occurrence matrix of (x, y), the average value of each characteristic parameter in the four directions of 0°, 45°, 90° and 135° is used as the characterization value corresponding to the characteristic parameter; S350, calculate the curve of the characterization value of each characteristic parameter changing with the relative object distance, select the curve with an obvious inflection point at the safe working distance Ls, and use the characteristic parameter corresponding to the curve as the working distance positioning calibration characteristic parameter Cm.
[0012] On the other hand, the present invention further provides an ultra-fine imaging surface roughness detection system based on image analysis technology, which includes a first detection unit, a data processing unit, a second detection unit, and a detection and recognition unit.
[0013] Among them, the first detection unit is configured to use an ultra-fine imaging system to extend into the interior of the cavity to be detected and approach the inner surface of the cavity to perform a first detection. The end face illumination of the ultra-fine imaging system is used to locally enhance the image illumination of the target area and thus highlight the roughness texture. The image sensor of the ultra-fine imaging system collects the roughness image of the inner surface of the cavity to be detected. The size of the ultra-fine imaging system is 0.48mm~3mm; the data processing unit is connected to the first detection unit and is configured to resample the collected roughness image, and then convert the spatial domain signal of the resampled roughness image into a spectral domain signal, and then amplify the spectral domain local portion of the resampled roughness image, so that the The sidelobe information of the spectral domain signal can be effectively identified and extracted, thereby obtaining the periodic changes in the texture features of the measured surface; the second detection unit is connected to the data processing unit and is configured to control the ultra-fine imaging system to perform secondary detection based on the periodic changes in the texture features of the measured surface, and perform real-time positioning and safe detection distance determination in the secondary detection; the detection and identification unit is connected to the second detection unit and is configured to collect the roughness texture image of the measured surface after determining the safe detection distance, and then use the resampled extended Fourier transform to preprocess the texture features of the roughness texture image, and input the preprocessed texture features into a pre-trained surface roughness neural network model, thereby realizing the detection of the roughness of the measured surface.
[0014] Furthermore, the data processing unit includes an image recognition subunit, a resampling subunit, and a feature recognition and extraction subunit, wherein the image recognition subunit is configured to recognize an image I(x, y) having a texture feature distribution in the collected roughness image, and flip the recognized image in four directions to obtain an image I inv (x, y), the original image pixels are M×N, and the flipped image is 2M×2N; the resampling subunit is connected to the image recognition subunit and is configured to perform the flipped image I inv (x,y) is resampled in two dimensions, with each Z f Pixels are sampled and the image I is obtained after resampling. sample (x, y), the pixels of this image are Ms×Ns, where: Ms=round(2M / Z f ), N f =round(2Ns / Z f ), Z fThe value of is an integer; the feature recognition and extraction subunit is connected to the resampling subunit and is configured to perform the resampled image I sample (x,y) performs a two-dimensional Fourier transform to obtain the spectrum distribution I fft (fx, fy), take the 1~2 level sidelobe frequency components and perform inverse Fourier transform IFFT to obtain an image with obvious texture features I tex (x, y) is the image to be subjected to feature extraction and feature parameter calculation, which realizes the preprocessing of effective image texture feature extraction.
[0015] Furthermore, the second detection unit includes a positioning presetting subunit, an extended transformation subunit, a feature distribution calculation subunit, a feature parameter calculation subunit, and an inflection point determination subunit, wherein the pre-training subunit is configured to perform pre-neural network model training, select a safe working distance Ls between the micro-imaging system and the surface to be measured required for detection, capture an image at the selected safe working distance Ls, and obtain an image Is(x,y); the extended transformation subunit is connected to the pre-training subunit and is configured to perform an extended Fourier transform on the image Is(x,y) to obtain a spectrum distribution map I ffts (f x , f y ) and in the spectrum distribution diagram I ffts (f x , f y ) of the first-order sidelobe area; the feature distribution calculation subunit is connected to the extended transformation subunit and is configured to perform an extended Fourier transform on the image continuously collected when the micro imaging system probe is close to the target surface, and then extract the spectrum distribution map I of the continuously collected image fft_i (f x , f y ) The information in the frequency domain of the positioning frame Rects is extracted and the surface roughness characteristic distribution map I is obtained after the inverse Fourier transform of the extracted information tex_i (x, y); The characteristic parameter calculation subunit is connected to the characteristic distribution calculation subunit and is configured to calculate the surface roughness characteristic distribution map I tex_i Each characteristic parameter of the gray-level co-occurrence matrix (x, y) is averaged at 0°, 45°, 90°, and 135° as the corresponding characteristic value. The inflection point determination subunit is connected to the characteristic parameter calculation subunit and is configured to calculate a curve showing the variation of the characteristic values of each characteristic parameter with the relative object distance. The curve with a clear inflection point at the safe working distance Ls is selected, and the characteristic parameter corresponding to this curve is used as the positioning calibration characteristic parameter Cm for the working distance. During actual measurement, the positioning calibration parameter Cm value is calculated, and positioning is achieved when a clear inflection point appears.
[0016] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0017] 1. This invention addresses the practical scenario where uniform illumination of the interior of a black cavity is limited by the limited illumination flux and poor imaging resolution, making it impossible to obtain a clear roughness texture feature image. This invention proposes the use of end-face illumination to locally increase the light intensity, thereby highlighting the texture features of the surface roughness. For roughness images caused by extremely uneven illumination and low signal-to-noise ratios, the invention employs a resampled extended Fourier transform method to transform the distribution information of texture features into the frequency domain. By expanding and resampling the spatial domain data, the local information on the spectrum is amplified, allowing for more accurate extraction of effective sidelobe spectrum information. Through an inverse Fourier transform, the roughness texture feature information in the spatial domain can be more clearly and accurately identified and extracted, and the calculation of feature parameters is more capable of characterizing texture features of different levels of roughness.
[0018] 2. The present invention utilizes the ultra-fine imaging system to collect image texture periods that gradually increase as the object distance to the surface to be measured decreases during the process of extending into the cavity and gradually approaching the inner cavity surface, as well as the related changes in the spectrum information within the same frequency band area frame, and then adopts the changes in the values of positioning and calibration feature parameters as a determination method for roughness detection positioning. That is, through resampling and extended Fourier transform, the first-order sidelobe position area frame Rects of the image collected at a preset safe working distance is accurately determined in the frequency domain. After the spectrum of a series of images that change with the relative object distance is extracted within Rects of the same frequency band and converted into a spatial domain image, the representation values of various feature parameters of the image grayscale co-occurrence matrix are used to obtain a trend curve of the representation values of each feature parameter with the relative object distance, and the feature parameters that have sensitive changes near the safe working distance are selected as positioning and calibration parameters to realize automatic identification of relative object distance information and positioning detection of surface roughness.
[0019] 3. This invention expands the scope of application scenarios for surface roughness detection methods based on machine vision images. It proposes the use of a resampled extended Fourier transform to more accurately extract texture information in the frequency domain, providing a promising approach for effectively identifying and extracting image texture features even in situations of poor image quality. Furthermore, without the need for any additional hardware, this invention utilizes the variation of the image's feature distribution with relative detection distance and proposes using the changing trend of the feature representation as a basis for positioning. This results in an economical and effective detection and positioning method, providing a technical approach for automated, digital micro-imaging system-based immersive surface roughness detection within ultra-fine size constraints. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0021] Figure 1 This is a flowchart provided for Example 1 of the present invention.
[0022] Figure 2 This is the collected surface roughness texture map provided in Example 2 of the present invention.
[0023] Figure 3 The embodiment 2 of the present invention provides Figure 2 The merged images after flipping.
[0024] Figure 4 The embodiment 2 of the present invention provides Figure 3 Spectrum after resampling Fourier transform.
[0025] Figure 5 The embodiment 2 of the present invention provides Figure 4 Feature texture map after frequency component extraction and inverse Fourier transform.
[0026] Figure 6 This is a texture map provided by Example 2 of the present invention at different object distances as the distance between the micro-imaging system and the object decreases.
[0027] Figure 7 A curve diagram showing the relationship between the Cm value of the positioning calibration characteristic parameter and the relative object distance provided in Example 2 of the present invention.
[0028] Figure 8 This is a system block diagram provided for Example 3 of the present invention. DETAILED DESCRIPTION
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0030] Example 1
[0031] This embodiment discloses an ultra-fine imaging surface roughness detection method based on image analysis technology.
[0032] There are generally three types of existing metal surface roughness detection technologies. The first is the probe contact method, which uses a probe to contact the surface to be measured to perform roughness detection. This method mainly uses a sharp, tiny probe to move at a certain speed along the direction perpendicular to the surface texture of the workpiece being measured. Since the probe has a certain pressure relative to the workpiece surface, it will move up and down due to the microscopic undulations on the surface. The undulation motion information of the probe is then converted into a data acquisition system through mechanical, optical and electrical conversion to obtain the microscopic undulation data information of the one-dimensional profile of the workpiece surface, and then calculate the surface roughness evaluation parameters Ra and perform corresponding data analysis.
[0033] The second is non-contact optical interferometry, a method for measuring the microscopic topography of a workpiece surface based on the phenomenon of light wave interference. When the light waves emitted by the laser light source are irradiated by the interference microscope system onto the workpiece surface to be measured and then return to the detection system, they interfere with the standard system surface within the interference microscope objective system to form interference fringes. The curvature of the fringes reflects the microscopic uneven roughness of the workpiece surface. Through phase shifting and software algorithms, the three-dimensional data information of the surface roughness fluctuations is calculated, and then the surface roughness evaluation parameters such as Ra are calculated and corresponding data analysis is performed.
[0034] The third method involves surface roughness detection based on machine vision images. This involves illuminating the surface of the workpiece under test with light from a light source. A visual imaging image acquisition device then captures the reflected or scattered light from the surface, generating a texture image containing the workpiece's surface roughness information. By studying the correlation between the surface roughness under test and the texture features of the surface image, and using a large sample set of images with varying levels of roughness, combined with image preprocessing, an optimal neural network prediction model can be designed and trained while ensuring image quality. This neural network model is then used to establish an algorithmic model for correlating surface roughness values (e.g., Ra) with texture image features. In field measurements, surface roughness detection is achieved by capturing clear images of the workpiece's surface roughness and utilizing the neural network algorithm model within the software. The structure, layout, and dimensions of the hardware visual imaging acquisition system in this method are flexible and adaptable. In industry, surface roughness detection within deep holes and crevices in metals is often performed using a combination of machine vision imaging methods.
[0035] In this embodiment, what needs to be solved is the non-contact detection of the surface roughness inside a narrow hole cavity. For this special detection application scenario, in the existing surface roughness detection technology, the contact probe cannot penetrate into the cavity to perform one-dimensional scanning detection; the non-contact interference method not only has a large structure and volume of the entire detection device, but also the microscopic interference lens cannot be inserted into the narrow cavity. The probe insertion detection method based on the micro-imaging system and the surface roughness detection method using machine vision images provide ideas and technical foundations for realizing the detection of surface roughness in narrow cavities. However, in actual applications, for the application requirements of the inner wall surface roughness in a narrow cavity, the outer diameter size of the traditional endoscope is not applicable, and the detection algorithm does not have the corresponding pertinence. Therefore, it is necessary to develop a customized micro-imaging system that matches the surface roughness detection in the cavity.
[0036] The content disclosed in this embodiment is to detect the surface roughness inside a narrow cavity. An ultra-fine imaging system is used to extend into the cavity and detect the inner surface roughness through machine vision imaging method. Figure 1 The micro-imaging surface roughness detection method in this embodiment specifically includes the following steps:
[0037] Step 1: Using an ultra-fine imaging system, the system is inserted into the cavity to be inspected and placed close to the inner surface of the cavity for the first inspection. The end-face illumination of the ultra-fine imaging system is used to locally enhance the image illumination of the target area, thereby highlighting the roughness texture. The image sensor of the ultra-fine imaging system captures a roughness image of the inner surface of the cavity to be inspected.
[0038] Step 2: Resample the collected roughness image, then convert the spatial domain signal of the resampled roughness image into a spectral domain signal, and then amplify the spectral domain part of the resampled roughness image so that the sidelobe information of the spectral domain signal can be effectively identified and extracted, thereby obtaining the texture periodic changes of the measured surface.
[0039] The specific steps include the following:
[0040] The collected image I(x,y) with a certain texture feature distribution is flipped in four directions to obtain image I inv (x,y), the original image pixels are M×N, and the flipped image is 2M×2N.
[0041] Image I inv (x,y) is resampled in two dimensions, with each Z f Pixels are sampled and the image I is obtained after resampling. sample (x,y), the pixels of this image are Ms×Ns, where: Ms=round(2M / Z f ), Nf =round(2Ns / Z f ), Z f The value of is an integer and can be selected according to the actual situation so that the frequency domain can clearly present the 1st to 2nd level sidelobe frequency component information.
[0042] For the resampled image I sample (x,y) performs a two-dimensional Fourier transform to obtain the spectrum distribution I fft (fx, fy), take the 1~2 level sidelobe frequency components and perform inverse Fourier transform IFFT to obtain an image with obvious texture features I tex (x, y) is the image to be subjected to feature extraction and feature parameter calculation, thus realizing effective preprocessing of image texture feature extraction.
[0043] It's important to note that the roughness image information obtained through spectral analysis in this step, particularly the sidelobe information, reveals the characteristics of the surface texture. This also provides a foundation for understanding the periodic variations in texture in the next step. In other words, the spectral feature analysis in this step serves as a reference for the subsequent positioning process, helping determine the safe detection distance in the next step.
[0044] Step 3: As the micro-imaging system probe approaches the surface to be measured, decreasing the relative object distance, real-time image acquisition is performed. The corresponding positioning calibration characteristic parameter, Cm, is calculated in real time. When a clear inflection point appears in the value of Cm, it indicates the set safe working distance for detection, thereby achieving roughness detection and positioning. The determination of the positioning calibration characteristic parameter is primarily based on the fact that the period of the captured image texture changes with the relative object distance from the surface to be measured. The closer to the positioning distance, the richer the corresponding spectral feature information.
[0045] It's important to note that because texture periodicity varies with relative object distance, the spectral signature information is richer near the surface. The spectral information extracted in the previous step can be used to determine the distance between the micro-imaging system and the surface during real-time positioning in this step. In other words, the spectral signatures (such as sidelobe information) extracted in the previous step contribute to the calculation and positioning of the Cm value in this step.
[0046] Specifically, this step may also include the following sub-steps:
[0047] When doing the pre-training of the neural network model, the safe working distance Ls between the micro-imaging system and the surface to be tested is selected, and the image Is(x, y) is collected at this position. The spectrum distribution map I is obtained by the extended Fourier transform method. ffts (f x , f y ), set the positioning box Rects in the first-level sidelobe area.
[0048] The extended Fourier transform is performed on the roughness texture images collected gradually as the relative object distance decreases, and the spectrum distribution diagram of each image I fft_i (f x , f y ), extract information in the frequency domain area of the positioning frame Rects, and obtain the surface roughness feature distribution map I after inverse Fourier transform tex_i (x, y).
[0049] to I tex_i (x, y) calculates each characteristic parameter of the gray level co-occurrence matrix, and the average value of each characteristic parameter in the four directions of 0°, 45°, 90° and 135° is used as the characterization value corresponding to the characteristic parameter.
[0050] Calculate the curve of the relationship between the characterization value of each characteristic parameter and the relative object distance, select the curve with an obvious inflection point at the safe positioning working distance Ls, and the characteristic parameter corresponding to the curve is used as the working distance positioning parameter, that is, the positioning calibration characteristic parameter Cm. During the actual measurement, the positioning calibration parameter Cm value is calculated in real time, and positioning is achieved when an obvious inflection point appears. Step 4: After determining the safe detection distance, collect the roughness texture image of the detected surface, and then use the resampled extended Fourier transform to preprocess the texture features of the roughness texture image, and input the preprocessed texture features into the pre-trained surface roughness neural network model to realize the detection of the roughness of the measured surface.
[0051] Example 2
[0052] This embodiment discloses a specific implementation process of an ultra-fine imaging surface roughness detection method based on image analysis technology of the present invention.
[0053] Step 1: Use a 0.48mm ultra-fine imaging system to probe into the cavity of the sample to be tested, gradually approaching the inner surface of the cavity, and perform the first detection. The end face illumination of the ultra-fine imaging system enhances the local illumination of the target area and highlights the roughness texture. The image sensor of the ultra-fine imaging system collects the texture image I(x, y) of the roughness standard sample. The collected image is as follows: Figure 2 shown.
[0054] Step 2: Perform extended Fourier transform on the texture image I(x, y) and obtain the 2N×2N extended image I by flipping the texture image I(x, y). inv (x, y), Figure 3 Shows the I obtained after the flip operation inv (x, y) image. Then Figure 3 The image in is resampled and a two-dimensional Fourier transform is performed to generate a frequency domain distribution map I fft(fx, fy), such as Figure 4 shown.
[0055] Step 3: According to the frequency domain distribution diagram I fft From (fx, fy), the main 1st and 2nd level side lobes are extracted and two-dimensional inverse Fourier transform is performed to obtain the image Itex(x, y) containing clear texture information, as shown in Figure 5 This is the preprocessed image, ready for feature recognition and feature parameter calculation.
[0056] Step 4: While controlling the micro-imaging system probe to continuously approach the surface to be measured, an image is captured while the relative object distance is reduced. In this embodiment, an image is captured every 0.1 mm reduction in the relative object distance. Figure 6 The five texture images collected in this embodiment as the relative object distance decreases are shown, showing the texture images at different object distances as the distance between the micro imaging system and the object becomes smaller. Figure 6 middle( a )~( e ) shows the texture image as the relative object distance decreases, Figure 6 middle( a ) is the image collected by the micro-imaging system probe at the initial relative object distance, Figure 6 (b) is the image captured by the micro-imaging system probe when the relative object distance is reduced by 0.1 mm compared to the initial distance. Figure 6 (c) is the image captured by the micro-imaging system probe when the relative object distance is reduced by 0.2 mm compared to the initial distance. Figure 6 Middle (d) is the image collected by the micro-imaging system probe when the relative object distance is reduced by 0.3mm compared to the initial distance. Figure 6 Middle (e) is the image captured when the micro-imaging system probe is reduced by 0.4 mm compared to the initial relative object distance.
[0057] Step 5: Spectrum I of all texture images collected every 0.1 mm fft In (fx, fy), information is extracted from the frequency domain region contained in the positioning frame Rects. Then, image I is generated by inverse Fourier transform. tex_i (x, y), and calculate the gray level co-occurrence matrix of each image, thereby calculating the representation value of each characteristic parameter, and obtaining the relationship curve between the representation value of each characteristic parameter and the relative object distance, such as Figure 7 As shown. Figure 7As can be seen in the figure, there is a clear inflection point at the working distance (i.e., relative to the object distance Ls). The characteristic parameter contrast shows a clear trend as the relative object distance changes. Therefore, contrast is used as a positioning indicator for the relative object distance, namely the positioning characteristic parameter Cm. When the contrast Cm value shows a significant decrease, the micro-imaging system's penetration movement can be stopped. By analyzing the trend of the contrast Cm value, the inflection point can be determined, and thus the pre-set working distance suitable for surface roughness testing can be determined.
[0058] Step 6: After determining the safe detection distance, collect the roughness texture image of the surface to be tested, and then use the extended Fourier transform to preprocess the texture features of the roughness texture image. The preprocessed texture features are input into the pre-trained surface roughness neural network model to realize the detection of the roughness of the surface to be tested.
[0059] Example 3
[0060] This embodiment provides an ultra-fine imaging surface roughness detection system based on image analysis technology. Figure 8 The system block diagram of this embodiment is shown in FIG. As can be seen from the figure, this system includes a first detection unit, a data processing unit, a second detection unit and a detection and identification unit.
[0061] The first detection unit is configured to use an ultra-fine imaging system to extend into the interior of a cavity to be inspected and approach the inner surface of the cavity to perform a first inspection. The end face illumination of the ultra-fine imaging system is used to locally enhance the image illumination of the target area and highlight the roughness texture. The image sensor of the ultra-fine imaging system collects the roughness image of the inner surface of the cavity to be inspected. The data processing unit is connected to the first detection unit and is configured to resample the collected roughness image and then convert the spatial domain signal of the resampled roughness image into a spectral domain signal, that is, amplify the spectral domain local portion of the resampled roughness image so that the sidelobe information of the spectral domain signal can be effectively identified and extracted, thereby obtaining the texture periodic changes of the surface to be inspected.
[0062] Specifically, in this embodiment, the data processing unit may include an image recognition subunit, a resampling subunit, and a feature recognition and extraction subunit.
[0063] The image recognition subunit is configured to identify the image I(x, y) with texture feature distribution in the collected roughness image, and flip the identified image in four directions to obtain the image I inv (x,y), the original image pixels are M×N, and the flipped image is 2M×2N.
[0064] The resampling subunit is connected to the image recognition subunit and is configured to perform a reversed image Iinv (x,y) is resampled in two dimensions, with each Z f Pixels are sampled and the image I is obtained after resampling. sample (x, y), the pixels of this image are Ms×Ns, where: Ms=round(2M / Z f ), N f =round(2Ns / Z f ), Z f The value of is an integer.
[0065] The feature recognition and extraction subunit is connected to the resampling subunit and is configured to perform feature extraction on the resampled image I sample (x,y) performs a two-dimensional Fourier transform to obtain the spectrum distribution I fft (fx, fy), take the 1~2 level sidelobe frequency components and perform inverse Fourier transform IFFT to obtain an image with obvious texture features I tex (x, y) is the image to be subjected to feature extraction and feature parameter calculation, which realizes the preprocessing of effective image texture feature extraction.
[0066] The second detection unit is connected to the data processing unit and is configured to control the ultra-fine imaging system to perform secondary detection according to periodic changes in the texture of the surface being detected, and perform real-time positioning and safe detection distance determination in the secondary detection.
[0067] Specifically, in this embodiment, the second detection unit may include a positioning presetting subunit, an expansion transformation subunit, a feature distribution calculation subunit, a feature parameter calculation subunit, and an inflection point determination subunit.
[0068] Among them, the positioning pre-setting subunit is configured to perform pre-neural network model training, select the safe working distance Ls between the micro-imaging system and the surface to be measured required for detection, collect images at the selected safe working distance Ls, and obtain the image Is(x,y).
[0069] The extended transformation subunit is connected to the positioning preset subunit and is configured to obtain a spectrum distribution map I after resampling and extending the image Is(x, y) through Fourier transformation. ffts (f x , f y ) and in the spectrum distribution diagram I ffts (f x , f y )’s first-level sidelobe area sets the positioning box Rects.
[0070] The feature distribution calculation subunit is connected to the extended transformation subunit and is configured to perform extended Fourier transform on the image continuously collected when the micro imaging system probe is close to the target surface, and then extract the spectrum distribution map I of the continuously collected image. fft_i (f x , f y ) The information in the frequency domain of the positioning frame Rects is extracted and the surface roughness characteristic distribution map I is obtained after the extracted information is inversely transformed by Fourier transform. tex_i (x, y).
[0071] The characteristic parameter calculation subunit is connected to the characteristic distribution calculation subunit and is configured to calculate the surface roughness characteristic distribution map I tex_i Each characteristic parameter of the gray level co-occurrence matrix of (x, y) is taken as the average value of the values of each characteristic parameter in the four directions of 0°, 45°, 90° and 135° as the characterization value corresponding to the characteristic parameter.
[0072] The inflection point determination subunit is connected to the characteristic parameter calculation subunit, and is configured to calculate the curve of the characteristic value of each characteristic parameter as the relative object distance changes, select the curve with an obvious inflection point at the safe working distance Ls, and use the characteristic parameter corresponding to the curve as the working distance positioning parameter Cm. During actual measurement, the positioning calibration parameter Cm value is calculated in real time, and positioning is achieved when an obvious inflection point appears. The detection and identification unit is connected to the second detection unit, and is configured to collect the roughness texture image of the detected surface after determining the safe detection distance, and then use the extended Fourier transform to perform texture feature preprocessing on the roughness texture image, and input the preprocessed texture features into the pre-trained surface roughness neural network model, thereby realizing the detection of the roughness of the measured surface.
[0073] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An ultra-fine imaging surface roughness detection method based on image analysis technology, characterized in that: The detection method comprises: S100, using an ultra-fine imaging system to penetrate into the cavity to be inspected and gradually approach the inner surface of the cavity to perform a first inspection, using the end surface illumination of the ultra-fine imaging system to enhance the local illumination of the target area image to highlight the roughness texture, and the image sensor of the ultra-fine imaging system to capture the roughness image of the inner surface of the cavity to be inspected; S200, resampling the roughness image collected in real time, converting the spatial domain signal of the resampled roughness image into a spectral domain signal, and then amplifying a spectral domain portion of the resampled roughness image so that sidelobe information of the spectral domain signal can be effectively identified and extracted, and performing an inverse Fourier transform to obtain a texture periodic variation of the roughness of each measured surface; S300, controlling the ultra-fine imaging system to perform secondary detection based on periodic changes in texture features of the surface being detected, and performing real-time positioning and safe detection distance determination in the secondary detection; S400, after determining the safe detection distance, collecting a roughness texture image of the surface to be detected, then using extended Fourier transform to perform texture feature preprocessing on the roughness texture image, and inputting the preprocessed texture feature image into a pre-trained surface roughness neural network model, thereby realizing roughness detection of the surface to be detected; The real-time positioning and safe detection distance determination in the secondary detection includes continuously capturing images while the micro-imaging system probe is close to the target surface, calculating the value of the real-time positioning calibration characteristic parameter Cm corresponding to the captured image based on the positioning calibration characteristic parameter Cm determined before the actual detection, and when the positioning calibration characteristic parameter Cm value has an inflection point, the inflection point is the corresponding safe working distance for detection by the ultra-fine imaging system. The positioning calibration characteristic parameter Cm is a contrast used as a relative object distance positioning mark.
2. The ultra-fine imaging surface roughness detection method based on image analysis technology according to claim 1, characterized in that: The probe size of the ultra-fine imaging system is 0.48mm~3mm.
3. The ultra-fine imaging surface roughness detection method based on image analysis technology according to claim 1, characterized in that: The resampling is achieved through the following sub-steps: S210, identifying an image I(x, y) with texture feature distribution in the collected roughness image, and flipping the identified image in four directions to obtain an image I inv (x, y), the original image pixels are M×N, and the flipped image is 2M×2N; S220, the flipped image I inv (x,y) is resampled in two dimensions, with each Z f Pixels are sampled and the image I is obtained after resampling. sample (x, y), the pixels of this image are Ms×Ns, where: Ms=round(2M / Z f ), N f =round(2Ns / Z f ), Z f The value of is an integer; S230, resampled image I sample (x,y) performs a two-dimensional Fourier transform to obtain the spectrum distribution I fft (fx, fy), take the 1~2 level sidelobe frequency components and perform inverse Fourier transform IFFT to obtain an image with obvious texture features I tex (x, y) is the image to be subjected to feature extraction and feature parameter calculation, which realizes the preprocessing of effective image texture feature extraction.
4. The ultra-fine imaging surface roughness detection method based on image analysis technology according to claim 1, characterized in that: The positioning calibration characteristic parameter Cm is obtained by the following steps: S310 , first pre-training the neural network model, selecting a safe working distance Ls between the micro-imaging system and the surface to be measured required for detection, capturing an image at the selected safe working distance Ls, and obtaining an image Is(x, y); S320, resample and extend the Fourier transform of the image Is(x,y) to obtain a spectrum distribution diagram I ffts (f x , f y ) and in the spectrum distribution diagram I ffts (f x , f y )'s first-level sidelobe area sets the positioning box Rects; S330, performing a resampled extended Fourier transform on the image continuously acquired when the micro imaging system probe is close to the target surface, and then extracting a spectrum distribution diagram I of the continuously acquired image. fft_i (f x , f y ) The information in the frequency domain of the positioning frame Rects is extracted and the surface roughness characteristic distribution map I is obtained after the extracted information is inversely transformed by Fourier transform. tex_i (x, y); S340, calculating the surface roughness characteristic distribution map I tex_i Each characteristic parameter of the gray level co-occurrence matrix of (x, y) is calculated by taking the average value of each characteristic parameter in the four directions of 0°, 45°, 90° and 135° as the corresponding characterization value of the characteristic parameter; S350. Calculate the curve of the characterization value of each characteristic parameter as it changes with the relative object distance, select the curve with an obvious inflection point at the safe working distance Ls, and use the characteristic parameter corresponding to the curve as the working distance positioning calibration characteristic parameter Cm.
5. The ultra-fine imaging surface roughness detection method based on image analysis technology according to claim 4, characterized in that: The real-time positioning calibration characteristic parameter Cm value is obtained by the following steps: S360, performing extended Fourier transform on the images continuously acquired when the micro-imaging system probe is close to the target surface, and then extracting the spectrum distribution diagram I of the continuously acquired images. fft_i (f x , f y ) The information in the frequency domain of the positioning frame Rects is extracted and the surface roughness characteristic distribution map I is obtained after the inverse Fourier transform of the extracted information tex_i (x, y); S370, calculating the surface roughness characteristic distribution map I tex_i The average value of the positioning calibration feature parameter Cm of the gray level co-occurrence matrix of (x, y) in the four directions of 0°, 45°, 90° and 135° is the value of the positioning calibration feature parameter Cm.
6. An ultra-fine imaging surface roughness detection system based on image analysis technology, characterized in that: The detection system includes a first detection unit, a data processing unit, a second detection unit and a detection and identification unit, wherein: The first detection unit is configured to use an ultra-fine imaging system to extend into the cavity to be inspected and approach the inner surface of the cavity to perform a first inspection, and to locally enhance the image illumination of the target area through end-face illumination of the ultra-fine imaging system to highlight the roughness texture, and the image sensor of the ultra-fine imaging system collects a roughness image of the inner surface of the cavity to be inspected; The data processing unit is connected to the first detection unit and is configured to resample the collected roughness image and then convert the spatial domain signal of the resampled roughness image into a spectral domain signal, that is, amplify the spectral domain part of the resampled roughness image so that the sidelobe information of the spectral domain signal can be effectively identified and extracted, thereby obtaining the periodic variation of the texture characteristics of the measured surface; The second detection unit is connected to the data processing unit and is configured to control the ultra-fine imaging system to perform secondary detection according to periodic changes in the texture characteristics of the surface being detected, and perform real-time positioning and safe detection distance determination in the secondary detection; The detection and recognition unit is connected to the second detection unit and is configured to collect a roughness texture image of the detected surface after determining the safe detection distance, then use extended Fourier transform to preprocess the texture feature of the roughness texture image, and input the preprocessed texture feature image into a pre-trained surface roughness neural network model to detect the roughness of the detected surface; The real-time positioning and safe detection distance determination in the secondary detection includes continuously capturing images while the micro-imaging system probe is close to the target surface, calculating the value of the real-time positioning calibration characteristic parameter Cm corresponding to the captured image based on the positioning calibration characteristic parameter Cm determined before the actual detection, and when the positioning calibration characteristic parameter Cm value has an inflection point, the inflection point is the corresponding safe working distance for detection by the ultra-fine imaging system. The positioning calibration characteristic parameter Cm is a contrast used as a relative object distance positioning mark.
7. The ultra-fine imaging surface roughness detection system based on image analysis technology according to claim 6, characterized in that: The data processing unit includes an image recognition subunit, a resampling subunit and a feature recognition and extraction subunit, wherein: The image recognition subunit is configured to identify an image I(x, y) with texture feature distribution in the collected roughness image, and flip the identified image in four directions to obtain an image I inv (x, y), the original image pixels are M×N, and the flipped image is 2M×2N; The resampling subunit is connected to the image recognition subunit and is configured to perform a reversed image I inv (x,y) is resampled in two dimensions, with each Z f Pixels are sampled and the image I is obtained after resampling. sample (x, y), the pixels of this image are Ms×Ns, where: Ms=round(2M / Z f ), N f =round(2Ns / Z f ), Z f The value of is an integer; The feature recognition and extraction subunit is connected to the resampling subunit and is configured to perform feature extraction on the resampled image I sample (x,y) performs a two-dimensional Fourier transform to obtain the spectrum distribution I fft (fx, fy), take the 1~2 level sidelobe frequency components and perform inverse Fourier transform IFFT to obtain an image with obvious texture features I tex (x, y) is the image to be subjected to feature extraction and feature parameter calculation, which realizes the preprocessing of effective image texture feature extraction.
8. The ultra-fine imaging surface roughness detection system based on image analysis technology according to claim 6, characterized in that: The second detection unit includes a positioning presetting subunit, an expansion transformation subunit, a feature distribution calculation subunit, a feature parameter calculation subunit and an inflection point determination subunit, wherein: The positioning presetting subunit is configured to, when performing pre-neural network model training, select a safe working distance Ls between the micro-imaging system and the surface to be measured required for detection, capture an image at the selected safe working distance Ls, and obtain an image Is(x, y); The extended transformation subunit is connected to the positioning preset subunit and is configured to obtain a spectrum distribution map I after resampling and extending the image Is(x, y) through Fourier transformation. ffts (f x , f y ) and in the spectrum distribution diagram I ffts (f x , f y )'s first-level sidelobe area sets the positioning box Rects; The feature distribution calculation subunit is connected to the extended transformation subunit and is configured to perform a resampled extended Fourier transform on the images continuously collected when the micro imaging system probe is close to the target surface, and then extract the spectrum distribution map I of each continuously collected image. fft_i (f x , f y ) The information in the frequency domain of the positioning frame Rects is extracted and the surface roughness characteristic distribution map I is obtained after the extracted information is inversely transformed by Fourier transform. tex_i (x, y); The characteristic parameter calculation subunit is connected to the characteristic distribution calculation subunit and is configured to calculate the surface roughness characteristic distribution map I tex_i Each characteristic parameter of the gray level co-occurrence matrix of (x, y) is calculated by taking the average value of each characteristic parameter in the four directions of 0°, 45°, 90° and 135° as the corresponding characterization value of the characteristic parameter; The inflection point determination subunit is connected to the characteristic parameter calculation subunit and is configured to calculate the curve of the representation value of each characteristic parameter as the relative object distance changes, select the curve with an obvious inflection point at the safe working distance Ls, and use the characteristic parameter corresponding to the curve as the measured working distance positioning calibration parameter Cm. During the actual measurement, the positioning calibration parameter Cm value is calculated in real time, and positioning is achieved when an obvious inflection point appears.
Citation Information
Patent Citations
Inner cavity surface roughness in-situ detection method based on double-point rotary friction
CN111189379A
Method for detecting polishing quality of casting part based on image processing analysis
CN115388817A