In-Line Inspection of Pipeline Defects Detection Using Ring-Type Laser

Pipeline plays a vital role in transporting fluids like oils, water, and petrochemical substances for longer distances. Based on the materials they carry, prolonged usage may cause the initiation of defects in the pipeline. These defects occur due to the formed salt deposits, chemical reaction happens between the inner surface and the transferring substance, prevailing environmental conditions, etc. These defects, if not identified earlier may lead to significant losses to the industry. In this work, an in-line inspection system uti-lizes the nondestructive way for analyzing the internal defects in the petrochemical pipeline. This system consists of a pipeline inspection robot having two major units namely the visual inspection unit and the power carrier unit. The visual inspection unit makes use of a ring-type laser diode and the camera. The laser diode serves as a light source for capturing good quality images of inspection. This unit is controlled by the Arduino in the power carrier unit which provides the necessary movement throughout the pipe. The inspected images captured by the camera are further processed with the aid of NI vision assistant software. After applying the processing function parameters provided by this software, the defect location can be clearly visualized with high precision. Three sets of defects are introduced in a Polylactide (PLA) pipe based on its position and angle along the circumference of the pipe. Further, this robot system serves as a real-time interactive image synchronization system for acquiring the inspected images. By comparing the actual and calculated defect size, the error percentage obtained was less than 5%.


Introduction
To transport sources such as petroleum products, oil, and water for long-distance  9, 589-603. in a fast manner, pipelines are majorly preferred due to their reliability and durability [1] [2] [3]. These pipelines are easy to construct and also it is more economical than any other method of transportation. Since these pipelines carry highly flammable substances, they can be easily damaged by the outside environment and other forces which results in the formation of leak holes [4], blockages [5], corrosion [6], and other damages [7] [8] to the pipeline. These damages will pave the way for the occurrence of the disaster which is very harmful to mankind and its surrounding environment. In recent years, several underground chemical pipeline accidents in abroad such as Alabama gasoline disaster in 2016, Kentucky gas explosion in 2019, and local accidents like Kaohsiung gas explosion in 2014, Xizhi's oil spill in 2015, and Yunlin Formosa gas explosion in 2019 grabbed the researcher's attention to focus more on the inspection of pipelines. Because these accidents are caused majorly by leakage of substances due to the leak holes in the pipeline. Therefore, these pipelines, if not properly maintained, are a high risk for the people [9] and also it will lead to major losses [10] to the industry.
For the inspection of pipeline defects where the direct human activities in analyzing those defects are low, many research was focused on an optical inspection system which consists of a Closed-Circuit TV (CCTV) camera fitted on a mobile platform [11] [12]. Thus the stored images from the videotape are analyzed in offline conditions by an engineer. The major drawbacks in analyzing the raw images acquired by the CCTV are 1) poor resolution of the image due to the inconvenient lighting conditions; 2) higher probability of error during the offline assessment by humans; 3) unable to clearly visualize the interiors of the pipe. If the pipelines to be inspected are more, then this approach towards defect detection is a difficult task and also it will lead to a significant increase in the inspection costs. The factors which will affect the inspection time of the pipe are an exorbitant amount of information [13] and the number of defects. Hence, for a heavily damaged pipe, the time of inspection is much longer than the inspection of an intact pipe section [14]. Normally small structural imperfections will initiate pipeline damages. The use of CCTV is not advisable for detecting those imperfections [15]. In some cases, due to the existent blockages, it is more difficult to deploy the camera [16].
In order to overcome these drawbacks, an in-line inspection system called the pipeline robotic inspection system has been proposed in this work. This pipeline robotic inspection will acquire the images of the pipeline by using the camera via a stable light source. By processing those acquired images, the defect location and its properties can be extracted [17] [18] [19] [20]. For acquiring high-quality images of inspection, a ring-type laser diode is preferred as the light source [21] [22]. The robot is designed in such a way that it should have continuous movement throughout the pipeline than the walking mechanism in order to reduce the time consumption of defect detection and if the pipeline profile has some curved geometries, the continuous movement will provide the optimum solution than World Journal of Engineering and Technology the walking mechanism and it is also a more reliable method for examining small defects with high precision.
In this paper, an in-line inspection system utilizing an interactive image synchronization technique has been proposed for identifying the inner defects in the pipeline. This system is well suited to carry out the inspection when there is no fluid flow in the pipe. Since it employs a high precision laser diode, this system can be recommended in analyzing pipeline that requires a high-quality inspection of defects. To generate inspection images, artificial defects were introduced in an eight-inch PLA pipe printed using the 3-D printing technique. With the help of the NI Vision Assistant software, the robot will continuously acquire images by using the light source and camera. Thus, the acquired images are processed by the processing function parameters in the vision assistant system. As a result, the defect location, properties such as the size of defects, the error percentages were tabulated and compared with the actual defect dimensions.

Camera-Based Laser Profiler
For ring-type laser diode, an intensity-based optical inspection system was preferred for the inspection of the defect. As represented in Figure 1(a), the robot is designed in such a way that it consists of two major slots for holding the light source and camera. For this light source, a red-emitting laser diode with a wavelength of 650 nm, working voltage of DC 2.5 -5 V and the power of 0.5 W is used. On the other hand, to acquire the images of inspection, the camera (SJ4000) with the resolution of 2 MP is directly connected to the computer via the USB cable to achieve a real-time interactive image synchronization. The robot is connected with the personal computer (PC) and by using the NI Vision Assistant system, for each movement the images are acquired and processed using the PC. In the case of corroded pipelines, due to the presence of uneven surfaces along the pipeline, there may be chances for the misalignment of the center axis of the camera [23]. To overcome this, a spring suspension system is coupled with the supporting wheels that are mounted on the internal surface of the pipe as shown in Figure 1

Optical Path
The optical path is defined as the path traveled by the light from the laser diode to the pipe wall and back to the camera. In general, the laser light is aligned in such a way that it is coincident with the center axis of the pipe. As in Figure  1(a), the distance between the laser source to the pipe wall (L) and the laser ring illuminated area (A) is obtained by using Equations (1) and (2).
where R is the pipe radius, α 1 and α 2 are the projection angles. The α 1 and α 2 are responsible for defining the distance (L) and width of the laser ring projected on the pipe wall. By increasing the α 2 , the illuminated area (A) also increases accordingly [24]. The above equations are suitable for the ideal case. In some cases, when the laser light is slanted, the center axis of the pipe is not coincident with the laser diode. Due to this misalignment, the circular laser ring can be changed to an oblique shape. Equations (3) and (4) defines the upper and lower bounds for distance L.
where (x 0 , y 0 ) represents the coordinates of the laser light position after misalignment and θ is the angle of misalignment with respect to the center axis [25] [26]. In our setup, there is no coincidence between the pipe center axis and the laser. At the same time, the laser diode is not slanted but the laser diode and the pipe center axis are very close to each other. An adaptive design combined with the respective optics will pave the way for the best inspection results [24].

Image Processing Stages
With the help of LabVIEW NI Vision Assistant software, the acquired images are processed by various processing function parameters (Figures 2(a)-(e)) as follows. First, the acquired raw image is masked for the defined Region of Interest (ROI) for eliminating the unwanted areas in the acquired image. After masking, all the particles in the defined ROI are highlighted using the RGB threshold function. In addition, for obtaining the desired ring profile, the thresholded image is processed using the advanced morphology function and to obtain the smooth edges of the ring profile, the basic morphology function is used. Finally, by using the contour analysis function, defect information such as the size and depth of defects can be obtained.

Design of Pipeline Robot
The frame of the robotic system is fabricated using 3D printing technology. PLA is preferred as the most suitable filament for the 3D printing process [27]. Because it exhibits good mechanical properties which are more efficient during the Fused Deposition Modeling (FDM) process than any other polymer [28] [29] [30]. With the help of Pro/E software, the frame is built according to the dimensions along with the suspension system. The entire robot body is divided into two units. The first unit namely the visual inspection unit consists of the slots for holding the light source and camera. It is connected to the second unit called the power carrier unit via a universal joint. The power carrier unit provides the necessary power for the movement of the robot. It consists of an Arduino UNO, programmed using Sketch software. This program controls the DC motor via the L298N motor control board which provides the axial movement of the robot throughout the pipe. In addition, a rotary encoder (HTR-34-360A-V) is also used in the power carrier unit to record the moving distance of the carrier in the pipeline. Both units have the spring suspension system and supporting rollers to avoid the misalignment of the devices with the center axis and to provide free movement during the inspection. Figure 1(b) shows the prototype model of the proposed robot system. It moves axially into the pipeline along with the detecting unit. The light source is projected onto the inner surface by the ring-type laser, allowing for the clear identification of defects. Raw images were captured in the inspection zone consisting of the defect and non-defect areas. Thus, the captured image was processed with the aid of the NI vision assistant system to identify the defect location.

Types of Defects
Three sets of defects were introduced in an 8-inch diameter PLA pipe as shown in Figure 3. For analyzing the defect characteristics, the PLA pipe is preferred as a substitute for the petrochemical pipeline because it is more convenient to introduce a variety of defects with different parameters and it can be easily fabricated using a 3D printer. The first set consists of an 8 mm diameter hole of various depths as 1, 2 and 4 mm (Figure 3(a)). The second set consists of 5, 7.5 and 10 mm diameter holes of varying depths as 3, 5 and 7 mm as in Figure 3(b). The third set of defects is entirely based on the sources of transportation in the pipeline. If the pipeline transports some chemical substances like petroleum products, after long-term usage there will be a formation of sediment residues in the pipeline. These residues will cause the pipeline wall to rupture due to corrosion.
In order to detect these types of sediment residues, three squared sediments of varying sizes with different heights were created in the pipe. Each squared sediment is located at a certain angle to the other squared sediment as shown in

Results and Discussion
The inner surface of the pipe is irradiated using the ring-type laser. The defects can be easily identified by the changes in the intensity level along the laser ring. In case of small defects (cracks), there will be an increase in the intensity level (bright) at the edges of the defect and for holes, we can observe two forms of intensity changes, an increase in the intensity at the edges of the defect and a drop in intensity at the inside of the defect [26].
For analyzing each set of defects and its characteristics, the NI Vision Assistant software is used for acquiring and processing the images. This software consists of predefined processing function parameters which are very helpful in extracting the defect characteristics. In this, the counter analysis function will provide the distance from counter to template plot which describes the defect. The x-axis in this plot will represent the number of pixels along the circumference of the pipe and the y-axis represents the halo offset distance from the counter to the template.
After processing the acquired images, there will be a drop in intensity in the defect portion when compared with the non-defect portion as in Figure 4(b). To compute the size of the defect, the number of pixels in the defect portion needs to be calculated. In an image, each pixel is represented by its coordinates. If we find the start and end coordinates of the pixel in the defect portion [31], the number of pixels in the defect portion can be calculated by using Equation (5).
Number of pixels in the defect portion where (x 1 , y 1 ) and (x 2 , y 2 ) represent the pixel coordinates at the start and end of the defect.

Calculation of Pixel Resolution
In an image, the resolution is defined as the number of pixels that the image consists of and it also provides the extent of details that can be extracted from an image. Thus, the image resolution and the physical dimensions of the image can be related to determine the quantity of space that each pixel will represent in the image. Equations (6) and (7) are used to calculate the space contributed by each pixel in an image [32]. The pixel can be represented using the pixel width (P w ) and pixel height (P h ).

Fixed Diameter Holes in Various Depths
In the first set, the defects are analyzed based on their position along the circumference of the pipe. For the defect of an 8 mm diameter hole, the required laser ring profiles were obtained (Figure 4(a)) after processing the acquired image with the aid of processing function parameters provided by the NI Vision Assistant software. From the laser ring profile (Figure 4(b)), the defect can be easily visualized because at the defect portion there will be a drop in intensity level than the non-defect portion. For an 8 mm diameter hole of 1 and 2 mm depth, the necessary laser ring profile was detailed in Appendix A. By applying the centroid and caliper function in vision assistant software, the angle of the defect with respect to the circumference of the pipe is displayed in a clockwise manner as in Figure 4(b). The counter analysis function plays a significant role in calculating the number of pixels in the defect portion. This function provides the distance from counter to template plot which is obtained by comparing the counters. The pixel coordinates at the start and end of the defect portion are extracted from the x-axis of this plot ( Figure 5) and the number of pixels in the defect portion is calculated using Equation (5). This pixel can be represented in mm by multiplying with the calculated pixel width. As a result, the size of the defect in mm can be obtained.
The peaks in this plot will represent the halo offset distance (depth of defect) in pixels. From Figures 5(a)-(c), we observe that the peak is slightly increased when the depth of defect is also increased. Since our robot moves in an axial direction throughout the pipe, the camera is unable to capture the actual depth of the defect. Due to this, the obtained peak value which defines the depth of defect is not considered for calculating the actual defect depth. Hence, our research is focused on the calculation of the size of the defect than the depth. Table 1 shows that for an 8 mm diameter hole of varying depths, the pixels in the defect portion are calculated and converted to their respective size in mm and by using the error formula, the error percentage was computed. From the table, by comparing the actual defect and calculated defect values, our robot system provides a very less percentage of error (less than 5%).

Different Diameter Holes of Varying Depths
In the second set, three holes of diameter of 5, 7.5, and 10 mm of varying depths  along the circumference of the pipe were introduced and the defect analysis is carried out as same as the first set. The laser ring profile (Figure 4(d)), the pixels in the defect portion and the error percentage are calculated and tabulated in Table 2. From Figure 6, it can be inferred that when the defect size (hole diameter) is increased, the number of pixels in the defect portion is also increased due to the increase in the intense area (Appendix B) occupied by the defect. Table 2 shows that for different diameter holes, the calculated number of pixels in the defect portion is also increased and thus the obtained pixels are converted to their respective size by multiplying with the pixel width and the error percentage was computed. In the second set also, the error percentage was less than 5%.

Sediment Residues
The third set of defects represents the sediment residues formed due to the transportation of chemical substances. Three squared sediments were created in different sizes of varying height and those sediments were analyzed in the same way as the first set. In the case of sediments, the defect portion occurs inside of the ellipse (Figure 7(b)) which ensures that our robot system can also measure the height of sediments. Because during the axial movement, the robot can detect the sediment size along with the height. After using the counter analysis function, the distance from counter to template plot was obtained for the sediments as shown in Figure 7(c). From the xaxis of this plot, it is observed that the number of pixels in the sediment portion increases with an increase in the sediment size which is due to the increase in the intense area occupied by the sediment. The peaks in this plot also increases with an increase in sediment's height. The respective angle between each sediment is also checked with the existing angle with the help of the caliper function as shown in Figure 7(b). By using P w and P h values, the sediment size, height, and error percentage were calculated and presented in Table 3.

Conclusion
This paper aims to overcome the drawbacks of the raw CCTV footage used for the inspection of pipelines. By using the ring-type laser inline inspection system, we will be able to clearly visualize the interiors of the pipe and the obtained images have better resolution due to the use of laser as a light source. This robot system serves as a real-time interactive image synchronization system for acquiring the inspected images. The processing function parameters provided by the NI Vision Assistant software process the acquired image for calculating the number of pixels in the defect portion. Three sets of defects were analyzed and as a result, this system can accurately measure the size of the defect and in the case of sediment residues, it can measure both the size and height of sediments. Thus, in all sets of defects, the error percentage obtained was less than 5%.