Research on Optical Sectioning Groove Depth Measurement Method Based on Digital Image Processing
2026-04-06 07:36:49··#1
1 Introduction In the study of non-destructive testing, standard samples are often prepared in advance for testing and calibration of equipment. Standard samples are grooves or holes of a certain specification, and relevant national standards have high requirements for their depth dimensions. There are many methods for measuring groove depth, such as mechanical instrument measurement, ultrasonic measurement, pulse thermography and white light interferometry. Pulse thermography usually uses the time series of thermography to first obtain the peak time and then obtain the groove depth, but this method is not suitable for measuring narrow grooves[1], nor is it suitable for accurately measuring small depth defects[2]. Mechanical instrument measurement usually uses vernier calipers, depth dial indicators or micrometers, which are simple to operate, but the measurement accuracy is not high. Ultrasonic measurement involves setting ultrasonic longitudinal wave transmitting probes and receiving probes at close positions on both sides of the groove. The echo received by the receiving probe contains groove depth information. The depth of the crack is measured according to the propagation time of this echo. This method has high measurement accuracy, but the ultrasonic measurement process is troublesome and has a small range of applications[3]. White light interferometry uses the Michelson optical path structure to generate coherent light and uses a white light source to measure the three-dimensional contour of the object surface. It has the characteristics of high measurement accuracy and high sensitivity, and the test process is fast and accurate. However, this method is not suitable for grooves with relatively rough bottoms [4]. In terms of measuring the depth of narrow and shallow grooves with relatively rough bottoms, the above measurement method is greatly limited. Nowadays, digital image processing technology is very mature, and the imaging quality of CCD is getting higher and higher. Using optical sectioning and CCD to obtain the image formed by the light band at the groove contour, and then using computer software to process the image, is not only very easy to operate, but also has high measurement accuracy.2. Measurement Principle of Optical Sectioning The main equipment for optical sectioning is a double-tube microscope. The measurement optical path after adding a CCD is shown in Figure 1. The double-tube microscope has two tubes, one for illumination and the other for observation. The axes of the two tubes are 90° apart. The light emitted by the light source 4 is focused into parallel light by the condenser lens 3, and forms a thin light band after passing through the slit 2. After being focused by the objective lens 1, it is projected onto the surface of the workpiece 8 at a 45° angle. The thin light band is perpendicular to the length direction of the groove. The light band is reflected in a direction at a 90° angle to the light source, and is focused by the objective lens 7 and the eyepiece 6 for observation [5]. A CCD 5 is added behind the eyepiece to generate digital images for transmission to the computer for processing. 1—Illumination tube objective lens 2—Slit 3—Condenser lens 4—Light source 5—Camera 6—Observation tube eyepiece 7—Observation tube objective lens 8—Workpiece with narrow groove On the surface of an ungrooved workpiece, the light band imaging is a complete light band. However, after grooving, because the bottom of the groove is not at the same height as the upper surface of the workpiece, the reflected light band formed will be offset from the reflection of the upper surface by a certain distance, and the light band is no longer continuous.[b]3 CCD Image Acquisition[/b] 3.1 CCD Imaging Principle Charge Coupled Device Image Sensor CCD (Charge Coupled Device) is a P (or N) type silicon substrate on which a SiO2 insulating layer (thickness of about 0.1 μm) is generated, and then a series of metal electrodes (gates) with very small gaps (less than 0.3 μm) are deposited on the insulating layer. Each metal electrode and the insulating layer and semiconductor silicon substrate below it form a MOS capacitor. CCD is actually a MOS array composed of a series of MOS capacitors. Since these MOS capacitors are very close to each other, they can be coupled to each other, so that the charge injected into the MOS capacitor can be transferred from one capacitor to another in a controlled manner. This charge transfer process is the charge coupling process [6]. The generated charge is converted into a digital signal by an analog-to-digital converter chip, and then transmitted to the computer. With the help of the computer's processing means, the image is modified as needed. CCD is usually measured in pixels. 3.2 Selection of Light Source CCD application systems can be roughly divided into two types: imaging and detection. Different types have different requirements for lighting sources. The purpose of photography is to record the structure, state and color of the scene in a real way. The light source is usually sunlight or high-power xenon lamp. There are generally two types of detection systems: one is to measure certain characteristic parameters of the object being detected by measuring the image of the object being detected; the other is to determine certain characteristic parameters of the object being detected by measuring the spatial spectrum distribution of the object being detected. For the former, it is sufficient to use incandescent lamp or halogen tungsten lamp as the lighting source; while for the latter, laser illumination should be used, which can meet the requirements of good monochromaticity, good coherence and high beam collimation[7]. In actual measurement, the light obtained by incandescent lamp after passing through a yellow-green filter is used as the light source, which effectively reduces the wavelength range of the light and ensures the illuminance, and the effect is good. 3.3 Image capture After adjusting the light source focus of the double-tube microscope, the eyepiece of the microscope is adjusted, and the imaging quality of the light band is observed with the naked eye. After obtaining a good imaging quality, the camera with CCD is installed and the image is captured. Two images need to be captured before and after, one is the light band image of the intact surface of the workpiece, and the other is the light band image of the groove and the surface of the workpiece next to it. An image of the light band from an electrical discharge machining (EDM) groove was measured. The workpiece was a stainless steel tube with a longitudinal groove (the length of the groove is parallel to the centerline of the steel tube) engraved on its outer cylindrical surface (OD surface). The steel tube was rotated first, and an image was taken of the intact part, as shown in Figure 2(a). This image is the reflected light band from the OD surface of the stainless steel tube, used as a reference for the groove image, making it easier to read the distance between the bottom of the groove and its corresponding surface of the steel tube. The image formed by the reflected light band from the OD surface of the steel tube and the bottom of the groove. (a) Image of the light band on the surface of the steel tube (b) Image of the light band in the groove of the steel tube[b]4 Digital Image Processing[/b] In practical applications, the surface of stainless steel pipes is affected by the smoothness, and the outline of the light band formed is not very clear. Especially due to the electrical discharge machining, the surface roughness at the bottom of the groove is large, and the light band formed at the bottom of the groove is short and blurry. In the case of low image quality, it is necessary to process the obtained image with digital image processing technology to extract the information of interest[8]. 4.1 Image Thresholding Since the image consists of only two parts, light band and dark background, the image can be better processed by thresholding first. The iterative thresholding image segmentation method is selected. First, the histogram gray value is statistically analyzed. The initial threshold is set to 127. The average gray values of the two groups of images with values less than 127 and greater than 127 are calculated respectively. Then, the iterative calculation is performed until the two thresholds are equal. The image is binarized according to the calculated threshold[8]. 4.2 Filtering Filtering makes the image outline smooth and improves the image quality. Median filtering can remove noise in the image and preserve the edges of some objects in the image[9]. The 9×9 median filtering method was selected. After reading the image, the pixel values of each point were obtained in a loop. The pixel values included in the 9×9 window centered on each point were sorted to obtain the median value, which was used to replace the pixel values of each point [8]. 4.3 Convert to grayscale image Convert the color image to grayscale image to facilitate the coarsening process in the next step. The specific processing method is to compare the R, G, and B component values of each pixel and take the maximum value as the grayscale value of the pixel [8]. (a) Light band of OD surface of steel pipe (b) Light band of groove of steel pipe Although the image is relatively clear at this time, the outline is relatively coarse and the edges are not neat, which is not conducive to reading. Therefore, it is necessary to carry out further processing. 4.4 Coarsening process Coarsening process is to obtain the "skeleton" of the image, that is, the central axis of the image outline. First, the grayscale image is complemented by grayscale values, and then the image is refined. That is, a 5×5 structural element is defined first, and the values at each position in the 5×5 structural element are calculated. Starting from the 3rd row and 3rd column, it is determined whether each pixel meets the four conditions for deletion at the same time, and then it is processed in turn [8]. The judgment of whether to delete is executed in a loop until there are no points that can be deleted. (a) Light strip skeleton of steel pipe OD surface (b) Light strip skeleton of steel pipe groove 4.5 Image superposition clearly shows that the light strip image is arc-shaped. In order to facilitate observation of the difference between the bottom image of the groove and the outer surface image of the steel pipe before processing. 4.6 After local magnification, the small black dots above the grid are the bottom image of the groove, and the horizontal line below is the image of the unprocessed part of the steel pipe surface. In order to facilitate reading, the middle part of the image is magnified by one time, and then a grid is added with a division of 6 micrometers/grid.[b]5 Conclusion[/b] In practical applications of grooving depth measurement on stainless steel pipes, this method offers high accuracy, particularly suitable for high-precision measurement of narrow, shallow grooves with a certain degree of roughness at the bottom. It can also be used to measure groove width. With a suitable application program, this method can automate digital image processing, or, if automatic image processing is ineffective, perform manual step-by-step processing. Brightness and contrast adjustments, as well as other filtering processes, can be added as needed. Furthermore, it allows for continuous measurement of the depth of different parts of a single groove while ensuring the smooth movement of the steel pipe, facilitating a complete understanding of the groove depth. By changing the magnification of the microscope, larger groove depths can also be measured.[b]References:[/b] [1] Wang Yongmao, Wang Sashuang, Ma Ning, et al. A new method for pulse thermography detection of defect depth (J). Nondestructive Testing, 2004, 26 (3), 124-126. [2] Wang Yongmao, Guo Xingwang, Li Rihua, et al. Infrared detection of defect size and depth (J). Nondestructive Testing, 2003, 25 (9), 458-461. [3] Wang Yafeng. Nondestructive measurement method of crack depth (J). Metrology Technology, 2006, 7, 39-40. [4] Xue Chenyang, Kong Fanhua, Zhang Wendong, et al. Measurement of MEMS deep groove structure using white light interference principle (J). Journal of Sensor Technology (J), 2006, 19 (5). [5] Xie Tiebang, Li Zhu, Xi Hongzhuo. Interchangeability and Technical Measurement (Third Edition) (M). Wuhan: Huazhong University of Science and Technology Press, 1998. [6] Liu Duren et al. Sensor Principles and Application Technology (M). Xi'an: Xi'an University of Electronic Science and Technology Press. 2003. [7] Wang Qingyou et al. CCD Application Technology (M). Tianjin: Tianjin University Press, 2000. [8] Yang Shuying. VC++ Image Processing Programming (2nd Edition) (M). Beijing: Tsinghua University Press, Beijing Jiaotong University Press, 2005. [9] Xia Liangzheng et al. Digital Image Processing (Revised Edition) (M). Nanjing: Southeast University Press, 1999.