Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
Surface Roughness Characterization Using Digital Image Processing Technique Arif M. D., Anayet U. Patwari and N. A. Chowdhury Department of Mechanical and Chemical Engineering Islamic University of Technology (IUT), Board Bazaar, Gazipur, Dhaka, Bangladesh Corresponding Author:
[email protected] ABSTRACT: The focus of this research work was to apply digital image processing techniques of MATLAB to analyse and quantify surface roughness of machined surfaces. For obtaining the high quality digital photographs a Canon 7.2 Mega-Pixel digital camera, along with a miniature dark studio, was used. Initially, digital pictures of machined plates with known Ra were used for calibration. The pictures of such plates were transformed into high quality and standard size grey scale images. The crests and troughs of the surface roughness showed up as bright and dark features respectively. The standardized images were then converted to labelled binary regions and the standard deviations (SD) of the different pictures determined. The idea was that the higher the surface roughness; the higher will be the standard deviation. A calibration curve was plotted with Ra on the y-axis and standard deviation values, calculated, on the x-axis. A linear regression model was obtained from the data. This algorithm and regression model was then tested by determining the surface roughness of a pair of machined surfaces (with known Ra values) from their digital photographs. The technique showed good precision and accuracy in determining the surface roughness of such plates; within a given range of Ra values. Therefore, this image processing software could be used independently (without physical surface roughness measuring processes) to determine the surface roughness of machined surfaces. Keywords: MATLAB, digital image processing, surface roughness, calibration, linear regression. 1. INTRODUCTION Surface roughness is an important topological factor of all machined parts. All machining processes inevitably produce roughness and imperfections on the surface of machined surfaces. Surface roughness usually is detrimental to the efficient performance of the concerned part. Kalpakjian et. al. [1] discriminated surface roughness and waviness. According to them, surface roughness is superimposed on the much larger surface imperfections called waviness. Surface roughness, thus, consists of closely spaced irregular deviations in the material’s surface topology. It is usually expressed in terms of its height, width and distance from a reference point on the part’s surface. Three common measures of roughness are: (1) Arithmetic mean value roughness, ‘Ra’, also called Centre line average, ‘CLA’, (2) Root-mean-square-average, ‘Rq’, and (3) Maximum roughness height, ‘Rt’ [2]. Rq is more sensitive to the highest peak and valley dimensions of surface roughness. However, Ra being easier to calculate, is more commonly used. The authors, hence, have based their research on the determination of Ra values. There are several instruments and methods of measuring surface roughness, such as: surface profilometer, laser interferometer, optical, scanning-electron, and even atomic-force microscope. However, Vandenberg et. al. [3] discussed that the roughness measurements by such methods, for example: diamond probe or laser light, were greatly sensitive to the probe’s dimensions. They suggested a novel approach of modelling the roughness as a random surface noise. But, this model has its own limitations as discussed in their research paper and is also computationally intensive. Ribeiro et. al. [4] took vertical sections of Jet impinged eroded samples and analysed them under light microscopy. The digital magnified images, thus taken, were used to calculate the fractal surface topography using image processing and analysis techniques. However, this process involves sectioning of the sample, a process that is usually destructive. Kumar et. al. [5] applied cubic convolution magnification and edge enhancement processes to get ‘crisper’ digital images of machined (ground, milled and shaped) parts. Then the Grey level average parameter, ‘Ga’, was determined from the surface image features. Finally, a regression analysis was carried out to determine the correlation among Ga, magnification index, and surface roughness. The authors of this paper, however, contend that standard deviation of Grey level is a much better indicator of surface roughness than Ga.
Mechanical Engineering Division
The Institution of Engineers, Bangladesh
Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
Anayet U. Patwari et. al. [6] had previously used digital image processing techniques, on grey scale sample profile pictures, to study a different machining phenomenon, chatter formation. They used Visual Basic to determine the primary and secondary serrated teeth of machined chips. This was used to correlate chip serration frequency to chattering. The authors of this paper built on this previous knowledge and skill to perform 2 dimensional digital image processing in order to determine Ra. 2. EQUIPMENTS A standardized environment was maintained for photographing both the calibrated and test plates. The following equipments ensured the consistency of image data acquisition: i) Canon PowerShot SD 750 with 7.1 mega pixels resolution and 3X optical zoom. ii) Blackened-interior 12 inch hollow Perspex cube with fixturing mechanism on the bottom inner face. iii) Rubert & Co. Ltd. (Cheshire, England) plates with common machined surfaces’ roughness values, Ra. Figure 1 is a schematic diagram of the setup and equipments. 3. PROCESS FLOW DIAGRAM The flow diagram of the steps used in the digital image processing technique for the measurement of surface roughness is as follows: Sample in Standardized Setup Fig. 1
Image Acquisition (All pics converted to jpeg format)
(Preprocessing) Resizing
(Preprocessing) Conversion to Gray Scale
(Preprocessing) Conversion to binary image and segmentation
Testing model with two known sample plates
Regression Analysis (Linear)
(Visualization) Graph of Calculated Standard Dev. Vs. Ra
(Post Processing) Image displayed with Standard Dev.
(Processing) Standard Deviation calculated from Pixel values
4. MATHEMATICAL MODEL (i) Governing Formula The average surface roughness ‘Ra’ is determined from vertical distances of the surface asperities and valleys from the centre line as follows [1]: Ra = (1/n) ∑yi ; i = 1 to n (1) Equation 1 above is used to plot Ra against standard deviation on a scatter plot and subsequently perform linear regression analysis. 5. DIGITAL IMAGE PROCESSING Digital image processing is the application of computer algorithm and logic to process and analyze digitized images. It is a subcategory of digital signal processing. It has many advantages over analog image processing such as application of a wider range of algorithms to the input data and avoidance of signal distortion build-ups. Another advantage is that images are defined over two or more dimensions and thus can be easily modelled in the form of Multidimensional systems in software dealing with Matrices like MATLAB.
Mechanical Engineering Division
The Institution of Engineers, Bangladesh
Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
6. ALGORITHM AND LOGIC USED MATLAB image processing toolbox was used to acquire the RGB image of a calibrated plate of known surface roughness, for example Ra = 100 µm. The image was then resized while preserving the aspect ratio. This was done to standardize the image comparison process. The resized RGB image was then converted to grey scale using the built-in MATLAB function ‘rgb2gray’. Then the grey scale image was converted to binary form and segmented into a labelled region to aid in further calculations. Figure 2 illustrates this sequence of processes. The labelled and segmented region was then used for two subsequent calculations. In the first calculation, the Centroid and Weighted Centroid of the grey scale image were determined. In the second one, built-in functions ‘regionprops’ and ‘PixelValues’ were used to determine the Standard deviation of the grey scale image. Figure 3 represents the results of these two calculations. The same standardization and calibration process was repeated with five other calibrated plates of surface roughness values: 0.8, 1.6, 6.3, 12.5, and 25 µm. The values of the corresponding standard deviations, calculated, were plotted against the known surface roughness values (figure 4). A regression analysis was then carried out and the equation of the best fit curve determined. Two machined plates of known Ra (3.2 and 50 µm) were used to test the accuracy, precision and limitations of the model. 7. RESULTS Linear regression, with an approximate model equation Ra = 2.8765 (SD) + 0.2628 and correlation coefficient R2 = 0.9978, was selected as the best fit model. The first test case, plate with Ra = 3.2 µm, yielded an SD value of 0.917, which is equivalent to a calculated Ra of 2.9 µm. The second test case, plate with Ra = 50 µm, resulted in a SD value of 18.508. This SD value corresponds to a calculated Ra of 53.5 µm. It can be seen from Table 1 that in both test cases the image processing model has an error of less than 10%. The vertical intercept region of the expanded calibration graph in figure 5 is of special interest to the authors. In this region, the SD value of the machined plate of Ra = 0.8 µm is 0. Thus, it is inferred that 0.8 µm is the resolution limit of the image processing technique discussed. The limitation is a function of both the hardware capabilities and the algorithm and model used. 8. CONCLUSION One of the salient features of the image processing technique was its ability to take the whole machined surface under consideration in determining the surface roughness. In this way it resembles the functioning of a laser contour measurement method. It is postulated, by the authors, to be more reliable than diamond probe or stylus measurement techniques, which use measurements along an arbitrarily selected line across the machined surface. An advantage of this process is its rapidity and economy. The whole process needs one high resolution digital image and reasonable computing facility. It is to be noted that the technique relies heavily on the illumination source used, the resolution of the digital camera, and the complexity of the algorithm used. Improvements of these three key factors/hardware would significantly improve the resolution and sensitivity of the technique. Further research and modification of the technique could increase its usefulness such that, the type of machining used to produce the sample could also be determined from digital image of the sample. After the recommended modifications and further examination, it is predicted that the technique could be used to aid in research work investigating the correlation of machining parameters, work-piece materials, and surface roughness in machining processes. ACKNOWLEDGEMENTS The authors would like to thank the faculty, technicians and staffs of Islamic University of Technology (IUT), Bangladesh, for allowing the authors to use the university’s laboratory facilities.
Mechanical Engineering Division
The Institution of Engineers, Bangladesh
Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
REFERENCES 1. Kalpakjian S. and Schmid S. R., 2008. Manufacturing processes. Pearson Vue publications, fifth edition, 134-138 2. Kalpakjian S. and Schmid S. R., 2002. Manufacturing engineering and technology. Pearson Education Inc., fourth edition, 873-882 3. Vandenberg S. and Osborne C. F., 1992. Digital image processing techniques, fractal dimensionality and scale-space applied to surface roughness. Wear, volume 159, issue 1, 17-30 4. Ribeiro L. M. F., Horovistiz A. L., Jesuino G. A., de O. Hein L. R., Abbade N. P. And Crnkovic S. J., 2002. Fractal analysis of eroded surfaces by digital image processing. Materials Letters, volume 56, issue 4, 512-517 5. Kumar R., Kulashekar P., Dhanasekar B. and Ramamoorthy B., 2005. Application of digital image magnification for surface roughness evaluation using machine vision. International Journal of Machine Tools and Manufacture, volume 45, issue 2, 228-234 6. Md. Anayet U. Patwari, A. K. M. Nurul Amin, and Faris W., 2009. Identification of instabilities of chip formation by image processing techniques. Proceedings of ICME 2009, 26th to 28th December 2009, Dhaka, Bangladesh
FIGURES
Fig. 1: Schematic diagram of the image acquisition setup
Fig. 2: Resizing, grey scale conversion, and binary image generation of machined surface (Ra= 100µm) by image processing technique (a) RGB image, (b) Resized & Grey scale, (c) Binary image
Mechanical Engineering Division
The Institution of Engineers, Bangladesh
Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
(a)
(b) Fig. 3: Determination of surface and pixel value properties of the plate with Ra=100µm. (a) Centroid (blue circle) and Weighted Centroid (red asterisk), (b) Standard deviation
Calibration Results Sl. No.
SD
Ra
1 2
0.000 0.187
0.8 1.6
3 4 5
2.860 3.410 9.320
6.3 12.5 25.0
6
34.500
100.0
Remarks Resolution limit All other data
Test Results Sl. No.
SD
Ra
Remarks
1 (a) 1 (b)
0.000 0.917
3.2 2.9
9.375% Error
2 (a) 2 (b)
0.000 18.508
50 53.5
7% Error
show a linear trend
Table: 1 Calibration and test results table for the image processing technique are displayed with relevant remarks. Data for the two test cases (under Test Results sub-section) display: (a) are the actual Ra and (b) the calculated Ra from the linear regression model. The error percentage, less than 10% is also shown.
Mechanical Engineering Division
The Institution of Engineers, Bangladesh
Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
Fig. 4: Graph of Ra plotted against Standard Deviation showing the linear regression model used with Ra range from 0 to 110 µm.
Fig. 5: A close up of the calibration graph in fig. 4 showing the limit of the model’s resolution
Mechanical Engineering Division
The Institution of Engineers, Bangladesh
Proceedings of the 13th Annual Paper Meet 25 September 2010, Dhaka
Mechanical Engineering Division
The Institution of Engineers, Bangladesh