Journal of Robotics, Networking and Artificial Life, Vol. 4, No. 1 (June 2017) 1–4___________________________________________________________________________________________________________An accurate method for the extraction of line structured light stripe
Jiwu Wang1

School of Mechanical, Electronic and Control Engineering, Beijing Jiaotong University
Yaodong Li1, Zhijing Jian1

School of Mechanical, Electronic and Control Engineering, Beijing Jiaotong University
Masanori Sugisaka2

Alife Robotics Corporation Ltd, Japan and Open University, United Kingdom
E-mail: jwwang@bjtu.edu.cn, icarob@alife-robotics.co.jp
www.bjtu.edu.cn

Abstract
In order to improve the accuracy in the On-line measurement of rail profile with a line structured light based onmachine vision, the accurate extraction of a structured light stripe is a necessary and key step. An accurate
extraction method is proposed for the structural light stripe in practical applications. The structured light stripe isseparated and extracted accurately based on the geometric characteristics of the structure light stripe in the binary
image. And the noise in the captured image is removed with region segmentation method. The above method wastested in laboratory conditions. Experiment results show that the developed method can effectively solve theproblem of the accurate extraction of structured light stripe in real time.
Keywords: Line structured light; region segmentation; Rail profile; Machine visionand calculate its real dimensions. By comparing thecalculated results with the standard rail profile, therailway working status will be determined.
In order to ensure the accuracy of measurement, theaccurate extraction of a structured light stripe is a keystep. The traditional methods1 are the threshold method
and the extreme value method. Those methods aresuitable in the situation when the distinction ofgrayscale is very large between the background andtarget area in the capture image. If there are a lot ofnoises in the image or the grayscale of the target issimilar to that of the background, it is not effect forthese methods.
In light of above problems, an accurate method used forthe extraction of structured light stripe is proposed inthis paper. Firstly, horizontal integral projecting andvertical integral projecting is calculated to determine the1. Introduction
With the rapid development of rail traffic, the issues oftrain safety are becoming more prominent than before.
Here railroad plays an important role. Identifying railwear status is critical to keep high-speed running safety.
In order to measure the rail profile efficiently, the Online measurement of rail profile with a line structured
light based on machine vision is proposed in this paper.
The basic measurement principle is that the structured
light projected on the object's surface, is captured by acamera, and the modulated strips images record thethree-dimensional information about that object surface.
In rail profile measurement the structure-light will bedistorted when it is projected on rail profile, and thisrepresents the railway profile information. Then thecapture image is processed to extract the contour line

Copyright © 2017, the Authors. Published by Atlantis Press.
This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
1

Journal of Robotics, Networking and Artificial Life, Vol. 4, No. 1 (June 2017) 1–4___________________________________________________________________________________________________________position of target stripe in the image. After that, themost of noise with more pixels in the captured image
will be removed with region segmentation method.
However, for some little noise with only few pixels, it isneeded to consider the characteristics of the stripe, suchas the shape, the size and the grayscale gradient.
According to these geometric and lumination
characteristics of the structure light stripe, the target is
extracted from the captured image. The experiments
show it can provide more accurate calculated results.

conditions generally will vary very fast and irregularly
when the vehicle moving. It will influence the quality of
the captured images. In order to get reliable image
processing results, it is necessary to reduce theillumination influence efficiently. Here the following
method is used. Firstly, some high quality images with alaser line are captured as a sample in the laboratory
conditions, and the average gray-value of the images iscalculated as g_valm. It is used as the standard value. In
the later measurement process, the average gray-valueof each captured image is calculated as g_val. The
difference between the standard value and is calculated
as △val. Finally, the new gray value of each pixel inthat image is calculated by subtracted the △ val with
their original gray scale.
The next step is to separate the target area and nontarget area. Horizontal integral projecting and vertical
integral projecting is calculated first. According to thevariance of the integral value, the target stripe andbackground are determined. According to the principleof Michelson contrast2, the area is extracted as in figure
2. The equation is Eq. (1).

2. Measurement method
The traditional rail measurement generally is a contact
measurement with a compound tool. It can only be used
for the measurement in a specified area. And it is
impossible to get the general geometric data of thewhole rail. Many conclusions are made by theoperator’s experience.
The on line measurement can be perform by the noncontact measurement with a line laser using machine
vision. In order to get the same measurement as thecontact method, it is necessary to determine themeasurement base point dynamically. Here a special
measurement device is designed to realize measurement
automatically as in figure 1. There are two measurement
modules A and B. Module A is used for the rail profile
measurement, and B is for determining the base point ofthat profile. Each of the measurement modules iscomposed of a line structured light emitter and anindustrial camera. Based on the triangular measurement
principle, the stripe of the light of the rail profile istransformed to the real dimension. Therefore, theprecision of the laser line extraction is important to thefinal measurement results.

MLC(x,y) =I ( x, y ) − µ

I ( x, y ) + µ(1)

I ( x, y )is for the gray-value of each pixel, µ is for theaverage gray-value of the region.

Fig 2.Processing with image enhancementAs shown in Fig.2, by image enhancement, the left
image captured outside with much sunshine influence,
the laser line is extracted effectively.
4. Stripe extraction
With the image enhancement, the influence ofillumination is removed, but some noises are left in theimage. In order to extract the rail profile stripe
efficiently, the noises are removed with following steps.
The region's intelligent segmentation is carried on firstto remove the most noises of the image. Then theposition of the target stripe can be extracted reliably

Fig.1.Illustration of the measurement method

3. Image enhancement
The on-line measurement of the rail profile is performedin the out-door environment. The illumination

2

Journal of Robotics, Networking and Artificial Life, Vol. 4, No. 1 (June 2017) 1–4___________________________________________________________________________________________________________

4.2. Identify geometric feature

with the geometry feature model identification
algorithm. Moreover, it can accurately locate theposition of the target stripe.

Considering the stripe geometric characters, in order toextract the stripe accurately, the structural light istreated as one object. In the boundaries of the stripe, thegray value of each pixel is not zero. And the geometricof the structured light area is different from other noises.
It can be segmented with pattern recognition algorithms
directly. Then with the continuous scanning of eachpixel in the X direction and the Y direction respectively,
the outer boundary and inner boundary of the line
structured light stripe can be accurately extracted4. As
shown in Fig.6, two continuous boundaries are obtained.
With the high resolution of the camera, they accurately
represent the geometric feature of the measured rail
profile.

4.1. Regional intelligent segmentation
In the rail profile measurement with line structure light,
the image with the line structure light contour, as shownin Fig.3, is captured. After the image binarization like inFig.4, the stripe is in the different connection area
separated3 with other big noises. Because they occupy
different independent regions, it is appropriate to extract
them with segmentation method. After this operation,
the line structured light contour and a small part as thenoise are left, as shown in Fig.5.
By the intelligent segmentation, most noises can beeliminated automatically and efficiently in each
captured image. Then the target stripe can be extractedwith the previous processing results.

Fig.6. Stripe extraction results

5. Skeleton extraction

Fig.3. Structured light profile

As shown in Fig.3, the structure light stripe is not a linewith one pixel width. The rail profile is represented
finally with the one pixel width line. It is necessary totransform the laser line into a line with one pixel width
before the real dimension calculation. Here the skeleton
algorithm is used after extracting the contour. Thenormal direction is calculated with the change of thecurvature. In this direction, the average coordinate valueof each internal and external contour’s pixel iscalculated as the pixel coordinate of the center stripe5.
In this experiment, the laser stripe is about the widthwith 10-20 pixels. After the skeleton processing, thewidth of the stripe is one pixel in the center of the stripe,
so it can improve the accuracy of later transformation.
The result of skeleton processing is shown in Fig.7.

Fig.4.Binary image with image processing

Fig.5. Remove the noise with region segment3

Journal of Robotics, Networking and Artificial Life, Vol. 4, No. 1 (June 2017) 1–4___________________________________________________________________________________________________________

7. Conclusions
In this paper, based on non-contact measurement withmachine vision, a rail profile detection method is given.
Due to the complexity in the practical working
environment, the image enhancement technique is used
to weaken the influence of illumination of outside sunshine. With the region segmentation and patternrecognition of geometric feature, the line structured
light stripe is extracted accurately. At the same time, theimage processing results are compared with the otheredge detection methods, such as Roberts and Sobel. The
method used in this paper, can effectively eliminate thenoise influence the measurement accuracy6.

Fig.7. Skeleton processing result

6. Analysis
The outer edge and inner edge of the structured light
stripe are extracted respectively as shown in the Fig.6.
Considering the influence of line laser width in thecaptured image, the center line is used as the line
structured light stripe, as shown in Fig.7. Comparedwith the outer edge and inner edge, the center line isbetter to represent the rail profile.
In order to verify the segmentation method in this paper,
other edge detection algorithms, such as Roberts
operator and Sobel operator, are tested with the sameimage. Their results are shown in Fig.8. In their result,
there are not only the stripe edges but also the internal
noise of the stripe. And some of the stripe edges are notcomposed with a single pixel, so it will influence themeasurement accuracy.

References
1. Qiucheng Sun and Renyun Liu, An extraction method oflaser stripe centre based on Legendre moment,International Journal for Light and Electron Optics,
Volume 127, Issue 2, January 2016, Pages 912–915.
2. Qingyong Li and Shengwei Ren, A visual detection
system for rail surface defects, IEEE Journals &Magazines, Volume 42, Issue 6, 2012, Pages 1531-1542.
3. Qiucheng Sun and Jian Chen, A robust method to extract alaser stripe centre based on grey level moment, Optics andLasers in Engineering, Volume 67, April 2015, Pages
122-127.
4. J. Cheng, S.G. Zheng, X.Y. Wu, Structured light-based
shape measurement system, Signal Process, 93 (6) (2013),
pp. 1435–1444.
5. Chen Xuanzhen and Wang Xicong, Color structure-light
stripe center-line extraction method research, IEEE
Conference Publications, 34, July 2015,Pages 3686-3689.
6. Sun J, Zhang J, Liu Z, et al. A vision measurement modelof laser displacement sensor and its calibration method.
Optics & Lasers in Engineering, 2013, 51(12):1344-1352.

Fig.8. Edge detection operator with Roberts and Sobel

Compared with other image segmentation method, themethod used in this paper can effectively eliminate thenoise and extract the stripe accurately. With the skeleton
algorithm, the central stripe with one pixel width is usedas the rail profile for dimension transformation.

4