JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 ISSN 2541-6332 | e-ISSN 2548-4281 Journal homepage: http://ejournal.umm.ac.id/index.php/JEMMME Budiono | Inspection on Railroads Quality by using Image Processing Method 111 Inspection on Rail Quality by using Image Processing Method Budionoa, Suwarsonob a,bDepartment of Mechanical Engineering, Engineering Faculty, Universitas Muhammadiyah Malang e-mail: budionoft@umm.ac.id, suwarsono@umm.ac.id Abstract The condition of railroads is the main determinant of train safety. The recent railroads inspection conducted by the mechanic results inaccurate inspection and it cannot be conducted continuously. Therefore, this research develops the inspection by using Image Processing Method. Image processing facilitates and accelerates the measurement of railroads quality. This technique enables the automation of railroads measurement in continuous and faster process. It is as the inspection needs no direct measurement. The image processing conducted in this research uses edge detection method with filter disk 12. For collecting data, this research uses laser line and camera to capture figure of the railroads. Furthermore, the figure data is analyzed by using Matlab software. Output of image processing is graphic of the railroads surface that is analyzed to obtain its quality from its flatness. Result of railroads surface measurement by using image processing is averagely 3.61311 mm height and 55.6000 mm width. It is validated with manual measurement by the result of average height is 3.63 mm and average width is 5.5385 mm. The normal flatness of railroads by using image processing is 0.4488 mm. Inspection by using image processing is feasible as the alternative for substituting the manual process previously conducted. Keywords: edge detection, image processing, railroads flatness, railroads inspection 1. INTRODUCTION Rail is the main infrastructure in the railroad system, where the train will only move on it. It is the identity of train transportation. The railroad guides the train to move from one place to another. Therefore, the railroad inspection is needed to maintain the trip safety. The railroad inspection should be conducted regularly on several aspects and components. This research focuses primarily on the rail, which is made of iron or high- pressured steel. The rail is also containing carbon, manganese, and silicone. The rail is specifically formed to detain the axle load of train moving on it (1). This technique is the development of previous research that uses image processing as the equipment to detect welding edge (2). In the previous research, it was conducted to find out the appropriate method of edge detection to figure out surface condition. Finally, the best method is Disk Method 15 (with radius filter of 15). Therefore, this paper used the disc method, yet the radius is determined in 12 as the rail is not in confined room. It is not like welding surface that the light effect is wider. 2. METHOD The measurement system consists of smartphone camera by specification of 8 MP resolution in 3264 ร— 2448 pixels with capability of autofocus (Lenovo A6000+) and measuring tape laser and level 7.5M (DC) (Krisbow KW0102546). The both are installed for building three axis system. Initially, the tape laser is installed 1800 mm above the rail that it results light field intersecting the rail profile. Meanwhile, the camera is placed behind http://ejournal.umm.ac.id/index.php/JEMMME mailto:budionoft@umm.ac.id mailto:suwarsono@umm.ac.id JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 112 the tape laser to configure the ao angle toward the laser light. Capturing the figure is conducted without changing the camera focus to result desired data. The figures regarded as the data of this research are analyzed. The good rail figures are a1, a2, a3, a4, a5, a8, a9, a10, a15 and a16. The rail with plate figures are a11, a12, a44, a45, a52, a66, a64, a65, a70 and 89. (a) (b) Figure 1. Camera and laser position toward the rail. (a) Side view. (b) Front view of rel Figure 2. Result of experiment (processed data) 3. RESULTS AND DISCUSSION Process of image processing consists of capturing the figure of laser lighting line projected on the surface. The digging of physical location is conducted from the laser beam of the picture. This physical location can be attached to surface profile under the laser line. The laser line projected the light above the rail surface. After reflected from the profile surface, the line contrast is decrease or has change on the wide and form (3). 3.1 Image Processing The surface roughness can blur and spread the laser line reflected (Figure 2). By this reason, the figure should be processed and be extracted to obtain the right information. Cropped figure The original figure has the laser beam on the rail that disturbs the processing because of the unnecessary intensity closes to the intensity of the processed rail surface. Therefore, L a s e r li n e 180 mm Laser beam The laser beam following the rail surface ao 180 mm 105 mm L a s e r li n e Camera 123 mm Object (the rail) JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 113 the figure should be cropped. The cropping process is not changing the intensity, but it change the size of figure. RGB to Grayscale It depends on the purpose of this research. The original figures (figure 2) are extracted to obtain the red color (the laser beam). Furthermore, the figure changed into grayscale (Figure 3). The following equation converts the RGB figure into the grayscale on pixel-to- pixel base. Grayscale value = 0.299R + .587G + 0.114B This equation is obtained from NTSC standard for exposure. The alternative of conversion from RGB to grayscale is the average of: (4) Grayscale value = (R + G + B) / 3 (1) Unsharp Unsharp is conducted to contrast the figure. The purpose is to show up the significant difference and the figure can be processed with median filter. The similarity of unsharp filter is: 1 (๐›ผ+1) [ โˆ’๐›ผ ๐›ผ โˆ’ 1 โˆ’ ๐›ผ ๐›ผ โˆ’ 1๐›ผ 5 ๐›ผ โˆ’ 1 โˆ’๐›ผ ๐›ผ โˆ’ 1 โˆ’ ๐›ผ ] (2) Filter Median The pixel value is replaced by median of the grayscale level in the pixel surrounding. This replacement is based on the distribution of selected grayscale value, for instance, [12, 14, 0, 15, 17, 20, 255, 13, 19] with pixel ranking order of [0, 12, 13, 14, 15, 17, 19, 20, 255 0]. So, the median value is 15, noise is [0, and 255]. Median of the data is the more accurate reflection of the right value when the data is influenced by noise. Filter of the edge detection (with filter disc 12) Filter disc or filter is in the form of circle. This filter is circular from all of sides centered on the pixel would be filtered. Form of the kernel used in image processing is the circular area of constant value surrounded by zero [2, 3]. Syntax on Matlab is special ('Disk', radius). The dot will circle the matrix box and will be back after 2*radius+1. The overview on this method will be clearer on figure 3 (2). Figure 3. The filter disc circuit on filtered matrix JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 114 60 40 20 0 -20 -40 -60 -80 0 100 200 300 400 500 600 700 800 900 1000 Thresholding After the filter process of edge detection, the figure is processed by comparing all gray intensity with the threshold. The threshold is conducted to obtain image separation based on depth value in figure pixel. The next process is easier as the figures under the threshold will be removed (5). Threshold = minimum value + 0.38 (maximum value โ€“ minimum value) (3) Adjusted to the figure, in obtaining the detail data, the value is minimized from 0.38 to 0.25. Control Noise Intensity value of the figure can be controlled to obtain the better result. The disc method 12 is used to remove noise by whitening the figure if in 12 pixel radius it has no black color. On figure 6, we can see the change of the original figure to the seventh step. Determining the center line Figure 4. Determining the center line After this processing, the figure can be analyzed as the contrast between the laser line and the surrounding is clear. The laser beam is represented by the white. From the image processing as the last step (control noise), the top and the bottom edge on the figure is transferred into a graphic. Subsequently, the center line is determined as the graphic representing the laser line (center line). This graphic is, furthermore, regarded as data to be analyzed to find out the rail flatness (6). Graphic 1. The rail height Center line Top edge Bottom edge JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 115 Figure 5. Result of each image processing from the original figure to control noise 3.2 Software Calibration The comparison of pixel distance and the real condition is the basic that should be recognized in order to give the right measurement for data processing and it can be presented in mm. After this process, it is used to calibrate the software. Data calibration is depicted on table 1. The x1 point is the left side of sample, while x2 is the right side. Point y1 is the laser point on the sample and y2 is the laser beam on the flat desk. The difference between x2 and x1 (the blue line) is the sample width, while the difference between y2 and y1 (the green line) is the sample height. Their result is, furthermore, divided by the real size to determine the difference. This description is clearly illustrated with Figure 6. Figure 6. Data processing calibration Table 1. Software Calibration No Data Width Height Pixel distance (P) Real distance (mm) Difference (pixel/mm) (Figure) x1 x2 y1 y2 Width Height Width Height Width Height 1 k119 139 395 143 177 256 34 14 1,63 18,2857 20,8589 2 k111 267 933 163 186 666 23 35,7 1,21 18,6555 19,0083 3 k11 1330 2110 1135 1141 780 6 39,15 0,3 19,9234 20 4 k90 1540 1680 1060 1215 140 155 8,57 8,51 16,3361 18,2139 5 k0 1560 1700 1055 1215 140 160 8,74 8,61 16,0183 18,583 6 k110 1250 1860 1417 1423 610 6 34,15 0,31 17,8624 19,3548 7 k4 1285 1855 1162 1168 570 6 28,85 0,33 19,7574 18,1818 Average 17,9795 18,8667 Original figure Cropped to Edge detection filter (disc 20) Cropped The determination of X and Y JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 116 Data on table 1 concludes that: 1 mm horizontal = 17,9795~ 18 pixel. 1 mm vertical = 18,8667 ~19 pixel. a) 3D graphic of the rail height b) Graphic of rail surface Figure 7. Plot 3 dimension of good rail graphic 3.3 Software Validation To figure out the software validity in processing the data, this research used the data obtained manually to compare the processed data to image processing. Table 2. Validity between software measurement and manual Measurement of image processing Manual measurement Validity Error No Rail Data Width Height Width Height Width Height Width Height (Figure) (pixel) (mm) (pixel) (mm) (mm) (mm) (%) (%) (%) (%) 1 a1 1014 56,3333 68 3,789 55,65 3,9 99,61331 99,5347 0,38669 0,4653 2 a2 998 55,4444 68 3,5789 55,65 3,6 3 a3 1009 56,0556 66,5 3,5 54,7 3,35 4 a4 1002 55,6667 63,5 3,3421 54,95 3,35 5 a5 1005 55,8333 69 3,6316 54,65 3,8 6 a8 1004 55,7778 68,5 3,6053 55,65 3,8 7 a9 995 55,2778 67 3,5263 55,65 3,6 8 a10 994 55,2222 76,5 4,0263 55,85 3,3 9 a15 991 55,0556 64 3,3684 55,25 3,7 10 a16 996 55,3333 71,5 3,7632 55,85 3,9 Average 55,6 3,61311 55,385 3,63 Validity of width = 99.61331 % and height = 99.5347 %. 3.4 The rail flatness Obtaining the rail flatness, the 10 data are needed. Furthermore, it can be determined the axis between Y(x=n/2) of the first data and Y(x=n/2) of the last data. Therefore, โˆ is obtained. Tangent ๐›ผ is used to correct the Y value of flat surface (Y(x=2mm) to Y(x=n)) as the previous surface is curved. The farthest deviation of all Y values will be used as the rail flatness value. JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 117 Table 3. The flatness value of straight rail in image processing No. Normal rail Broken rail Rail data (Figure) Maximum deviation (mm) Flatness value (mm) Rail data (Figure) Maximum deviation (mm) Flatness value (mm) 1 a1 0,4488 0,4488 a1 0,4488 5,8443 2 a2 0,3159 a2 0,3159 3 a3 0,3699 a3 0,3699 4 a4 0,3949 a4 0,3949 5 a5 0,4476 a64 4,6065 6 a8 0,2911 a65 5,8443 7 a9 0,3158 a66 5,7128 8 a10 0,3421 a10 0,3421 9 a15 0,4472 a15 0,4472 10 a16 0,2124 a16 0,2124 Table 4. The comparison of broken and normal rail surface No Data 1 Normal rail Surface 3D graphic 2 Broken rail Surface 3D graphic 4. CONCLUSION The comparison between pixel on the figure and the size of the real object is 18 pixel/mm to horizontal and 19 pixel/mm to vertical. Software validity toward manual measurement is 99,61331 % on the width of the rail surface and on the height of the rail surface is 99,5347 %. It gives information that image processing in this research is feasible to be alternative to substitute the manual inspection as nowadays conducted. As the manual measurement cannot be predicted on its validity, it may be obtained smaller during manual measurement, 95 %, to the real measurement. This error occurs as the cause of time limits for inspection. The limitation obtained as the JEMMME (Journal of Energy, Mechanical, Material, and Manufacturing Engineering) Vol.4, No. 2, November 2019 Budiono | Inspection on Rail Quality by using Image Processing Method 118 crowded schedules of the train and the examiner exhaustion. Data from software can be more accurate than the manual. This is the weakness of manual measurer. Data analysis with image processing is the facility to increase time efficiency of railroads inspection. The surface flatness of normal rail in this research is 0,4488 mm. Furthermore, this result can be compared to standard flatness of railroads surface to find out the rail quality. It needs further research to find out the curved rail surface as this research only results the surface on the straight rail. REFERENCES 1. Ario Sunar Baskoro, Suwarsono, Gandjar kiswanto, Comparison of Edge-Detection Methods for Vision-Based Clad Height Measurement in Welding Inspection, International Journal of Machine Vision and Applications, January 2010. 2. -,Image Processing Toolboxโ„ข Userโ€™s Guide, The MathWorks, Inc.,2008 3. S.W. Smith, Digital Signal Processing, 2nd edition, California Technical Publishing, California, 1999. 4. -, IMAQTM Vision Concepts Manual, Nasional Instruments Part Number 322916A-01, October 2000. 5. https://hendriyana90.wordpress.com . 6. T.A. Davis, Y.C. Shin, Vision-based clad height measurement, International Journal of Machine Vision and Applications, January 2010. matlab.izmiran.ru%20โ€บ%20help%20โ€บ%20toolbox%20โ€บ%20images https://www.analog.com/media/en/technical-documentation/dsp-book/dsp_book_frontmat.pdf http://www.ni.com/pdf/manuals/322916a.pdf%20IMAQ%20Vision%20Concepts%20Manual https://hendriyana90.wordpress.com/kontruksi-rel-kereta%20api/ https://link.springer.com/article/10.1007/s00138-009-0240-9