1 Introduction

In many railway systems, fleet and infrastructure inspections are done manually. Therefore, the use of the old model, which on the one side, due to human error and in some cases the lack of accurate inspection by the inspector, leads to accidents and heavy damages [1]. On the other hand, slow process of manually inspection, reduces efficiency and increases costs. Hence some of the railway systems with technological advances made in this field are using automation system for fault diagnosis in order to increase safety, reduce costs and increase efficiency based on equipping and needs assessment [2]. The interaction between wheel and rail and the relevant phenomena such as wear is one of the most important issues in the railway systems which many researches and activities are done each year [3]. This is because of that the inappropriate contact between wheel and rail always causes severe damage to the wheels and the train [4]. By considering the cost of maintenance in the railway systems around the world, we find that many expenses spent on the purchase, replacement and installation of wheel and rail in the railway systems [5]. The railway wheels have a specific geometry and incompatibility of it with the geometric characteristics of rail profile can cause significant negative consequences, such as severe wear of wheel and rail and dynamical instability of vehicle, because the stability of vehicle and passenger comfort is dependent on wheel and rail wear [6]. With development of the technology of industrial products, needs for automatic measurements methods while maintaining the required accuracy is felt [7, 8]. One of the most efficient approaches is use of machine vision in the measurement [9]. Machine vision systems which are based on image processing techniques that have simple required tools are capable to increase system accuracy using effective tricks of software and efficient algorithms available. The advantages of this method is to be a non-contact measurement method. Measurements through contact with the piece, when small, may cause a probable relative move due to contact slide, which can lead to error in the measurement. In addition, if a piece is soft or rigid, it may affect the measurement results. The volume of data obtained by machine vision-based measurement methods about specimens are far greater than the volume of data obtained by other techniques. These methods also take less time to process. Another advantage of the non- contact property of these methods is their ability to be examined on moving production, maintenance and repair lines and conveyors [10].

Compared with mechanical methods, measurement techniques based on computer vision techniques are relatively new. In these methods the specimen is placed under view of one or more cameras. If the three-dimensional characteristic of the specimen is considered, at least two cameras must be used, but for flat specimen or specimens that is considered their external border, the measurement can be done with one camera. In the method that presented by Geiser using an appropriate lighting system, the precision has been achieved between 1 and 10 microns [11]. However, in such a system the length of specimens does not exceed 5 cm. In addition, only the length and diameter of the cylinder-shaped specimens with a radial symmetry are measured. Xu and Wendel also introduced a system that is supposed to define the geometric faults in the image, and the system’s task is determining the exact location of this fault [12]. Sometimes it is needed to take an image from different angles. An example of these cases can be found in reference [13]. In this case, a rotating base is used and by rotating the base, images can be taken from various angles of the specimen. All of the above-mentioned cases can be carried out using one camera. Using two or even three cameras in measurement is prevalent that these cameras work in parallel with each other [14]. This matter increases capability of the system, and certainly needs more accurate and stronger software methods.

Many research has been done to determine the railway wheel profile due to wear. But a new applied method for railway wheel profile measurements due to wear using image processing techniques has not been under sufficient attention in railway systems. This paper provides the new method for measuring and evaluating the railway wheel profile using the image processing techniques. The remainder of the paper is structured as follows: In the following section, we investigate a large group of relevant literature and discuss the reasonable mechanisms driving our results. Section 2 gives a brief description of profile measurement methods for measuring the railway wheel profile. Section 3 reports experimental programme and method for measuring wheel profile. Section 4 gives a detailed description of image processing method for measuring wheel profile. In Sect. 5 gives a detailed description of the data obtained in the image processing method. Finally, Sect. 6 is the conclusion of the paper.

2 Review of profile measurement methods

Different areas of the wheel profile are mentioned in Fig. 1 and some of them are introduced as follows [15].

Fig. 1
figure 1

The railway wheel profile; (a) field observation, (b) schematic of the wheel profile [15]

The flange angle is the angle of the flange that connects the inner corner to the toe of the flange. To avoid the derailment phenomenon, this amount is recommended to be between 68 and 70 degrees. Conicity angle is the internal angle and external rolling contact part of wheel profiles. High amount of conicity increases handling and increases probability of instability at high speeds. Upper and lower limits for the amount of conicity angle depend on geometry and kinematic features of the vehicle. Upper limit is to avoid instability of the vehicle and lower limit is suitable for arc traverse [13]. Equivalent conicity for optimized profile of the wheels must be as much as possible in the range of (0.2–0.4). Conicity values must be proportional to the following factors: vehicle design (for the passing of the curve and having stability at high speeds), working conditions of performance and line conditions (number and severity of the curvature in the line).

The vertical distance between top of the flange and horizontal line passing of the reference point is the flange height. To minimize the amount of wear and have a safety course, flange height is considered 28 mm. The curvature radius of the inner corner of flange is called flange root radius. This value is 12.7 mm in most standard profiles. The lower values lead to two-point contacts and greater values create higher contact stresses that forms cracks in this area. Also, wheel reference point is a point on the rolling surface of the wheel which its horizontal distance behind the wheel is 70 mm. The dimensions and sizes of wheels are evaluated related to their reference point. The relationship between general characteristics of wheel profiles and dynamic phenomena is shown in Table 1 [15]. The railway wheel parameters used in railway system is shown in the Fig. 2.

Table 1 Relationship between general characteristics of wheel profiles and dynamic phenomena [15]
Fig. 2
figure 2

Various parameters of the wheel profile [10]

Calipri is a universal handheld gauge for fast non-contact recording of geometrical data of objects of nearly any shape. With this device, this parameters is measured in approximately 5 s: wheel profile, wheel diameter gauge and wheel clearance gauge. All measurement and profile data are made available for processing in the XML format or CSV format. All measurements can be visualized and analyzed. The creation of individual reports constitutes another feature (Fig. 3). This entails sending measurement data in a clear presentation directly to a printer or else generating a PDF document. Calipri laser device measure various parameters of wheel profile including height, width, rail profile and wheel diameter. After measurement, the device attempted to draw the profile and report the probable failure according to the original dimension of the profile. The main characteristics obtained by Calipri laser device are shown in Fig. 4.

Fig. 3
figure 3

Measuring the railway wheel profile with Calipri contactless profile measurement device

Fig. 4
figure 4

Main characteristics of wheel profile [3]

3 Experimental programme and method for measuring wheel profile

In this study, taking images of wheel was performed in an experimental position without using the base. The result showed that this method has errors. So, in order to show the ability of the new applied method and reduce errors for obtaining the best position for imaging, image processing of the wheel was done in 10 different positions by using the camera stand. Figure 5 shows the experimental test setup and a schematic of the position of the camera stand relative to the wheel, where the distance from the center of the camera lens to the ground with a height of wheel (A) are equal. Taking image was done in 3 different positions and different angels. Classification of images is shown in Table 2.

Fig. 5
figure 5

The new applied method for measuring wheel profile; (a) Experimental test setup, (b) schematic of the wheel position, stand and camera

Table 2 Different positions of taking image

4 Image processing method for measuring wheel profile

First, images were taken by using a camera. Given that most digital cameras have automatic color and brightness options, in this study, all automatic correction options were turned off and brightness and contrast were in normal conditions. In this study, the images with sizing 960*540 pixels are used, which this size and characteristics of camera was the same in all images such as instantaneous and non-instantaneous imaging. The corresponding pattern, which is oval in the image, is extracted from the image. The gradient descent method was used to obtain the ideal oval and minimize the error. Also, the error function defined as the pixel error square of the calibration pattern. The error function is as follow:

$$e_{k} = \frac{{\left( {x_{k} - x_{0} } \right)^{2} }}{{a^{2} }} + \frac{{\left( {y_{k} - y_{0} } \right)^{2} }}{{b^{2} }} - 1,$$
(1)
$$e_{k}^{^{\prime}} = \sqrt {\frac{{\left( {x_{k} - x_{0} } \right)^{2} }}{{a^{2} }} + \frac{{\left( {y_{k} - y_{0} } \right)^{2} }}{{b^{2} }}} - 1,$$
(2)

where, a and b are half the diameter of the large and small ellipses, respectively. Also, (x0, y0) are the coordinates of the center of the ellipse, and (xk, yk) are the coordinates of the pixels of the extraction edges. These pixels are located close to the oval environment with good approximation [16].

There are different edge detection methods, including the first-order differential method, the second-order differential method, the gradient operator method, and the logarithm operator method. In this paper, Roberts edge detection operator uses the first-order differential method, which uses a spatial differential to detect the edge. Roberts edge detection operator is by the following formula:

$$g\left( {x,y} \right) = \left\{ {\left[ {\sqrt {f\left( {x,y} \right)} - \sqrt {f\left( {x + 1,y + 1} \right)} } \right]^{2} + \left[ {\sqrt {f\left( {x,y} \right)} - \sqrt {f\left( {x - 1,y - 1} \right)} } \right]^{2} } \right\}^{{{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 2}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{$2$}}}} ,$$
(3)

where f (x, y) is the gray value of the input image with the correct pixel coordinates [17].

Oxyz is the camera's coordinate frame. Ouxuyu is image coordinates frame. Osxsyszs is the coordinate frame of the light screen, where the Osxsys screen matches the laser-launched light screen. The z-coordinates of the points on the light plane in Osxsyszs must be zero. Assuming that \(m_{s} = \left( {x_{s} ,y_{s} ,0} \right)^{2}\) are the coordinates of the point P on the light plane in Osxsyszs, the coordinates of the homogeneous image of P in Osxsyszs are equal to \(p = \left( {u,v,l} \right)^{T}\). According to the camera model, we have:

$$\rho \left( {\begin{array}{*{20}c} u \\ v \\ l \\ \end{array} } \right) = A\left( {R_{s} t_{s} } \right)\left( {\begin{array}{*{20}c} {x_{s} } \\ {y_{s} } \\ 0 \\ 1 \\ \end{array} } \right),$$
(4)

where \(\rho\) is a scale factor, A is the real camera parameter matrix and Rs and ts are the Durran matrix and the vector return of the conversion coordinates from Osxsyszs to Oxyz, respectively.

Equation (4) can be written as follows:

$$p\left( {\begin{array}{*{20}c} u \\ v \\ l \\ \end{array} } \right) = A\left( {r_{s}^{1} r_{s}^{2} t_{s} } \right)\left( {\begin{array}{*{20}c} {x_{s} } \\ {y_{s} } \\ 0 \\ 1 \\ \end{array} } \right) = H_{s} \left( {\begin{array}{*{20}c} {x_{s} } \\ {y_{s} } \\ l \\ \end{array} } \right),$$
(5)

where Hs is the homogeneous matrix from the light plate to the image plate. \(r_{s}^{1}\) is the i column vector of Rs.

After accessing the images and extracting the center points of the light strip from the wheel profile, the three-dimensional coordinates of the wheel profile points in the camera coordinates frame can be obtained by Eq. (5) [18].

The distance between the laser source and the wheel is measured with a laser meter. But sometimes the distance from the faulty part of the wheel can be the same as the healthy part of the rail. The fuzzy system can produce incorrect results in this field. Therefore, angle information is required with distance information. Vibration and noise can affect the data at the time of measurement. Filtering eliminates vibration and noise. The Gaussian filter is used to remove image noise. The following equation uses a gray image for each pixel [19]:

$$G\left( {x,y} \right) = \frac{1}{{2\pi \sigma^{2} }}e^{{\frac{{x^{2} + y^{2} }}{{2\sigma^{2} }}}} ,$$
(6)

where G represents the input image, x and y are the image coordinates and \(\sigma\) is the standard deviation.

A simple meaning of the edge is the boundary where light level changes are high. An ideal edge is an edge that lighting changes occur suddenly. But in practice the edges does not appear in this form, and lighting changes occur from one level to other level gradually. There are several reasons that cause it, which can be outlined as follows: ambient and imaging system noise, scattering light at the edges, poor lighting which leads to light weakness in some areas and strength in other areas or causes light reflection on some of the surfaces or makes the shadow in some areas, angel and curvature of some edges, sampling and quantization error. In addition to existing the edge, this issue causes that determining the edge location is also of great importance. The primary methods of edge detection are based on the first and second-order derivatives. But the basis of these methods is on the use of derivatives, application of these methods increase or boosts the noise. Because noise and edge are both components of the high frequency of image. There are other methods to determine location of the edge which act on the basis of the integration. This act weakens the noise of the images. Some of these methods are based on the adaptation model. By using these methods, the edge can be estimated with less accuracy than the pixel size. In the edge detection method, model adaptation takes place using gray levels moments [20]. In this paper, images are taken with appropriate lighting conditions, A few simple pre-processing is done. At first, the pixel data is converted to double-type data and are placed in the range of zero and one. Then, the input image which is usually as a three-channel or RGB image is converted to a single channel or gray surface image and finally 3 × 3 Gaussian filter is used with sigma 0.95. In the new applied method, the objects edges in the image have been used which are the most important feature of lower level of image qualifier. After applying the Gaussian filter, the image gradient is calculated using Sobel filter. In general, the size and angle of the gradient vector at each pixel of the image g (x, y): R2 → R, are calculated according to the Eqs. (7, 8):

$$\left\| {\nabla g(x,y)} \right\| = \sqrt {\left( {\frac{\partial g}{{\partial x}}} \right)^{2} + \left( {\frac{\partial g}{{\partial y}}} \right)^{2} } ,$$
$$\phi (x,y) = \tan^{ - 1} \left( {\frac{{g_{x} }}{{g_{y} }}} \right).$$

In order to determine the upper geometry of the railway wheel, the following algorithm is proposed. This algorithm is presented in seven steps which are shown in Fig. 6. Each step of the algorithm is described below.

Fig. 6
figure 6

The steps of the new applied method

An image of the side view of wheel is taken (Fig. 7). At this point, the angle of the camera and the distance between camera and wheel is not important, because this is for the initial validation of the algorithm.

Fig. 7
figure 7

taken from wheel profile

Image

The image taken using the camera at the first step is the outline of the wheel. This is despite the fact that the issue defined in this study, is only taking image from the top of wheel profile. By limiting the image of wheel in a limited space the image processing can be done more easily for the desired geometry (Fig. 8). By determining the coefficients available in the edge detection algorithm, the upper curve is shown by green color in Fig. 9. As shown in Fig. 10 shows the actual scale obtained in the previous, which results in the actual coordinates of the wheel profile.

Fig. 8
figure 8

Cutting image around the desired geometry

Fig. 9
figure 9

Identifying the upper edge of the image with new applied method

Fig. 10
figure 10

Actual scale of upper edge of the wheel

5 Results and discussion

According to the data obtained in the new applied method, the size of three parts of the most important indicators of the profile is obtained based on the Fig. 11. Table 3 shows a comparison between the results obtained from the new applied method and Calipri laser device.

Fig. 11
figure 11

Determining the sizes required for the produced profile

Table 3 Comparison of the various parts size of wheel obtained from the new applied method, Calipri laser device and wheel document

This method of measuring has some errors. As shown in Table 3, only the error of flange width is about 11% and other parameters errors are acceptable. Based on experimental position for taking images and need to identify the causes of errors and reducing it, the new applied method for determining the optimal position of taking images is presented.

The experimental tests results in 10 different locations and measurement errors are shown in Table 4. Figures 12, 13, 14 show the measuring various parts of wheel in different positions. Also, the results of the new applied method for the various parts of wheel in different positions for the railway wheel are compared with Calipri laser device that results in acceptable achievements.

Table 4 Measuring various parts of wheel in different positions by the new applied method and Calipri laser device
Fig. 12
figure 12

Comparison of the flange height results in terms of position for the wheel obtained from the new applied method and Calipri laser device

Fig. 13
figure 13

Comparison of the flange width results in terms of position for the wheel obtained from the new applied method and Calipri laser device

Fig. 14
figure 14

Comparison of the profile width results in terms of position for the wheel obtained from the new applied method and Calipri laser device

The results show that the best position to use the camera to minimize errors is situation No. 1 in the Table 4. By increasing the base height up to 2 cm (position No. 8 in Table 4), error of flange height decreased by 0.08% and error of flange width reduced by 0.01%, while the error of profile width is increased. To verify the measurements, photographing can be done in both positions. Table 5 presents a comparison between the new applied method results with the original size of wheel.

Table 5 Comparison of the profile different specified size

6 Conclusion

In this study a low cost approach based on edge detection theories in image processing techniques is proposed. Results were obtained based on the use of experimental method and image processing techniques. The fact that it is only necessary to have an experimental parameter to determine the railway wheel profile is an important and significant subject. Based on the numerical analysis and experimental tests, the new applied method for profile measurements due to wear is obtained in railway wheel, which has a considerable accuracy. The effect of wear in railway wheel on its contact condition to rail, contact stress field and corresponding effect of rolling contact fatigue are also considered. In the new applied method, geometrical specifications of the railway wheel profile are developed in seven steps. A Comparative study with Calipri laser device is considered to evaluate the capabilities of the proposed system. The comparison between numerical results and experimental tests shows that although the error rate with respect to the result of using Calipri laser device is between 0.5 and 3% (this is considered negligible in industrial application), but considerable reduction is observable with respect to the cost. This shows that the new applied method can be used as an alternative method in the railway systems. In the continuation of this study, it is recommended to improve the efficiency of the proposed method such as using a linear laser light source so that the curvature boundaries of the wheel profile are completely differentiated and can be installed on camera, designing a base and fixing the camera in the repair station, designing methods and equipment for continuous shooting of railway wheels without the need for the presence of technicians, designing a new algorithm that can measure all the dimensions and parameters required for wheels. Also, by generalization of application of this method in railway brake pads, hopefully more desirable results can be obtained.