^{1}

^{*}

^{1}

^{1}

^{1}

^{1}

This paper proposes the Levenberg-Marquardt algorithm to solve the problem of a big error while matching the measurement profile with the template profile. In order to achieve more accurate matching result, error function of the two profiles should be structured firstly. And the next step is optimizing the parameters of transform matrix of error function. To be specific, the error is about the corresponding point distance, and optimization parameters are the rotation variables and the translation variables of the transformation matrix. The experimental result of the system shows that using the method of template matching for profile measurement based on Levenberg-Marquardt algorithm is feasible.

At present, one of the common methods about template matching has been used neural network to classify the training to finish matching [

Fast and accurate template matching method has a great significance in many areas.

Now, the principle of L-M algorithm is introduced simply.

Error function is showed in Equation (1):

where

The equation of the improved Gauss-Newton method:

where

When

The contour matching is a process to obtain the best matching, using the same object obtained from different camera contour to transform into the same coordinate system. There is overlap part in two profile images, with the measurement contour image as the optimal image and the template contour image as the target image. The coordinate of optimal image can obtain the coordinate of target image through a transformation matrix. As usual, the transformation matrix has three rows and three columns, containing the rotation variables and the translation variables. The transformation matrix is denoted H:

where h_{1}, h_{2}, h_{4} and h_{5} represent the rotation variables, h_{3}, h_{6} represent the translation variables. h_{7}, h_{8} is very small usually, so they could be equal 0. h_{9} is the normalized constant, so h_{9} is considered to be 1.Thus, there are six parameters to be optimized.

The key issue of template matching is how to reduce the matching error, and the paper utilizes the L-M algorithm to solve this problem. At first, a certain number of corresponding feature points is determined, feature points from calibration. Then, the initial transformation matrix is obtained by calibration method.

Assuming the number of feature points is n.

The relationship of

Error function is expressed concretely as:

The differential on

With the addition, the deformation Equation of Equation (5):

Combine Equation (7) with Equation (8), Jacobi matrix can be solved.

The calculation steps of L-M algorithm, as follows:

1) Given several conditions, one is

2) The measurement contour image would be calculated out by the transformation matrix

3) According to the former introduction, the next goal is to calculate Jacobi matrix.

4) Structure equation:

where

5) Work out

a) If

b) If

The first step of the experiment is to obtain the rail profile.

To unify the two coordinate systems is not hard, and it can be come true that rail change into calibration block. The initial matrix H has been worked out by feature points. Once coordinate systems are unified, rail measurement profile is shown in

Two groups’ coordinate have been obtained, and then the error of the two groups’ coordinate also can be solved. Original results are compared with results by using L-M algorithm in four aspects, including mean, standard deviation, maximum, and the numbers of value larger than 0.2. The results are listed in

From

The experiment principle diagram

The picture from two cameras. (The red line from camera 1, the blue from camera 2)

Rail profile unified on the same coordinate systems

Overlap enlargement diagram

Matching result diagram by L-M algorithm

. The comparison between Original results and results by using L-M algorithm

item | Mean (mm) | standard deviation (mm) | Maximum (mm) | the numbers of value larger than 0.2 |
---|---|---|---|---|

Origination | 0.1727 | 0.0637 | 0.3022 | 39 |

L-M algorithm | 0.1516 | 0.0557 | 0.2848 | 14 |

This paper proposes the L-M algorithm to optimize the parameters of the transformation matrix. This method can reduce the error between the measurement contour and the template contour. Experimental results show that the L-M algorithm can effectively solve the problem of the contour template matching.

Authors are grateful for the support of Scientific Research Innovation Project of Shanghai Education Commission (Granted No. 12YZ149, No. 12ZZ184) and Discipline Construction Project for Transportation Engineering (Granted No.: 13SC002), as well as Postgraduate Research Innovation Project (Granted No.: A-0903-13-01124).